Function Nick Enters Chatting

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

    Function Nick Enters Chatting

    hello everybody! the function nick of chatting I work, I would signal that by chatting, but when I do not write, and you refresh the page, I always send the same message. as the system is the problem?

    #2
    im guessing your saying eveytime the page refreshes and you dont say anything then it tells you ...you have entered chat. if so something like this should sort it out
    Code:
    $check = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_chonline WHERE uid='".$uid."', rid='".$rid."'"));
    if($check[0]!=$uid){
    ////////////then enters chat code
    }

    (make sure addtochat($uid, $rid) function is underneath this code tho)

    Comment


      #3
      <div class='quotetop'>QUOTE (something else @ Jan 24 2009, 03:21 PM) <{POST_SNAPBACK}></div>
      im guessing your saying eveytime the page refreshes and you dont say anything then it tells you ...you have entered chat. if so something like this should sort it out
      Code:
      $check = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_chonline WHERE uid=&#39;".$uid."&#39;, rid=&#39;".$rid."&#39;"));
      if($check[0]!=$uid){
      ////////////then enters chat code
      }

      (make sure addtochat($uid, $rid) function is underneath this code tho)[/b]
      ill try this lol

      Comment


        #4
        I do not understand! in which file I must add? core.php? or chat.php? and where?

        Comment


          #5
          in chat.php
          where your enter chat code is
          i cant see your script so cant tell you exactly where :P

          Comment


            #6
            Code:
            addtochat($uid, $rid);
                    $timeto = 86400;
                    $timenw = time();
                    $timeout = $timenw-$timeto;
                    $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id=&#39;".$rid."&#39;"));
                    $rname = $rooms[1];
                    $nick = getnick_sid($sid);
                    $check = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_chonline WHERE uid=&#39;".$uid."&#39;, rid=&#39;".$rid."&#39;"));
                    if($check[0]!=$uid);
                   
                  if ($action=="")
                  {
                  $me= getnick_uid($uid);    mysql_query("INSERT INTO ibwf_chat SET  chatter=&#39;1&#39;, who=&#39;".$who."&#39;, timesent=&#39;".time()."&#39;, msgtext=&#39;$me entered the JAKENPOY Chat room&#39;, rid=&#39;".$rid."&#39;");
                  mysql_query("INSERT INTO ibwf_chat SET timesent=&#39;".time()."&#39;, chatter=&#39;".$uid."&#39;, text=&#39;".$msg."&#39;");
            
                  echo "<head>";
                  echo "<title>$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=&#39;1&#39; AND touid=&#39;".$uid."&#39;"));
                  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\">";
            does not work! Once you refresh the page always repeated the same message

            Comment


              #7
              Enter what ? lmao

              Code:
               if ($action=="")
                    {
                    $me= getnick_uid($uid);    mysql_query("INSERT INTO ibwf_chat SET  chatter=&#39;1&#39;, who=&#39;".$who."&#39;, timesent=&#39;".time()."&#39;, msgtext=&#39;$me entered the JAKENPOY Chat room&#39;, rid=&#39;".$rid."&#39;");
                    mysql_query("INSERT INTO ibwf_chat SET timesent=&#39;".time()."&#39;, chatter=&#39;".$uid."&#39;, text=&#39;".$msg."&#39;");
              }
               if ($action=="nothing")
                    {
                    echo "<head>";
                    echo "<title>$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=&#39;1&#39; AND touid=&#39;".$uid."&#39;"));
                    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\">";

              make the script action=nothing
              Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
              Visit: WapMasterz Coming Back Soon!
              _______
              SCRIPTS FOR SALE BY SUBZERO
              Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
              FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
              _______
              Info & Tips
              php.net
              w3schools.com

              Comment


                #8
                I was blank page

                Comment


                  #9
                  i give up on ppl learning to code always not listen or dont do it right or

                  just add and didnt care
                  Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                  Visit: WapMasterz Coming Back Soon!
                  _______
                  SCRIPTS FOR SALE BY SUBZERO
                  Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                  FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                  _______
                  Info & Tips
                  php.net
                  w3schools.com

                  Comment


                    #10
                    Code:
                            $timeto = 86400;
                            $timenw = time();
                            $timeout = $timenw-$timeto;
                            $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id=&#39;".$rid."&#39;"));
                            $rname = $rooms[1];
                            $nick = getnick_sid($sid);
                       
                           
                          if ($action=="")
                          {
                         $check = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_chonline WHERE uid=&#39;".$uid."&#39;, rid=&#39;".$rid."&#39;"));
                            if($check[0]!=$uid){
                          $me= getnick_uid($uid);    mysql_query("INSERT INTO ibwf_chat SET  chatter=&#39;1&#39;, who=&#39;".$who."&#39;, timesent=&#39;".time()."&#39;, msgtext=&#39;$me entered the JAKENPOY Chat room&#39;, rid=&#39;".$rid."&#39;");
                          mysql_query("INSERT INTO ibwf_chat SET timesent=&#39;".time()."&#39;, chatter=&#39;".$uid."&#39;, text=&#39;".$msg."&#39;");
                    }
                    addtochat($uid, $rid);
                          echo "<head>";
                          echo "<title>$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=&#39;1&#39; AND touid=&#39;".$uid."&#39;"));
                          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\">";

                    Comment


                      #11
                      Always the same problem, when you refresh the page always check the same message .. enter in room

                      Comment


                        #12
                        did u move
                        addtochat($uid, $rid);
                        to where i have placed it ? in previous code?

                        Comment


                          #13
                          yes

                          Comment

                          Working...
                          X