diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-01 10:19:24 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-10-01 10:19:24 +0200 |
commit | 170b75d0c9bab9d7500748c32bc4de93d1bf5c2f (patch) | |
tree | 484de5bacc5de90d0b51f0644247931bb9b08fbb /phpBB/includes/functions_compatibility.php | |
parent | 994a0dcd4c444c7902f85355efba3a9a6b06f78e (diff) | |
parent | cd7b21a7033d692b2f558dfd82bb67d3696d9e0e (diff) | |
download | forums-170b75d0c9bab9d7500748c32bc4de93d1bf5c2f.tar forums-170b75d0c9bab9d7500748c32bc4de93d1bf5c2f.tar.gz forums-170b75d0c9bab9d7500748c32bc4de93d1bf5c2f.tar.bz2 forums-170b75d0c9bab9d7500748c32bc4de93d1bf5c2f.tar.xz forums-170b75d0c9bab9d7500748c32bc4de93d1bf5c2f.zip |
Merge pull request #2888 from Nicofuma/ticket/12993
[ticket/12993] Improve get_user_ranks
Diffstat (limited to 'phpBB/includes/functions_compatibility.php')
-rw-r--r-- | phpBB/includes/functions_compatibility.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index ea092c83bc..fbb1f0e03d 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -165,3 +165,30 @@ function update_foes($group_id = false, $user_id = false) global $db, $auth; return phpbb_update_foes($db, $auth, $group_id, $user_id); } + +/** +* Get user rank title and image +* +* @param int $user_rank the current stored users rank id +* @param int $user_posts the users number of posts +* @param string &$rank_title the rank title will be stored here after execution +* @param string &$rank_img the rank image as full img tag is stored here after execution +* @param string &$rank_img_src the rank image source is stored here after execution +* +* @deprecated 3.1.0-RC5 (To be removed: 3.3.0) +* +* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false +*/ +function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src) +{ + global $phpbb_root_path, $phpEx; + if (!function_exists('phpbb_get_user_rank')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + $rank_data = phpbb_get_user_rank(array('user_rank' => $user_rank), $user_posts); + $rank_title = $rank_data['title']; + $rank_img = $rank_data['img']; + $rank_img_src = $rank_data['img_src']; +} |