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


PHP comments::get方法代碼示例

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


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

示例1: index

 function index()
 {
     if (isset($this->args[0]) && $this->args[0] != "index") {
         system::setParam("page", "layout");
         $cacheID = $this->args[0] . "|ARTICLE";
         $this->smarty->setCacheID($cacheID);
         if (isset($_POST["contentID"]) && $_POST["contentID"]) {
             comments::add(intval($_POST["contentID"]));
         }
         $this->smarty->assign("isFav", blog::isFavorite($this->args[0]));
         if (!$this->smarty->isCached()) {
             $sqlData = blog::getOnePost($this->args[0], "article")->fetch();
             if ($sqlData) {
                 $this->smarty->assign("comments", comments::get(intval($sqlData["contentID"])));
                 $this->smarty->assign("post", $sqlData);
             }
         }
     } else {
         $offset = 1;
         system::setParam("page", "list");
         if (isset($this->get["offset"])) {
             $offset = intval($this->get["offset"]);
         }
         $cacheID = "ARTICLES|artoffset_{$offset}";
         $this->smarty->setCacheID($cacheID);
         if (!$this->smarty->isCached()) {
             $allCount = $this->db->query("SELECT COUNT(*) as cnt FROM `content` WHERE `type`='article'")->fetch();
             $this->smarty->assign("posts", news::getPosts(core::pagination($allCount["cnt"], $offset), "article")->fetchAll());
         }
     }
 }
開發者ID:ygres,項目名稱:sblog,代碼行數:31,代碼來源:index.php

示例2: change_rateAction

 public function change_rateAction()
 {
     if (!isset($_SESSION['comments_rate'][system::url(2)])) {
         if ($comment = comments::get(system::url(2))) {
             if (system::url(3) == 'up') {
                 $comment->rateUp();
             } else {
                 $comment->rateDown();
             }
             $_SESSION['comments_rate'][$comment->id()] = 1;
             $comment->save();
         }
     }
     system::stop();
 }
開發者ID:sunfun,項目名稱:Bagira.CMS,代碼行數:15,代碼來源:controller.php

示例3: index

 function index()
 {
     system::setParam("page", "post");
     if ($this->args[0] != "blog") {
         $cacheID = $this->args[0] . "|POST";
         $this->smarty->setCacheID($cacheID);
         if (isset($_POST["SLUG"]) && isset($_POST["comment"])) {
             blog::addCommentBySLUG($_POST["SLUG"]);
         }
         if (!$this->smarty->isCached()) {
             $sqlData = blog::getOnePost($this->args[0])->fetchAll();
             if ($sqlData) {
                 $sqlData = array_shift($sqlData);
                 $comments = comments::get($sqlData["contentID"]);
                 $this->smarty->assign("comments", $comments);
                 blog::highlightCode($sqlData["body"]);
                 $this->smarty->assign("item", $sqlData);
             }
         }
     } else {
         system::redirect("/");
     }
 }
開發者ID:ygres,項目名稱:sblog,代碼行數:23,代碼來源:blog.php

示例4: view

 /**
  * @return HTML
  * @param int $comment_id - ID комментария
  * @param string $templ_name - Шаблон оформления комментария
  * @desc МАКРОС: Выводит информацию об указанном комментарии
  */
 public function view($comment_id, $templ_name = 'tree')
 {
     $templ_file = '/comments/' . $templ_name . '.tpl';
     $TEMPLATE = page::getTemplate($templ_file);
     if (!is_array($TEMPLATE)) {
         return page::errorNotFound('comments.view', $templ_file);
     }
     if ($comment = comments::get($comment_id)) {
         if ($comment->isActive() || reg::getKey('/comments/show_noactive')) {
             page::assign('obj.id', $comment->id());
             page::assign('obj.parent_id', $comment->getParentId());
             page::assign('obj.user_id', $comment->getUserId());
             page::assign('obj.publ_date', $comment->getPublDate());
             page::assign('obj.username', $comment->getUserName());
             page::assign('obj.email', $comment->getEmail());
             page::assign('obj.text', $comment->getText());
             page::assign('obj.rate', $comment->getRate());
             if (isset($_SESSION['comments_rate'][$comment->id()])) {
                 page::fParse('rate', $TEMPLATE['rate_change']);
             } else {
                 page::fParse('rate', $TEMPLATE['rate']);
             }
             page::assign('list', '');
             return page::parse($TEMPLATE['list']);
         }
     }
 }
開發者ID:sunfun,項目名稱:Bagira.CMS,代碼行數:33,代碼來源:macros.php

示例5: act

 public function act()
 {
     if (system::issetUrl(2) && is_numeric(system::url(2))) {
         if ($obj = comments::get(system::url(2))) {
             $obj->setActive(!$obj->isActive());
             $obj->save();
             echo $obj->isActive() ? 'active' : 'no_active';
         }
     } else {
         if (isset($_POST['objects'])) {
             while (list($id, $val) = each($_POST['objects'])) {
                 if ($obj = comments::get($val)) {
                     $obj->setActive(!$obj->isActive());
                     $obj->save();
                 }
             }
             echo 'invert';
         }
     }
     system::stop();
 }
開發者ID:sunfun,項目名稱:Bagira.CMS,代碼行數:21,代碼來源:__comment.php

示例6: comments

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
$commentID = get_id(2);
$commentsClass = new comments();
$comment = $commentsClass->get($commentID);
if (!is_array($comment)) {
    addErrorMessage($langArray['wrong_comment'], '', 'error');
} else {
    abr('show_form', 'yes');
    abr('comment', $comment);
}
開發者ID:yunsite,項目名稱:demila,代碼行數:21,代碼來源:reply.php


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