当前位置: 首页>>代码示例>>PHP>>正文


PHP comment::countCommentsByPost方法代码示例

本文整理汇总了PHP中comment::countCommentsByPost方法的典型用法代码示例。如果您正苦于以下问题:PHP comment::countCommentsByPost方法的具体用法?PHP comment::countCommentsByPost怎么用?PHP comment::countCommentsByPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comment的用法示例。


在下文中一共展示了comment::countCommentsByPost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index($id = NULL)
 {
     $this->view->setLayout("admin");
     $this->view->conf = $this->conf;
     $this->title_for_layout($this->l10n->__("Comentarios - Codice CMS"));
     $comment = new comment();
     $total_rows = $comment->countCommentsByPost();
     $page = $id;
     $page = is_null($page) ? 1 : $page;
     $limit = $this->userConf['posts_per_page'];
     $offset = ($page - 1) * $limit;
     $limitQuery = $offset . "," . $limit;
     $targetpage = $this->path . 'comments/';
     $pagination = $this->pagination->init($total_rows, $page, $limit, $targetpage);
     $this->view->pagination = $pagination;
     $comments = $comment->findAll(NULL, "ID DESC", $limitQuery, NULL);
     foreach ($comments as $key => $value) {
         $Post = new post();
         $post = $Post->findBy('ID', $value['ID_post']);
         $value['post'] = array('urlfriendly' => $post['urlfriendly'], 'title' => $post['title']);
         $value["content"] = utils::htmlentities($value["content"]);
         $value["content"] = utils::nl2br($value["content"]);
         $comments[$key] = $value;
     }
     $this->registry->comments = $comments;
     $this->plugin->call("comments_comment_content");
     $this->view->comments = $this->registry->comments;
     $this->render();
 }
开发者ID:ravenlp,项目名称:CodiceCMS,代码行数:29,代码来源:comments_controller.php

示例2: adminNotify

 public function adminNotify()
 {
     if ($this->cookie->check("id_user") and $this->cookie->id_user == 1) {
         //no notificamos a administrador de su propio comentario.
         return;
     }
     $id = $this->registry->lastCommentID;
     $Comment = new comment();
     $comment = $Comment->find($id);
     $comment['content'] = utils::nl2br($comment['content']);
     if (!defined('GESHI_VERSION')) {
         $comment['content'] = $this->comment_source_code_beautifier($comment['content'], 'addTagPRE');
     } else {
         $comment['content'] = $this->comment_source_code_beautifier($comment['content']);
     }
     $User = new user();
     $user = $User->find(1);
     $Post = new post();
     $post = $Post->find($comment['ID_post']);
     $commentsWaiting = $Comment->countCommentsByPost(null, 'waiting');
     $mailStr = "\n\t\t\t<table width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<small>\n\t\t\t\t\t\t<strong>From IP</strong>: {$comment['IP']}<br />\n\t\t\t\t\t\t<strong>URL</strong>: <a href=\"{$comment['url']}\">{$comment['url']}</a><br />\n\t\t\t\t\t\t<strong>Email</strong>: <a href=\"mailto:{$comment['email']}\">{$comment['email']}</a><br />\n\t\t\t\t\t\t<strong>DateTime</strong>: {$comment['created']}<br />\n\t\t\t\t\t</small>\n\t\t\t\t\t<hr>\n\t\t\t\t\t<strong>Author</strong>: {$comment['author']}<br />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr><td><strong>Content</strong></td></tr>\n\t\t\t<tr><td bgcolor=\"#f7f7f7\">\n\t\t\t\t{$comment['content']}\n\t\t\t\t<hr />\n\t\t\t</td></tr>\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tModerate comment: <a href=\"{$this->registry->path}comments/edit/{$comment['ID']}\">{$this->registry->path}comments/edit/{$comment['ID']}</a><br />\n\t\t\t\t\t\tView entry: <a href=\"{$this->registry->path}{$post['urlfriendly']}\">{$this->registry->path}{$post['urlfriendly']}</a>\n\t\t\t\t\t</p>\n\t\t\n\t\t\t\t\t<p>\n\t\t\t\t\t\tThere are {$commentsWaiting} comments waiting for approbal. <br />\n\t\t\t\t\t\tPlease moderate comments: <a href=\"{$this->registry->path}comments/waiting\">{$this->registry->path}comments</a>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t</table>\n\t\t";
     $conf = $this->registry->conf;
     $subject = "[{$conf['blog_name']}] Nuevo Comentario en: {$post['title']}";
     $this->enviaMail($user['email'], $subject, $mailStr, $user['email']);
 }
