Dy/hour In Chatrooms Wapdesire

Started on the old forum in November 2008 · view the original in the archive · old links redirect here

19 replies · 955 views · started 18 years ago · 1 min read

TL;DR · summary of 19 replies
  • $chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".date('Y-m-d H:i:s')."', msgtext='".$message."', rid='".$rid."'") works if the sql has enough character spacing for timesent...
  • Change [code] ORDER BY timesent [code] to [code] ORDER BY id [code] in chat.php to fix messages appearing at the bottom instead of above.
  • Adding date and time directly into the SQL query might not work as expected without proper adjustments.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
honkytonkman Senior · 252 posts #1

this is the chat.php page on my version of wapdesire

CODE<?php header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); //header('Content-type: application/vnd.wap.xhtml+xml'); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; ?>

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/> <meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/> </head> <?php

include("config.php"); include("core.php"); connectdb(); $action=$_GET["action"]; $id=$_GET["id"]; $sid = $_GET["sid"]; $rid=$_GET["rid"]; $rpw=$_GET["rpw"]; $uid = getuid_sid($sid); $uexist = isuser($uid); $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));

if((islogged($sid)==false)||!$uexist) { echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/white_medium.css">"; echo "</head>"; echo "<body>"; echo ""; echo "You are not logged in "; echo "Or Your session has been expired

"; echo "<a href="index.php">Login</a>"; echo ""; echo "</html>"; echo "</body>"; exit(); }

if(isbanned($uid)) { echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; echo "<img src="../images/notok.gif" alt="x"/> "; echo "You are Banned

"; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Time Left:$rmsg "; $nick = getnick_uid($banto[2]); echo "By:$nick "; echo "Reason:$banto[1]"; //echo "<a href="index.php">Login</a>"; echo " "; echo "</body>"; echo "</html>"; exit(); } $isroom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'")); if($isroom[0]==0) { echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo ""; echo "Room Doesn't Exist

"; echo "<a href="index.php?action=chat&sid=$sid">Chatrooms</a>"; echo ""; echo "</body>"; echo "</html>"; exit(); } $passworded = mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_rooms WHERE id='".$rid."'")); if($passworded[0]!="") { if($rpw!=$passworded[0]) { echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo ""; echo "Wrong Password! "; echo "You can't enter this room

"; echo "<a href="index.php?action=chat&sid=$sid">Chatrooms</a>"; echo ""; echo "</body>"; echo "</html>"; exit(); } } if(!canenter($rid,$sid)) { echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo ""; echo "Permission denied!

"; echo "<a href="index.php?action=chat&sid=$sid">Chatrooms</a>"; echo ""; echo "</body>"; echo "</html>"; exit(); } addtochat($uid, $rid); $timeto = 300; $timenw = time(); $timeout = $timenw-$timeto; $deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout.""); $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; $nick = getnick_sid($sid);

  if ($action=="")
  {
  echo "<head>";
  echo "<title>$nick@$rname</title>";
  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
  $unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups WHERE unread='1' AND touid='".$uid."'"));
  if ($unreadpopup[0]<1)
  {
  echo "<meta http-equiv=\"refresh\" content=\"20; url=chat.php?time=";
  echo "".date("dmHis")."";
  echo "&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">";
  }
  echo "</head>";
  echo "<body>";
    addonline($uid,"Chating in $rname","chat.php?rid=$rid&amp;rpw=$rpw");
    //echo "

"; echo popup($sid); echo "1<a name="top" id="top" accesskey="1" href="chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw">Write</a> "; echo "2<a accesskey="2" href="#opt">options</a> "; echo "*****<a accesskey="*" href="chat.php?time="; echo "".date("dmHis").""; echo "&sid=$sid&rid=$rid&rpw=$rpw">Refresh</a> ";

    $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
    $unrd="".$unreadinbox[0]."";
    if ($unreadinbox[0]>0)
    {
    echo "**5**<a href=\"inbox.php?action=main&amp;sid=$sid&amp;lstloc=cht&amp;rid=$rid\">$unrd New Inbox!</a>

"; } //echo " "; //echo "

";

    $message=$_POST["message"];
    $who = $_POST["who"];
    $rinfo = mysql_fetch_array(mysql_query("SELECT censord, freaky FROM ibwf_rooms WHERE id='".$rid."'"));
    if (trim($message) != "")
    {
if(!isblocked($message,$uid))
{

  $chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';");
  $lstmsg = mysql_query("UPDATE ibwf_rooms SET lastmsg='".time()."' WHERE id='".$rid."'");
        
  $hehe=mysql_fetch_array(mysql_query("SELECT chmsgs FROM ibwf_users WHERE id='".$uid."'"));
  $totl = $hehe[0]+1;
  $msgst= mysql_query("UPDATE ibwf_users SET chmsgs='".$totl."' WHERE id='".$uid."'");
}else{
$bantime = time() + (30*24*60*60);
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
echo "Can't Post Msg

"; echo "You just tried sending a msg with a link to one of the crapiest sites on earth The members of these sites spam here a lot, so go to that site and stay there if you don't like it here as a result of your stupid action:

  1. you have lost your sheild

  2. you have lost all your plusses

  3. You are BANNED!"; $user = getnick_sid($sid); mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='".getnick_uid(1)." auto banned $user for spamming chat', actdt='".time()."'"); mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='1', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'"); mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'"); echo "</body>"; echo "</html>"; exit(); } if($rinfo[1]==2) { //oh damn i gotta post this message to ravebabe 🙁 //will it succeed? $botid = "eeb070e74e366473"; $hostname = "www.pandorabots.com"; $hostpath = "/pandora/talk-xml"; $sendData = "botid=".$botid."&input=".urlencode($message)."&custid=".$custid;

           $result = PostToHost($hostname, $hostpath, $sendData);
    
           $pos = strpos($result, "custid=\"");
           $pos = strpos($result, "<that>");
     if ($pos === false) {
     	$reply = "";
     } else {
     	$pos += 6;
     	$endpos = strpos($result, "</that>", $pos);
     	$reply = unhtmlspecialchars2(substr($result, $pos, $endpos - $pos));
     	$reply = mysql_escape_string($reply);
     }
    
     $chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='1', who='', timesent='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';");
    
         }
       $message = "";
         }
    
         echo "
    

"; $chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC"); $counter=0;

        while($chat = mysql_fetch_array($chats))
        {
            $canc = true;
           
            
            if($counter<40)
            {
              if(istrashed($chat[0])){
                    if($uid!=$chat[0])
                    {
                      $canc = false;
                    }
              }
            //////good
            /*if(isignored($chat[0],$uid)){
              $canc = false;
            }*/
            //////////good
            if($chat[0]!=$uid)
            {
              if($chat[1]!=0)
              {
                if($chat[1]!=$uid)
                {
                  $canc = false;
                }
              }
            }
            if($chat[4]=='1' && ismod($uid))
            {
              $canc = true;
            }
            if($canc)
            {
               $cmid = mysql_fetch_array(mysql_query("SELECT  chmood FROM ibwf_users WHERE id='".$chat[0]."'"));
               
               $iml = "";
            if(($cmid[0]!=0))
            {
              $mlnk = mysql_fetch_array(mysql_query("SELECT img, text FROM ibwf_moods WHERE id='".$cmid[0]."'"));
              $iml = "<img src=\"$mlnk[0]\" alt=\"$mlnk[1]\"/>";

            }
              $chnick = getnick_uid($chat[0]);
                $optlink = $iml.$chnick;
              if(($chat[1]!=0)&&($chat[0]==$uid))
              {
                ///out
                $iml = "<img src=\"../moods/out.gif\" alt=\"!\"/>";
                $chnick = getnick_uid($chat[1]);
                $optlink = $iml."Pm To ".$chnick;
              }
              if($chat[1]==$uid)
              {
                ///out
                $iml = "<img src=\"../moods/in.gif\" alt=\"!\"/>";
                $chnick = getnick_uid($chat[0]);
                $optlink = $iml."Pm By ".$chnick;
              }
                if($chat[4]=='1')
              {
                ///out
                $iml = "<img src=\"../moods/point.gif\" alt=\"!\"/>";
                $chnick = getnick_uid($chat[0]);
                $tonick = getnick_uid($chat[1]);
                $optlink = "$iml By ".$chnick." To ".$tonick;
              }

$ds= date("H.i.s", $chat[2]); $text = parsepm($chat[3], $sid); $nos = substr_count($text,"External image (may be gone)2){ $chnick = getnick_uid($chat[0]); echo addchatmsg($chat[0],$text,1,"Hey! $chnick, U Can Only Use 2 Smilies Per Msg!"); }else{ $sres = substr($chat[3],0,3); if($sres == "/me") { $chco = strlen($chat[3]); $goto = $chco - 3; $rest = substr($chat[3],3,$goto); $tosay = parsepm($rest, $sid);

echo addchatmsg($chat[0],$tosay,1,""); } else{ if($rinfo[0]==0){$tosay = getbbcode($chat[3], $sid, 0);} else{$tosay = parsepm($chat[3], $sid, 1);} if($rinfo[1]==1){$tosay = strrev($tosay);} echo "<a href="chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw">$optlink</a> - "; echo $tosay." "; } } $counter++; } } } echo " "; echo "<a name="opt" id="opt"></a>"; echo "*****<a accesskey="" href="chat.php?time="; echo "".date("dmHis").""; echo "&sid=$sid&rid=$rid&rpw=$rpw">Refresh</a> "; echo "1<a href="chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw">Write</a> "; echo "3<a accesskey="3" href="chat.php?action=options&sid=$sid&rid=$rid&rpw=$rpw">Settings</a> "; $chatters=mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_chonline where rid='".$rid."'")); echo "4<a accesskey="4" href="chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw">Whos Inside $chatters[0]</a> "; echo "5<a accesskey="5" href="inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid">Inbox</a> "; echo "6<a accesskey="6" href="lists.php?action=buds&sid=$sid">BuddyList</a> "; echo "7<a accesskey="7" href="index.php?action=chat&sid=$sid">Chat</a> "; echo forumlink($sid,8); echo "9<a accesskey="9" href="#top">top</a> "; echo "0<a accesskey="0" href="index.php?action=main&sid=$sid">Home</a>"; echo "</body>"; } /////////////////////////////////////////////////////SAY

  else if ($action=="say")   
  {
echo "<head>";
  echo "<title>Write Msg</title>";

echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; addonline($uid,"Writing Chat Msg",""); echo "<form action="chat.php?sid=$sid&rid=$rid&rpw=$rpw" method="post">"; echo "

Message:<input name="message" type="text" maxlength="255"/> "; echo "<input type="Submit" Name="sy2" value="Say"></form> "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "4<a accesskey="4" href="chat.php?sid=$sid&rid=$rid&rpw=$rpw">Back To $rname</a> "; echo "6<a accesskey="6" href="inbox.php?action=main&sid=$sid">Inbox</a> "; echo "7<a accesskey="7" href="lists.php?action=buds&sid=$sid">BuddyList</a> "; echo "8<a accesskey="8" href="index.php?action=chat&sid=$sid">Chat</a> "; echo forumlink($sid,9); echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a> "; echo "</body>"; } //////////////////////////////////////////// /////////////////////////////////////////////////////SAY2 else if ($action=="say2") { echo "<head>"; echo "<title>Send Pm</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; $unick = getnick_uid($who); echo "Send Pm To $unick"; echo " ";

    addonline($uid,"Writing Chat Msg","");
    echo "<form action=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">";
    echo "<input type=\"Hidden\" name=\"who\" value=\"$who\">";
    echo "

Message:<input name="message" type="text" maxlength="255"/> "; echo "<input type="Submit" name="private" Value="Private"></form>"; echo " "; if(ismod($uid)) { echo "*****<a accesskey="*" href="chat.php?action=clear&sid=$sid&who=$who&lstloc=cht&rid=$rid">Clear Msgs</a> "; } echo "1<a accesskey="1" href="index.php?action=viewuser&sid=$sid&who=$who&lstloc=cht&rid=$rid">View $unick's Profile</a> "; echo "2<a accesskey="2" href="chat.php?action=expose&sid=$sid&who=$who&rid=$rid&rpw=$rpw">Expose $unick's Msgs</a> "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "4<a accesskey="4" href="chat.php?sid=$sid&rid=$rid&rpw=$rpw">Back To $rname</a> "; echo "6<a accesskey="6" href="inbox.php?action=main&sid=$sid">Inbox</a> "; echo "7<a accesskey="7" href="lists.php?action=buds&sid=$sid">BuddyList</a> "; echo "8<a accesskey="8" href="index.php?action=chat&sid=$sid">Chat</a> "; echo forumlink($sid,9); echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a> "; echo "</body>"; } /////////////////////////////////////////////////////CHAT OPTIONS

    else if ($action=="options")   
                    {
	echo "<head>";
  echo "<title>Chat Options</title>";

echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>";

    addonline($uid,"Chat Options","");
    echo "**1**<a accesskey=\"1\" href=\"lists.php?action=chmood&amp;sid=$sid&amp;page=1\">Chat Mood</a>

"; echo "2<a accesskey="2" href="lists.php?action=smilies&sid=$sid">Smilies List</a> "; echo "3<a accesskey="3" href="chat.php?action=inside&sid=$sid&rid=$rid&rpw=$rpw">Who's Inside</a> "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "4<a accesskey="4" href="chat.php?sid=$sid&rid=$rid&rpw=$rpw">Back To $rname</a> ";
echo "6<a accesskey="6" href="inbox.php?action=main&sid=$sid">Inbox</a> "; echo "7<a accesskey="7" href="lists.php?action=buds&sid=$sid">BuddyList</a> "; echo "8<a accesskey="8" href="index.php?action=chat&sid=$sid">Chat</a> "; echo forumlink($sid,9); echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a> "; echo "</body>"; } //////////////////////////////////////////// //////////////////////////////inside////////// else if ($action=="inside") {

  addonline($uid,"Viewing Chat UserList","");
  echo "<head>";
  echo "<title>Chat UserList</title>";

echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo "

"; $inside=mysql_query("SELECT DISTINCT * FROM ibwf_chonline WHERE rid='".$rid."' and uid IS NOT NULL");

    while($ins=mysql_fetch_array($inside))
    {
      $unick = getnick_uid($ins[1]);
      $userl = "<a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$ins[1]&amp;rid=$rid&amp;rpw=$rpw\">$unick</a>

"; echo "$userl"; } echo " "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "4<a accesskey="4" href="chat.php?sid=$sid&rid=$rid&rpw=$rpw">Back To $rname</a> "; echo "6<a accesskey="6" href="inbox.php?action=main&sid=$sid">Inbox</a> "; echo "7<a accesskey="7" href="lists.php?action=buds&sid=$sid">BuddyList</a> "; echo "8<a accesskey="8" href="index.php?action=chat&sid=$sid">Chat</a> "; echo forumlink($sid,9); echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a> "; echo "</body>"; } else if ($action=="expose") {

  addonline($uid,"Exposing ChatUser","");
  echo "<head>";
  echo "<title>Exposing ChatUser</title>";

echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo "

"; mysql_query("UPDATE ibwf_chat SET exposed='1' WHERE chatter='".$who."' AND who='".$uid."'"); $unick = getnick_uid($who); echo "$unick messages to you have been exposed to staff"; echo "

"; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "4<a accesskey="4" href="chat.php?sid=$sid&rid=$rid&rpw=$rpw">Back To $rname</a> "; echo "6<a accesskey="6" href="inbox.php?action=main&sid=$sid">Inbox</a> "; echo "7<a accesskey="7" href="lists.php?action=buds&sid=$sid">BuddyList</a> "; echo "8<a accesskey="8" href="index.php?action=chat&sid=$sid"><img src="../images/chat.gif" alt=""/>RoomList</a> "; echo forumlink($sid,9); echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a> "; echo "</body>"; } else if(($action=="clear")&&(ismod($uid))) { addonline($uid,"Chat Tools",""); echo "<head>"; echo "<title>Clearing Users Msgs</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo "

"; $trgtnick=getnick_uid($who); $perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'")); $trgtperm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'")); if($trgtperm>$perm){ echo "<img src="../images/notok.gif" alt="x"/> Error!!! Permission Denied... "; echo " U Cannot Clear $trgtnick's Msgs "; }else{ if(($who!="")||($who!=0)) { $res = mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."'"); if($res) { echo "$trgtnick msgs have been cleared "; }else{ echo "Failed clearing $trgtnick msgs "; } }else{ echo "Username doesnot exist "; } } echo " "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "4<a accesskey="4" href="chat.php?sid=$sid&rid=$rid&rpw=$rpw">Back To $rname</a> "; echo "6<a accesskey="6" href="inbox.php?action=main&sid=$sid">Inbox</a> "; echo "7<a accesskey="7" href="lists.php?action=buds&sid=$sid">BuddyList</a> "; echo "8<a accesskey="8" href="index.php?action=chat&sid=$sid"><img src="../images/chat.gif" alt=""/>RoomList</a> "; echo forumlink($sid,9); echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a> "; echo "</body>"; } ?>

</html>

..i 've been trying to put it before the nicks in rooms hour/day time; exemple: 26-11-2008/13.34-misterx -hi, everybody

but i don't find the way..

i 've done some changes to keep messages on rooms created by owner for 48 hours and i really like to have hour date close nicks..

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

Anshul Senior · 296 posts #2

try to put before dis

$msgtime=date("F j, Y, g:i a",$chat[2]);
echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - $msgtime";
echo $tosay."
";

i am not sure about it try it urself

something else Fellow · 2,296 posts #3

just change:

$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';");

so timesent includes date aswell 🙂 (might need to change the ibwf_chat sql slightly for more character spacing on timesent) 🙂

honkytonkman Senior · 252 posts #4

QUOTE (inca @ Nov 26 2008, 06:29 PM) <{POST_SNAPBACK}>

just change:

$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';");

so timesent includes date aswell 🙂 (might need to change the ibwf_chat sql slightly for more character spacing on timesent) :)

this code $chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';"); is on it !..look at chat.php but no time appers close nick and message.. that's the code i 've been working without results..

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

Anshul Senior · 296 posts #5

code tat i had gav works the same u want it 🙂

something else Fellow · 2,296 posts #6

i said add date on it like this:

$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".date("D d M y - ")."/".time()."', msgtext='".$message."', rid='".$rid."';");

