mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)
[changed parameters for get_user_rank(), breaks backward compatibility] git-svn-id: file:///svn/phpbb/trunk@9083 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
a9274f1d63
commit
04f7c1da69
4 changed files with 8 additions and 7 deletions
|
@ -1141,6 +1141,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||||
/**
|
/**
|
||||||
* Get user rank title and image
|
* Get user rank title and image
|
||||||
*
|
*
|
||||||
|
* @param int $user_id the users user id
|
||||||
* @param int $user_rank the current stored users rank id
|
* @param int $user_rank the current stored users rank id
|
||||||
* @param int $user_posts the users number of posts
|
* @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_title the rank title will be stored here after execution
|
||||||
|
@ -1148,7 +1149,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||||
* @param string &$rank_img_src the rank image source 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)
|
function get_user_rank($user_id, $user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
|
||||||
{
|
{
|
||||||
global $ranks, $config;
|
global $ranks, $config;
|
||||||
|
|
||||||
|
@ -1164,7 +1165,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
|
||||||
$rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . PHPBB_ROOT_PATH . $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 = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . PHPBB_ROOT_PATH . $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'])) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
|
$rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? PHPBB_ROOT_PATH . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
|
||||||
}
|
}
|
||||||
else
|
else if ($user_id != ANONYMOUS)
|
||||||
{
|
{
|
||||||
if (!empty($ranks['normal']))
|
if (!empty($ranks['normal']))
|
||||||
{
|
{
|
||||||
|
|
|
@ -295,7 +295,7 @@ function get_user_information($user_id, $user_row)
|
||||||
|
|
||||||
$user_row['avatar'] = ($user->optionget('viewavatars')) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';
|
$user_row['avatar'] = ($user->optionget('viewavatars')) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';
|
||||||
|
|
||||||
get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
|
get_user_rank($user_id, $user_row['user_rank'], $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('a_email'))
|
if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email'))
|
||||||
{
|
{
|
||||||
|
|
|
@ -238,7 +238,7 @@ switch ($mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
$rank_title = $rank_img = '';
|
$rank_title = $rank_img = '';
|
||||||
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
get_user_rank($row['user_id'], $row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||||
|
|
||||||
$template->assign_block_vars($which_row, array(
|
$template->assign_block_vars($which_row, array(
|
||||||
'USER_ID' => $row['user_id'],
|
'USER_ID' => $row['user_id'],
|
||||||
|
@ -1533,7 +1533,7 @@ function show_profile($data)
|
||||||
$user_id = $data['user_id'];
|
$user_id = $data['user_id'];
|
||||||
|
|
||||||
$rank_title = $rank_img = $rank_img_src = '';
|
$rank_title = $rank_img = $rank_img_src = '';
|
||||||
get_user_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
get_user_rank($user_id, $data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||||
|
|
||||||
if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_email'))
|
if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_email'))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1048,7 +1048,7 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
'allow_pm' => 0,
|
'allow_pm' => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
|
get_user_rank($poster_id, $row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1095,7 +1095,7 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
'search' => ($auth->acl_get('u_search')) ? append_sid('search', "author_id=$poster_id&sr=posts") : '',
|
'search' => ($auth->acl_get('u_search')) ? append_sid('search', "author_id=$poster_id&sr=posts") : '',
|
||||||
);
|
);
|
||||||
|
|
||||||
get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
|
get_user_rank($poster_id, $row['user_rank'], $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('a_email'))
|
if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue