Ciao a tutti, non capisco perchè non si riesce a cancellare il messaggio
Codice PHP:
///////////////////////////////////////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/>";
Codice 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/>";
}
}
eppure la funzione $shid sembra essere giusta.. grazie a chi mi aiuta.