aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-08-18 16:13:32 +0200
committerTristan Darricau <github@nicofuma.fr>2014-08-18 16:32:05 +0200
commit496cc64bc63befc2bb6f250e1712cd5a00986aef (patch)
treea93acde193e432f43bb875025c51b1b241ead7fd
parent685bdc87e6480597c7d7f30a7b9477c543099d2e (diff)
downloadforums-496cc64bc63befc2bb6f250e1712cd5a00986aef.tar
forums-496cc64bc63befc2bb6f250e1712cd5a00986aef.tar.gz
forums-496cc64bc63befc2bb6f250e1712cd5a00986aef.tar.bz2
forums-496cc64bc63befc2bb6f250e1712cd5a00986aef.tar.xz
forums-496cc64bc63befc2bb6f250e1712cd5a00986aef.zip
[ticket/12993] Rename to phpbb_get_user_rank
PHPBB3-12993
-rw-r--r--phpBB/includes/functions_compatibility.php18
-rw-r--r--phpBB/includes/functions_display.php7
-rw-r--r--phpBB/includes/mcp/mcp_warn.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php2
-rw-r--r--phpBB/memberlist.php4
-rw-r--r--phpBB/phpbb/user_loader.php2
-rw-r--r--phpBB/viewtopic.php4
7 files changed, 29 insertions, 12 deletions
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
index 093cb19538..b371978ee5 100644
--- a/phpBB/includes/functions_compatibility.php
+++ b/phpBB/includes/functions_compatibility.php
@@ -166,3 +166,21 @@ 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
+*
+* 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)
+{
+ phpbb_get_user_rank(array('user_rank' => $user_rank), $user_posts, $rank_title, $rank_img, $rank_img_src);
+}
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 1c80855163..75b86b4f71 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1386,7 +1386,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
*
* 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_data, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
+function phpbb_get_user_rank($user_data, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
{
global $ranks, $config, $phpbb_root_path, $phpbb_path_helper, $phpbb_dispatcher;
@@ -1396,7 +1396,7 @@ function get_user_rank($user_data, $user_posts, &$rank_title, &$rank_img, &$rank
* @event core.modify_user_rank
* @var array user_data Array with user's data
* @var int user_posts User_posts to change
- * @since 3.1.0-RC3
+ * @since 3.1.0-RC4
*/
$vars = array('user_data', 'user_posts');
@@ -1435,7 +1435,6 @@ function get_user_rank($user_data, $user_posts, &$rank_title, &$rank_img, &$rank
}
}
-
/**
* Prepare profile data
*/
@@ -1447,7 +1446,7 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl
$user_id = $data['user_id'];
$rank_title = $rank_img = $rank_img_src = '';
- get_user_rank($data, (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);
+ phpbb_get_user_rank($data, (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);
if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_user'))
{
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 1629e62872..356988d2e8 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -341,7 +341,7 @@ class mcp_warn
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- get_user_rank($user_row, $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
+ phpbb_get_user_rank($user_row, $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
$avatar_img = phpbb_get_user_avatar($user_row);
$template->assign_vars(array(
@@ -490,7 +490,7 @@ class mcp_warn
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- get_user_rank($user_row, $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
+ phpbb_get_user_rank($user_row, $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
$avatar_img = phpbb_get_user_avatar($user_row);
// OK, they didn't submit a warning so lets build the page for them to do so
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 3b3a45a8ff..c98aa39b5b 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -408,7 +408,7 @@ function get_user_information($user_id, $user_row)
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- get_user_rank($user_row, $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
+ phpbb_get_user_rank($user_row, $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
if ((!empty($user_row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index a1737116cf..4a117ea9e6 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -284,7 +284,7 @@ switch ($mode)
}
$rank_title = $rank_img = $rank_img_src = '';
- get_user_rank($row, (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);
+ phpbb_get_user_rank($row, (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);
$template->assign_block_vars('group.user', array(
'USER_ID' => $row['user_id'],
@@ -1083,7 +1083,7 @@ switch ($mode)
$rank_title = $rank_img = $rank_img_src = '';
if ($group_row['group_rank'])
{
- get_user_rank($group_row, false, $rank_title, $rank_img, $rank_img_src);
+ phpbb_get_user_rank($group_row, false, $rank_title, $rank_img, $rank_img_src);
if ($rank_img)
{
diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php
index e6a2429163..35199d8864 100644
--- a/phpBB/phpbb/user_loader.php
+++ b/phpBB/phpbb/user_loader.php
@@ -223,7 +223,7 @@ class user_loader
'rank_img_src',
);
- get_user_rank($user, (($user['user_id'] == ANONYMOUS) ? false : $user['user_posts']), $rank['rank_title'], $rank['rank_img'], $rank['rank_img_src']);
+ phpbb_get_user_rank($user, (($user['user_id'] == ANONYMOUS) ? false : $user['user_posts']), $rank['rank_title'], $rank['rank_img'], $rank['rank_img_src']);
return $rank;
}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index c9d7d884c4..89b5a5033b 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1174,7 +1174,7 @@ while ($row = $db->sql_fetchrow($result))
$user_cache[$poster_id] = $user_cache_data;
- get_user_rank($row, false, $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
+ phpbb_get_user_rank($row, false, $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
}
else
{
@@ -1238,7 +1238,7 @@ while ($row = $db->sql_fetchrow($result))
$user_cache[$poster_id] = $user_cache_data;
- get_user_rank($row, $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
+ phpbb_get_user_rank($row, $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{