Delete messages in room

Started on the old forum in December 2010 · view the original in the archive · old links redirect here

3 replies · 392 views · started 15 years ago · 1 min read

3 participants
Leviathan73 Senior · 260 posts #1

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 🙂

srecnica Developer · 174 posts #2

attempt this, to my chat script lavalair forum is this code and works beautifully in chat.php add this

$idposta = $chat["id"];        
 if(ismod(getuid_sid($sid)))
   {

  $del= "[<a href=\"genproc.php?action=delp&sid=$sid&pid=$idposta\">X</a>]";

   }
                  echo "<b>[$ds]</b><a href=\"chat.php?action=say2&sid=$sid&who=$chatter&rid=$rid&rpw=$rpw\">$optlink</a>» $tosay $del<br/><br/>";

in genproc.php add this

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&rid=$room[0]\">$room[1]($noi[0])</a><br/>";
          }
          
        }

  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
echo "HAPPY</a>";

  echo "</p></card>";
}
leadiztah Developer · 55 posts #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 😊

Leviathan73 Senior · 260 posts #4

leadiztah, does not work, I also deleted my other posts the same in the other rooms! I the quote here ...

$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?

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