😛 providing the ibwf_chat timesent has enough charcter spacing 🙂

something else Fellow · 2,296 posts #7

oh your missing time aswell 🙂

echo "$chat[3] <a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
  echo $tosay."
";
ori Lead · 512 posts #8

time() gets date and time if u use date("d/m/y - H:i",$chat['time'])

honkytonkman Senior · 252 posts #10

i tried to use $msgtime=date("F j, Y, g:i a",$chat[2]); echo "<a href="chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw">$optlink</a> - $msgtime"; echo $tosay." "; but creates scripts in the page.. i don't understand where to put it right.. i didn't think it was so hard to put hour/time on wapdesire chatroom messages.. 😛

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

Anshul Senior · 296 posts #11

QUOTE

i tried to use $msgtime=date("F j, Y, g:i a",$chat[2]); echo "<a href="chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw">$optlink</a> - $msgtime"; echo $tosay." "; but creates scripts in the page.. i don't understand where to put it right.. i didn't think it was so hard to put hour/time on wapdesire chatroom messages..

creates script in the page didnt get ya ??? find dis line

echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
echo $tosay."
";

replace it wit tat one

opticalpigion Lead · 593 posts #12
  $time = time() - (9 * 60 * 60);
  $newtime = date("H:i",$time);
  $date = strtotime('-9 hours');
  $newdate = date('D jS M y',$date);
echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> -".$newtime." - ".$newdate." ";
echo $tosay."
";
Attachments: screenshot.jpg
something else Fellow · 2,296 posts #13

QUOTE (opticalpigion @ Nov 28 2008, 01:36 PM) <{POST_SNAPBACK}>

  $time = time() - (9 * 60 * 60);
  $newtime = date("H:i",$time);
  $date = strtotime('-9 hours');
  $newdate = date('D jS M y',$date);
echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> -".$newtime." - ".$newdate." ";
echo $tosay."
";

but your not saving it into database so the time/date is going to say the same date for all posts??

opticalpigion Lead · 593 posts #14

QUOTE (inca @ Nov 28 2008, 10:43 PM) <{POST_SNAPBACK}>

but your not saving it into database so the time/date is going to say the same date for all posts??

hummm instead of finding mistakes why dont u give better code him !

something else Fellow · 2,296 posts #15

the 2 previous codes iv posted will work together iv checked the sql and there is enough character spacing (50) so it will wrk fine: so replace this:

$chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';");

with this:

$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".date("D d M y - ")."/".time()."', msgtext='".$message."', rid='".$rid."';");

and replace this:

  echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";

  echo $tosay."
";

with this:

echo "$chat[3] <a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
  echo $tosay."
";