开发者ID:ravenlp,项目名称:CodiceCMS,代码行数:25,代码来源:commentNotify.plugin.php

示例3: index

 public function index($id = NULL, $page = 1)
 {
     if (is_null($id) or is_numeric($id)) {
         $this->redirect($this->conf['blog_siteurl']);
     }
     $tag = $id;
     $post = new post();
     $link = new link();
     $comment = new comment();
     $this->html->useTheme($this->conf['blog_current_theme']);
     $info = array();
     $info["isAdmin"] = false;
     if ($this->cookie->check("logged") and $this->cookie->id_user == 1) {
         $info["isAdmin"] = true;
     }
     $this->themes->info = $info;
     $includes['charset'] = $this->html->charsetTag("UTF-8");
     $includes['rssFeed'] = $this->html->includeRSS();
     if ($page > 1) {
         $includes['canonical'] = "<link rel=\"canonical\" href=\"{$this->conf['blog_siteurl']}/tag/" . rawurlencode($post->sql_escape($id)) . "/{$page}\" />";
     } else {
         $includes['canonical'] = "<link rel=\"canonical\" href=\"{$this->conf['blog_siteurl']}/tag/" . rawurlencode($post->sql_escape($id)) . "\" />";
     }
     $this->registry->includes = $includes;
     $this->plugin->call('index_includes');
     $includes = null;
     foreach ($this->registry->includes as $include) {
         $includes .= $include;
     }
     $this->themes->includes = $includes;
     $this->themes->links = $link->findAll();
     $this->themes->single = false;
     $total_rows = $post->countPosts(array('status' => 'publish', 'tag' => $tag));
     $page = (int) is_null($page) ? 1 : $page;
     $limit = $this->conf['blog_posts_per_page'];
     $offset = ($page - 1) * $limit;
     $limitQuery = $offset . "," . $limit;
     $targetpage = $this->path . "tag/{$tag}/";
     $this->themes->pagination = $this->pagination->init($total_rows, $page, $limit, $targetpage);
     $posts = $post->getPostsByTag($tag, $limitQuery);
     foreach ($posts as $k => $p) {
         $posts[$k]['title'] = htmlspecialchars($p['title']);
         $posts[$k]['tags'] = $post->getTags($p['ID']);
         $posts[$k]['comments_count'] = $comment->countCommentsByPost($posts[$k]['ID']);
         $user = new user();
         if ($posts[$k]['id_user'] < 2) {
             $posts[$k]['autor'] = $user->find(1);
         } else {
             $posts[$k]['autor'] = $user->find($posts[$k]['id_user']);
         }
     }
     $this->registry->posts = $posts;
     $this->plugin->call("index_post_content");
     $this->themes->posts = $this->registry->posts;
     $this->themes->title_for_layout = "{$this->conf['blog_name']} - {$tag}";
     $this->render();
 }
开发者ID:ravenlp,项目名称:CodiceCMS,代码行数:57,代码来源:tag_controller.php

示例4: getPost

 public function getPost($urlfriendly, $status = null)
 {
     $urlfriendy = rawurlencode($this->sql_escape($urlfriendly));
     $post = array();
     if (is_null($status) === true) {
         $post = $this->findBy('urlfriendly', $urlfriendly);
     } else {
         $post = $this->findBy(array('urlfriendly', 'status'), array($urlfriendly, $status));
     }
     if ($this->isNew() === false) {
         if ($post['title']) {
             $post['title'] = htmlspecialchars($post['title']);
         } else {
             $post['title'] = "Untitled";
         }
         $post['tags'] = $this->getTags($post['ID']);
         $C = new comment();
         $post["comments_count"] = $C->countCommentsByPost($post['ID'], "publish");
         $post["comments"] = $C->getAll($post['ID'], "publish");
     }
     return $post;
 }
开发者ID:ravenlp,项目名称:CodiceCMS,代码行数:22,代码来源:post.php


注:本文中的comment::countCommentsByPost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。