Delete messages in room

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

    Delete messages in room

    Hello everyone, script lavalair, them on a problem in chat rooms, when I delete a message in the room of a user, you are also deleting all messages, that same user, in other rooms. I wish you clear only in the room that I want them deleted, but not in other rooms. Thanks to those who solves the problem :-)

    #2
    attempt this, to my chat script lavalair forum is this code and works beautifully
    in chat.php add this
    Code:
    $idposta = $chat["id"];        
     if(ismod(getuid_sid($sid)))
       {
    
      $del= "[<a href=\"genproc.php?action=delp&amp;sid=$sid&amp;pid=$idposta\">X</a>]";
    
       }
                      echo "<b>[$ds]</b><a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$chatter&amp;rid=$rid&amp;rpw=$rpw\">$optlink</a>&#187; $tosay $del<br/><br/>";
    in genproc.php add this
    Code:
    else if($action=="delp")
    {
     $pid = $_GET["pid"];
     $who = $_GET["who"];
    $rid = $_GET["rid"];
      addonline(getuid_sid($sid),"<b>Vlasnicki panel</b>","");
      echo "<card id=\"main\" title=\"$sitename\">";
      echo "<p align=\"center\">";
        
        $res = mysql_query("DELETE  FROM batica_chat WHERE id='".$pid."'");
        if($res)
            {
                echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Poruka je obrisana<br/>";
            }
      else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Nemoguce je obrisati poruku<br/>";
      }
      echo "<br/>";
          $rooms = mysql_query("SELECT id, name, perms, mage, chposts FROM batica_rooms WHERE static='1' AND clubid='0'");
            while ($room= mysql_fetch_array($rooms))
            {
              
              if(canenter($room[0], $sid))
              {
                $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM batica_chonline WHERE rid='".$room[0]."'"));
                echo "<a href=\"chat.php?sid=$sid&amp;rid=$room[0]\">$room[1]($noi[0])</a><br/>";
              }
              
            }
    
    
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
    echo "HAPPY</a>";
    
      echo "</p></card>";
    }
    Last edited by srecnica; 25.12.10, 17:28.
    sigpichttp://happy.srecnica.com/web

    Comment


      #3
      just make a query that depend on the ROOM ID? or RID..

      like

      mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."' and rid='".$rid."'");

      that's all

      Comment


        #4
        leadiztah, does not work, I also deleted my other posts the same in the other rooms! I the quote here ...
        PHP Code:
        $user getnick_sid($sid);
            
        mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>".getnick_uid(1)."</b> 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."'");
            
        mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."' and rid='".$rid."'");
            echo 
        "</body>";
            echo 
        "</html>";
            exit();
          }
                    if(
        $rinfo[1]==2)
                    {
                      
        //oh damn i gotta post this message to ravebabe :(
                      //will it succeed? 
        maybe I put something in the database?
        Last edited by Leviathan73; 26.12.10, 09:24.

        Comment

        Working...
        X