FreiChat related discussions
color text admin

Hello,
I've integrated freichat and it's work perfectly.
Now I would like the administrator to write in red and the others in black
I've test this but i don't work perfectly.
Thanks

$db = new Db();
$db->query('SELECT group_id FROM pun_users WHERE username="'.$login.'"');
$role = $db->field();
$db->close();

if($role=="1"){
                        $color = "#F7230C";
                        echo'<link rel="stylesheet" href="http://www.XXX.com/fr/game/tchat/client/jquery/freichat_themes/freichatcssadmin.php" type="text/css">';
                    } else {
                                $color = "#000000";
                                echo'<link rel="stylesheet" href="http://www.XXX.com/fr/game/tchat/client/jquery/freichat_themes/freichatcss.php" type="text/css">';
                                }

if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
    if(is_file("/home/XXX/public_html/fr/game/tchat/hardcode.php")){
require "/home/XXX/public_html/fr/game/tchat/hardcode.php";

               $temp_id =  $ses . $uid;

               return md5($temp_id);

       }
       else
       {
               echo "<script>alert('module freichatx says: hardcode.php file not
found!');</script>";
       }

       return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://XXXX/fr/game/tchat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
Hello, I&#039;ve integrated freichat and it&#039;s work perfectly. Now I would like the administrator to write in red and the others in black I&#039;ve test this but i don&#039;t work perfectly. Thanks ```` $db = new Db(); $db-&gt;query(&#039;SELECT group_id FROM pun_users WHERE username=&quot;&#039;.$login.&#039;&quot;&#039;); $role = $db-&gt;field(); $db-&gt;close(); if($role==&quot;1&quot;){ $color = &quot;#F7230C&quot;; echo&#039;&lt;link rel=&quot;stylesheet&quot; href=&quot;http://www.XXX.com/fr/game/tchat/client/jquery/freichat_themes/freichatcssadmin.php&quot; type=&quot;text/css&quot;&gt;&#039;; } else { $color = &quot;#000000&quot;; echo&#039;&lt;link rel=&quot;stylesheet&quot; href=&quot;http://www.XXX.com/fr/game/tchat/client/jquery/freichat_themes/freichatcss.php&quot; type=&quot;text/css&quot;&gt;&#039;; } if(!function_exists(&quot;freichatx_get_hash&quot;)){ function freichatx_get_hash($ses){ if(is_file(&quot;/home/XXX/public_html/fr/game/tchat/hardcode.php&quot;)){ require &quot;/home/XXX/public_html/fr/game/tchat/hardcode.php&quot;; $temp_id = $ses . $uid; return md5($temp_id); } else { echo &quot;&lt;script&gt;alert(&#039;module freichatx says: hardcode.php file not found!&#039;);&lt;/script&gt;&quot;; } return 0; } } ?&gt; &lt;script type=&quot;text/javascript&quot; language=&quot;javascipt&quot; src=&quot;http://XXXX/fr/game/tchat/client/main.php?id=&lt;?php echo $ses;?&gt;&amp;xhash=&lt;?php echo freichatx_get_hash($ses); ?&gt;&quot;&gt;&lt;/script&gt; ````

I resolved ! in plugin.js

  formatBB: function (message) {

                         if (coloradmin =="1"){

                message = "<span style='color:#FF0000'>" + message + "</span>";
            }
else{                message = "<span style='color:#000000'>" + message + "</span>";
}
            return message;
        },
        format: function (message) {
                if (coloradmin =="1"){

                message = "<span style='color:#FF0000'>" + message + "</span>";
            }
else{                message = "<span style='color:#000000'>" + message + "</span>";
}
            return message;

        }
    },
I resolved ! in plugin.js ```` formatBB: function (message) { if (coloradmin ==&quot;1&quot;){ message = &quot;&lt;span style=&#039;color:#FF0000&#039;&gt;&quot; + message + &quot;&lt;/span&gt;&quot;; } else{ message = &quot;&lt;span style=&#039;color:#000000&#039;&gt;&quot; + message + &quot;&lt;/span&gt;&quot;; } return message; }, format: function (message) { if (coloradmin ==&quot;1&quot;){ message = &quot;&lt;span style=&#039;color:#FF0000&#039;&gt;&quot; + message + &quot;&lt;/span&gt;&quot;; } else{ message = &quot;&lt;span style=&#039;color:#000000&#039;&gt;&quot; + message + &quot;&lt;/span&gt;&quot;; } return message; } }, ````
52
1
1
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft