View Single Post
  #6  
Old 20th December 2016, 09:58
fireknight's Avatar
fireknight fireknight is offline
Administrator
 
Join Date: Aug 2010
Australia
Posts: 173
Default
This is the format_username from the freetsp source
PHP Code:
function format_username ($user$icons true)
{
    global 
$CURUSER$image_dir$site_url;

    
$user['id']    = (int) $user['id'];
    
$user['class'] = (int) $user['class'];

    if (
$user['id'] == 0)
    {
        return 
'System';
    }

    elseif (
$user['username'] == '')
    {
        return 
'unknown['.$user['id'].']';
    }

    
$username '<span style="font-weight:bold; color:#'.get_user_class_color($user['class']).';">'.htmlspecialchars($user['username']).'&nbsp;</span>';
    
$str      '<span style="white-space: nowrap;"><a href="'.$site_url.'/userdetails.php?id='.$user['id'].'"target="_blank">'.$username.'</a>';

    if (
$icons != false)
    {
        
$str .= ($user['donor'] == 'yes' '<img src="'.$image_dir.'star.png" width="16" height="16" border="0" alt="Donor" title="Donor" />' '');
        
$str .= ($user['warned'] == 'yes' '<img src="'.$image_dir.'warned.png" width="15" height="16" border="0" alt="Warned" title="Warned" />' '');
        
$str .= ($user['enabled'] == 'no' '<img src="'.$image_dir.'disabled.png" width="16" height="15" border="0" alt="Disabled" title="Disabled" />' '');
    }
    
$str .= "</span>\n";

    return 
$str;

Krypto added this to the source.
I never knew it came from U232.
So my apology's for that Bigjoos

I will update the version with proper credits to U232.
Do you know the name of the coder so I can add their name to the credit as well.
Reply With Quote