chat bubbles

Started on the old forum in June 2012 · view the original in the archive · old links redirect here

6 replies · 586 views · started 14 years ago · 1 min read

3 participants
mirror Developer · 108 posts #1

hey bro i want help with my chat.php, i want every chat messages to be displayed in chatbubbles but m not able to get the proper position of "";

<?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");
include("config.php"); 
include("core.php"); 
echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML Mobile 1.0//EN\"". " \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo '<meta http-equiv="refresh" content="90" />';
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Chat</title>
<meta forua="true" http-equiv="Cache-Control" content="no-cache"/>
<meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
<?php
include("hacker.php");
connectdb();
$sid = $_GET["sid"];
echo gettheme($sid);
?>
</head>
<body>
<?php
gettimebar($sid);
boxstart("Chat");
$action=$_GET["action"];
$id=$_GET["id"];
$rid=$_GET["rid"];
$rpw=$_GET["rpw"];
$uid = getuid_sid($sid);
$uexist = isuser($uid);
if((islogged($sid)==false)||!$uexist){
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 "</div></div></body>";
echo "</html>";
exit();
}
if(isbanned($uid)){
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 "</p>";
echo "</div></div></body>";
echo "</html>";
exit();
}
$isroom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'"));
if($isroom[0]==0){
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&sid=$sid\">Chatrooms</a>";
echo "</p>";
echo "</div></div></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 "<p align=\"center\">";
echo "You can't enter this room<br/>";
echo ":P stay away<br/><br/>";
echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a>";
echo "</p>";
echo "</div></div></body>";
echo "</html>";
exit();
}
}
if(!canenter($rid,$sid)){
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&sid=$sid\">Chatrooms</a>";
echo "</p>";
echo "</div></div></body>";
echo "</html>";
exit();
}

