當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ContentModel::Month_Hot方法代碼示例

本文整理匯總了PHP中ContentModel::Month_Hot方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContentModel::Month_Hot方法的具體用法?PHP ContentModel::Month_Hot怎麽用?PHP ContentModel::Month_Hot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ContentModel的用法示例。


在下文中一共展示了ContentModel::Month_Hot方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Show_Month

 private function Show_Month()
 {
     global $templates;
     $content = new ContentModel();
     $content->id = $_GET['id'];
     $parid = $content->Get_Par_Id();
     $content->nav = $parid->nav;
     //列出本月推薦
     $object_rec = $content->Month_Rec();
     if ($object_rec) {
         foreach ($object_rec as $value) {
             $value->title = Tool::Sub_Str($value->title, 15);
             $value->date = date('m-d', strtotime($value->date));
             //將時間格式轉換一下
         }
     }
     $templates->assgin('Month_Rec', $object_rec);
     //注入模板,顯示本月推薦
     //列出本月熱點
     $object_hot = $content->Month_Hot();
     if ($object_hot) {
         foreach ($object_hot as $value) {
             $value->title = Tool::Sub_Str($value->title, 15);
             $value->date = date('m-d', strtotime($value->date));
             //將時間格式轉換一下
         }
     }
     $templates->assgin('Month_Hot', $object_hot);
     //注入模板,顯示本月熱點
     //列出本月圖文(含有圖片的wenzha)
     $object_pic = $content->Month_Pic();
     if ($object_pic) {
         foreach ($object_pic as $value) {
             $value->title = Tool::Sub_Str($value->title, 15);
             $value->date = date('m-d', strtotime($value->date));
             //將時間格式轉換一下
         }
     }
     $templates->assgin('Month_pic', $object_pic);
     //注入模板,顯示本月熱點
 }
開發者ID:hachi-zzq,項目名稱:guest-cms,代碼行數:41,代碼來源:DetailAction.class.php

示例2: Get_Contentlist

 private function Get_Contentlist()
 {
     global $templates;
     $content = new ContentModel();
     $nav = new NavModel();
     $nav->id = $_GET['id'];
     $object_child = $nav->selectchildNav_nolimit();
     //根據父導航ld找到子導航
     foreach ($object_child as $value_child) {
         $id[] = $value_child->id;
     }
     if ($object_child) {
         $in = implode(',', $id);
         $content->nav = $in;
         //sQL語句中IN關鍵字
     } else {
         $content->nav = $_GET['id'];
     }
     $countArr = $content->Get_Contentlist();
     $count = $countArr->c;
     //得到記錄數
     $page = new Page($count, PAGE_SIZE);
     $content->limit = $page->limit;
     //注入limit值
     $templates->assgin('page', $page->Show_Page_Num());
     //顯示分頁
     $object = $content->Get_Content();
     //獲取所有的content
     foreach ($object as $value) {
         $value->title = Tool::Sub_Str($value->title, 15);
         //對title進行截取
         $value->info = Tool::Sub_Str($value->info, 120);
         //對info進行截取
         if (empty($value->thumbnail)) {
             $value->thumbnail = 'images/none.jpg';
         }
     }
     $templates->assgin('AllContent', $object);
     //注入模板,顯示content
     //列出本月推薦
     $object_rec = $content->Month_Rec();
     if ($object_rec) {
         foreach ($object_rec as $value) {
             $value->title = Tool::Sub_Str($value->title, 15);
             $value->date = date('m-d', strtotime($value->date));
             //將時間格式轉換一下
         }
     }
     $templates->assgin('Month_Rec', $object_rec);
     //注入模板,顯示本月推薦
     //列出本月熱點
     $object_hot = $content->Month_Hot();
     if ($object_hot) {
         foreach ($object_hot as $value) {
             $value->title = Tool::Sub_Str($value->title, 15);
             $value->date = date('m-d', strtotime($value->date));
             //將時間格式轉換一下
         }
     }
     $templates->assgin('Month_Hot', $object_hot);
     //注入模板,顯示本月熱點
     //列出本月圖文(含有圖片的wenzha)
     $object_pic = $content->Month_Pic();
     if ($object_pic) {
         foreach ($object_pic as $value) {
             $value->title = Tool::Sub_Str($value->title, 15);
             $value->date = date('m-d', strtotime($value->date));
             //將時間格式轉換一下
         }
     }
     $templates->assgin('Month_pic', $object_pic);
     //注入模板,顯示本月熱點
 }
開發者ID:hachi-zzq,項目名稱:guest-cms,代碼行數:73,代碼來源:ListAction.class.php


注:本文中的ContentModel::Month_Hot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。