 - : ELKOL
 -@mail : elkol95@gmail.com
 - : eksait.ru
 -WebMoney  : R419576292697

               1.0.1 ()  (  L!MP )    

            

 -----------------------------------------------------------------
           :
  -----------------------------------------------------------------
1.     alter table `users` add `colornick` varchar(6) not null;
                                              alter table `users` add `colornick2` varchar(6) not null;





2.  functions.php    "   "





/*
    -----------------------------------------------------------------
    
    -----------------------------------------------------------------
    */
function gradient($text,$from='',$to='', $mode="hex")
{
    if($mode=="hex")
    {
        $to  = hexdec($to[0].$to[1]).",".hexdec($to[2].$to[3]).",".hexdec($to[4].$to[5]);
        $from= hexdec($from[0].$from[1]).",".hexdec($from[2].$from[3]).",".hexdec($from[4].$from[5]);
    }

    if( empty($text) )
        return '';
    else
        $levels=strlen($text);

    if (empty($from))
                $from = array(0,0,255);
    else
                $from = explode(",", $from);

    if (empty($to))

                $to = array(255,0,0);
    else
                $to = explode(",", $to);

        $output = "";

        for ($i=1;$i<=$levels;$i++)
        {
                for ($ii=0;$ii<3;$ii++)
                {
                        $tmp[$ii] = $from[$ii] - $to[$ii];
                        $tmp[$ii] = floor($tmp[$ii] / $levels);
                        $rgb[$ii] = $from[$ii] - ($tmp[$ii] * $i);

                        if ($rgb[$ii] > 255) $rgb[$ii] = 255;

                        $rgb[$ii] = dechex($rgb[$ii]);
                        $rgb[$ii] = strtoupper($rgb[$ii]);

                        if (strlen($rgb[$ii]) < 2) $rgb[$ii] = "0$rgb[$ii]";
                }
             $output .= ''.$rgb[0].$rgb[1].$rgb[2].'' == '000000' ? '' . mb_substr($text, ($i-1), 1) . '' : "<font color=\"#".$rgb[0].$rgb[1].$rgb[2]."\">" . mb_substr($text, ($i-1), 1) ."</font>";
        }
        return $output;
}







  "   " :




    /*
    -----------------------------------------------------------------
       
    -----------------------------------------------------------------
    $user          (array)         `users`
    $arg           (array)       
       [lastvisit] (boolean)       
       [stshide]   (boolean)     ( )
       [iphide]    (boolean)    ( ) IP  UserAgent
       [iphist]    (boolean)       IP

       [header]    (string)         
       [body]      (string)     ,   
       [sub]       (string)        "sub"
       [footer]    (string)        "sub"
    -----------------------------------------------------------------
    */
    function display_user($user = array (), $arg = array ()) {
        global $set, $set_user, $realtime, $user_id, $rights, $lng, $rootpath;
        $out = false;
$colornick = mysql_fetch_assoc(mysql_query("select `colornick`,`colornick2` from `users` where `id`='".$user_id."';"));
$colornickk = mysql_fetch_assoc(mysql_query("select `colornick`,`colornick2` from `users` where `id`='".$user['id']."';"));
        if (!$user['id']) {
            $out = '<b>' . $lng['guest'] . '</b>';
            if (!empty($user['name']))
                $out .= ': ' . $user['name'];
            if (!empty($arg['header']))
                $out .= ' ' . $arg['header'];
        } else {
            if ($set_user['avatar']) {
                $out .= '<table cellpadding="0" cellspacing="0"><tr><td>';
                if (file_exists(($rootpath . 'files/users/avatar/' . $user['id'] . '.png')))
                    $out .= '<img src="' . $set['homeurl'] . '/files/users/avatar/' . $user['id'] . '.png" width="32" height="32" alt="" />&#160;';
                else
                    $out .= '<img src="' . $set['homeurl'] . '/images/empty.png" width="32" height="32" alt="" />&#160;';
                $out .= '</td><td>';
            }
            if ($user['sex'])
                $out .= '<img src="' . $set['homeurl'] . '/theme/' . $set_user['skin'] . '/images/' . ($user['sex'] == 'm' ? 'm' : 'w') . ($user['datereg'] > $realtime - 86400 ? '_new' : '')
                    . '.png" width="16" height="16" align="middle" alt="' . ($user['sex'] == 'm' ? '' : '') . '" />&#160;';
            else
                $out .= '<img src="' . $set['homeurl'] . '/images/del.png" width="12" height="12" align="middle" />&#160;';
            $out .= !$user_id || $user_id == $user['id'] ? '<b>'.functions::gradient('' . $user['name'] . '', '' . $colornick['colornick'] . '',''.$colornick['colornick2'].'').'</b>' : '<a href="' . $set['homeurl'] . '/users/profile.php?user=' . $user['id'] . '"><b>'.functions::gradient('' . $user['name'] . '', '' . $colornickk['colornick'] . '',''.$colornickk['colornick2'].'').'</b></a>';
            $rank = array (
                0 => '',
                1 => '<span style="color:green">(GMod)</span>',
                2 => '<span style="color:green">(CMod)</span>',
                3 => '<span style="color:green">(FMod)</span>',
                4 => '<span style="color:green">(DMod)</span>',
                5 => '<span style="color:green">(LMod)</span>',
                6 => '<span style="color:green">(Smd)</span>',
                7 => '<span style="color:blue">(Adm)</span>',
                9 => '<span style="color:red">(SV!)</span>'
            );
            $out .= ' ' . $rank[$user['rights']];
            $out .= ($realtime > $user['lastdate'] + 300 ? '<span class="red"> [Off]</span>' : '<span class="green"> [ON]</span>');
            if (!empty($arg['header']))
                $out .= ' ' . $arg['header'];
            if (!$arg['stshide'] && !empty($user['status']))
                $out .= '<div class="status"><img src="' . $set['homeurl'] . '/theme/' . $set_user['skin'] . '/images/label.png" alt="" align="middle" />&#160;' . $user['status'] . '</div>';
            if ($set_user['avatar'])
                $out .= '</td></tr></table>';
        }

        if ($arg['body'])
            $out .= '<div>' . $arg['body'] . '</div>';
        $ipinf = ($rights || $user_id == $user['id']) && !$arg['iphide'] ? 1 : 0;
        $lastvisit = $realtime > $user['lastdate'] + 300 && $arg['lastvisit'] ? date("d.m.Y (H:i)", $user['lastdate']) : false;

        if ($ipinf || $lastvisit || $arg['sub'] || $arg['footer']) {
            $out .= '<div class="sub">';
            if ($arg['sub'])
                $out .= '<div>' . $arg['sub'] . '</div>';
            if ($lastvisit)
                $out .= '<div><span class="gray">' . $lng['last_visit'] . ':</span> ' . $lastvisit . '</div>';
            $iphist = '';
            if ($ipinf && $arg['iphist']) {
                $iptotal = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_users_iphistory` WHERE `user_id` = '" . $user['id'] . "'"), 0);
                $iphist = '&#160;<a href="' . $set['homeurl'] . '/users/profile.php?act=ip&amp;user=' . $user['id'] . '">[' . $iptotal . ']</a>';
            }
            if ($ipinf) {
                $out .= '<div><span class="gray">UserAgent:</span> ' . $user['browser'] . '</div>';
                if ($rights)
                    $out .= '<div><span class="gray">' . $lng['last_ip'] . ':</span> <a href="' . $set['homeurl'] . '/' . $set['admp'] . '/index.php?act=search_ip&amp;ip=' . $user['ip'] . '">' . long2ip($user['ip']) . '</a>' . $iphist
                        . '</div>';
                else
                    $out .= '<div><span class="gray">' . $lng['last_ip'] . ':</span> ' . long2ip($user['ip']) . $iphist . '</div>';
            }
            if ($arg['footer'])
                $out .= $arg['footer'];
            $out .= '</div>';
        }
        return $out;
    }



 forum/index.php 

 //       
$colornick = mysql_fetch_assoc(mysql_query("select `colornick`,`colornick2` from `users` where `name`='".$res['from']."';"));
                    if ($user_id && $user_id != $res['user_id']) {
                        echo '<a href="../users/profile.php?user=' . $res['user_id'] . '"><b>'.functions::gradient('' . $res['from'] . '', '' . $colornick['colornick'] . '',''.$colornick['colornick2'].'').'</b></a> ';
                    } else {
                        echo '<b>'.functions::gradient('' . $res['from'] . '', '' . $colornick['colornick'] . '',''.$colornick['colornick2'].'').'</b> ';
                    }




3.    users   

4.     echo'<a href="../users/color.php">  </a></li>';


                    !!!
