Chat system

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

    Chat system

    I have try this code..maybe something wrong and i need help

    in core.php

    PHP Code:
    function addtochat($uid$rid)
    {
    $bago mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
    if(
    $bago[0]==0){
    $msg "*mat Enter the Room";
    mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$rid."'");
    }

    $timeto 120;
    $timenw time();
    $timeout $timenw $timeto;
    $exec mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'");
    $res mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
    if(!
    $res)
    {
    mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
    }

    and chat.php

    PHP Code:
    if(isspam($text) || substr($chat[3],0,4)=="*mat")
    {
    $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));
    $chnick getnick_uid($chat[0]);
    if(
    isspam($text)){
    echo 
    "<b>Chat system:<i>*$chnick, please don't try to spam*</i></b><br/>";
    }else{
    echo 
    "<b>Chat system:<br/><i>$chnick joined room with ".getbr_uid($chat[0])."<br/>($chatters[0] user in this room)</i></b><br/>";
    }

    the problem is it become

    alex - *mat enter the room

    not

    Chat system - Alex enter the room.

    anybody can help me??

    #2
    Do it $who enter room or $nick

    Comment


      #3
      Originally posted by manavworld View Post
      Do it $who enter room or $nick
      still didnt work my fren..

      Comment


        #4
        $msg = "*mat Enter the Room";
        to
        $msg = "Enter the Room";

        Comment


          #5
          Originally posted by amylee View Post
          $msg = "*mat Enter the Room";
          to
          $msg = "Enter the Room";
          it became

          Alex - Enter the room

          actually it should be like this

          Chat system : Alex enter the room

          Comment


            #6
            try this


            chat.php

            PHP Code:
            if(isspam($text) || substr($chat[3],0,3)=="*mat")
            {
            $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));
            $chnick getnick_uid($chat[0]);
            if(
            isspam($text)){
            echo 
            "<b>Chat system:<i>*$chnick, please don't try to spam*</i></b><br/>";
            }else{
            echo 
            "<b>Chat system:<br/><i>$chnick joined room with ".getbr_uid($chat[0])."<br/>($chatters[0] user in this room)</i></b><br/>";
            }

            Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

            Comment


              #7
              maybe i have what you'r lookin'for..
              on chat.php put this:
              Code:
                $newtime = date("H:i,$roomtime");
              then before
              addtochat($uid, $rid);
              put this code:
              Code:
              mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='0', timesent='".time()."', msgtext='".$newtime." enter in chat!', rid='".$rid."', exposed='0' ");
              sigpicthe italian/international COMMUNITY of friendship
              http://people2000.netne.net
              WAP/WEB
              peoplemailbox@katamail.com

              Comment


                #8
                Originally posted by ksg91 View Post
                try this


                chat.php

                PHP Code:
                if(isspam($text) || substr($chat[3],0,3)=="*mat")
                {
                $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline where rid='".$rid."'"));
                $chnick getnick_uid($chat[0]);
                if(
                isspam($text)){
                echo 
                "<b>Chat system:<i>*$chnick, please don't try to spam*</i></b><br/>";
                }else{
                echo 
                "<b>Chat system:<br/><i>$chnick joined room with ".getbr_uid($chat[0])."<br/>($chatters[0] user in this room)</i></b><br/>";
                }

                not working

                Comment


                  #9
                  Originally posted by honkytonkman View Post
                  maybe i have what you'r lookin'for..
                  on chat.php put this:
                  Code:
                    $newtime = date("H:i,$roomtime");
                  then before
                  addtochat($uid, $rid);
                  put this code:
                  Code:
                  mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='0', timesent='".time()."', msgtext='".$newtime." enter in chat!', rid='".$rid."', exposed='0' ");
                  not working

                  Comment


                    #10
                    Originally posted by JoEsaR View Post
                    not working
                    sorry i lost part of the code..
                    before
                    addtochat($uid, $rid);
                    put this:
                    Code:
                    $ENTRA = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."' "));
                    if ($ENTRA[0] == "0")
                    { $name = getnick_sid($sid);
                    
                    mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='0', timesent='".time()."', msgtext='".$newtime." enters in chat!', rid='".$rid."', exposed='0' ");
                    sigpicthe italian/international COMMUNITY of friendship
                    http://people2000.netne.net
                    WAP/WEB
                    peoplemailbox@katamail.com

                    Comment


                      #11
                      sorry frend.. i lost part of the code..
                      before
                      addtochat($uid, $rid);

                      put this:
                      Code:
                      $ENTRA = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."' "));
                      if ($ENTRA[0] == "0")
                      { $name = getnick_sid($sid);
                      
                      mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='0', timesent='".time()."', msgtext='".$newtime." enters in chat!', rid='".$rid."', exposed='0' ");
                      i use it on my xhtml wapdesire/lava and works fine
                      sigpicthe italian/international COMMUNITY of friendship
                      http://people2000.netne.net
                      WAP/WEB
                      peoplemailbox@katamail.com

                      Comment


                        #12
                        Originally posted by honkytonkman View Post
                        sorry frend.. i lost part of the code..
                        before
                        addtochat($uid, $rid);

                        put this:
                        Code:
                        $ENTRA = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."' "));
                        if ($ENTRA[0] == "0")
                        { $name = getnick_sid($sid);
                        
                        mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='0', timesent='".time()."', msgtext='".$newtime." enters in chat!', rid='".$rid."', exposed='0' ");
                        i use it on my xhtml wapdesire/lava and works fine
                        put it before addtochat($uid, $rid); ??

                        this is my addtochat($uid, $rid); ??

                        PHP Code:
                        function addtochat($uid$rid)
                        {
                        $bago mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chatonline WHERE uid='".$uid."' AND rid='".$rid."'"));
                        if(
                        $bago[0]==0){
                        $msg "*mat Enter the Room";
                        mysql_query("INSERT INTO chat SET timesent='".time()."', uid='".$uid."', text='".$msg."', rid='".$rid."'");
                        }

                        $timeto 120;
                        $timenw time();
                        $timeout $timenw $timeto;
                        $exec mysql_query("DELETE FROM chatonline WHERE lton<'".$timeout."'");
                        $res mysql_query("INSERT INTO chatonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
                        if(!
                        $res)
                        {
                        mysql_query("UPDATE chatonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
                        }

                        dou mean like this??

                        PHP Code:
                        $ENTRA mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chatonline WHERE uid='".$uid."' AND rid='".$rid."' "));
                        if (
                        $ENTRA[0] == "0")
                        $name getnick_sid($sid);

                        mysql_query("INSERT INTO chat SET uid='".$uid."', who='0', timesent='".time()."', text='".$newtime." enters in chat!', rid='".$rid."', exposed='0' ");

                        function 
                        addtochat($uid$rid)
                        {
                        $bago mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chatonline WHERE uid='".$uid."' AND rid='".$rid."'"));
                        if(
                        $bago[0]==0){
                        $msg "*mat Enter the Room";
                        mysql_query("INSERT INTO chat SET timesent='".time()."', uid='".$uid."', text='".$msg."', rid='".$rid."'");
                        }

                        $timeto 120;
                        $timenw time();
                        $timeout $timenw $timeto;
                        $exec mysql_query("DELETE FROM chatonline WHERE lton<'".$timeout."'");
                        $res mysql_query("INSERT INTO chatonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
                        if(!
                        $res)
                        {
                        mysql_query("UPDATE chatonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
                        }

                        Comment


                          #13
                          yes you must put the codes i given to you before the code
                          function addtochat($uid, $rid)
                          sigpicthe italian/international COMMUNITY of friendship
                          http://people2000.netne.net
                          WAP/WEB
                          peoplemailbox@katamail.com

                          Comment


                            #14
                            Originally posted by honkytonkman View Post
                            yes you must put the codes i given to you before the code
                            function addtochat($uid, )
                            its imposible to put it before
                            PHP Code:
                            addtochat$uid$rid); 

                            Comment


                              #15
                              Originally posted by JoEsaR View Post
                              not working
                              well logically it shoud work. post complete code of chat.php bcoz i dont know what your $chat array cosist of
                              Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

                              Comment

                              Working...
                              X