Esempio n. 1
0
/**
 * Get the reputation of a user
 * @param  false|integere $uid    WordPress user id
 * @param  boolean        $short  set it to true for formatted output like 1.2K
 * @return string
 */
function ap_get_reputation($uid = false, $short = false)
{
    if (!$uid) {
        $uid = get_current_user_id();
    }
    $reputation = get_user_meta($uid, 'ap_reputation', true);
    if ($reputation == '') {
        return 0;
    } else {
        if (false !== $short) {
            return ap_short_num($reputation);
        }
        return $reputation;
    }
}
Esempio n. 2
0
function ap_get_points($uid, $short = false)
{
    $points = get_user_meta($uid, 'ap_points', true);
    if ($points == '') {
        return 0;
    } else {
        if ($short) {
            return ap_short_num($points);
        }
        return $points;
    }
}