本文整理汇总了PHP中ap_meta_total_count函数的典型用法代码示例。如果您正苦于以下问题:PHP ap_meta_total_count函数的具体用法?PHP ap_meta_total_count怎么用?PHP ap_meta_total_count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ap_meta_total_count函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ap_get_parti
function ap_get_parti($post_id, $count = false)
{
global $wpdb;
if ($count) {
return ap_meta_total_count('parti', $post_id, false, 'apmeta_userid');
} else {
return ap_get_all_meta(array('where' => array('apmeta_type' => array('value' => 'parti', 'compare' => '=', 'relation' => 'AND'), 'apmeta_actionid' => array('value' => $post_id, 'compare' => '=', 'relation' => 'AND')), 'group' => array('apmeta_userid' => array('relation' => 'AND'))), 5);
}
}
示例2: ap_get_parti
function ap_get_parti($post_id = false, $count = false, $param = false)
{
global $wpdb;
if ($count) {
return ap_meta_total_count('parti', $post_id, false, 'apmeta_userid');
} else {
$where = array('apmeta_type' => array('value' => 'parti', 'compare' => '=', 'relation' => 'AND'));
if ($post_id !== false) {
$where['apmeta_actionid'] = array('value' => $post_id, 'compare' => '=', 'relation' => 'AND');
}
if ($param !== false) {
$where['apmeta_param'] = array('value' => $param, 'compare' => '=', 'relation' => 'AND');
}
return ap_get_all_meta(array('where' => $where, 'group' => array('apmeta_userid' => array('relation' => 'AND'))));
}
}
示例3: ap_following_count
/**
* Count total numbers of following user
* @param integer $user_id
* @return integer
*/
function ap_following_count($user_id)
{
return ap_meta_total_count('follower', false, $user_id);
}
示例4: ap_get_views_db
/**
* @param integer $id
*/
function ap_get_views_db($id)
{
return ap_meta_total_count('post_view', $id);
}
示例5: ap_received_reputation_post
function ap_received_reputation_post($post_id)
{
$reputation = ap_reputation_by_event('question_upvote', true);
$vote_count = ap_meta_total_count('vote_up', $post_id);
return $vote_count * $reputation;
}
示例6: ap_comment_flag_count
/**
* Count comment flag votes.
*
*
* @return int
*/
function ap_comment_flag_count($comment_id = false)
{
if (false === $comment_id) {
$comment_id = get_comment_ID();
}
return apply_filters('ap_comment_flag_count', ap_meta_total_count('comment_flag', $comment_id));
}
示例7: ap_post_close_vote
/**
* post close vote count.
*
* @param bool|int $postid
*
* @return int
*/
function ap_post_close_vote($postid = false)
{
global $post;
$postid = $postid ? $postid : $post->ID;
return ap_meta_total_count('close', $postid);
}
示例8: ap_post_subscribers_count
function ap_post_subscribers_count($post_id)
{
_deprecated_function('ap_post_subscribers_count', '2.2.0.1', 'ap_subscribers_count');
$post_id = $post_id ? $post_id : get_question_id();
return ap_meta_total_count('subscriber', $post_id);
}
示例9: ap_subscribers_count
/**
* Return the count of subscribers for question or term
* @param integer $action_id Question id or term_id
* @param string $type Type of subscription
* @return integer
*/
function ap_subscribers_count($action_id = false, $type = '')
{
$subscribe_type = $type != '' ? 'subscriber_' . $type : 'subscriber';
$action_id = $action_id ? $action_id : get_question_id();
return ap_meta_total_count($subscribe_type, $action_id);
}
示例10: ap_post_flag_count
function ap_post_flag_count($postid = false)
{
global $post;
$postid = $postid ? $postid : $post->ID;
return ap_meta_total_count('flag', $postid);
}
示例11: ap_received_point_post
function ap_received_point_post($post_id)
{
$point = ap_point_by_event('question_upvote', true);
$vote_count = ap_meta_total_count('vote_up', $post_id);
return $vote_count * $point;
}