aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-01-02 16:35:48 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-01-02 16:35:48 +0000
commit46c9da77a47abba5f0bb314d9a4cd68d1abb32c9 (patch)
tree33183de1bf76a073820ffeafc5d9931381ba125d /phpBB/includes/functions_display.php
parent1c32dcaeb10292de8fa8de25c8775fbdab25e2c7 (diff)
downloadforums-46c9da77a47abba5f0bb314d9a4cd68d1abb32c9.tar
forums-46c9da77a47abba5f0bb314d9a4cd68d1abb32c9.tar.gz
forums-46c9da77a47abba5f0bb314d9a4cd68d1abb32c9.tar.bz2
forums-46c9da77a47abba5f0bb314d9a4cd68d1abb32c9.tar.xz
forums-46c9da77a47abba5f0bb314d9a4cd68d1abb32c9.zip
- do not allow setting the parent to currently assigned childs [Bug #6708]
- Allow the display_on_index setting to be specified for link forums [Bug #6660] - Rank code in functions_display.php [Bug #6656] - Added some new locations for the viewonline page [Related to bug #6484] - Do not display attached images inline if user disabled image display in posts; the same with flash files [Bug #6226] git-svn-id: file:///svn/phpbb/trunk@6829 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 47e7e67c17..60e35709c9 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -998,4 +998,48 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $for
return;
}
+/**
+* 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
+*
+*/
+function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
+{
+ global $ranks, $config;
+
+ if (empty($ranks))
+ {
+ global $cache;
+ $ranks = $cache->obtain_ranks();
+ }
+
+ if (!empty($user_rank))
+ {
+ $rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
+ $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
+ $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
+ }
+ else
+ {
+ if (!empty($ranks['normal']))
+ {
+ foreach ($ranks['normal'] as $rank)
+ {
+ if ($user_posts >= $rank['rank_min'])
+ {
+ $rank_title = $rank['rank_title'];
+ $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
+ $rank_img_src = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : '';
+ break;
+ }
+ }
+ }
+ }
+}
+
?> \ No newline at end of file