Location: PHPKode > scripts > Net Shoubox > net-shoubox/admin_show.php
<?php
session_start();
if (session_is_registered("nettag")){
//////
//
// Net Shout
//
// www.php-net.net/
//
/////
echo '<link href="./shout.css" rel="stylesheet" type="text/css">';
require_once "net_config.php";
echo $_links_admin;

if ($_GET['action']=="delete_all_shout"){
$sql=mysql_query("DELETE FROM net_shout ");
}

if ($_GET['action']=="delete_shout"){
$sql=mysql_query("DELETE FROM net_shout WHERE shoutID ='$_GET[aid]'");
}
if ($_GET['action']=="ban_ip"){
$sql=mysql_query("insert into net_ban (ip,date) values ('$_GET[ip]',now())");
echo "ip banned";
}

if ($_GET['action']=="ban_nick"){

$sql=mysql_query("insert into net_ban_nick (nick,date) values ('$_GET[nick]',now())");
echo "Name Banned banned";
}

if ($_GET['action']=="edit_shout"){

if(isset($_POST['shout'])){

$_POST['message'] = substr($_POST['message'], 0, 210);

$_POST['name'] = trim($_POST['name']);
$_POST['message'] = trim($_POST['message']);
$_POST['name'] = addslashes($_POST['name']);
$_POST['message'] = addslashes($_POST['message']);

$sql ="update net_shout set shoutName='$_POST[name]',shoutMessage='$_POST[message]' where shoutID='$_POST[id]'";
mysql_query($sql);
echo "Tag Update";
}
$qset = "select * from net_shout WHERE shoutID ='$_GET[aid]' ";
$rset = mysql_query($qset) or die(mysql_error());
$aset = mysql_fetch_array($rset);
echo"<form method=\"post\" name=\"shoutform\"><script language=\"Javascript\">
function MPsmiley(smiley){
document.shoutform.message.value += \" \"+smiley+\" \";
document.shoutform.message.focus();
}</script>
<table width=\"160\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"000000\">
<tr> 
<td bordercolor=\" $color1\" bgcolor=\"$color1\"></td>
</tr>
<tr> 
<td bordercolor=\"$color2\" bgcolor=\"$color2\">Name:<br />
<input name=\"name\" type=\"text\" id=\"name\" size=\"20\" maxlength=\"20\" value=\"$aset[shoutName]\"><br />
Shout:<br />
<TEXTAREA NAME=\"message\" id=\"message\" ROWS=\"5\" COLS=\"17\" maxlength=\"150\">$aset[shoutMessage]</TEXTAREA><br />
<INPUT TYPE=\"hidden\" name=\"id\" value=\"$_GET[aid]\" /><input name=\"shout\" type=\"submit\" id=\"shout\" value=\"Shout!\" /></td>
</tr>
<tr> 
<td bordercolor=\"$color2\" bgcolor=\"$color2\">
<a href=\"javascript:MPsmiley(':)')\" title=':)'><img src='http://php-net.net/images/smiles/icon_smile.gif' border='0'></a> 
<a href=\"javascript:MPsmiley(':D')\" title=':D'><img src='http://php-net.net/images/smiles/icon_bigsmile.gif' border='0'></a> 
<a href=\"javascript:MPsmiley('8D')\" title='8D'><img src='http://php-net.net/images/smiles/icon_cool.gif' border='0'></a> 
<a href=\"javascript:MPsmiley(':(!')\" title=':(!'><img src='http://php-net.net/images/smiles/icon_angry.gif' border='0'></a> 
<a href=\"javascript:MPsmiley(':(')\" title=':('><img src='http://php-net.net/images/smiles/icon_frown.gif' border='0'></a> 
<a href=\"javascript:MPsmiley(':P')\" title=':P'><img src='http://php-net.net/images/smiles/icon_tongue.gif' border='0'></a> 
<a href=\"javascript:MPsmiley(';)')\" title=';)'><img src='http://php-net.net/images/smiles/icon_wink.gif' border='0'></a></td>
</tr>
<tr>
<td bordercolor=\"$color3\" bgcolor=\"$color3\"></td>
</tr>
</table>
</form>";
}
$showquery = mysql_query("SELECT * FROM net_shout ORDER BY shoutID DESC");
while($row = mysql_fetch_array($showquery)){
$message = wordwrap( $row['shoutMessage'], 17, "<br />", 1);
$row['shoutName'] = wordwrap( $row['shoutName'], 10, "\n", 1);
$message = str_replace(":)","<img src='http://php-net.net/images/smiles/icon_smile.gif' border='0' />",$message);
$message = str_replace(":D","<img src='http://php-net.net/images/smiles/icon_bigsmile.gif' border='0' />",$message);
$message = str_replace("8D","<img src='http://php-net.net/images/smiles/icon_cool.gif' border='0' />",$message);
$message = str_replace(":(!","<img src='http://php-net.net/images/smiles/icon_angry.gif' border='0' />",$message);
$message = str_replace(":(","<img src='http://php-net.net/images/smiles/icon_frown.gif' border='0' />",$message);
$message = str_replace(":P","<img src='http://php-net.net/images/smiles/icon_tongue.gif' border='0' />",$message);
$message = str_replace(";)","<img src='http://php-net.net/images/smiles/icon_wink.gif' border='0' />",$message);
$background ="#215478"; 
echo("<tr bgcolor=\"000000\">\n");
echo "<td title=\"Posted $row[shoutDate],$row[shoutTime], IP Logged\"><b>".$row['shoutName']."</b><br />
</td>";
echo $message."<br />
<a href='?action=edit_shout&aid=$row[shoutID]'>edit</a> || <a href='?action=delete_shout&aid=$row[shoutID]'>delete</a> || <a href='?action=ban_ip&ip=$row[ip]'>Ban IP $row[ip]</a> || <a href='?action=ban_nick&nick=$row[shoutName]'>Ban Name $row[shoutName]</a><br />
";
echo "</tr>";
}
echo "</span>";
mysql_close($db);

} else {
echo <<<EOT
<html>
<head>
<title></title>
</head>
<body>
<br /><p align="center">
ACCESS DENIED!!!!!!!!!!!<br />
<a href="login.php"><b>-- LOGIN HERE --</b></a></p>
<br />
</body>
</html>
<!-- //DO NOT REMOVE!!! -->
<span style="font-size:8pt;"><a href="http://php-net.net/">empowered by Net shout .5</a></span>
<!-- //END OF DO NOT REMOVE!!! -->
EOT;
}
?>
Return current item: Net Shoubox