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


PHP comment::read_db_record方法代码示例

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


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

示例1: delete

 function delete()
 {
     // delete all contacts and comments linked with this client as well
     $db = new db_alloc();
     $query = prepare("SELECT * FROM clientContact WHERE clientID=%d", $this->get_id());
     $db->query($query);
     while ($db->next_record()) {
         $clientContact = new clientContact();
         $clientContact->read_db_record($db);
         $clientContact->delete();
     }
     $query = prepare("SELECT * FROM comment WHERE commentType = 'client' and commentLinkID=%d", $this->get_id());
     $db->query($query);
     while ($db->next_record()) {
         $comment = new comment();
         $comment->read_db_record($db);
         $comment->delete();
     }
     return parent::delete();
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:20,代码来源:client.inc.php

示例2: prepare

<?php

// Create a search index for Comments. This patch may take a long time to apply.
ini_set('max_execution_time', 180000);
ini_set('memory_limit', "256M");
$index = Zend_Search_Lucene::create(ATTACHMENTS_DIR . 'search/comment');
$db = new db_alloc();
$q = prepare("SELECT * FROM comment");
$db->query($q);
while ($db->row()) {
    $comment = new comment();
    $comment->read_db_record($db);
    $comment->update_search_index_doc($index);
}
$index->commit();
开发者ID:cjbayliss,项目名称:alloc,代码行数:15,代码来源:patch-00163-alla.php

示例3: date

 function comment_stats()
 {
     // date from which a comment is counted as being new. if monday then date back to friday, else the previous day
     $days = date("w") == 1 ? 3 : 1;
     $date = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - $days, date("Y")));
     $query = "SELECT * FROM comment";
     $db = new db_alloc();
     $db->query($query);
     while ($db->next_record()) {
         $comment = new comment();
         $comment->read_db_record($db);
         $this->comments["total"][$comment->get_value("commentModifiedUser")]++;
         $this->comments["total"]["total"]++;
         if ($comment->get_value("commentModifiedTime") != "") {
             if (!isset($this->comments["all"][$comment->get_value("commentModifiedUser")])) {
                 $this->comments["all"][$comment->get_value("commentModifiedUser")] = array();
             }
             $this->comments["all"][$comment->get_value("commentModifiedUser")][date("Y-m-d", strtotime($comment->get_value("commentModifiedTime")))]++;
             $this->comments["all"][$comment->get_value("commentModifiedUser")]["total"]++;
             $this->comments["all"]["total"][date("Y-m-d", strtotime($comment->get_value("commentModifiedTime")))]++;
             if (strcmp($date, $comment->get_value("commentModifiedTime")) <= 0) {
                 if (!isset($this->comments["new"][$comment->get_value("commentModifiedUser")])) {
                     $this->comments["new"][$comment->get_value("commentModifiedUser")] = array();
                 }
                 $this->comments["new"][$comment->get_value("commentModifiedUser")][date("Y-m-d", strtotime($comment->get_value("commentModifiedTime")))]++;
                 $this->comments["new"][$comment->get_value("commentModifiedUser")]["total"]++;
                 $this->comments["new"]["total"][date("Y-m-d", strtotime($comment->get_value("commentModifiedTime")))]++;
             }
         }
     }
     return $this->comments;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:32,代码来源:stats.inc.php


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