mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Update functions.php
This commit is contained in:
parent
30c5d01ea1
commit
4b4fab6615
@ -2701,30 +2701,41 @@ function profile_url ($data)
|
|||||||
{
|
{
|
||||||
global $bb_cfg, $lang, $datastore;
|
global $bb_cfg, $lang, $datastore;
|
||||||
|
|
||||||
|
$user_id = !empty($data['user_id']) ? $data['user_id'] : GUEST_UID;
|
||||||
|
$username = !empty($data['username']) ? $data['username'] : $lang['GUEST'];
|
||||||
|
$user_rank = !empty($data['user_rank']) ? $data['user_rank'] : 0;
|
||||||
|
|
||||||
if (!$ranks = $datastore->get('ranks'))
|
if (!$ranks = $datastore->get('ranks'))
|
||||||
{
|
{
|
||||||
$datastore->update('ranks');
|
$datastore->update('ranks');
|
||||||
$ranks = $datastore->get('ranks');
|
$ranks = $datastore->get('ranks');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_rank = !empty($data['user_rank']) ? $data['user_rank'] : 0;
|
$title = $lang['USER'];
|
||||||
|
$style = 'colorUser';
|
||||||
if (isset($ranks[$user_rank]))
|
if (isset($ranks[$user_rank]))
|
||||||
{
|
{
|
||||||
$title = $ranks[$user_rank]['rank_title'];
|
$title = $ranks[$user_rank]['rank_title'];
|
||||||
$style = $ranks[$user_rank]['rank_style'];
|
if (!empty($ranks[$user_rank]['rank_style']) && $bb_cfg['color_nick'])
|
||||||
|
{
|
||||||
|
$style = $ranks[$user_rank]['rank_style'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (empty($title)) $title = $lang['USER'];
|
|
||||||
if (empty($style)) $style = 'colorUser';
|
|
||||||
|
|
||||||
if (!$bb_cfg['color_nick']) $style = '';
|
if (empty($title))
|
||||||
|
{
|
||||||
$username = !empty($data['username']) ? $data['username'] : $lang['GUEST'];
|
if ($user_id == GUEST_UID)
|
||||||
$user_id = (!empty($data['user_id']) && $username != $lang['GUEST']) ? $data['user_id'] : GUEST_UID;
|
{
|
||||||
|
$title = $lang['GUEST'];
|
||||||
|
}
|
||||||
|
elseif ($user_id == BOT_UID)
|
||||||
|
{
|
||||||
|
$title = $username;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$profile = '<span title="'. $title .'" class="'. $style .'">'. $username .'</span>';
|
$profile = '<span title="'. $title .'" class="'. $style .'">'. $username .'</span>';
|
||||||
|
if (!in_array($user_id, array('', GUEST_UID, BOT_UID)))
|
||||||
if (!in_array($user_id, array('', GUEST_UID, BOT_UID)) && $username)
|
|
||||||
{
|
{
|
||||||
$profile = '<a href="'. make_url(PROFILE_URL . $user_id) .'">'. $profile .'</a>';
|
$profile = '<a href="'. make_url(PROFILE_URL . $user_id) .'">'. $profile .'</a>';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user