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


PHP Blog::getComments方法代码示例

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


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

示例1: getRead

 function getRead($id = null)
 {
     $row = Blog::getRowBlog($id);
     if ($row) {
         $this->data['row'] = $row;
         $this->data['id'] = $row->blogID;
         $this->data['alias'] = $row->slug;
         $this->data['blogcategories'] = Blog::summaryCategory();
         $this->data['clouds'] = Blog::clouds();
         $this->data['recent'] = Blog::recentPosts();
         $this->data['comments'] = Blog::getComments($row->blogID);
         $this->layout = View::make("layouts." . CNF_THEME . ".index");
         $this->layout->nest('content', 'blog.view', $this->data)->with('page', $this->data);
     } else {
         return Redirect::to('blog')->with('message', SiteHelpers::alert('error', ' Article not found !'));
     }
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:17,代码来源:BlogController.php

示例2: mktime

require "blocks/autoload.php";
require "blocks/db.php";
require "blocks/user.php";
if (isset($_GET['id'])) {
    $id = $_GET['id'];
}
//Устанавливаем cookie для того, чтобы просмотры засчитывались только 1 раз от юзера
setcookie("viewCookie[" . $id . "]", "view" . $id . "", mktime(0, 0, 0, 1, 1, date("Y") + 1));
$blog = new Blog($id);
$blog->db = $db;
if (!isset($_COOKIE['viewCookie'][$id])) {
    $blog->addView("news");
}
try {
    $blog->getSelectedData();
    $blog->getComments();
} catch (DataException $e) {
    die(require "blocks/errorTemplate.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<? require("blocks/scripts.php"); ?>
<title>Официальный сайт клана Пламя - <? print($blog->title); ?></title>
</head>
<body>
开发者ID:Klym,项目名称:flame,代码行数:31,代码来源:viewBlog.php

示例3: foreach

?>
    </p>
<?php 
?>
  <div class="boxbottom"><div class="author"></div><div class="links"></div></div>
</div>
<?php 
if ($showComments) {
    ?>
<div id="comments">
    <h3><?php 
    echo $words->get('CommentsTitle');
    ?>
</h3>
<?php 
    $comments = $Blog->getComments($blog->blog_id);
    if (!$comments) {
        echo '<p>' . $words->get('CommentsAdd') . '</p>';
    } else {
        $count = 0;
        $lastHandle = '';
        foreach ($comments as $comment) {
            require 'comment.php';
            ++$count;
            $lastHandle = $comment->user_handle;
        }
    }
    if ($member) {
        ?>
<form method="post" action="" class="def-form" id="blog-comment-form">
    <div class="row">
开发者ID:gpuenteallott,项目名称:rox,代码行数:31,代码来源:singlepost.php


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