本文整理汇总了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();
}
示例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();
示例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;
}