| .. | |||||
| back | |||||
| Admin.php | |||||
| Auth.php | |||||
| Blog.php | |||||
| Contact.php | |||||
| Home.php | |||||
| index.html |
| Server IP : 103.169.32.36 / Your IP : 216.73.217.13 Web Server : Apache System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : apache ( 48) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/dpmptsp/public_html/newsigniter/application/controllers/ |
Upload File : |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Blog extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('identity_model', 'identity', true);
$this->load->model('banner_model', 'banner', true);
$this->load->model('posting_model', 'posting', true);
$this->load->model('category_model', 'category', true);
}
public function index($page = null)
{
$data['favicon'] = $this->identity->getIdentity();
$data['title'] = 'News';
$data['navbar'] = $this->category->getCategory();
$data['banner'] = $this->banner->getBanner();
$data['category'] = $this->category->getCategory();
$data['post'] = $this->posting->getAllPosting($page);
$data['popular'] = $this->posting->getMostPopular();
$data['trending'] = $this->posting->getThread();
$data['category'] = $this->category->getCategory();
$data['lastNews'] = $this->posting->getLastNews();
$data['banner'] = $this->banner->getBanner();
$data['total_rows'] = $this->posting->countPosting();
$data['pagination'] = $this->posting->makePagination(
base_url('blog'), 2, $data['total_rows']
);
$data['page'] = 'blog';
$this->load->view('front/layouts/app', $data);
}
public function category($category, $page = null)
{
$data['favicon'] = $this->identity->getIdentity();
$data['title'] = 'Blog';
$data['category'] = $this->category->getCategory();
$data['post'] = $this->posting->getPostingByCategory($category, $page);
$data['category'] = $this->category->getCategory();
$data['lastNews'] = $this->posting->getLastNews();
$data['banner'] = $this->banner->getBanner();
$data['total_rows'] = $this->posting->countPosting($category);
$data['pagination'] = $this->posting->makePagination(
base_url("blog/category/$category/"), 4, $data['total_rows']
);
$data['page'] = 'blog';
$this->load->view('front/layouts/app', $data);
}
public function read($seo_title)
{
$row = $this->posting->getPosting($seo_title);
if($row){
$data['posting'] = $row;
$data['title'] = $row->title;
$data['favicon'] = $this->identity->getIdentity();
$data['banner'] = $this->banner->getBanner();
$data['category'] = $this->category->getCategory();
$data['page'] = 'news-detail';
$data['lastNews'] = $this->posting->getLastNews();
$this->load->view('front/layouts/app', $data);
}else{
redirect(base_url('home'));
}
}
public function search($page = null)
{
$filter = stripslashes(strip_tags(htmlspecialchars($_POST['q'],ENT_QUOTES)));
$data['favicon'] = $this->identity->getIdentity();
$data['title'] = 'Blog';
$data['category'] = $this->category->getCategory();
$data['post'] = $this->posting->getPostingByKeyword($filter, $page);
$data['category'] = $this->category->getCategory();
$data['lastNews'] = $this->posting->getLastNews();
$data['banner'] = $this->banner->getBanner();
$data['filter'] = $filter;
$data['total_rows'] = $this->posting->countPosting2($filter);
$data['pagination'] = $this->posting->makePagination(
base_url("blog/search/"), 4, $data['total_rows']
);
$data['page'] = 'blog';
$this->load->view('front/layouts/app', $data);
}
}
/* End of file Blog.php */
| .. | |||||
| back | |||||
| Admin.php | |||||
| Auth.php | |||||
| Blog.php | |||||
| Contact.php | |||||
| Home.php | |||||
| index.html |