当前位置: 首页>>代码示例>>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;未经允许,请勿转载。