Mod Nick color Jcms 700

805
.
CyberGhostNet Group
First open ---> system/johncms/Tools.php
And Add this line:
public function nick($id, $mod = false){
       $ban = $this->db->query("SELECT COUNT(*) FROM `cms_ban_users` WHERE `user_id` = '" . $id . "' AND `ban_time` > '" . time() . "'")->fetchColumn();
       $user = $this->db->query("SELECT * FROM `users` WHERE `id` = '" . $id . "'")->fetch();
       if($ban > 0) {
         $out .= '<font color="black">'.($mod == 1 ? '<small>' : '<b>').'<s>' . $user['name'] . '</s>'.($mod == 1 ? '</small>' : '</b>').'</font>';
       } else {
         if($user['rights'] > 1) {
             if($user['rights'] == 3) {
               $font = '<font color="green">';
             }
             if($user['rights'] > 3) {
               $font = '<font color="red">';
             }
             if($user['rights'] == 6) {
               $font = '<font color="#993399">';
             }
             if($user['rights'] == 7) {
               $font = '<font color="gold">';
             }
            if($user['rights'] == 9) {
               $font = '<font color="red">';
            }
            if($user['rights'] == 10) {
               $font = '<font color="#7192a8">';
            }
           $out .= ''.$font.'' . $user['name']. '</font>';
        } else {
           $out .= '<font color="blue">' . $user['name'] . '</font>';
        }
       }
      return $out;
      }


to use add this code for any file you want:
$tools->nick($user['id']);

or:
$tools->nick($user['user_id']);

just change query id to id or user_id
.
$tools->nick($user['user_id']);

where to put this in forum to show colour?
.
wtf? (+/-)


use this:
$color = 'blue'; // Default color
if($user['rights'] > 1) {
  if($user['rights'] == 3) {
    $color = 'green';
  }
  if($user['rights'] > 3) {
    $color = 'red';
  }
  if($user['rights'] == 6) {
   $color = '#993399';
  }
  if($user['rights'] == 7) {
    $color = 'gold';
  }
  if($user['rights'] == 9) {
    $color = 'red';
  }
  if($user['rights'] == 10) {
    $color = '#7192a8';
  }
}
$out .= '<font color="' . $color . '">' . $user['name'] . '</font>';
.
Gabriel,
$ncolor=array('blue','magenta','magenta','green','red','red','red','#993399','#993399','gold','#7192a8');
               $font = '<font color="$ncolor[$user['rights']]">';
.
CyberGhostNet Group
Good
.
# Gabriel (21.03.2017 / 14:12)
First open ---> system/johncms/Tools.php
And Add this line:
public function nick($id, $mod = false){
$ban = $this->db->query("SELECT COUNT(*) FROM `cms_ban_users` WHERE `user_id` = '" .
Do not working in johncms 8. Help me
Всего: 6