You are not connected. Please login or register


Handyman Ajax Chat BG Code




      • Please log in to reply

    View previous topic View next topic Go down  Message [Page 1 of 1]

    #1

    OfflineDrakius

    avatar
    Admin
    on Fri Sep 05, 2014 10:01 pm
    Make a profile field called chat_bg

    Enter the color codes into your style

    Enter an import code to your chat.php

    Add this code to your server.

    Code:

    <?php
    $sql = "SELECT * FROM phpbb_users WHERE user_id = '".$row['user_id']."' LIMIT 1";
    $result = $db->sql_query($sql);
    $sqlrows = $db->sql_fetchrowset($result);

    foreach ($sqlrows as $sqlrows2){
       $group_id = $sqlrows2['group_id'];
    }
    switch($group_id){
       case '5': //Admin
          $sql1 = "SELECT * FROM phpbb_profile_fields_data WHERE user_id = '".$row['user_id']."' LIMIT 1";
          $result1 = $db->sql_query($sql1);
          $rows1 = $db->sql_fetchrowset($result1);

          foreach ($rows1 as $row2){
             $adminBG = $row2['pf_chat_bg_color'];
          }
          $class4 = 5;
          if($adminBG != NULL && $adminBG != ""){
             $class4 = $adminBG;
          }
          break;

       case '56': //MOD
          $sql1 = "SELECT * FROM phpbb_profile_fields_data WHERE user_id = '".$row['user_id']."' LIMIT 1";
          $result1 = $db->sql_query($sql1);
          $rows1 = $db->sql_fetchrowset($result1);

          foreach ($rows1 as $row2){
             $adminBG = $row2['pf_chat_bg_color'];
          }
          $class4 = 5;
          if($adminBG != NULL && $adminBG != ""){
             $class4 = $adminBG;
          }
          break;

       case '4': //GMOD
          $sql1 = "SELECT * FROM phpbb_profile_fields_data WHERE user_id = '".$row['user_id']."' LIMIT 1";
          $result1 = $db->sql_query($sql1);
          $rows1 = $db->sql_fetchrowset($result1);

          foreach ($rows1 as $row2){
             $adminBG = $row2['pf_chat_bg_color'];
          }
          $class4 = 5;
          if($adminBG != NULL && $adminBG != ""){
             $class4 = $adminBG;
          }
          break;
       case '65': //Mario
          $class4 = FF0000;
          break;
       case '47': //AnotherGroup
          $class4 = 800000;
          break;
       default:
          $class4 = ($row['message_id'] % 2) ? 1 : 2;
          break;
    }
    ?>

    The case shows group ID

    View user profile http://code15.board-directory.net

    View previous topic View next topic Go down  Message [Page 1 of 1]



    Permissions in this forum:
    You cannot reply to topics in this forum