if(!inside($uid, $rid))
    {
 if(!iscowner($uid, $rid))
    {
if(locked($uid, $rid))
    {
      echo "<p align=\"center\">";
      echo "This room is locked!<br/>";
      echo ":P Stay outside<br/><br/>";
      echo "<a href=\"index.php?action=chat&sid=$sid&type=send&browse?start\">Chatrooms</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
}
}
 if(kick($uid, $rid))
    {

      echo "<p align=\"center\">";
      echo "You have been kicked from this room hekhek!<br/>";
      echo ":P Stay outside<br/><br/>";
      echo "<a href=\"index.php?action=chat&sid=$sid&type=send&browse?start\">Chatrooms</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }

addtochat($uid, $rid);
$timeto = 7200;
$timenw = time();
$timeout = $timenw-$timeto;
$deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
if ($action==""){
echo "<p>";
addonline($uid,"Chatrooms","");
echo "<a href=\"chat.php?time=";
echo date('dmHis');
echo "&sid=$sid&rid=$rid&rpw=$rpw";
echo "\">refresh</a><br/>";
echo "Message:<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\"><input class=\"inputText\" name=\"message\" type=\"text\" value=\"\" maxlength=\"255\"/><br/>";
echo "<select name=\"color\">"; 
echo "<option value=\"red\">red</option>"; 
echo "<option value=\"blue\">blue</option>"; 
echo "<option value=\"green\">green</option>"; 
echo "</select><br/>";  

echo "<input class=\"inputButton\" type=\"submit\" value=\"Send\"/>";
echo "</form>";
if(iscowner($uid, $rid))
             {
     if(!locked($uid, $rid))
    {

      echo "<a href=\"genproc.php?action=lock&sid=$sid&rid=$rid&browse?start\">Lock</a><br/>";
    }else{
        echo "<a href=\"genproc.php?action=unlock&sid=$sid&rid=$rid&browse?start\">Unlock</a><br/>";
    }
}

if(have())
    {
if($rid==804)
        {

$range_result = mysql_query( " SELECT MAX(`id`) AS max_id , MIN(`id`) AS min_id FROM `ibwf_quiz` ");
$range_row = mysql_fetch_object( $range_result );
$random = mt_rand( $range_row->min_id , $range_row->max_id );
$result = mysql_query( " SELECT question, answer, id FROM `ibwf_quiz` WHERE `id` >= $random LIMIT 0,1 ");
while($rpgds=mysql_fetch_array($result))
  {

 $winner =$rpgds[0];
$winner2 =$rpgds[1];
}

 $tm = time();
 $time = mysql_fetch_array(mysql_query("SELECT MAX(displaytime) FROM ibwf_quizrooms ORDER by id LIMIT 1"));
  $pmfl = $time[0]+60;
  if($pmfl<$tm)
  {
   mysql_query("INSERT INTO ibwf_chat SET  chatter='133', who='', timesent='".time()."', msgtext='Nobody got the correct answer. Next question.', rid='".$rid."';");
mysql_query("INSERT INTO ibwf_quizrooms SET  displaytime='".time()."', question='".$winner."', answer='".$winner2."';");

 }else{
$quiz = mysql_query("SELECT question, answer, id FROM ibwf_quizrooms ORDER BY id DESC LIMIT 1");
 while($rpgds=mysql_fetch_array($quiz))
  {
 $question =$rpgds[0];
$question2 =$rpgds[1];
$question3 =$rpgds[2];
}

echo "system: $question";
$rema = $pmfl - $tm;
if ($rema==60)
{
$kano ="100";

}else if ($rema==59)
{

$kano ="100";
}else if ($rema==58)
{

$kano ="90";
}else if ($rema==57)
{

$kano ="90";
}else if ($rema==56)
{

$kano ="80";
}else if ($rema==55)
{

$kano ="80";
}else if ($rema==54)
{

$kano ="80";
}else if ($rema==53)
{

$kano ="70";
}else if ($rema==52)
{

$kano ="70";
}else if ($rema==51)
{

$kano ="60";
}else if ($rema==50)
{

$kano ="50";
}else if ($rema==49)
{

$kano ="40";
}else if ($rema==48)
{

$kano ="40";
}else if ($rema==47)
{

$kano ="40";
}else if ($rema==46)
{

$kano ="40";
}else if ($rema==45)
{

$kano ="38";
}else if ($rema==44)
{

$kano ="38";
}else if ($rema==43)
{

$kano ="38";
}else if ($rema==42)
{

$kano ="38";
}else if ($rema==41)
{

$kano ="35";
}else if ($rema==40)
{

$kano ="35";
}else if ($rema==39)
{

$kano ="35";
}else if ($rema==38)
{

$kano ="35";
}else if ($rema==37)
{

$kano ="35";
}else if ($rema==36)
{

$kano ="35";
}else if ($rema==35)
{

$kano ="35";
}else if ($rema==34)
{

$kano ="35";
}else if ($rema==33)
{

$kano ="35";
}else if ($rema==32)
{

$kano ="35";
}else if ($rema==31)
{

$kano ="33";
}else if ($rema==30)
{

$kano ="33";
}else if ($rema==29)
{

$kano ="33";
}else if ($rema==28)
{

$kano ="33";
}else if ($rema==27)
{

$kano ="33";
}else if ($rema==26)
{

$kano ="33";
}else if ($rema==25)
{
$kano ="33";
}else if ($rema==24)
{

$kano ="30";
}else if ($rema==23)
{

$kano ="30";
}else if ($rema==22)
{

$kano ="30";
}else if ($rema==21)
{

$kano ="26";
}else if ($rema==20)
{

$kano ="26";
}else if ($rema==19)
{

$kano ="26";
}else if ($rema==18)
{

$kano ="26";
}else if ($rema==17)
{

$kano ="25";
}else if ($rema==16)
{

$kano ="25";
}else if ($rema==15)
{

$kano ="25";
}else if ($rema==14)
{

$kano ="20";
}else if ($rema==13)
{

$kano ="20";
}else if ($rema==12)
{

$kano ="20";
}else if ($rema==11)
{

$kano ="20";
}else if ($rema==10)
{

$kano ="18";
}else if ($rema==9)
{

$kano ="17";
}else if ($rema==8)
{

$kano ="17";
}else if ($rema==7)
{

$kano ="16";
}else if ($rema==6)
{

$kano ="15";
}else if ($rema==5)
{

$kano ="13";
}else if ($rema==4)
{

$kano ="10";
}else if ($rema==3)
{

$kano ="6";
}else if ($rema==2)
{

$kano ="5";
}else if ($rema==1)
{

$kano ="4";
}else if ($rema==0)
{

$kano ="0";
}
echo " Time Left to answer:$rema seconds.REWARD: $kano Plusses and GP.";
}
}
}
    if($rid==182)
        {

echo "<a href=\"chat.php?action=reset&rid=182\">CLEAR DATA</a><br/>";
}
if($rid==454)
        {

$tries2 = mysql_fetch_array(mysql_query("SELECT cards FROM ibwf_spincard"));
$mama2= $tries2[0];
if($mama2>0)
 {
if($spin==1)
        {

  $tm = time();
  $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(spintime) FROM ibwf_users WHERE id='".$uid."'"));
  $pmfl = $lastpm[0]+15;
  if($pmfl<$tm)
  {

     }else{

$rema = $pmfl - $tm;
echo "Chat system:»*you can spin cards again after <b>$rema</b> seconds.*<br/>";
}
if(!spinned($uid))
    {
$rpgd = mysql_query("SELECT id, no FROM ibwf_getcards ORDER by RAND() LIMIT 1");
 while($rpgds=mysql_fetch_array($rpgd))
  {

$cards =$rpgds[1];
}
 if(getplusses(getuid_sid($sid))<10)
    {
        echo "You need 10 plusses in order to spin the wheel!";
    }else{
 mysql_query("UPDATE ibwf_users SET cards=cards+'$cards' WHERE id='".$uid."'");
 mysql_query("UPDATE ibwf_spincard SET cards=cards-'$cards'");
 mysql_query("UPDATE ibwf_users SET plusses=plusses-'1' WHERE id='".$uid."'");
 mysql_query("UPDATE ibwf_users SET spintime='".time()."' WHERE id='".$uid."'");
 mysql_query("UPDATE ibwf_users SET spinned='1' WHERE id='".$uid."'");
$mycards = mysql_fetch_array(mysql_query("SELECT cards FROM ibwf_users WHERE id='".$uid."'"));
echo "Chat system:»*you got $cards card(s) for that spin wait after 20 sec to spin cards again. You have $mycards[0] total of cards.*<br/>";
  }

}
}else{

  $tm = time();
  $lastpm = mysql_fetch_array(mysql_query("SELECT MAX(spintime) FROM ibwf_users WHERE id='".$uid."'"));
  $pmfl = $lastpm[0]+20;
  if($pmfl<$tm)
  {
mysql_query("UPDATE ibwf_users SET spinned='0' WHERE id='".$uid."'");
$cinfo = mysql_fetch_array(mysql_query("SELECT cards from ibwf_spincard"));
echo "<a href=\"index.php?action=viewuser&who=133\">system</a>»There are $cinfo[0] remaining cards. Click <a href=\"chat.php?spin=1&rid=$rid\">spin the wheel</a> spin cards to get some cards. Each spin will cost 1 plusses, if you got the highest number of cards after the remaining cards goes to zero, you will get the 1000 plusses prize more info for game info.<br/>";
     }else{

$rema = $pmfl - $tm;
echo "Chat system:»*you can spin cards again after <b>$rema</b> seconds.*<br/>";
}
}
}else{
$rpgd = mysql_query("SELECT id, cards FROM ibwf_users ORDER by cards DESC LIMIT 1");
 while($rpgds=mysql_fetch_array($rpgd))
  {
 $winner =$rpgds[0];
$winner2 =$rpgds[1];
}
 $unick2 = getnick_uid($winner);
mysql_query("UPDATE ibwf_spincard SET cards='500'");
mysql_query("INSERT INTO ibwf_chat SET  chatter='133', timesent='".time()."', msgtext='$unick2 got $winner2 cards, and the 1000 plusses prize', perm='".$perm[0]."', rid='".$rid."';");
mysql_query("UPDATE ibwf_users SET plusses=plusses+'1000' WHERE id='".$winner."'");
mysql_query("UPDATE ibwf_users SET cards='0'");
mysql_query("UPDATE ibwf_users SET spintime='0'");
}
}

   if($rid==182)
        {
     $uid = getuid_sid($sid);

$nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_jnp WHERE touid='".$uid."' AND reply='1'"));
if($nopop[0]>0)
{
 $ncl = mysql_fetch_array(mysql_query("SELECT id, bet, byuid, touid FROM ibwf_jnp WHERE touid='".$uid."' ORDER BY id DESC LIMIT 1"));
$by = getnick_uid($ncl[2]);
echo "Jack en Poy challenge from $by BET: $ncl[1]<br/>";
 echo "<form action=\"chat.php?action=jnp&rid=$rid&time=$time\" method=\"post\">";
    echo "JNP Challenge: <select name=\"kamay\">";
 echo "<option value=\"0\">Decline</option>";
 echo "<option value=\"1\">Paper</option>";
  echo "<option value=\"2\">Scissors</option>";
  echo "<option value=\"3\">Rock</option>";
  echo "</select>";
echo "<input type=\"hidden\" name=\"who\" value=\"$ncl[2]\"/>";
echo "<input type=\"hidden\" name=\"poy\" value=\"$ncl[0]\"/>";
echo "<input type=\"submit\" value=\"Send\"/>";
echo "</form>";
}
}

$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&sid=$sid\">Inbox$unrd</a>";
}
echo "</p>";
$message=$_POST["message"];
if(isset($_POST['color'])) 
 $message = "[color={$_POST['color']}]$message\[/color]";  

$who = $_POST["who"];
$rinfo = mysql_fetch_array(mysql_query("SELECT censord, freaky FROM ibwf_rooms WHERE id='".$rid."'"));
if(trim($message) != ""){
$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."'");

if($rid==804) 
{ 
$msg = $message; 
$ans = "/$question2/i"; 
if(!preg_match($ans, $msg)) 
{ 
 $by = getnick_uid($uid); 
echo "<b>Chat system</b>» $by, sorry your answer is wrong. You've been deducted 2 plusses. Please try again!!!<br/>"; 
mysql_query("UPDATE ibwf_users SET plusses=plusses-'2' WHERE id='".$uid."'"); 
}else{ 
$range_result = mysql_query("SELECT MAX(`id`) AS max_id, MIN(`id`) AS min_id FROM `ibwf_quiz`"); 
$range_row = mysql_fetch_object($range_result); 
$random = mt_rand($range_row->min_id , $range_row->max_id); 
$result = mysql_query("SELECT question, answer, id FROM `ibwf_quiz` WHERE `id` >= $random LIMIT 0,1"); 
while($rpgds=mysql_fetch_array($result)) 
{ 
$winner = $rpgds[0]; 
$winner2 = $rpgds[1]; 
} 
 mysql_query("DELETE FROM ibwf_quiz WHERE id='".$question3."'"); 
mysql_query("INSERT INTO ibwf_quizrooms SET displaytime='".time()."', question='".$winner."', answer='".$winner2."'"); 
$by = getnick_uid($uid); 
$csmsg = "$by, you are correct. you got $kano plusses. Next question!!!"; 
$csm = "$by, i'm sorry but it's already time out!!!"; 
if($kano!="") 
{ 
echo "<b>Chat system</b>» ".$csmsg."<br/>"; 
mysql_query("UPDATE ibwf_users SET plusses=plusses+'$kano' WHERE id='".$uid."'"); 
}else{ 
echo "<b>Chat system</b>» ".$csm."<br/>"; 
mysql_query("UPDATE ibwf_users SET plusses=plusses+'$kano' WHERE id='".$uid."'"); 
} 
mysql_query("DELETE FROM ibwf_quizrooms WHERE id='".$question3."'"); 
} 
}  

  $chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', perm='".$perm[0]."', 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."'");
          if($rid!==454)
        {
if($rid!==182)
        {
            $hehe2=mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
            $totl2 = $hehe2[0]+1;
            $msgst2= mysql_query("UPDATE ibwf_users SET plusses='".$totl2."' WHERE id='".$uid."'");
}
}

if($rinfo[1]==2){
$botid = "c078df85ae3753d5";
$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 = 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."';");
           	addonline('1',"Bot chatroom","");
//$logit = mysql_query("INSERT INTO logs VALUES (NULL, 'IW Bot', 'IW Browser', '205.209.127.217', '', '', '', '', '', '')");
}
          
          $message = "";
            }
            
            echo "<span class=\"bubble\">";
            
            $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 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 A", $chat[2]+(12.5*60*60));
                  $text = parsepm($chat[3], $sid);
                  $nos = substr_count($text,"<img src=");
                  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 if($enters == "1ENTERSROOM1")
				                    {
				                    	$chco = strlen($chat[3]);
				                        $goto = $chco - 12;
				                        $rest = substr($chat[3],12,$goto);
				                        
				                        echo "<b>Chat System</b> » $ds<br/><b><i>*$chnick, enterd*</i></b><br/>";
				                    }else{

                      
                      $tosay = parsepm($chat[3], $sid);
                      
                      if($rinfo[0]==1)
                      {
                      $tosay = str_replace("****","f***",$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&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a>»$ds<br/>";
echo $tosay."<br/>";
}
}
$counter++;
}
}
}
echo "</span>";
echo "<p align=\"center\">";
if(ismod($uid))
  {
echo "<a href=\"lists.php?action=kicklist&sid=$sid&rid=$rid\">----Kick List</a>";
}

$chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));
echo "<br/><a href=\"chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw\">Who's Inside($chatters[0])</a><br/><a href=\"lists.php?action=chmood&sid=$sid&page=1\">»Chat mood</a><br/>";
echo "<a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a><br/>";
echo "</p>";
getfooter($sid);
}
else if ($action=="say"){
addonline($uid,"Writing Chat Message","");
echo "<p>Message:<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\"><input class=\"inputText\" name=\"message\" type=\"text\" value=\"\" maxlength=\"255\"/><br/>";
echo "<input class=\"inputButton\" type=\"submit\" value=\"Post\"/>";
echo "</form><br/>";
echo "<a href=\"lists.php?action=chmood&sid=$sid&page=1\">»Chat mood</a><br/>";
echo "<a href=\"chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw\">»Who's Inside</a><br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">«Chatroom</a></p>";
echo "<p align=\"center\"><a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a><br/>";
echo "</p>";
getfooter($sid);
}
else if ($action=="say2"){
echo "<p align=\"center\">";
$who = $_GET["who"];
$unick = getnick_uid($who);
echo "<b>Private to $unick</b>";
echo "</p>";
addonline($uid,"Writing chat message","");
echo "<p>Message:<form action=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\" method=\"post\"><input class=\"inputText\" name=\"message\" type=\"text\" value=\" \" maxlength=\"255\"/><br/>";
echo "<input type=\"hidden\" name=\"who\" value=\"$who\"><input class=\"inputButton\" type=\"submit\" value=\"Send\"/>";
echo "<br/>";
echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$who\">»View $unick's Profile</a><br/>";
echo "<a href=\"chat.php?action=expose&sid=$sid&who=$who&rid=$rid&rpw=$rpw\">»Expose $unick</a><br/>";
 if(iscowner($uid, $rid))
             {
     if(!kick($who, $rid))
    {

      echo "<a href=\"genproc.php?action=kick&sid=$sid&who=$who&rid=$rid\">»Kick</a><br/>";
    }else{
        echo "<a href=\"genproc.php?action=unkick&sid=$sid&who=$who&rid=$rid\">»Unkick</a><br/>";
    }
}

echo "<a href=\"chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw\">»Who's Inside</a><br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">«Chatroom</a></p>";
echo "<p align=\"center\"><a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a><br/>";
echo "</p>";
getfooter($sid);
}
else if ($action=="inside"){
addonline($uid,"Chat 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 = "<a href=\"chat.php?action=say2&sid=$sid&who=$ins[1]&rid=$rid&rpw=$rpw\">$unick</a>, ";
echo "$userl";
}
echo "<br/><br/>";
echo "<a href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">«Chatroom</a><br/>";
echo "<br/><a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a><br/>";
echo "</p>";
getfooter($sid);
}
else if ($action=="expose")           {
addonline($uid,"Chat 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&rid=$rid&rpw=$rpw\">«Chatroom</a><br/>";
echo "<br/><a href=\"index.php?action=chat&sid=$sid\">Chatrooms</a><br/>";
echo "</p>";
}
else if(($action=="clear")&&(isadmin($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\"><br/>";
      $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 "<b><img src=\"../images/notok.gif\" alt=\"x\"/><br/>Error!!!<br/>Permission Denied...</b><br/>";
      echo "<br/>U Cannot Clear $trgtnick's Msgs<br/>";
      }else{
      if(($who!="")||($who!=0))
      {
      $res = mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."'");
      if($res)
      {
      echo "$trgtnick msgs have been cleared<br/>";
      }else{
      echo "Failed clearing $trgtnick msgs<br/>";
      }
      }else{
      echo "Username doesnot exist<br/>";
      }
      }
      echo "<br/>";
      $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
      $rname = $rooms[1];
      echo "<b>4 </b><a accesskey=\"4\" href=\"chat.php?sid=$sid&rid=$rid&rpw=$rpw\">Back To $rname</a><br/>";
      echo "<b>6 </b><a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a><br/>";
      echo "<b>7 </b><a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a><br/>";
      echo "<b>8 </b><a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>RoomList</a><br/>";
   
      echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>";
      echo "</body>";
}

boxend();
?>
</body>
</html>
Ghost Senior · 366 posts #2

not quite sure how mysql database works exactly.

but to do this in Flat File (.txt files) i had to actually put the span tags into the message database "with" the users messages for it to show chat bubble around each users message. or i would just get a bubble floating around the chat page not knowing where it wanted to settle.

this is me putting a table around my chat "instead" of a bubble but the same concept works for the bubble (i removed bubble in end. wasnt happy still)

like this

  /** Write Username, Time, And Message To Chat Database File.
      Then Redirect User Back To Chat Page For Viewing. */
      $output = file_get_contents($Chat_File);
    $Span_Start = "<span class=\"chatspan\">";
  $Span_End = "</span>";
       $Table_Start = "<table class=\"chat\"><tr><td class=\"chat\">";
  $Table_End = "</td></tr></table>";
$input = $Table_Start . $Span_Start . $name . $Span_End . ': ' . $time . '» ' . $message .  $Table_End . '
' . $output;
     $handle = fopen($Chat_File, "w+");
   fputs($handle, $input);
if (filesize($Chat_File)>1000000)
  {
  ftruncate($handle,1000000);
  }
fclose($handle);

//ignore this part
//try to make code box bigger
//.
//.
//.
//.
//.
//.
//.
//.
//.

then in chat file database it would look something like.

<table class="chat"><tr><td class="chat"><span class="chatspan">ghost</span>: 14:01» but all the other pages except this one are naturally small. i didnt make them like it. they just appeared like it. gay..</td></tr></table>

//ignore this part
//try to make code box bigger
//.
//.
//.
//.
//.
//.
//.
//.
//.

maybe mysql is kinda the same?

<?php include ('Ghost'); if ($Post == true) { echo ' ![](http://destrukt.dk/ico/phpdeveloper.jpg) alt='coding-talk.com!!' />'; echo 'Sharing Is Caring!'; } else { echo ' ![](http://img98.imageshack.us/img98/6476/av3ro4.jpg) alt='the username GHOST has been comprimised!' />'; echo 'OMG SOMEBODY HELP ME!!'; } ?>
mirror Developer · 108 posts #4

Loony wrote: i usually dont help anyone that requests help thru my inbox but check this site out Demo: Pure CSS speech bubbles – Nicolas Gallagher

sorry to disturb u bro , i m confused as to where i shud apply tht div class anyway thanks for tht link it wasnt much help i had already checked tht site using google, let me try again ur nick looks good in BLUE color📖

Ghost Senior · 366 posts #6

couldnt you try something like this maybe. im gonna guest at this is the enter message part.

 
$Span_Start = "<span class=\"bubble\">"; 
 $Span_End = "</span>"; 

  $chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$Span_Start.$message.$Span_End."', perm='".$perm[0]."', rid='".$rid."';"); 
//.
//..
//..
//..
//..
//..
//..

and just have the whole string enter message database.

ps im not a mysql user so dont shoot me if im wrong. its just a suggestion.

<?php include ('Ghost'); if ($Post == true) { echo ' ![](http://destrukt.dk/ico/phpdeveloper.jpg) alt='coding-talk.com!!' />'; echo 'Sharing Is Caring!'; } else { echo ' ![](http://img98.imageshack.us/img98/6476/av3ro4.jpg) alt='the username GHOST has been comprimised!' />'; echo 'OMG SOMEBODY HELP ME!!'; } ?>
mirror Developer · 108 posts #7

still not working ghost bro

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close