Bbcode Colors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Bbcode Colors

    this is code 4 my script lavalair:

    $text=preg_replace("/\[red\](.*?)\[\/red\]/i","<font color=\"red\">\\1</font>", $text);
    $text=preg_replace("/\[lime\](.*?)\[\/lime\]/i","<font color=\"lime\">\\1</font>", $text);
    $text=preg_replace("/\[green\](.*?)\[\/green\]/i","<font color=\"green\">\\1</font>", $text);
    $text=preg_replace("/\[yellow\](.*?)\[\/yellow\]/i","<font color=\"yellow\">\\1</font>", $text);
    $text=preg_replace("/\[white\](.*?)\[\/white\]/i","<font color=\"white\">\\1</font>", $text);
    $text=preg_replace("/\[blue\](.*?)\[\/blue\]/i","<font color=\"blue\">\\1</font>", $text);
    $text=preg_replace("/\[grey\](.*?)\[\/grey\]/i","<font color=\"grey\">\\1</font>", $text);
    $text=preg_replace("/\[silver\](.*?)\[\/silver\]/i","<font color=\"silver\">\\1</font>", $text);

    but...

    How I can add new colors ??? like pink,orange and more??

    tnks to help ;)
    if like my post click:

    http://coding-talk.com/images/totall...ost_thanks.gif

    #2
    wtf????????????????????????
    isnt it obvious????????????????????????

    Comment


      #3
      here is orange now do you think you can manage to do the rest on your own lol

      $text=preg_replace("/\[orange\](.*?)\[\/orange\]/i","<font color=\"orange\">\\1</font>", $text);

      Comment


        #4
        but 4 create new code with exadecimal code how I can???
        if like my post click:

        http://coding-talk.com/images/totall...ost_thanks.gif

        Comment


          #5
          replace orange for #FFFFFF etc

          Comment


            #6
            but 4 create new code with exadecimal code how I can???[/b]
            add this row into core.php
            Code:
            $text = preg_replace("/\[color=(.*?)\](.*?)\[\/color\]/i","<font color=\"\\1\">\\2</font>", $text);
            usage:
            Code:
            [ color = #0000FF ]text....... [ / color ]
            [ color = blue ]text.......... [ / color ]
            It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
            ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
            ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
            キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

            Comment


              #7
              I think...
              at usercp user select blue colour and your msg at chat page are blue.

              this is auto. at chat page. not can add [colour] tags.is auto.

              like this screenshot:
              if like my post click:

              http://coding-talk.com/images/totall...ost_thanks.gif

              Comment


                #8
                PHP Code:
                Sql = ibwf_users chatcolor varchar(50) default="orange"
                
                replace index.php?action=sitethms with this:overflow:auto'>/////////////////////////////////////themes 
                else if($action=="sitethms")
                {
                  addonline(getuid_sid($sid),"Site Themes","");
                  echo "<head>";
                  echo "<title>Site Themes</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                  echo "</head>";
                  echo "<body>";
                  echo "<p align=\"center\">";
                  echo "Site Themes</p>";
                  echo "
                
                changing ur site theme will change all the colors of the site eg:
                backround, text, links, typing fields etc..
                ";
                  echo "<form action=\"genproc.php?action=updtthme&sid=$sid\" method=\"post\">";
                  echo "<select name=\"thms\">";
                  echo "<option value=\"white\">White</option>";
                  echo "<option value=\"black\">Black</option>";
                  echo "<option value=\"red\">Red</option>";
                  echo "<option value=\"blue\">Blue</option>";
                  echo "<option value=\"green\">Green</option>";
                  echo "<option value=\"pink\">Pink</option>";
                  echo "</select>";
                  echo "<select name=\"size\">";
                  echo "<option value=\"small\">Small</option>";
                  echo "<option value=\"medium\">Medium</option>";
                  echo "<option value=\"large\">Large</option>";
                  echo "</select>
                ";
                  echo "Chat Text Colour
                  echo "<select name=\"chatc\">";
                  echo "<option value=\"red\">red</option>";
                  echo "<option value=\"red\">red</option>";
                  echo "<option value=\"lime\">lime</option>";
                  echo "</select>";
                  echo "<input type=\"Submit\" name=\"submit\" Value=\"Save\"></form>";
                  echo "</p>";
                  echo "<p align=\"center\">";
                  echo "9 <a accesskey=\"9\" href=\"index.php?action=cpanel&sid=$sid\">Settings</a>
                ";
                  echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
                  echo "</p>";
                  echo "</body>";
                }
                </div>
                
                replace genproc.php?action=updtthme with:
                <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>//////////////////////////theme
                else if($action=="updtthme")
                {
                  addonline(getuid_sid($sid),"Updating Theme","");
                  $theme = $_POST["thms"];
                  $size = $_POST["size"];
                  $size = $_POST["size"];
                  $chatc = $_POST["chatc"];
                  $uid = getuid_sid($sid);
                  $exist = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE id='".$uid."'"));
                if ($exist[0]>0)
                  {
                  $res = mysql_query("UPDATE ibwf_users SET theme='".$theme."_".$size.".css', chatcolor='".$chatc."' WHERE id='".$uid."'");
                  }else{
                  $res = mysql_query("UPDATE ibwf_users SET theme='".$theme."_".$size.".css', chatcolor='".$chatc."' WHERE id='".$uid."'");
                  }
                  echo "<head>";
                  echo "<title>$sitename</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/".$theme."_".$size.".css\">";
                  echo "</head>";
                  echo "<body>";
                  echo "<p align=\"center\">";
                  echo mysql_error();
                if($res)
                  {
                  echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Your theme has been updated successfully
                
                
                ";
                  }else{
                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!
                
                ";
                  }
                  echo "9 <a accesskey=\"9\" href=\"index.php?action=cpanel&sid=$sid\">Settings</a>
                ";
                  echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
                  echo "</p>";
                  echo "</body>";
                }</div>
                
                and last replace chat.php with:
                <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
                header("Cache-Control: no-cache, must-revalidate");
                header("Pragma: no-cache");
                //header('Content-type: application/vnd.wap.xhtml+xml'); 
                echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
                echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
                ?>
                <html xmlns="http://www.w3.org/1999/xhtml">
                <head>
                <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/>
                <meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
                </head>
                <?php
                
                include("config.php"); 
                include("core.php"); 
                connectdb();
                $action=$_GET["action"];
                $id=$_GET["id"];
                $sid = $_GET["sid"];
                $rid=$_GET["rid"];
                $rpw=$_GET["rpw"];
                $uid = getuid_sid($sid);
                $uexist = isuser($uid);
                $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
                
                if((islogged($sid)==false)||!$uexist)
                    {
                    echo "<head>";
                      echo "<title>Error!!!</title>";
                      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<center>";
                      echo "You are not logged in
                ";
                      echo "Or Your session has been expired
                
                ";
                      echo "<a href=\"index.php\">Login</a>";
                      echo "</center>";
                      echo "</html>";
                      echo "</body>";
                      exit();
                    }
                    
                if(isbanned($uid))
                    {
                      echo "<head>";
                      echo "<title>Error!!!</title>";
                      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<p align=\"center\">";
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>
                ";
                      echo "You are Banned
                
                ";
                      $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
                    $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
                      $remain = $banto[0]- time();
                      $rmsg = gettimemsg($remain);
                      echo "Time Left: $rmsg
                ";
                      $nick = getnick_uid($banto[2]);
                    echo "By: $nick
                ";
                    echo "Reason: $banto[1]";
                      //echo "<a href=\"index.php\">Login</a>";
                      echo "</p>";
                      echo "</body>";
                      echo "</html>";
                      exit();
                    }
                    $isroom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'"));
                    if($isroom[0]==0)
                    {
                    echo "<head>";
                      echo "<title>Error!!!</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<center>";
                      echo "Room Doesn't Exist
                
                ";
                      echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a>";
                      echo "</center>";
                      echo "</body>";
                      echo "</html>";
                      exit();
                    }
                    $passworded = mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_rooms WHERE id='".$rid."'"));
                    if($passworded[0]!="")
                    {
                      if($rpw!=$passworded[0])
                      {
                    echo "<head>";
                      echo "<title>Error!!!</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<center>";
                      echo "Wrong Password!
                ";
                      echo "You can't enter this room
                
                ";
                      echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a>";
                      echo "</center>";
                      echo "</body>";
                      echo "</html>";
                      exit();
                      }
                    }
                    if(!canenter($rid,$sid))
                    {
                    echo "<head>";
                      echo "<title>Error!!!</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<center>";
                      echo "Permission denied!
                
                ";
                      echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a>";
                      echo "</center>";
                      echo "</body>";
                      echo "</html>";
                      exit();
                    }
                    addtochat($uid, $rid);
                        $timeto = 300;
                        $timenw = time();
                        $timeout = $timenw-$timeto;
                        $deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
                        $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                        $rname = $rooms[1];
                        $nick = getnick_sid($sid);
                            
                      if ($action=="")
                      {
                      echo "<head>";
                      echo "<title>$nick@$rname</title>";
                      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      $unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups WHERE unread='1' AND touid='".$uid."'"));
                      if ($unreadpopup[0]<1)
                      {
                      echo "<meta http-equiv=\"refresh\" content=\"20; url=chat.php?time=";
                      echo "".date("dmHis")."";
                      echo "&sid=$sid&rid=$rid&rpw=$rpw\">";
                      }
                      echo "</head>";
                      echo "<body>";
                        addonline($uid,"Chating in $rname","chat.php?rid=$rid&rpw=$rpw");
                        //echo "
                
                ";
                        echo popup($sid);
                        echo "1 <a name=\"top\" id=\"top\" accesskey=\"1\" href=\"chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw\">Write</a>
                ";
                        echo "2 <a accesskey=\"2\" href=\"#opt\">options</a>
                ";
                        echo "* <a accesskey=\"*\" href=\"chat.php?time=";
                        echo "".date("dmHis")."";
                        echo "&sid=$sid&rid=$rid&rpw=$rpw\">Refresh</a>
                ";
                
                        $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
                        $unrd="".$unreadinbox[0]."";
                        if ($unreadinbox[0]>0)
                        {
                        echo "5 <a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a>
                ";
                      }
                      //echo "</p>";
                      //echo "
                
                ";
                
                        $message=$_POST["message"];
                        $who = $_POST["who"];
                        $rinfo = mysql_fetch_array(mysql_query("SELECT censord, freaky FROM ibwf_rooms WHERE id='".$rid."'"));
                        if (trim($message) != "")
                        {
                    if(!isblocked($message,$uid))
                    {
                
                      $chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';");
                      $lstmsg = mysql_query("UPDATE ibwf_rooms SET lastmsg='".time()."' WHERE id='".$rid."'");
                            
                      $hehe=mysql_fetch_array(mysql_query("SELECT chmsgs FROM ibwf_users WHERE id='".$uid."'"));
                      $totl = $hehe[0]+1;
                      $msgst= mysql_query("UPDATE ibwf_users SET chmsgs='".$totl."' WHERE id='".$uid."'");
                    }else{
                    $bantime = time() + (30*24*60*60);
                    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
                    echo "Can't Post Msg
                
                ";
                    echo "You just tried sending a msg with a link to one of the crapiest sites on earth
                 The members of these sites spam here a lot, so go to that site and stay there if you don't like it here
                 as a result of your stupid action:
                1. you have lost your sheild
                2. you have lost all your plusses
                3. You are BANNED!";
                        $user = getnick_sid($sid);
                    mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='".getnick_uid(1)." auto banned $user for spamming chat', actdt='".time()."'");
                    mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='1', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
                    mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
                    echo "</body>";
                    echo "</html>";
                    exit();
                  }
                            if($rinfo[1]==2)
                            {
                              //oh damn i gotta post this message to ravebabe :(
                              //will it succeed?
                              $botid = "eeb070e74e366473";
                              $hostname = "www.pandorabots.com";
                              $hostpath = "/pandora/talk-xml";
                              $sendData = "botid=".$botid."&input=".urlencode($message)."&custid=".$custid;
                              
                              $result = PostToHost($hostname, $hostpath, $sendData);
                              
                              $pos = strpos($result, "custid=\"");
                              $pos = strpos($result, "<that>");
                        if ($pos === false) {
                            $reply = "";
                        } else {
                            $pos += 6;
                            $endpos = strpos($result, "</that>", $pos);
                            $reply = unhtmlspecialchars2(substr($result, $pos, $endpos - $pos));
                            $reply = mysql_escape_string($reply);
                        }
                        
                        $chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='1', who='', timesent='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';");
                        
                            }
                          $message = "";
                            }
                            
                            echo "
                ";
                            $chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC");
                            $counter=0;
                
                            while($chat = mysql_fetch_array($chats))
                            {
                                $canc = true;
                               
                                
                                if($counter<40)
                                {
                                  if(istrashed($chat[0])){
                                        if($uid!=$chat[0])
                                        {
                                          $canc = false;
                                        }
                                  }
                                //////good
                                /*if(isignored($chat[0],$uid)){
                                  $canc = false;
                                }*/
                                //////////good
                                if($chat[0]!=$uid)
                                {
                                  if($chat[1]!=0)
                                  {
                                    if($chat[1]!=$uid)
                                    {
                                      $canc = false;
                                    }
                                  }
                                }
                                if($chat[4]=='1' && ismod($uid))
                                {
                                  $canc = true;
                                }
                                if($canc)
                                {
                                   $cmid = mysql_fetch_array(mysql_query("SELECT chmood, chatcolor FROM ibwf_users WHERE id='".$chat[0]."'"));
                                   
                                   $iml = "";
                                if(($cmid[0]!=0))
                                {
                                  $mlnk = mysql_fetch_array(mysql_query("SELECT img, text FROM ibwf_moods WHERE id='".$cmid[0]."'"));
                                  $iml = "<img src=\"$mlnk[0]\" alt=\"$mlnk[1]\"/>";
                
                                }
                                  $chnick = getnick_uid($chat[0]);
                
                                    $optlink = $iml.$chnick;
                                  if(($chat[1]!=0)&&($chat[0]==$uid))
                                  {
                                    ///out
                                    $iml = "<img src=\"../moods/out.gif\" alt=\"!\"/>";
                                    $chnick = getnick_uid($chat[1]);
                                    $optlink = $iml."Pm To ".$chnick;
                                  }
                                  if($chat[1]==$uid)
                                  {
                                    ///out
                                    $iml = "<img src=\"../moods/in.gif\" alt=\"!\"/>";
                                    $chnick = getnick_uid($chat[0]);
                                    $optlink = $iml."Pm By ".$chnick;
                                  }
                                    if($chat[4]=='1')
                                  {
                                    ///out
                                    $iml = "<img src=\"../moods/point.gif\" alt=\"!\"/>";
                                    $chnick = getnick_uid($chat[0]);
                                    $tonick = getnick_uid($chat[1]);
                                    $optlink = "$iml By ".$chnick." To ".$tonick;
                                  }
                                  
                  $ds= date("H.i.s", $chat[2]);
                  $text = parsepm($chat[3], $sid);
                  $nos = substr_count($text,"<img src=");
                  if(isspam($text))
                  {
                  $chnick = getnick_uid($chat[0]);
                  echo addchatmsg($chat[0],$text,1,"*Oi! $chnick, No Spamming!*");
                  }
                  else if($nos>2){
                  $chnick = getnick_uid($chat[0]);
                  echo addchatmsg($chat[0],$text,1,"*Hey! $chnick, U Can Only Use 2 Smilies Per Msg!*");
                  }else{
                  $sres = substr($chat[3],0,3);
                  if($sres == "/me")
                  {
                  $chco = strlen($chat[3]);
                  $goto = $chco - 3;
                  $rest = substr($chat[3],3,$goto);
                  $tosay = parsepm($rest, $sid);
                    
                  echo addchatmsg($chat[0],$tosay,1,"");
                  }
                else{
                  if($rinfo[0]==0){$tosay = getbbcode($chat[3], $sid, 0);}
                  else{$tosay = parsepm($chat[3], $sid, 1);}
                  if($rinfo[1]==1){$tosay = strrev($tosay);}
                  echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
                  echo "<font color=\"$cmid[1]\">$tosay</font>
                ";
                  }
                  }
                  $counter++;
                  }
                  }
                  }
                        echo "
                ";
                        echo "<a name=\"opt\" id=\"opt\"></a>";
                        echo "* <a accesskey=\"*\" href=\"chat.php?time=";
                        echo "".date("dmHis")."";
                        echo "&sid=$sid&rid=$rid&rpw=$rpw\">Refresh</a>
                ";
                      echo "1 <a href=\"chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw\">Write</a>
                ";
                        echo "3 <a accesskey=\"3\" href=\"chat.php?action=options&sid=$sid&rid=$rid&rpw=$rpw\">Settings</a>
                ";
                        $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));
                        echo "4 <a accesskey=\"4\" href=\"chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw\">Whos Inside $chatters[0]</a>
                ";
                        echo "5 <a accesskey=\"5\" href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">Inbox</a>
                ";
                        echo "6 <a accesskey=\"6\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a>
                ";
                        echo "7 <a accesskey=\"7\" href=\"index.php?action=chat&sid=$sid\">Chat</a>
                ";
                        echo forumlink($sid,8);
                        echo "9 <a accesskey=\"9\" href=\"#top\">top</a> ";
                        echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\">Home</a>";
                        echo "</body>";
                }
                /////////////////////////////////////////////////////SAY
                
                      else if ($action=="say")   
                      {
                     echo "<head>";
                      echo "<title>Write Msg</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<p align=\"center\">";
                        addonline($uid,"Writing Chat Msg","");
                        echo "<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\">";
                        echo "
                
                Message:<input name=\"message\" type=\"text\" maxlength=\"255\"/>
                ";
                        echo "<input type=\"Submit\" Name=\"sy2\" value=\"Say\"></form>
                ";
                      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                      $rname = $rooms[1];
                        echo "4 <a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a>
                ";
                        echo "6 <a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a>
                ";
                        echo "7 <a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a>
                ";
                        echo "8 <a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a>
                ";
                        echo forumlink($sid,9);
                        echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
                        echo "</body>";
                }
                        ////////////////////////////////////////////
                    /////////////////////////////////////////////////////SAY2
                      else if ($action=="say2")                   {
                    echo "<head>";
                      echo "<title>Send Pm</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<p align=\"center\">";
                        $unick = getnick_uid($who);
                        echo "Send Pm To $unick";
                        echo "</p>";
                        
                        addonline($uid,"Writing Chat Msg","");
                        echo "<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\">";
                        echo "<input type=\"Hidden\" name=\"who\" value=\"$who\">";
                        echo "
                
                Message:<input name=\"message\" type=\"text\" maxlength=\"255\"/>
                ";
                        echo "<input type=\"Submit\" name=\"private\" Value=\"Private\"></form>";
                        echo "
                ";
                        if(ismod($uid))
                        {
                        echo "* <a accesskey=\"*\" href=\"chat.php?action=clear&sid=$sid&who=$who&lstloc=cht&rid=$rid\">Clear Msgs</a>
                ";
                        }
                        echo "1 <a accesskey=\"1\" href=\"index.php?action=viewuser&sid=$sid&who=$who&lstloc=cht&rid=$rid\">View $unick's Profile</a>
                ";
                        echo "2 <a accesskey=\"2\" href=\"chat.php?action=expose&sid=$sid&who=$who&rid=$rid&rpw=$rpw\">Expose $unick's Msgs</a>
                ";
                      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                      $rname = $rooms[1];
                        echo "4 <a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a>
                ";
                        echo "6 <a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a>
                ";
                        echo "7 <a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a>
                ";
                        echo "8 <a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a>
                ";
                        echo forumlink($sid,9);
                        echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
                        echo "</body>";
                }
                /////////////////////////////////////////////////////CHAT OPTIONS
                
                        else if ($action=="options")   
                                        {
                         echo "<head>";
                      echo "<title>Chat Options</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                        
                        addonline($uid,"Chat Options","");
                        echo "1 <a accesskey=\"1\" href=\"lists.php?action=chmood&sid=$sid&page=1\">Chat Mood</a>
                ";
                        echo "2 <a accesskey=\"2\" href=\"lists.php?action=smilies&sid=$sid\">Smilies List</a>
                ";
                        echo "3 <a accesskey=\"3\"  href=\"chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw\">Who's Inside</a>
                ";
                      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                      $rname = $rooms[1];
                        echo "4 <a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a>
                ";    
                        echo "6 <a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a>
                ";
                        echo "7 <a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a>
                ";
                        echo "8 <a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a>
                ";
                        echo forumlink($sid,9);
                        echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
                        echo "</body>";
                }
                        ////////////////////////////////////////////
                        //////////////////////////////inside//////////
                      else if ($action=="inside")           {
                          
                      addonline($uid,"Viewing Chat UserList","");
                      echo "<head>";
                      echo "<title>Chat UserList</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                        echo "
                
                
                ";
                        $inside=mysql_query("SELECT DISTINCT * FROM ibwf_chonline WHERE rid='".$rid."' and uid IS NOT NULL");
                        
                        while($ins=mysql_fetch_array($inside))
                        {
                          $unick = getnick_uid($ins[1]);
                          $userl = "<a href=\"chat.php?action=say2&sid=$sid&who=$ins[1]&rid=$rid&rpw=$rpw\">$unick</a>
                ";
                          echo "$userl";
                        }
                        echo "
                ";
                      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                      $rname = $rooms[1];
                        echo "4 <a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a>
                ";
                        echo "6 <a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a>
                ";
                        echo "7 <a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a>
                ";
                        echo "8 <a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a>
                ";
                        echo forumlink($sid,9);
                        echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
                        echo "</body>";
                }
                      else if ($action=="expose")           {
                
                      addonline($uid,"Exposing ChatUser","");
                      echo "<head>";
                      echo "<title>Exposing ChatUser</title>";
                  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<p align=\"center\">
                ";
                      mysql_query("UPDATE ibwf_chat SET exposed='1' WHERE chatter='".$who."' AND who='".$uid."'");
                      $unick = getnick_uid($who);
                      echo "$unick messages to you have been exposed to staff";
                      echo "
                
                ";
                      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                      $rname = $rooms[1];
                      echo "4 <a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a>
                ";
                      echo "6 <a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a>
                ";
                      echo "7 <a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a>
                ";
                      echo "<;b>8 [/b]<a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a>
                ";
                      echo forumlink($sid,9);
                      echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
                      echo "</body>";
                }
                      else if(($action=="clear")&&(ismod($uid)))
                      {
                      addonline($uid,"Chat Tools","");
                      echo "<head>";
                      echo "<title>Clearing Users Msgs</title>";
                      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                      echo "<p align=\"center\">
                ";
                      $trgtnick=getnick_uid($who);
                      $perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
                      $trgtperm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'"));
                      if($trgtperm>$perm){ 
                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>
                Error!!!
                Permission Denied...
                ";
                      echo "
                U Cannot Clear $trgtnick's Msgs
                ";
                      }else{
                      if(($who!="")||($who!=0))
                      {
                      $res = mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."'");
                      if($res)
                      {
                      echo "$trgtnick msgs have been cleared
                ";
                      }else{
                      echo "Failed clearing $trgtnick msgs
                ";
                      }
                      }else{
                      echo "Username doesnot exist
                ";
                      }
                      }
                      echo "
                ";
                      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                      $rname = $rooms[1];
                      echo "4 <a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a>
                ";
                      echo "6 <a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a>
                ";
                      echo "7 <a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a>
                ";
                      echo "8 <a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a>
                ";
                      echo forumlink($sid,9);
                      echo "0 <a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
                      echo "</body>";
                }
                ?>
                </html>
                I havent tested it.
                Last edited by metulj; 12.08.09, 23:26.

                Comment


                  #9
                  not correct...I think...

                  user1 select colour write "blue" at 4 chat msg.
                  user2 select colour write "pink" at 4 chat msg.

                  at chat page:

                  user1: write blue msg.
                  user2:write pink msg.

                  and all user view the colours selected by user write the msg ;)

                  if like my post click:

                  http://coding-talk.com/images/totall...ost_thanks.gif

                  Comment


                    #10
                    thats what the above code does.........

                    Comment


                      #11
                      inca how to bbcode u have?
                      Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                      <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                      Comment


                        #12
                        I Dont Use The Same bb Code set up as everyone else Cos mines set up via admincp (can add bb codes via my phone any time i like really easily)
                        but if i was going to use the old way i would probably code it something like this:

                        core.php
                        <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$text = preg_replace("/\[user\=(.*?)\](.*?)\[\/user\]/is","<a href=\"index.php?action=viewuser&amp;inca=$1&amp;s id=$sid\">$2</a>",$text);</div>

                        Then On the top of index.php Change view user profile to something like this:
                        <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$inca = $_GET["inca"];
                        if($inca!="")
                        {
                        $who = getuid_nick($inca);
                        }else if($who==""||$who==0){
                        $mnick = $_POST["mnick"];
                        $who = getuid_nick($mnick);
                        }
                        $whonick = getnick_uid($who);
                        if($whonick!=""){</div>


                        I havent tested it but it should work
                        Hope this helps

                        Comment


                          #13
                          Use this:
                          Code:
                          $text = preg_replace ( "#\[color=\#?([0-9abcdef]{3,6})\](.*?)\[/color\]#i", "\\2", $text );

                          Comment


                            #14
                            oops didnt notice the error at bottom lol

                            $colorchatmsg = mysql_fetch_array(mysql_query("SELECT colorchatmsg FROM ibwf_users WHERE id=&#39;".$chat[0]."&#39;"));
                            echo "[$ds]<a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$ chat[0]&amp;rid=$rid&amp;rpw=$rpw\">$optlink</a> - ";
                            echo "".strtolower($tosay)."
                            ";

                            Comment


                              #15
                              works just fine apart from a minor coding error, be aware though that different ppl will have different themes, if you for example choose red writing and someone is using a red theme they wont see your messages lol
                              :p:p:p

                              Comment

                              Working...
                              X