🙂 job done 😛

honkytonkman Senior · 252 posts #16

QUOTE (inca @ Nov 29 2008, 03:49 PM) <{POST_SNAPBACK}>

the 2 previous codes iv posted will work together iv checked the sql and there is enough character spacing (50) so it will wrk fine: so replace this:

$chatok = mysql_query("INSERT INTO ibwf_chat SET  chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';");

with this:

$chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".date("D d M y - ")."/".time()."', msgtext='".$message."', rid='".$rid."';");

and replace this:

  echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";

  echo $tosay."
";

with this:

echo "$chat[3] <a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
  echo $tosay."
";

🙂 job done :P

mmm..more easy to repair the shuttle..

i try it but DON'T WORKS!..message appears with no date/hour and it goes to the last down ,instead up where it would be !???... 🙄

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

honkytonkman Senior · 252 posts #18

QUOTE (opticalpigion @ Nov 29 2008, 05:12 PM) <{POST_SNAPBACK}>

post your chat.php

it will be more betterrr

CODE

<?php header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); //header('Content-type: application/vnd.wap.xhtml+xml'); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";

echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; ?>

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/> <meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/> </head> <?php

include("config.php"); include("core.php"); connectdb(); $action=$_GET["action"]; $id=$_GET["id"]; $sid = $_GET["sid"]; $rid=$_GET["rid"]; $rpw=$_GET["rpw"]; $uid = getuid_sid($sid); $uexist = isuser($uid); $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));

if((islogged($sid)==false)||!$uexist) { echo "<head>"; echo "<title>chat</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/white_medium.css">"; echo "</head>"; echo "<body>"; echo "";

  echo "<a href=\"index.php\">Login</a>";
  echo "";
  echo "</html>";
  echo "</body>";
  exit();
}

