本文整理汇总了PHP中Vote::count_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Vote::count_all方法的具体用法?PHP Vote::count_all怎么用?PHP Vote::count_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vote
的用法示例。
在下文中一共展示了Vote::count_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Vote
function count_all_votes($value = "> 0")
{
require_once mnminclude . 'votes.php';
$vote = new Vote();
$vote->type = 'links';
$vote->link = $this->id;
return $vote->count_all($value);
}
示例2: Vote
function insert_vote($user = 0, $value = 10)
{
global $anon_karma;
require_once mnminclude . 'votes.php';
if (!is_numeric($this->id)) {
return false;
}
$vote = new Vote();
$vote->type = 'comments';
$vote->user = $user;
$vote->link = $this->id;
$vote->value = $value;
if ($vote->insert()) {
$vote = new Vote();
$vote->type = 'comments';
$vote->link = $this->id;
$this->votes = $vote->count() - $vote->count('<0');
if (comment_buries_spam > 0 && $vote->count_all("<0") >= comment_buries_spam) {
$this->status = 'discard';
$this->store();
$vars = array('comment_id' => $this->id);
check_actions('comment_spam', $vars);
require_once mnminclude . 'link.php';
$link = new Link();
$link->id = $this->link;
$link->read();
$link->recalc_comments();
$link->store();
}
$vars = array('vote' => $this);
check_actions('comment_insert_vote_post', $vars);
return $vote->sum();
}
return false;
}