View file wap/chat.php

File size: 17.96Kb
<?php
include("inc/func.inc.php");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\"?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
  if(!db()){
  echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
  echo "</head>";
  echo "<body>";
  echo getdberror();
  echo "</body>";
  echo "</html>";
  exit();
  }

  $show = $_GET["show"];
  $hits = $_GET["hits"];
  $page = $_GET["page"];
  $who = $_GET["who"];
  $uid = getuid_hits($hits);
  $uip = getip();
  $ubr = $_SERVER['HTTP_USER_AGENT'];
  cleardata();
  addvisitor();

  if(isipbanned($uip,$ubr)){
  if(!isshield(getuid_hits($hits))){
  echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
  echo "</head>";
  echo "<body>";
  echo getipbanned($uip, $ubr);
  echo "</body>";
  echo "</html>";
  exit();
  }
  }

  if(($show != "") && ($show != "terms")){
  $uid = getuid_hits($hits);
  if((islogged($hits)==false)||($uid==0)){
  echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
  echo "</head>";
  echo "<body>";
  echo getsesexplog();
  echo "</body>";
  echo "</html>";
  exit();
  }
  }

  if((isbanned($uid))&&($uid != '0')){
  echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
  echo "</head>";
  echo "<body>";
  echo getbanned($uid);
  echo "</body>";
  echo "</html>";
  exit();
  }


 $id = $_GET["id"];
 $rid = $_GET["rid"];
 $rpw = $_GET["rpw"];
 $uexist = isuser($uid);

    $isroom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mx_rooms WHERE id='".$rid."'"));
    if($isroom[0]==0)
    {
                echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";

    echo "<center><b>Room Error</b></center><br/>";
      echo "This Room Doesn't Exist Anymore<br/>";
      echo ":P See In Another Room<br/>";

 echo footerweb($hits);
      echo "</body>";
      echo "</html>";
      exit();
    }
    $passworded = mysql_fetch_array(mysql_query("SELECT pass FROM mx_rooms WHERE id='".$rid."'"));
    if($passworded[0]!="")
    {
      if($rpw!=$passworded[0])
      {
                echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";

  echo "<center><b>Wrong Password</b></center><br/>";
      echo "You Can't Enter This Room<br/>";
      echo ":P Stay Away<br/>";

 echo footerweb($hits);
      echo "</body>";
      echo "</html>";
      exit();
      }
    }
    if(!canenter($rid,$hits))
    {
                echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";

    echo "<center><b>Private Room</b></center><br/>";
      echo "You Can't Enter This Room<br/>";
      echo ":P Stay Away<br/>";

 echo footerweb($hits);
      echo "</body>";
      echo "</html>";
      exit();
    }

     addtochat($uid, $rid);
         $timeto = 300;
         $timenw = time();
         $timeout = $timenw-$timeto;
         $deleted = mysql_query("DELETE FROM mx_chat WHERE timesent<".$timeout."");

        $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM mx_rooms WHERE id='".$rid."'"));

          $rname = $rooms[1];                 $nick = getnick_hits($hits);

        if($show=="")
        {
      addonline($uid,"ChatRoom In $rname","chat.php?rid=$rid");          
              echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";
      echo "<meta http-equiv=\"refresh\" content=\"60; url=chat.php?time=";
      echo "".date("dmHis")."";
      echo "&amp;hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">";
  echo "<center><b>$rname</b></center><br/><br/>";
  if(istrashed(getuid_hits($hits)))
 {
       $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM mx_penalties WHERE uid='".getuid_hits($hits)."' AND penalty='0'"));
    $remain = $banto[0]-time();
    $rmsg = gettimemsg($remain);
 echo "<img src=\"images/notok.gif\" alt=\"X\"/><b>You Has Been Mute!!</b><br/><br/>Remain: $rmsg";
 }else{
  $ses4d = rand(10000, 100000);
          echo "<form action=\"chat.php?hits=$hits&amp;rid=$rid&amp;ran=$ses4d&amp;rpw=$rpw\" method=\"post\">";
          echo "<input name=\"message\" size=\"10\" type=\"text\" maxlength=\"500\"/><br/>";

    echo "<input type=\"submit\" value=\"Chat\"/>";
    echo "</form>";
    echo "<hr/>";

        $message = $_POST["message"];
        $who = $_POST["who"];
        $rinfo = mysql_fetch_array(mysql_query("SELECT censord, freaky FROM mx_rooms WHERE id='".$rid."'"));
        if(trim($message) != "")
        {
          $nosm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mx_chat WHERE msgtext='".$message."'"));
          if($nosm[0]==0)
 {
            $chatok = mysql_query("INSERT INTO mx_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."'");
        $usts = mysql_fetch_array(mysql_query("SELECT plusses FROM mx_users WHERE id='".$uid."'"));
        $upl = $usts[0]+2;
        mysql_query("UPDATE mx_users SET plusses='".$upl."' WHERE id='".$uid."'");
            $lstmsg = mysql_query("UPDATE mx_rooms SET lastmsg='".time()."' WHERE id='".$rid."'");
                        $hehe=mysql_fetch_array(mysql_query("SELECT chmsgs, chmsgs2 FROM mx_users WHERE id='".$uid."'"));
            $totl = $hehe[0]+1;
            $totls = $hehe[1]+1;
            $msgst= mysql_query("UPDATE mx_users SET chmsgs='".$totl."', chmsgs2='".$totls."' WHERE id='".$uid."'");
                if($rinfo[1]==2)
            {
              //robot
              $botid = "d960293f6e374371";
              $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 += 12;
    		$endpos = strpos($result, "</that>", $pos);
    		$reply = unhtmlspecialchars2(substr($result, $pos, $endpos - $pos));
    		$reply = mysql_escape_string($reply);
    	}
     	$chatok = mysql_query("INSERT INTO mx_chat SET  chatter='0', who='', timesent='".time()."', msgtext='".$reply." @ ".getnick_uid($uid)."', rid='".$rid."';");
            }
 }
          $message = "";
            }
            
            $chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM mx_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC");
            $counter=0;
            while($chat = mysql_fetch_array($chats))
            {
                $canc = true;
                  if($counter<12)
                {
                  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 mx_users WHERE id='".$chat[0]."'"));

                   $imld = "";

                if(($cmid[0]!=0))
                {
                  $mlnk = mysql_fetch_array(mysql_query("SELECT img, text FROM mx_moods WHERE id='".$cmid[0]."'"));
                  $imld = "<img src=\"$mlnk[0]\" alt=\"$mlnk[1]\"/>";
                }

    $online = mysql_fetch_array(mysql_query("SELECT sex, uicon FROM mx_users WHERE id='".$chat[0]."'"));

 if($online[1]=="")
 {
 if($online[0]=="M")
 {
 $iml = "<img src=\"images/male.gif\" alt=\"M\"/>";
 }
 else if($online[0]=="F")
 {
 $iml = "<img src=\"images/female.gif\" alt=\"F\"/>";
 }else{
 $iml = "";
 }
}else{
 $iml = "<img src=\"$online[1]\" alt=\"*\"/>";
 }

 if($chat[0]==0)
 {
                    $chnick = "<b>Mrs.Wap29</b>";
 }else{
                    $chnick = getnick_uid($chat[0]);
 }
                    $optlink = "$imld$iml$chnick";
                  if(($chat[1]!=0)&&($chat[0]==$uid))
                  {
                    ///out
                    $imld = "<img src=\"moods/out.gif\" alt=\"!\"/>";
                    $chnick = getnick_uid($chat[1]);
                    $optlink = "$imld$iml PM to $chnick";
                  }
                  if($chat[1]==$uid)
                  {
                    ///out
                    $imld = "<img src=\"moods/in.gif\" alt=\"!\"/>";

 if($chat[0]==0)
 {
                    $chnick = "<b>Mrs.Wap29</b>";
 }else{
                    $chnick = getnick_uid($chat[0]);
 }
                    $optlink = "$imld$iml PM by $chnick";
                  }

                    if($chat[4]=='1')
                  {
                    ///out
                    $imld = "<img src=\"moods/point.gif\" alt=\"!\"/>";

 if($chat[0]==0)
 {
                    $chnick = "<b>Mrs.Wap29</b>";
 }else{
                    $chnick = getnick_uid($chat[0]);
 }
                    $tonick = getnick_uid($chat[1]);
                    $optlink = "$imld$iml By $chnick To $tonick";
                  }
                  
                  $ds = date("H.i.s", $chat[2]);
                  $text = parsepm($chat[3], $hits);
                  $nos = substr_count($text,"<img src=");
                  if($nos>3)
{
                    $chnick = getnick_uid($chat[0]);

                    echo "<i>$chnick Only Three Smilies Allowed</i><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, $hits);
                        
                        echo "$chnick $tosay<br/>";
                    }else{
                      
                      $tosay = parsepm($chat[3], $hits);
                      
                      if($rinfo[0]==1)
                      {
                      $tosay = str_replace("fuck","f**k",$tosay);
                        $tosay = str_replace("shit","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);
                        }
 if($chat[0]==0)
 {
        $rinfoo = mysql_fetch_array(mysql_query("SELECT censord, freaky FROM mx_rooms WHERE id='".$rid."'"));
                if($rinfoo[1]==2)
            {
                  echo "$optlink - $tosay<br/>";
 }else{
                  echo "$tosay<br/>";
 }

 }else{
                  echo "<a href=\"chat.php?show=say2&amp;hits=$hits&amp;who=$chat[0]&amp;rid=$rid&amp;rpw=$rpw\">$optlink</a> - $tosay<br/>";
 }                      
                  }
                }
               
                  $counter++;
                }
                }
            }
}

       $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mx_chonline where rid='".$rid."'"));
      echo "<hr/><a href=\"chat.php?show=inside&amp;hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">Inside $chatters[0]</a><br/>";
  echo "<a href=\"lists.php?show=smilies&amp;hits=$hits\">Smilies</a><br/>";

  echo "<a href=\"index.php?show=main&amp;hits=$hits\">EXiT</a>";
  echo "<br/><br/>";
 echo footerweb($hits);
        echo "</body>";
}
/////////////////////////////////////////////////////SAY
        else if ($show=="say")                   {
                echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";
        addonline($uid,"Writing Chat Message","");
    echo "<center><b>Option</b></center><br/>";

            if(istrashed(getuid_hits($hits)))
 {
       $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM mx_penalties WHERE uid='".getuid_hits($hits)."' AND penalty='0'"));
    $remain = $banto[0]-time();
    $rmsg = gettimemsg($remain);
 echo "<img src=\"images/notok.gif\" alt=\"X\"/><b>You Has Been Mute!!</b><br/><br/>Remain: $rmsg";
 }else{
              echo "<form action=\"chat.php?hits=$hits&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">";        
            echo "Message:<br/><input name=\"message\" type=\"text\" value=\"\" maxlength=\"255\"/><br/>";
    echo "<input type=\"submit\" value=\"Submit\"/></form><br/><br/>";}
           echo "<a href=\"chat.php?show=inside&amp;hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">Who's Inside</a><br/>";
            echo "<a href=\"chat.php?hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">Back to Chatroom</a>";
        //end
              echo "<br/>";

 include("wapv.php");
        echo "</body>";
                                               }
        ////////////////////////////////////////////
    /////////////////////////////////////////////////////SAY2
        else if ($show=="say2")                   {
                echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";
  ///echo "<card=\"say\" title=\"MaxHits.CO.CC\">";

        $unick = getnick_uid($who);
    echo "<center><b>View Chatter</b></center><br/>";
        
        addonline($uid,"View Chatter","");
          if(istrashed(getuid_hits($hits)))
 {
       $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM mx_penalties WHERE uid='".getuid_hits($hits)."' AND penalty='0'"));
    $remain = $banto[0]-time();
    $rmsg = gettimemsg($remain);
 echo "<img src=\"images/notok.gif\" alt=\"X\"/><b>You Has Been Mute!!</b><br/><br/>Remain: $rmsg";
 }else{
            echo "<form action=\"chat.php?hits=$hits&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">";         
            echo "Message:<br/><input name=\"message\" type=\"text\" value=\" \" maxlength=\"255\"/><br/>";
    echo "<input type=\"submit\" value=\"Submit\"/>";

            echo "<input type=\"hidden\" name=\"who\" value=\"$who\"/></form><br/>";
            }
            echo "<a href=\"prov.php?show=viewuser&amp;hits=$hits&amp;who=$who\">View $unick's Profile</a><br/>";
            echo "<a href=\"chat.php?show=expose&amp;hits=$hits&amp;who=$who&amp;rid=$rid&amp;rpw=$rpw\">Expose $unick</a><br/>";
            
            echo "<a href=\"chat.php?show=inside&amp;hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">Who's Inside</a><br/>";
            echo "<a href=\"chat.php?hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">Chatroom</a>";
        //end

echo "<br/>";
include("wapv.php");
        echo "</body>";
                                               }
        ////////////////////////////////////////////
        //////////////////////////////inhitse//////////
        else if ($show=="inside")           {
          
          addonline($uid,"Chat Inside List","");
                echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";
  ///echo "<card=\"main\" title=\"Inside list\">";

    echo "<center><b>Who Inside</b></center><br/>";
        $inside=mysql_query("SELECT DISTINCT * FROM mx_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?show=say2&amp;hits=$hits&amp;who=$ins[1]&amp;rid=$rid&amp;rpw=$rpw\">$unick</a><br/>";
          echo "$userl";
        }
        echo "<br/><br/>";
        echo "<a href=\"chat.php?hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">&#171;Chatroom</a><br/>";

include("wapv.php");
        echo "</body>";
                                           }
        else if ($show=="expose")           {

          addonline($uid,"Chat inside list","");
                echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";
  ///echo "<card=\"main\" title=\"Inside list\">";

    echo "<center><b>Expose</b></center><br/>";
        mysql_query("UPDATE mx_chat SET exposed='1' WHERE chatter='".$who."' AND who='".$uid."'");
        $unick = getnick_uid($who);
        echo "$unick messages to you are exposed to the moderation team. We will deal with the matter as soon as possible.";
        echo "<a href=\"chat.php?hits=$hits&amp;rid=$rid&amp;rpw=$rpw\">Back to Chatroom</a><br/>";

echo "<br/>";
include("wapv.php");

        echo "</body>";
                                           }else{
       echo "<head>";
  echo "<title>RemiXchaT.CoM - World Wide Chat Community And Downloads !</title>";
  include("inc/css.inc.php");
 echo "</head>";
 echo "<body>";
   echo getpagerror();
   echo "</body>";
}
        
?>
</html>