Clear shoutbox 2

Started on the old forum in May 2011 · view the original in the archive · old links redirect here

8 replies · 766 views · started 15 years ago · 1 min read

2 participants
Leviathan73 Senior · 260 posts #1

Hello why do not you delete the text message?

///////////////////////////////////////Delete chat shoutbox 2
else if($action=="delsh")
{
  $shid = $_GET["shid"];
echo "<meta http-equiv=Refresh content=0;url=index.php?action=uchat&sid=$sid>";
 echo "<head>";
      echo "<title>Admin Tools</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
  echo "<p align=\"center\">";
  $sht = mysql_fetch_array(mysql_query("SELECT shouter, shout FROM ibwf_shouts2 WHERE id='".$shid."'"));
  $msg = getnick_uid($sht[0]);
  $msg .= ": ".htmlspecialchars((strlen($sht[1])<20?$sht[1]:substr($sht[1], 0, 20)));
  $res = mysql_query("DELETE FROM ibwf_shouts2 WHERE id ='".$shid."'");
  if($res)
          {
    mysql_query("INSERT INTO ibwf_mlog SET action='shouts2', details='<b>".getnick_uid(getuid_sid($sid))."</b> Cancella lo shout <b>".$shid."</b> - $msg', actdt='".(time() - $timeadjust)."'");
            echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Shout cancellato";
          }else{
            echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Database Error";
          }
  echo "<br/><br/>";
something else Fellow · 2,296 posts #2

Try adding this on your page and you might find your answer

echo '<b>Debug: Shout id: '.$shid.'</b>';
Leviathan73 Senior · 260 posts #3

sorry but I have to put in what page? put it in 3 pages but does not work

something else Fellow · 2,296 posts #4

if it doesnt work there is your answer $shid is not set so you need to look at the page with the delete link on it to find out why $shid is not set

Leviathan73 Senior · 260 posts #5

list.php

//////////////////////////////////chat shouts 2
else if($action=="shouts2")
{
    addonline(getuid_sid($sid),"è nel chat shout","");
    echo "<head>";
    echo "<title>Chat ShoutBox</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
    echo "</head>";
    echo "<body>";
    echo "<p align=\"center\">";
    $who = $_GET["who"];
    //////ALL LISTS SCRIPT <<
    if($page=="" || $page<=0)$page=1;
    if($who=="")
    {
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts2"));
    }else{
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts2 WHERE shouter='".$who."'"));
    }
    $num_items = $noi[0]; //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;
    //changable sql
    if($who =="")
    {
        $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts2 ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}else{
    $sql = "SELECT id, shout, shouter, shtime  FROM ibwf_shouts2  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";
}
    echo "<p><small>";
    $items = mysql_query($sql);
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
    {
        $shnick = getnick_uid($item[2]);
        $sht = htmlspecialchars($item[1]);
        $shdt = date("d m y-H:i", $item[3]);
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$shnick</a>: $sht<br/>$shdt";
      if(ismod(getuid_sid($sid)))
      {
      $dlsh = "<a href=\"modproc.php?action=delsh&sid=$sid&shid=$item[0]\">[x]</a>";
      }else{
        $dlsh = "";
      }
      echo "$lnk $dlsh<br/>";
 
    }
    }
something else Fellow · 2,296 posts #6

have you got 2 actions for delsh in modproc.php ? ... as delsh in lava is to delete normal shoutbox

Leviathan73 Senior · 260 posts #7

somethingelse exact, I have 2 Action delsh. But I can not erase that of normal Shout, because the result is that you delete the message in the shoutbox 2, but the message in the shoutbox normal, not canceled. You have to find a solution, so that you can erase all 2 Shout

something else Fellow · 2,296 posts #8

just have

if($action=="delsh2")

on your modproc for your new delete shout and replace the link on your lists.php eg:

$dlsh = "<a href=\"modproc.php?action=delsh2&sid=$sid&shid=$item[0]\">[x]</a>";

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