if(isbanned($uid)) { echo "<head>"; echo "<title>ErrorE!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; echo "<img src="../images/notok.gif" alt="x"/> "; echo "BANNING

"; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "TEMPO RIMANENTE:$rmsg "; $nick = getnick_uid($banto[2]); echo "BANN EFFETTUATO DA :$nick "; echo "MOTIVO:$banto[1]"; //echo "<a href="index.php">Login</a>";

  echo "

"; echo "</body>"; echo "</html>"; exit(); } $isroom = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE id='".$rid."'")); if($isroom[0]==0) { echo "<head>"; echo "<title>ErrorE!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo ""; echo "STANZA INESISTENTE..forse c'é a hiwap3 o a live..ehm..

"; echo "<a href="index.php?action=chat&sid=$sid">Chatrooms</a>"; ?>

PEOPLE 2000 COMMUNITY

<? echo ""; echo "</body>"; echo "</html>"; exit(); } $passworded = mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_rooms WHERE id='".$rid."'")); if($passworded[0]!="") { if($rpw!=$passworded[0]) { echo "<head>"; echo "<title>Errore!!!</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo ""; echo "**CHIAVE ERRATA!** "; echo "accesso negato..CONTATTA INBOX IL CREATORE DELLA STANZA "; echo "<a href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a>"; echo ""; echo "</body>"; echo "</html>"; exit(); } } if(!canenter($rid,$sid)) { echo "<head>"; echo "<title>ErrorE!!!</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo ""; echo "**ACCESSO NEGATO!** "; echo "<a href=\"index.php?action=chat&amp;sid=$sid\">Chatrooms</a>"; echo ""; echo "</body>"; echo "</html>"; exit(); } addtochat($uid, $rid); $timeto = 300; $timenw = time(); $timeout = $timenw-$timeto; $deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout.""); $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; $nick = getnick_sid($sid); if ($action=="") { echo "<head>"; echo "<title>$nick@$rname</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; $unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups WHERE unread='1' AND touid='".$uid."'")); if ($unreadpopup[0]<1) { echo "<meta http-equiv=\"refresh\" content=\"39; url=chat.php?time="; echo "".date("dmHis").""; echo "&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">"; } echo "</head>"; echo "<body>"; addonline($uid,"Chating in $rname","chat.php?rid=$rid&amp;rpw=$rpw"); //echo " "; echo popup($sid); echo "<img src=\"../images/CHATROOM.gif\" alt=\"\"/> "; echo "".date("H:i")." - ".date("j-m-Y").""; echo "<a name=\"top\" id=\"top\" accesskey=\"1\" href=\"chat.php?action=say&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">[SCRIVI]</a> "; echo "<a accesskey=\"2\" href=\"#opt\">[opzioni]</a> "; echo "<a accesskey=\"*\" href=\"chat.php?time="; echo "".date("dmHis").""; echo "&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">RefresH</a> "; $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'")); $unrd="".$unreadinbox[0].""; if ($unreadinbox[0]>0) { echo "**-->**<a href=\"inbox.php?action=main&amp;sid=$sid&amp;lstloc=cht&amp;rid=$rid\">$unrd NUOVO/I Inbox!</a> "; } //echo " "; //echo " "; $message=$_POST["message"]; $who = $_POST["who"]; $rinfo = mysql_fetch_array(mysql_query("SELECT censord, freaky FROM ibwf_rooms WHERE id='".$rid."'")); if (trim($message) != "") { if(!isblocked($message,$uid)) { $chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';"); $lstmsg = mysql_query("UPDATE ibwf_rooms SET lastmsg='".time()."' WHERE id='".$rid."'"); $hehe=mysql_fetch_array(mysql_query("SELECT chmsgs FROM ibwf_users WHERE id='".$uid."'")); $totl = $hehe[0]+1; $msgst= mysql_query("UPDATE ibwf_users SET chmsgs='".$totl."' WHERE id='".$uid."'"); }else{ $bantime = time() + (30*24*60*60); //echo "<img src=\"../images/notok.gif\" alt=\"X\"/>"; //echo "Can't Post Msg "; //echo "You just tried sending a msg with a link to one of the crapiest sites on earth The members of these sites spam here a lot, so go to that site and stay there if you don't like it here as a result of your stupid action: 1. you have lost your sheild 2. you have lost all your plusses 3. You are BANNED!"; $user = getnick_sid($sid); mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='**".getnick_uid(1)."** auto banned $user for spamming chat', actdt='".time()."'"); mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='1', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'"); mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'"); echo "</body>"; echo "</html>"; exit(); } if($rinfo[1]==2) { //oh damn i gotta post this message to ravebabe 🙁 //will it succeed? $botid = "eeb070e74e366473"; $hostname = "www.pandorabots.com"; $hostpath = "/pandora/talk-xml"; $sendData = "botid=".$botid."&input=".urlencode($message)."&custid=".$custid; $result = PostToHost($hostname, $hostpath, $sendData); $pos = strpos($result, "custid=\""); $pos = strpos($result, "<that>"); if ($pos === false) { $reply = ""; } else { $pos += 6; $endpos = strpos($result, "</that>", $pos); $reply = unhtmlspecialchars2(substr($result, $pos, $endpos - $pos)); $reply = mysql_escape_string($reply); } $chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='1', who='', timesent='".time()."', msgtext='".$reply." @".getnick_uid($uid)."', rid='".$rid."';"); } $message = ""; } echo " "; $chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC"); $counter=0; while($chat = mysql_fetch_array($chats)) { $canc = true; if($counter<40) { if(istrashed($chat[0])){ if($uid!=$chat[0]) { $canc = false; } } //////good /*if(isignored($chat[0],$uid)){ $canc = false; }*/ //////////good if($chat[0]!=$uid) { if($chat[1]!=0) { if($chat[1]!=$uid) { $canc = false; } } } if($chat[4]=='1' && ismod($uid)) { $canc = true; } if($canc) { $cmid = mysql_fetch_array(mysql_query("SELECT chmood 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."PVT INBOX A ".$chnick; } if($chat[1]==$uid) { ///out $iml = "<img src=\"../moods/in.gif\" alt=\"!\"/>"; $chnick = getnick_uid($chat[0]); $optlink = $iml."PVT INBOX DI ".$chnick; } if($chat[4]=='1') { ///out $iml = "<img src=\"../moods/point.gif\" alt=\"!\"/>"; $chnick = getnick_uid($chat[0]); $tonick = getnick_uid($chat[1]); $optlink = "$iml By ".$chnick." To ".$tonick; } $ds= date("H.i.s", $chat[2]); $text = parsepm($chat[3], $sid); $nos = substr_count($text,"![](#)8){ $chnick = getnick_uid($chat[0]); echo addchatmsg($chat[0],$text,1,"*MODERATORE ELETTRONICO..RISCHIO INTASAMENTO DA SMILEYS..USANE DI MENO!!!*"); }else{ $sres = substr($chat[3],0,3); if($sres == "/me") { $chco = strlen($chat[3]); $goto = $chco - 3; $rest = substr($chat[3],3,$goto); $tosay = parsepm($rest, $sid); echo addchatmsg($chat[0],$tosay,1,""); } else{ if($rinfo[0]==0){$tosay = getbbcode($chat[3], $sid, 0);} else{$tosay = parsepm($chat[3], $sid, 1);} if($rinfo[1]==1){$tosay = strrev($tosay);} echo "<a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$chat[0]&amp;rid=$rid&amp;rpw=$rpw\">$optlink</a> - "; echo $tosay." "; } } $counter++; } } } echo " "; echo "<a name=\"opt\" id=\"opt\"></a>"; echo "*****<a accesskey=\"*\" href=\"chat.php?time="; echo "".date("dmHis").""; echo "&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">RefresH</a> "; echo "<a href=\"chat.php?action=say&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">[SCRIVI]</a> "; echo "<a accesskey=\"3\" href=\"chat.php?action=options&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">[SETTAGGI]</a> "; $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'")); echo "<a accesskey=\"4\" href=\"chat.php?action=inside&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">ON LINE $chatters[0]</a> "; echo "<a accesskey=\"5\" href=\"inbox.php?action=main&amp;sid=$sid&amp;lstloc=cht&amp;rid=$rid\">PVT Inbox</a> "; echo "<a accesskey=\"6\" href=\"lists.php?action=buds&amp;sid=$sid\">AMICI</a> "; echo "<a accesskey=\"7\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a> "; echo forumlink($sid,8); echo "<a accesskey=\"9\" href=\"#top\">top</a> "; echo "<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\">Home</a>"; echo "</body>"; } /////////////////////////////////////////////////////SAY else if ($action=="say") { echo "<head>"; echo "<title>SCRIVI </title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo " "; addonline($uid,"Writing Chat Msg",""); echo "<img src=\"../images/CHATROOM2.gif\" alt=\"\"/> "; echo "".date("H:i")." - ".date("j-m-Y").""; echo "<form action=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">"; echo " MESSAGGIO:<input name=\"message\" type=\"text\" maxlength=\"955\"/> "; echo "<input type=\"Submit\" Name=\"sy2\" value=\"OK\"></form> "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "<a accesskey=\"4\" href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">INDIETRO A $rname</a> "; echo "<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">PVT Inbox</a> "; echo "<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">AMICI</a> "; echo "<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a> "; echo forumlink($sid,9); echo "<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a> "; echo "</body>"; } //////////////////////////////////////////// /////////////////////////////////////////////////////SAY2 else if ($action=="say2") { echo "<head>"; echo "<title>MESSAGGERIA PRIVATA</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo " "; $unick = getnick_uid($who); echo "**MANDA PVT INBOX A $unick**"; echo " "; addonline($uid,"Writing Chat Msg",""); echo "<form action=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\" method=\"post\">"; echo "<input type=\"Hidden\" name=\"who\" value=\"$who\">"; echo " MESSAGGIO:<input name=\"message\" type=\"text\" maxlength=\"955\"/> "; echo "<input type=\"Submit\" name=\"private\" Value=\"OK\"></form>"; echo " "; if(ismod($uid)) { echo "<a accesskey=\"*\" href=\"chat.php?action=clear&amp;sid=$sid&amp;who=$who&amp;lstloc=cht&amp;rid=$rid\">PULISCI MESSAGGIO</a> "; } echo "<a accesskey=\"1\" href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who&amp;lstloc=cht&amp;rid=$rid\">VEDI PROFILO DI $unick</a> "; echo "<a accesskey=\"2\" href=\"chat.php?action=expose&amp;sid=$sid&amp;who=$who&amp;rid=$rid&amp;rpw=$rpw\">SEGNALA MESSAGGIO DI $unick</a> "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "<a accesskey=\"4\" href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">INDIETRO A $rname</a> "; echo "<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">PVT Inbox</a> "; echo "<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">AMICI</a> "; echo "<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a> "; echo forumlink($sid,9); echo "<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a> "; echo "</body>"; } /////////////////////////////////////////////////////CHAT OPTIONS else if ($action=="options") { echo "<head>"; echo "<title>CHAT (OPZIONI)</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; addonline($uid,"Chat Options",""); //echo "**1**<a accesskey=\"1\" href=\"lists.php?action=chmood&amp;sid=$sid&amp;page=1\">Chat Mood</a> "; echo "<a accesskey=\"2\" href=\"lists.php?action=smilies&amp;sid=$sid\">SmilEYS-LOGHI</a> "; echo "<a accesskey=\"3\" href=\"chat.php?action=inside&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">ON LINE</a> "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "<a accesskey=\"4\" href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">INDIETRO A $rname</a> "; echo "<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">PVT Inbox</a> "; echo "<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">AMICI</a> "; echo "<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a> "; echo forumlink($sid,9); echo "<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a> "; ?>

