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


PHP CommentModel::getNewThreeComment方法代碼示例

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


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

示例1: getDetails

 private function getDetails()
 {
     if (isset($_GET['id'])) {
         parent::__construct($this->_tpl, new ContentModel());
         $this->_model->id = $_GET['id'];
         if (!$this->_model->getOneContent()) {
             Tool::alertBack('警告:不存在此文檔!');
         }
         $_content = $this->_model->getOneContent();
         $_comment = new CommentModel();
         $_comment->cid = $this->_model->id;
         $_tarArr = explode(',', $_content->tag);
         if (is_array($_tarArr)) {
             foreach ($_tarArr as $_value) {
                 $_content->tag = str_replace($_value, '<a href="search.php?type=3&inputkeyword=' . $_value . '">' . $_value . '</a>', $_content->tag);
             }
         }
         $this->_tpl->assign('id', $_content->id);
         $this->_tpl->assign('titlec', $_content->title);
         $this->_tpl->assign('date', $_content->date);
         $this->_tpl->assign('source', $_content->source);
         $this->_tpl->assign('author', $_content->author);
         $this->_tpl->assign('info', $_content->info);
         $this->_tpl->assign('tag', $_content->tag);
         $this->_tpl->assign('content', Tool::unHtml($_content->content));
         $this->getNav($_content->nav);
         if (IS_CAHCE) {
             $this->_tpl->assign('count', '<script type="text/javascript">getContentCount();</script>');
         } else {
             $this->_tpl->assign('count', $_content->count);
         }
         $this->_tpl->assign('comment', $_comment->getCommentTotal());
         $_object = $_comment->getNewThreeComment();
         if ($_object) {
             foreach ($_object as $_value) {
                 switch ($_value->manner) {
                     case -1:
                         $_value->manner = '反對';
                         break;
                     case 0:
                         $_value->manner = '中立';
                         break;
                     case 1:
                         $_value->manner = '支持';
                         break;
                 }
                 if (empty($_value->face)) {
                     $_value->face = '00.gif';
                 }
                 if (!empty($_value->oppose)) {
                     $_value->oppose = '-' . $_value->oppose;
                 }
             }
         }
         $this->_tpl->assign('NewThreeComment', $_object);
         $this->_model->nav = $_content->nav;
         $_object = $this->_model->getMonthNavRec();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavRec', $_object);
         $_object = $this->_model->getMonthNavHot();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavHot', $_object);
         $_object = $this->_model->getMonthNavPic();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavPic', $_object);
     } else {
         Tool::alertBack('警告:非法操作!');
     }
 }
開發者ID:denson7,項目名稱:phpstudy,代碼行數:69,代碼來源:DetailsAction.class.php

示例2: getDetails

 private function getDetails()
 {
     if (isset($_GET['id'])) {
         parent::__construct($this->_tpl, new ContentModel());
         $this->_model->id = $_GET['id'];
         if (!$this->_model->setContentCount()) {
             Tool::alertBack('article not existing');
         }
         $_content = $this->_model->getOneContent();
         $_comment = new CommentModel();
         $_comment->cid = $this->_model->id;
         $this->_tpl->assign('id', $_content->id);
         $this->_tpl->assign('titlec', $_content->title);
         $this->_tpl->assign('date', $_content->date);
         $this->_tpl->assign('source', $_content->source);
         $this->_tpl->assign('author', $_content->author);
         $this->_tpl->assign('info', $_content->info);
         $this->_tpl->assign('tag', $_content->tag);
         $this->_tpl->assign('content', Tool::unHtml($_content->content));
         $this->getNav($_content->nav);
         if (IS_CACHE) {
             $this->_tpl->assign('count', '<script>getContentCount();</script>');
         } else {
             $this->_tpl->assign('count', $_content->count);
         }
         $this->_tpl->assign('comment', $_comment->getCommentTotal());
         $_object = $_comment->getNewThreeComment();
         if ($_object) {
             foreach ($_object as $_value) {
                 switch ($_value->manner) {
                     case -1:
                         $_value->manner = 'disagree';
                         break;
                     case 0:
                         $_value->manner = 'no opinion';
                         break;
                     case 1:
                         $_value->manner = 'agree';
                         break;
                 }
                 if (empty($_value->face)) {
                     $_value->face = '00.png';
                 }
                 if (!empty($_value->oppose)) {
                     $_value->oppose = '-' . $_value->oppose;
                 }
             }
         }
         $this->_tpl->assign('NewThreeComment', $_object);
         $this->_model->nav = $_content->nav;
         $_object = $this->_model->getMonthNavRec();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavRec', $_object);
         $_object = $this->_model->getMonthNavHot();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavHot', $_object);
         $_object = $this->_model->getMonthNavPic();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavPic', $_object);
     } else {
         Tool::alertBack('illegal act');
     }
 }
開發者ID:e0zhao02,項目名稱:sample_code,代碼行數:63,代碼來源:DetailsAction.class.php


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