當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。