Show in room

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

    #16
    Originally posted by Ponick View Post
    i got this


    Error!
    Remote server or file not found
    this is my roolist cod :

    else if ($action=="uchat") {
    addonline(getuid_sid($sid),"Select Room","");
    echo "<card id=\"t\" title=\"Room\">";
    echo "<p align=\"left\">";
    echo "<img src=\"images/logo.gif\" alt=\"x\"/><br/>";
    echo "roomlist<br/>";





    $rooms = mysql_query("SELECT id, name, perms, mage, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'");
    while ($room= mysql_fetch_array($rooms))
    {

    if(canenter($room[0], $sid))
    {
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
    echo "<a href=\"chat.php?sid=$sid&amp;rid=$room[0]\">$room[1]($noi[0])</a><br/>";
    }

    }


    echo "</p>";
    echo "</card>";




    now what to do? please
    PHP Code:
    /* I don't know everything hehe */ 
    Find me on facebook

    Comment


      #17
      Originally posted by something else View Post
      kind of a long winded way by adding another page for enters chat:
      why not just change the enter room link to
      chat.php?sid=$sid&rid=$rid&enter=1

      then in chat.php

      if($enter==1){
      //insert into db enters chat from who evers id you like
      }

      saves coding a whole new page?
      same as on leaving chat just have :
      say you were going to index.php?action=main
      then change link to:
      index.php?action=main&leave=1

      then on index.php
      have
      if($leave==1){
      //insert into db who ever left chat from who evers id you like
      }
      saves loads of pointless coding
      }
      $entercount*=*mysql_fetch_array(mysql_query("SELEC T*COUNT(*)*FROM*ibwf_chat*WHERE*msgtext='1entersdr oom'*AND*chatter='".$uid."'*AND*rid='".$rid."'"));
      $onlinecount*=*mysql_fetch_array(mysql_query("SELE CT*COUNT(*)*FROM*ibwf_chonline*WHERE*rid='".$rid." '*and*uid='".$uid."'"));
      if(($entercount[0]==0)*&&*($onlinecount[0]==0))
      {
      **$enter*=*mysql_query("INSERT*INTO*ibwf_chat*SET* chatter='".$uid."',*who='0',*timesent='".time()."' ,*msgtext='1entersdroom',*rid='".$rid."'");
      }
      header("Location:chat.php?sid=$sid&rid=$rid&enter=1")
      exit();



      is it ok ?
      PHP Code:
      /* I don't know everything hehe */ 
      Find me on facebook

      Comment


        #18
        i would have on index.php have:
        Code:
        else if ($action=="uchat") {
        addonline(getuid_sid($sid),"Select Room","");
        echo "<card id=\"t\" title=\"Room\">";
        echo "<p align=\"left\">";
        echo "<img src=\"images/logo.gif\" alt=\"x\"/><br/>";
        echo "roomlist<br/>";
        $rooms = mysql_query("SELECT id, name, perms, mage, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'");
        while ($room= mysql_fetch_array($rooms))
        {
        if(canenter($room[0], $sid))
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
        echo "<a href=\"chat.php?sid=$sid&amp;rid=$room[0]&amp;enter=1\">$room[1]($noi[0])</a><br/>";
        }
        }
        echo "</p>";
        echo "</card>";
        }
        then on chat.php have:
        Code:
        if($_GET["enter"]==1){
        $entercount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='enters room' AND chatter='".$uid."' AND rid='".$rid."'"));
        $onlinecount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid."' and uid='".$uid."'"));
        if(($entercount[0]==0)*&&*($onlinecount[0]==0))
        {
        mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."',*who='0',*timesent='".time()."' ,*msgtext='enters room', rid='".$rid."'");
        }
        }

        Comment


          #19
          Originally posted by something else View Post
          kind of a long winded way by adding another page for enters chat:
          why not just change the enter room link to
          chat.php?sid=$sid&rid=$rid&enter=1

          then in chat.php

          if($enter==1){
          //insert into db enters chat from who evers id you like
          }

          saves coding a whole new page?
          same as on leaving chat just have :
          say you were going to index.php?action=main
          then change link to:
          index.php?action=main&leave=1

          then on index.php
          have
          if($leave==1){
          //insert into db who ever left chat from who evers id you like
          }
          saves loads of pointless coding
          this isn't a good idea.,also my first post..coz users can easily cheat to enter a room without being seen that they entered..they can do like enter=0 or enter= .,and in my first post, they can skip to it by going directly to url chat.php?rid=$rid..so i just did a little changes..no more chat_enter.php.,just put its code to chat.php.,put this somewhere after if isbanned and ipbanned..still, the if($msg=="1entersdroom")
          should be placed in chat.php..
          PHP Code:
          $entercount mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='1entersdroom' AND chatter='".$uid."' AND rid='".$rid."'"));
          $onlinecount mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid."' and uid='".$uid."'"));
          if((
          $entercount[0]==0) && ($onlinecount[0]==0))
          {
            
          $enter mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='0', timesent='".time()."', msgtext='1entersdroom', rid='".$rid."'");

          tried and tested..-up-
          Last edited by kiLLeR-eyEd_14; 11.09.09, 00:47.
          My Blog: http://jhommark.blogspot.com
          My Facebook: http://www.facebook.com/jhommark
          My Official Site: http://www.undergroundweb.tk
          My Community Site: http://undergroundwap.xtreemhost.com

          Comment


            #20
            nothing hapen in chat room

            here is my chat.php
            PHP Code:
            <?php
            header
            ("Content-type: text/vnd.wap.wml");
            header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");                // expires in the past
              
            header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");     // Last modified, right now
              
            header("Cache-Control: no-cache, must-revalidate");            // Prevent caching, HTTP/1.1
              
            header("Pragma: no-cache");
            print 
            "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
            echo 
            "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
            //8152
            ?>
            <wml>
            <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);

            if((
            islogged($sid)==false)||!$uexist)
                {
                    echo 
            "<card id=\"main\" title=\"Chatnxtg\">";
                  echo 
            "<p align=\"center\">";
                  echo 
            "You are not logged in<br/>";
                  echo 
            "Or Your session has been expired<br/><br/>";
                  echo 
            "<a href=\"index.php\">Login</a>";
                  echo 
            "</p>";
                  echo 
            "</card>";
                  echo 
            "</wml>";
                  exit();
                }
                
            if(
            isbanned($uid))
                {
                    echo 
            "<card id=\"main\" title=\"Chatnxtg\">";
                  echo 
            "<p align=\"center\">";
                  echo 
            "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
                  echo 
            "You are <b>Banned</b><br/>";
                  
            $banto mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
                  
            $remain $banto[0]- time();
                  
            $rmsg gettimemsg($remain);
                  echo 
            "Time to finish your penalty: $rmsg<br/><br/>";
                  
            //echo "<a href=\"index.php\">Login</a>";
                  
            echo "</p>";
                  echo 
            "</card>";
                  echo 
            "</wml>";
                  exit();
                }
                
            $isroom mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'"));
                if(
            $isroom[0]==0)
                {
                    echo 
            "<card id=\"main\" title=\"Chatnxtg\">";
                  echo 
            "<p align=\"center\">";
                  echo 
            "This room doesn't exist anymore<br/>";
                  echo 
            ":P see in another room<br/><br/>";
                  echo 
            "<a href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a>";
                  echo 
            "</p>";
                  echo 
            "</card>";
                  echo 
            "</wml>";
                  exit();
                }
                
            $passworded mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_rooms WHERE id='".$rid."'"));
                if(
            $passworded[0]!="")
                {
                  if(
            $rpw!=$passworded[0])
                  {
                    echo 
            "<card id=\"main\" title=\"Chatnxtg\">";
                  echo 
            "<p align=\"center\">";
                  echo 
            "You can't enter this room<br/>";
                  echo 
            ":P stay away<br/><br/>";
                  echo 
            "<a href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a>";
                  echo 
            "</p>";
                  echo 
            "</card>";
                  echo 
            "</wml>";
                  exit();
                  }
                }
                if(!
            canenter($rid,$sid))
                {
                    echo 
            "<card id=\"main\" title=\"Chatnxtg\">";
                  echo 
            "<p align=\"center\">";
                  echo 
            "You can't enter this room<br/>";
                  echo 
            ":P stay away<br/><br/>";
                  echo 
            "<a href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a>";
                  echo 
            "</p>";
                  echo 
            "</card>";
                  echo 
            "</wml>";
                  exit();
                }
                
            addtochat($uid$rid);
                    
            //This Chat Script is by Ra'ed Far'oun
                    //raed_mfs@yahoo.com
                    //want to see main menu...
                    
            $timeto 300;
                        
            $timenw time();
                        
            $timeout $timenw-$timeto;
                        
            $deleted mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
                        
                    if (
            $action=="")
                                     {
                      
                    echo 
            "<card id=\"chat\" title=\"Chatnxtg\" ontimer=\"chat.php?time=";
                    echo 
            date('dmHis');
                    echo 
            "&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw";
                    
                    echo 
            "\">";
                    
                     
            //start of main card
                     
                    
            echo "<timer value=\"200\"/><p align=\"center\">";
                      
            addonline($uid,"Chatrooms","");
                    echo 
            "<small>
                    <a href=\"chat.php?action=say&amp;sid=
            $sid&amp;rid=$rid&amp;rpw=$rpw\">options</a>, ";
                    echo 
            "<a href=\"chat.php?time=";
                    echo 
            date('dmHis');
                    echo 
            "&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw";
                    echo 
            "\">refresh</a>";
                    
            /*
                    if(getuid_sid($sid)==2)
                    {
                      echo "<a href=\"wtai://wp/mc;+8801713209272\">Call me</a><br/>";
                    }
                    */
                    
            $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
                    
            $pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
                    
            $unrd="(".$unreadinbox[0]."/".$pmtotl[0].")";
                    if (
            $unreadinbox[0]>0)
                    {
                    echo 
            "<br/><a href=\"inbox.php?action=main&amp;sid=$sid\">Inbox$unrd</a>";
                  }
                  echo 
            "</small></p>";
                    
            $message=$_POST["message"];
                    
            $who $_POST["who"];
                    
            $rinfo mysql_fetch_array(mysql_query("SELECT censord, freaky FROM ibwf_rooms WHERE id='".$rid."'"));
                    if (
            trim($message) != "")
                    {
                      
            $nosm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='".$message."'"));
                      if(
            $nosm[0]==0){
                        
                        
            $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;
                        
            $msgstmysql_query("UPDATE ibwf_users SET chmsgs='".$totl."' WHERE id='".$uid."'");
                        if(
            $rinfo[1]==2)
                        {
                          
            //oh damn i gotta post this message to ravebabe :(
                          //will it succeed?
                          
            $botid "a946463cae36564f";
                          
            $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='8152', who='', timesent='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';");
                        }
                      }
                      
            $message "";
                        }
                        
                        echo 
            "<p>";
                        echo 
            "<small>";
                        
            $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<10)
                            {
                              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 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;
                              }
                              
                              
            $dsdate("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 
            "<b>Chat system:»<i>*$chnick, please don't try to spam*</i></b><br/>";
                              }
                              else if(
            $nos>2){
                                
            $chnick getnick_uid($chat[0]);
                                echo 
            "<b>Chat system:»<i>*$chnick is greedy when it comes to smilies*</i></b><br/>";
                              }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 
            "<b><i>*$chnick $tosay*</i></b><br/>";
                                }else{
                                  
                                  
            $tosay parsepm($chat[3], $sid);
                                  
                                  if(
            $rinfo[0]==1)
                                  {
                                  
            $tosay str_replace("****","f**k",$tosay);
                                    
            $tosay str_replace("****","sh*t",$tosay);
                                    
            $tosay str_replace("dick","d**k",$tosay);
                                    
            $tosay str_replace("pussy","pu**y",$tosay);
                                    
            $tosay str_replace("cock","c**k",$tosay);
                                    
            $tosay str_replace("ass ","@s* ",$tosay);
                                  }
                                  
                                  if(
            $rinfo[1]==1)
                                  {
                                      
            $tosay htmlspecialchars($chat[3]);
                                      
            $tosay strrev($tosay);
                                    }
                              echo 
            "<a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$chat[0]&amp;rid=$rid&amp;rpw=$rpw\">$optlink</a>»$ds<br/>";
                              echo 
            $tosay."<br/>";
                              }
                            }
                           
                              
            $counter++;
                            }
                            }
                        }
                        echo 
            "</small>";
                        echo 
            "</p>";
                    
                    echo 
            "<p align=\"center\">";
                    
            $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));
                    echo 
            "<br/><a href=\"chat.php?action=inside&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">Who's Inside($chatters[0])</a><br/>";
                    echo 
            "<a href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a><br/>";
                    echo 
            "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a></p>";
                    
                    echo 
            "</card>";
            }
            /////////////////////////////////////////////////////SAY
                    
            else if ($action=="say")                   {
                    echo 
            "<card id=\"say\" title=\"Chatnxtg\">";
                    
                    
            addonline($uid,"Writing Chat Message","");
                      
                        echo 
            "<p>Message:<input name=\"message\" type=\"text\" value=\"\" maxlength=\"255\"/><br/>";
                        echo 
            "<small><anchor>«Say";
                        echo 
            "<go href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">";
                        echo 
            "<postfield name=\"message\" value=\"$(message)\"/>";
                        echo 
            "</go></anchor></small><br/>";
                        echo 
            "<small><a href=\"lists.php?action=chmood&amp;sid=$sid&amp;page=1\">»Chat mood</a></small><br/>";
                        echo 
            "<small><a href=\"chat.php?action=inside&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">»Who's Inside</a></small><br/>";
                        echo 
            "<small><a href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">«Chatroom</a></small></p>";
                    
            //end
                    
                    
            echo "<p align=\"center\"><a href=\"index.php?action=chat&amp;sid=$sid\"><img src=\"images/chat.gif\" alt=\"*\"/>Chatrooms</a><br/>";
                    echo 
            "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a></p>";

                    echo 
            "</card>";
                                                           }
                    
            ////////////////////////////////////////////
                /////////////////////////////////////////////////////SAY2
                    
            else if ($action=="say2")                   {
                    echo 
            "<card id=\"say\" title=\"Chatnxtg\">";
                    echo 
            "<p align=\"center\">";
                    
            $unick getnick_uid($who);
                    echo 
            "<b>Private to $unick</b>";
                    echo 
            "</p>";
                    
                    
            addonline($uid,"Writing chat message","");
                     
                        echo 
            "<p>Message:<input name=\"message\" type=\"text\" value=\" \" maxlength=\"255\"/><br/>";
                        echo 
            "<small><anchor>«Private";
                        echo 
            "<go href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">";
                        echo 
            "<postfield name=\"message\" value=\"$(message)\"/>";
                        echo 
            "<postfield name=\"who\" value=\"$who\"/>";
                        echo 
            "</go></anchor></small><br/>";
                        echo 
            "<small><a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">»View $unick's Profile</a></small><br/>";
                        echo 
            "<small><a href=\"chat.php?action=expose&amp;sid=$sid&amp;who=$who&amp;rid=$rid&amp;rpw=$rpw\">»Expose $unick</a></small><br/>";
                        
                        echo 
            "<small><a href=\"chat.php?action=inside&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">»Who's Inside</a></small><br/>";
                        echo 
            "<small><a href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">«Chatroom</a></small></p>";
                    
            //end
                    
                    
            echo "<p align=\"center\"><a href=\"index.php?action=chat&amp;sid=$sid\"><img src=\"images/chat.gif\" alt=\"*\"/>Chatrooms</a><br/>";
                    echo 
            "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a></p>";

                    echo 
            "</card>";
                                                           }
                    
            ////////////////////////////////////////////
                    //////////////////////////////inside//////////
                    
            else if ($action=="inside")           {
                      
                      
            addonline($uid,"Chat inside list","");
                    echo 
            "<card id=\"main\" title=\"Inside list\">";
                    echo 
            "<p align=\"center\"><br/>";
                    
            $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 "<small><a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$ins[1]&amp;rid=$rid&amp;rpw=$rpw\">$unick</a>, </small>";
                      echo 
            "$userl";
                    }
                    echo 
            "<br/><br/>";
                    echo 
            "<a href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">«Chatroom</a><br/>";
                    echo 
            "<br/><a href=\"index.php?action=chat&amp;sid=$sid\"><img src=\"images/chat.gif\" alt=\"*\"/>Chatrooms</a><br/>";
                    echo 
            "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a></p>";
                    
                    echo 
            "</card>";
                                                       }
                    else if (
            $action=="expose")           {

                      
            addonline($uid,"Chat inside list","");
                    echo 
            "<card id=\"main\" title=\"Inside list\">";
                    echo 
            "<p align=\"center\"><br/>";
                    
            mysql_query("UPDATE ibwf_chat SET exposed='1' WHERE chatter='".$who."' AND who='".$uid."'");
                    
            $unick getnick_uid($who);
                    echo 
            "$unick messages to you are exposed to mods";
                    echo 
            "<br/><br/>";
                    echo 
            "<a href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">«Chatroom</a><br/>";
                    echo 
            "<br/><a href=\"index.php?action=chat&amp;sid=$sid\"><img src=\"images/chat.gif\" alt=\"*\"/>Chatrooms</a><br/>";
                    echo 
            "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a></p>";

                    echo 
            "</card>";
                                                       }
                    
                    
            ?>
            </wml>

            now what to do here??
            please..
            PHP Code:
            /* I don't know everything hehe */ 
            Find me on facebook

            Comment


              #21
              people can get into chat room ether way without being seen ... only way to do it would be to add a session when you get in the chat room and if session was blank then it would say: enters chat.

              Comment


                #22
                place this at top of chat.php :
                Code:
                session_name("PHPSESSID");
                session_start();
                $enter = $_SESSION['enter'];
                and then further down have:
                Code:
                if($enter==""){
                $entercount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='enters room' AND chatter='".$uid."' AND rid='".$rid."'"));
                $onlinecount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid."' and uid='".$uid."'"));
                if(($entercount[0]==0)&&($onlinecount[0]==0))
                {
                mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."',*who='0',*timesent='".time()."' ,*msgtext='enters room', rid='".$rid."'");
                }
                $tm = time();
                $_SESSION['enter'] = $tm; 
                }
                Last edited by something else; 11.09.09, 07:59.

                Comment


                  #23
                  Originally posted by something else View Post
                  place this at top of chat.php :
                  Code:
                  session_name("PHPSESSID");
                  session_start();
                  $enter = $_SESSION['enter'];
                  and then further down have:
                  Code:
                  if($enter==""){
                  $entercount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='enters room' AND chatter='".$uid."' AND rid='".$rid."'"));
                  $onlinecount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid."' and uid='".$uid."'"));
                  if(($entercount[0]==0)&&($onlinecount[0]==0))
                  {
                  mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."',*who='0',*timesent='".time()."' ,*msgtext='enters room', rid='".$rid."'");
                  }
                  $tm = time();
                  $_SESSION['enter'] = $tm; 
                  }
                  PHP Code:
                  <?php

                  include("config.php"); 
                  include(
                  "core.php");
                  include(
                  "IP_FILES/countries.php");
                  session_name("PHPSESSID");
                  session_start();
                  $enter $_SESSION['enter'];
                  connectdb();
                  $action=$_GET["action"];
                  $id=$_GET["id"];
                  $sid $_GET["sid"];
                  $rid=$_GET["rid"];
                  $rpw=$_GET["rpw"];
                  $IPaddress=getip();
                  $two_letter_country_code=iptocountry($IPaddress);

                  $uid getuid_sid($sid);

                   
                   
                  $uexist isuser($uid);

                  if((
                  islogged($sid)==false)||!$uexist)
                      {
                          echo 
                  "<card id=\"main\" title=\"kewmew\">";
                        echo 
                  "<p align=\"left\">";
                        echo 
                  "You are not logged in<br/>";
                        echo 
                  "Or Your session has been expired<br/><br/>";
                        echo 
                  "<a href=\"index.php\">Login</a>";
                        echo 
                  "</p>";
                        echo 
                  "</card>";
                        echo 
                  "</wml>";
                        exit();
                      }
                      
                  if(
                  isbanned($uid))
                      {
                    echo 
                  "<card id=\"main\" title=\"kewmew\">";
                    echo 
                  "<p align=\"left\">";
                    echo 
                  "<img src=\"images/logo.gif\" alt=\"KewMew\"/><br/>";
                    echo 
                  "Free MobileChat*! <br/>Join now to chat with people worldwide. ";
                    
                  $onu getnumonline();
                  echo 
                  $onu people chatting now.<br/><br/>";

                    
                  $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);
                      
                        
                  $nick getnick_uid($banto[2]);
                  echo 
                  "<b>for support kewmew@gmail.com </b><br/>";
                  echo 
                  "<b>You have Banned By $nick for $banto[1].your ban time left $rmsg</b><br/><br/>";


                    
                    
                    


                    echo 
                  "Enter your Nickname below:<br/><input name=\"loguid\" format=\"*x\" maxlength=\"12\"/><br/>";
                    echo 
                  "Password:<br/><input type=\"password\" name=\"logpwd\"  maxlength=\"12\"/><br/>";
                    echo 
                  "<anchor>Enter Chat<go href=\"login.php\" method=\"get\">";
                    echo 
                  "<postfield name=\"loguid\" value=\"$(loguid)\"/>";
                    echo 
                  "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>";
                    echo 
                  "</go></anchor>";

                    echo 
                  "<br/><a href=\"register.php\">Signup</a><br/><br/>";
                    

                    

                    


                    echo 
                  "*) Operator charges may apply for the data passing.We do not charge for the chat service.<br/><br/>";
                    
                     echo 
                  "<a href=\"http://waptrack.net/welcome/30868\"><img src=\"http://waptrack.net/counthits.asp?id=30868\" alt=\"Kewmew\"/></a><br/>";
                        echo 
                  "</p>";
                        echo 
                  "</card>";
                        echo 
                  "</wml>";
                        exit();
                        
                      }
                      
                  $isroom mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'"));
                      if(
                  $isroom[0]==0)
                      {
                          echo 
                  "<card id=\"main\" title=\"KEWMEW\">";
                        echo 
                  "<p align=\"center\">";
                        echo 
                  "This room doesn't exist anymore<br/>";
                        echo 
                  ":P see in another room<br/><br/>";
                        echo 
                  "<a href=\"index.php?action=uchat&amp;sid=$sid\">Back</a>";
                        echo 
                  "</p>";
                        echo 
                  "</card>";
                        echo 
                  "</wml>";
                        exit();
                      }
                      
                  $passworded mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_rooms WHERE id='".$rid."'"));
                      if(
                  $passworded[0]!="")
                      {
                        if(
                  $rpw!=$passworded[0])
                        {
                          echo 
                  "<card id=\"main\" title=\"Kewmew\">";
                        echo 
                  "<p align=\"center\">";
                        echo 
                  "You can't enter this room<br/>";
                        echo 
                  ":P stay away<br/><br/>";
                        echo 
                  "<a href=\"index.php?action=chat&amp;sid=$sid\">Back</a>";
                        echo 
                  "</p>";
                        echo 
                  "</card>";
                        echo 
                  "</wml>";
                        exit();
                        }
                      }
                      if(!
                  canenter($rid,$sid))
                      {
                          echo 
                  "<card id=\"main\" title=\"Kewmew\">";
                        echo 
                  "<p align=\"center\">";
                        echo 
                  "You can't enter this room<br/>";
                        echo 
                  ":P stay away<br/><br/>";
                        echo 
                  "<a href=\"index.php?action=chat&amp;sid=$sid\">Back</a>";
                        echo 
                  "</p>";
                        echo 
                  "</card>";
                        echo 
                  "</wml>";
                        exit();
                      }
                      
                  addtochat($uid$rid);
                          
                  //This Chat Script is by Ra'ed Far'oun
                          //raed_mfs@yahoo.com
                          //want to see main menu...
                         
                              
                  $rooms mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
                          
                  $rname $rooms[1];
                          


                              
                          if (
                  $action=="")
                                           {
                            
                  header("Content-type: text/vnd.wap.wml");
                          echo 
                  "<card id=\"chat\" title=\"kewmew\">";
                          
                           
                  //start of main card
                           
                          
                  echo "<p align=\"left\">";
                            
                  addonline($uid,"$rname","chat.php?rid=$rid&amp;rpw=$rpw");
                        
                          
                          echo 
                  "<input name=\"message\" type=\"text\" value=\"\" maxlength=\"200\"/><br/>";
                              echo 
                  "<anchor>Write";
                              echo 
                  "<go href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">";
                              echo 
                  "<postfield name=\"message\" value=\"$(message)\"/>";
                              echo 
                  "</go></anchor><br/>";
                              
                              echo 
                  "<a href=\"chat.php?time=";
                          echo 
                  date('dmHis');
                          echo 
                  "&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw";
                          echo 
                  "\">Refresh</a>";
                          
                  $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
                          
                  $pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
                          
                  $unrd="(".$unreadinbox[0]."/".$pmtotl[0].")";
                          if (
                  $unreadinbox[0]>0)
                          {
                          echo 
                  "<br/><a href=\"inbox.php?action=main&amp;sid=$sid\"><img src=\"images/newmsg.png\" alt=\"You have new massage\"/></a>";
                        }
                          
                                  
                        echo 
                  "</p>";
                          
                  $message=$_POST["message"];
                          
                  $who $_POST["who"];
                          
                  $rinfo mysql_fetch_array(mysql_query("SELECT censord, freaky FROM ibwf_rooms WHERE id='".$rid."'"));
                          if (
                  trim($message) != "")
                          {
                            
                  $nosm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='".$message."'"));
                            if(
                  $nosm[0]==0){
                              
                              
                  $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;
                              
                  $msgstmysql_query("UPDATE ibwf_users SET chmsgs='".$totl."' WHERE id='".$uid."'");
                              
                              
                              
                              
                              
                              
                              if(
                  $rinfo[1]==2)
                              {
                                
                  //oh damn i gotta post this message to ravebabe :(
                                //will it succeed?
                                
                  $botid "a946463cae36564f";
                                
                  $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='8152', who='', timesent='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';");
                              }
                            }
                            
                  $message "";
                              }
                              
                              echo 
                  "<p>";
                             
                              
                  $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<8)
                                  {
                                    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 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;
                                    }
                                    
                  $entercount mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='1entersdroom' AND chatter='".$uid."' AND rid='".$rid."'")); 
                  $onlinecount mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid."' and uid='".$uid."'")); 
                  if((
                  $entercount[0]==0) && ($onlinecount[0]==0)) 

                    
                  $enter mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='0', timesent='".time()."', msgtext='1entersdroom', rid='".$rid."'"); 

                                    
                                    
                                      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;
                                    }
                                    
                                    if(
                  $enter==""){
                  $entercount mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='enters room' AND chatter='".$uid."' AND rid='".$rid."'"));
                  $onlinecount mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid."' and uid='".$uid."'"));
                  if((
                  $entercount[0]==0)&&($onlinecount[0]==0))
                  {
                  mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."',*who='0',*timesent='".time()."' ,*msgtext='enters room', rid='".$rid."'");
                  }
                  $tm time();
                  $_SESSION['enter'] = $tm
                  }
                                    
                                    
                  $dsdate("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 
                  "<i>$chnick please don't try to spam</i><br/>";
                                    }
                                    
                                    
                                    else if(
                  $chat[3]=="1entersdroom"


                    
                  $chnick getnick_uid($chat[0]); 
                    echo 
                  "<b>Chat system</b>» $chnick entered the room!!!<br/>"

                                    
                                    else if(
                  $nos>2){
                                      
                  $chnick getnick_uid($chat[0]);
                                      echo 
                  "<b>Chat system:»<i>*$chnick is greedy when it comes to smilies*</i></b><br/>";
                                    }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 
                  "<b><i>*$chnick $tosay*</i></b><br/>";
                                      }else{

                  idont get any eroro.... but it show nothing!!
                  where is the problem ?

                  i
                  PHP Code:
                  /* I don't know everything hehe */ 
                  Find me on facebook

                  Comment


                    #24
                    place
                    session_name("PHPSESSID");
                    session_start();
                    $enter = $_SESSION['enter'];

                    at very top of page after
                    <?php
                    it has to be above header

                    Comment


                      #25
                      Originally posted by something else View Post
                      place this at top of chat.php :
                      Code:
                      session_name("PHPSESSID");
                      session_start();
                      $enter = $_SESSION['enter'];
                      and then further down have:
                      Code:
                      if($enter==""){
                      $entercount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE msgtext='enters room' AND chatter='".$uid."' AND rid='".$rid."'"));
                      $onlinecount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$rid."' and uid='".$uid."'"));
                      if(($entercount[0]==0)&&($onlinecount[0]==0))
                      {
                      mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."',*who='0',*timesent='".time()."' ,*msgtext='enters room', rid='".$rid."'");
                      }
                      $tm = time();
                      $_SESSION['enter'] = $tm; 
                      }
                      my second post was enough and tested..it can't be cheat by users..you use $_SESSION which are maybe not supported by other browsers..
                      My Blog: http://jhommark.blogspot.com
                      My Facebook: http://www.facebook.com/jhommark
                      My Official Site: http://www.undergroundweb.tk
                      My Community Site: http://undergroundwap.xtreemhost.com

                      Comment


                        #26
                        your code is easily cheated why cant i just bookmark into chatroom and totally miss out your new page? where as sessions most people dont know how to change.
                        Also the number of phones not supporting sessions is very small and you hardly see 1 or 2 people a year using them

                        Also your code was unprotected against invisable users joining room :P

                        Comment


                          #27
                          Originally posted by something else View Post
                          your code is easily cheated why cant i just bookmark into chatroom and totally miss out your new page? where as sessions most people dont know how to change.
                          Also the number of phones not supporting sessions is very small and you hardly see 1 or 2 people a year using them

                          Also your code was unprotected against invisable users joining room :P
                          you haven't read my 2nd post which i've done some changes with my first post..just read it..
                          My Blog: http://jhommark.blogspot.com
                          My Facebook: http://www.facebook.com/jhommark
                          My Official Site: http://www.undergroundweb.tk
                          My Community Site: http://undergroundwap.xtreemhost.com

                          Comment


                            #28
                            a min ago you were saying that only a limited amount of phones use session and now you have edited your first post to use sessions?
                            and also:
                            header("Location: chatroom-$rid");
                            wtf??

                            Comment


                              #29
                              It not show anithing again . Can you give me a chat.Php file ? Please please . . . . Im realy greatfull to you . .
                              PHP Code:
                              /* I don't know everything hehe */ 
                              Find me on facebook

                              Comment


                                #30
                                Originally posted by something else View Post
                                a min ago you were saying that only a limited amount of phones use session and now you have edited your first post to use sessions?
                                and also:
                                header("Location: chatroom-$rid");
                                wtf??
                                in login.php, i set $_session with a value of $sid = md5($did)..then if it is not set or cannot be set due to browser not supporting $_session, i create a cookie and set a value of $sid..that's what i've done..i didn't rely only in $_session..=)
                                and why won't you check out my site and my chatrooms to see what i'm trying to say..
                                Last edited by kiLLeR-eyEd_14; 11.09.09, 11:27.
                                My Blog: http://jhommark.blogspot.com
                                My Facebook: http://www.facebook.com/jhommark
                                My Official Site: http://www.undergroundweb.tk
                                My Community Site: http://undergroundwap.xtreemhost.com

                                Comment

                                Working...
                                X