new pisilinux web sites
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<?php namespace Project\Controllers;
|
||||
use URI,DB,Cookie,URL,Method;
|
||||
/*
|
||||
* Created By : Erkan IŞIK
|
||||
* Created Date: 2017-12-05
|
||||
* Update Date : 2021-11-17
|
||||
*/
|
||||
|
||||
class Blog extends Controller{
|
||||
|
||||
function main(){
|
||||
|
||||
Cookie::insert('returnlink', '');
|
||||
if (Method::post('lang')) {
|
||||
|
||||
$bloglist = contentListAdmin(Method::post('lang'));
|
||||
}else{
|
||||
$bloglist = contentListAdmin('tr');
|
||||
}
|
||||
view::bloglist($bloglist);
|
||||
}
|
||||
|
||||
function category(){
|
||||
$id = explode('-',URI::get('category'));
|
||||
$id = $id['0'];
|
||||
//$data['catlist'] = DB::where('icerik_katid',$id['0'])->get('content')->result();
|
||||
// define('TITLE', ' '.$seo['0']);
|
||||
//import::view(THEMA_NAME.'blog/category_view',$id);
|
||||
|
||||
view::id($id);
|
||||
}
|
||||
|
||||
function content(){
|
||||
|
||||
$id = explode('-',URI::get('content'));
|
||||
$id = $id['0'];
|
||||
|
||||
$row = contentRow($id);
|
||||
if (!$row) {
|
||||
return Masterpage::error404();
|
||||
}
|
||||
|
||||
if (Cookie::select('contentid') != $id) {
|
||||
$hits = $row->hits + 1;
|
||||
DB::where('id', $id)->update('content',['hits' => $hits]);
|
||||
Cookie::time(60 * 60 * 24)->insert('contentid',$id);
|
||||
}
|
||||
|
||||
Masterpage::title($row->title);
|
||||
Masterpage::meta
|
||||
([
|
||||
'name:description' => $row->keywords,
|
||||
'name:keywords' => $row->label
|
||||
]);
|
||||
|
||||
define('TITLE',$row->title);
|
||||
define('LINK','https://blog.pisilinux.og/content/'.$id.'-'.$row->title_seo.'.html');
|
||||
define('DESC',$row->keywords);
|
||||
define('IMG',content_image($row->content));
|
||||
|
||||
view::id($id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user