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); } }
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')))); } }
/** * 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); }
/** * @param integer $id */ function ap_get_views_db($id) { return ap_meta_total_count('post_view', $id); }
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; }
/** * 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)); }
/** * 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); }
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); }
/** * 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); }
function ap_post_flag_count($postid = false) { global $post; $postid = $postid ? $postid : $post->ID; return ap_meta_total_count('flag', $postid); }
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; }