2
有來電cubepoints點下組BuddyPress的功能topic.php發佈的一個好朋友在這裏計算器:呼叫Cubepoints排名的BuddyPress的函數
add_filter('bp_get_the_topic_time_since_last_post','bp_forum_extras_get_the_topic_time_since_last_post');
add_action('bp_get_the_topic_post_poster_avatar', 'topic_poster_avatar');
function topic_poster_avatar($avatar) {
preg_match_all('/user-([0-9]+)-avatar/', $avatar, $m);
$id = $m[1][0];
if ($count = get_user_meta($id, 'cpoints', 1))
return $avatar . '<div class="cp-avatar-counter"><center><span class="number">' . $count . '</span> Points</center></div>';
return $avatar;
}
我想知道你知道調用cubepoints的函數是buddypress的函數麼?下面的代碼用於BB press not buddypress。應該使用cp_module_ranks_getRank來調用cubepoints的rank,但是我怎樣才能將它變成像上面那樣的函數?
<?php echo cp_module_ranks_getRank(bp_displayed_user_id()); ?>
試過 - > add_filter('bp_get_the_topic_time_since_last_post','bp_forum_extras_get_the_topi c_time_since_last_post'); add_action('bp_get_the_topic_post_poster_avatar','topic_poster_avatar');函數topic_poster_avatar($ avatar){pre-_match_all('/ user - ([0-9] +) - avatar /',$ avatar,$ m); $ id = $ m [1] [0]; if($ count = get_user_meta($ id,'cpoints',1)) return $ avatar。 if(function_exists('cp_module_ranks_getRank'))&& $ user-> ID){echo'
這不適用於這個嗎? –