PEOPLE 2000 CHAT

<? echo "</body>"; } //////////////////////////////////////////// //////////////////////////////inside////////// else if ($action=="inside") { addonline($uid,"Viewing Chat UserList",""); echo "<head>"; echo "<title>ON LINE </title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo " "; $inside=mysql_query("SELECT DISTINCT * FROM ibwf_chonline WHERE rid='".$rid."' and uid IS NOT NULL"); while($ins=mysql_fetch_array($inside)) { $unick = getnick_uid($ins[1]); $userl = "<a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$ins[1]&amp;rid=$rid&amp;rpw=$rpw\">$unick</a> "; echo "$userl"; } echo " "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "<a accesskey=\"4\" href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">INDIETRO A $rname</a> "; echo "<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">PVT Inbox</a> "; echo "<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">AMICI</a> "; echo "<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a> "; echo forumlink($sid,9); echo "<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a> "; echo "</body>"; } else if ($action=="expose") { addonline($uid,"Exposing ChatUser",""); echo "<head>"; echo "<title>SEGNALA UTENTE</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo " "; mysql_query("UPDATE ibwf_chat SET exposed='1' WHERE chatter='".$who."' AND who='".$uid."'"); $unick = getnick_uid($who); echo "MESSAGGIO DI $unick SEGNALATO!!"; echo " "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "<a accesskey=\"4\" href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">Back To $rname</a> "; echo "<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">PVT Inbox</a> "; echo "<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">AMICI</a> "; echo "<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>LISTA STANZE</a> "; echo forumlink($sid,9); echo "<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a> "; echo "</body>"; } else if(($action=="clear")&&(ismod($uid))) { addonline($uid,"Chat Tools",""); echo "<head>"; echo "<title>PULISCI MESSAGGI</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo " "; $trgtnick=getnick_uid($who); $perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'")); $trgtperm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'")); if($trgtperm>$perm){ echo "**<img src=\"../images/notok.gif\" alt=\"x\"/> Error!!! PermESSO NEGATO..** "; echo " NON PUOI CANCELLARE MESSAGGI DI $trgtnick "; }else{ if(($who!="")||($who!=0)) { $res = mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."'"); if($res) { echo "MESSAGGI DI $trgtnick ELIMINATI!! "; }else{ echo "ERRORE "; } }else{ echo "UTENTE INESISTENTE "; } } echo " "; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; echo "<a accesskey=\"4\" href=\"chat.php?sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">INDIETRO A $rname</a> "; echo "<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">PVT Inbox</a> "; echo "<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">AMICI</a> "; echo "<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\"><img src=\"../images/chat.gif\" alt=\"\"/>LISTA STANZE</a> "; echo forumlink($sid,9); echo "<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a> " echo "</body>"; } ?> </html>

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

