29 lines
770 B
PHP
29 lines
770 B
PHP
<?php namespace Project\Controllers;
|
|
USE Import,Cookie,URI,Method,Session, DB;
|
|
class Subject extends Controller{
|
|
|
|
function main(){
|
|
$id = URI::get('subject');
|
|
$id1 = explode('-',$id);
|
|
$id2 = $id1['0'];
|
|
|
|
if (method::post()) {$this->forum_model->cevap(method::post()); }
|
|
|
|
$fk = $this->forum_model->forumkonu($id2);
|
|
|
|
if (isset($fk->title_seo)) {
|
|
|
|
define('TITLE', ' ' . $fk->title_seo);
|
|
session::insert('return', 'forum/subject/' . $fk->id . '-' . $fk->title_seo);
|
|
if (!Cookie::select('count')) {
|
|
$hits = DB::select('view')->where('id', $id2)->get('forum')->value();
|
|
$hit = $hits + 1;
|
|
DB::where('id', $id2)->update('forum', ['view' => $hit]);
|
|
}
|
|
Cookie::time(60 * 60 * 24)->insert('count',$id2);
|
|
|
|
view::fk($fk);
|
|
|
|
}
|
|
}
|
|
} |