コード例 #1
0
 function category($args)
 {
     list($id) = $args;
     $id = urldecode($id);
     $page = isset($_GET['page']) ? tin($_GET['page']) : 1;
     $limit = 10;
     $begin = ($page - 1) * $limit;
     //echo "<br><br><br><br>ID ".$id;
     $bm = new BlogModel();
     $arrB = $bm->getWhere("topic_category LIKE '%{$id}%' AND topic_status = 'publish' ORDER BY topic_date DESC LIMIT {$begin},{$limit}");
     $jml = $bm->getJumlah("topic_category LIKE '%{$id}%' AND topic_status = 'publish'");
     $bc = new BlogCategory();
     $bc->getByID($id);
     //categort
     $this->isiMetaCategory($bc);
     $dis = $bc->getWhere("cat_active=1");
     $jmlpage = ceil($jml / $limit);
     //        pr($arrB);
     //        pr($dis);
     $arr['posts'] = $arrB;
     $arr['cat'] = $dis;
     $arr['page'] = $page;
     $arr['begin'] = $begin;
     $arr['limit'] = $limit;
     $arr['jmlpage'] = $jmlpage;
     $arr['jml'] = $jml;
     $arr['bc'] = $bc;
     $directory = get_called_class() . "_" . __FUNCTION__;
     //        echo "<br><br><br>";
     //        echo $directory;
     //        Mold::theme("Pages/".$directory.)
     $layout_id = "Blog_category";
     $file = Layout::getFile($layout_id);
     //        echo "Pages/".$layout_id."/".$file;
     Mold::theme("Pages/" . $layout_id . "/" . $file, $arr);
     //        Mold::theme("Pages/Blog_index",$arr);
 }