This commit is contained in:
CHIEFSOFT\ameye
2025-12-21 07:54:28 -05:00
parent be7fb8aafb
commit ab2898cb82
+46 -35
View File
@@ -13,16 +13,20 @@ class Home extends BaseController
return view('welcome_message'); return view('welcome_message');
} }
public function home2(){ public function home2()
{
$data = []; $data = [];
return $this->sitePage("home", $data); return $this->sitePage("home", $data);
} }
private function sitePage($curr_page, $data){ private function sitePage($curr_page, $data)
{
return view('main/header') . view('main/home') . view('main/footer'); return view('main/header') . view('main/home') . view('main/footer');
} }
public function home(){
public function home()
{
$siteData = []; $siteData = [];
$out = $this->APIcall('GET', 'https://blogdata.chiefsoft.net/blogdata/chiefsoft', []); // https://blogdata.chiefsoft.net/ $out = $this->APIcall('GET', 'https://blogdata.chiefsoft.net/blogdata/chiefsoft', []); // https://blogdata.chiefsoft.net/
@@ -36,47 +40,55 @@ class Home extends BaseController
return view('site/home', $data); return view('site/home', $data);
} }
public function about(){
public function about()
{
$data = array(); $data = array();
$this->renderSitePage('about', $data); $this->renderSitePage('about', $data);
} }
public function services(){
public function services()
{
$data = array(); $data = array();
$this->renderSitePage('services', $data); $this->renderSitePage('services', $data);
} }
public function contact(){
public function contact()
{
$data = array(); $data = array();
$this->renderSitePage('contact', $data); $this->renderSitePage('contact', $data);
} }
public function blog(){
public function blog()
{
$data = array(); $data = array();
$this->db = \Config\Database::connect($this->con_name); // $this->db = \Config\Database::connect($this->con_name);
//
try { // try {
$mysql = "SELECT id, post_title, post_content,post_date,comment_count FROM wp_posts WHERE post_type='post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 9"; // $mysql = "SELECT id, post_title, post_content,post_date,comment_count FROM wp_posts WHERE post_type='post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 9";
//
//
$mysql = "SELECT p1.id AS id, p1.*, wm2.meta_value FROM wp_posts p1 LEFT JOIN wp_postmeta wm1 // $mysql = "SELECT p1.id AS id, p1.*, wm2.meta_value FROM wp_posts p1 LEFT JOIN wp_postmeta wm1
ON (wm1.post_id = p1.id AND wm1.meta_value IS NOT NULL AND wm1.meta_key = '_thumbnail_id' ) // ON (wm1.post_id = p1.id AND wm1.meta_value IS NOT NULL AND wm1.meta_key = '_thumbnail_id' )
LEFT JOIN // LEFT JOIN
wp_postmeta wm2 // wp_postmeta wm2
ON (wm1.meta_value = wm2.post_id AND wm2.meta_key = '_wp_attached_file' AND wm2.meta_value IS NOT NULL ) // ON (wm1.meta_value = wm2.post_id AND wm2.meta_key = '_wp_attached_file' AND wm2.meta_value IS NOT NULL )
WHERE // WHERE
p1.post_status='publish' // p1.post_status='publish'
AND p1.post_type='post' // AND p1.post_type='post'
ORDER BY p1.post_date DESC LIMIT 9"; // ORDER BY p1.post_date DESC LIMIT 9";
//
//
//
$query = $this->db->query($mysql); // $query = $this->db->query($mysql);
//
$row = $query->getResultArray(); // $row = $query->getResultArray();
// print_r( $row ); // // print_r( $row );
// $r = $this->db->query($mysql); // // $r = $this->db->query($mysql);
$data["blog_array"] = $row; // $data["blog_array"] = $row;
} catch (Exception $ex) { // } catch (Exception $ex) {
//
} // }
// featured // featured
try { try {
@@ -102,7 +114,6 @@ class Home extends BaseController
$data["blog_array"] = array_slice($siteData['blogdata'], 0, 7); // $siteData['blogdata']; $data["blog_array"] = array_slice($siteData['blogdata'], 0, 7); // $siteData['blogdata'];
$this->renderSitePage('blog', $data); $this->renderSitePage('blog', $data);
} }