something else Fellow · 2,296 posts #19

oh shit the chat sql is in oreder of time sent ..... oops by adding the date it throws the order out lol

i think if you remove the order by timesent it should sort its self out eg: change:

 $chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC");

to

$chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM ibwf_chat WHERE rid='".$rid."' ORDER BY id DESC");

that should rectify the problem 🙂

honkytonkman Senior · 252 posts #20

QUOTE (inca @ Nov 29 2008, 06:04 PM) <{POST_SNAPBACK}>

oh shit the chat sql is in oreder of time sent ..... oops by adding the date it throws the order out lol

i think if you remove the order by timesent it should sort its self out eg: change:

 $chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM ibwf_chat WHERE rid='".$rid."' ORDER BY timesent DESC, id DESC");

to

$chats = mysql_query("SELECT chatter, who, timesent, msgtext, exposed FROM ibwf_chat WHERE rid='".$rid."' ORDER BY id DESC");

that should rectify the problem :)

yes, i rectify the right moving on text messages in room but i'm at the same starting point..hour/date don't appears on it. i think it's time to surrend..ain't no way to put hour/date on it. i think maybe could be more easy to put a nick "ENTER and LEAVING message" on rooms? somethin' like this: NICK enters in room at 12:07 NICK leaves the room at 13:09 someone can gimme a start point to work for this?

the italian/international COMMUNITY of friendship http://people2000.netne.net WAP/WEB peoplemailbox@katamail.com

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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