You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
anonnews2/public_html/module.moderation.process.php

43 lines
841 B
PHTML

13 years ago
<?php
if(!isset($_ANONNEWS)) { die(); } /* Protect from direct requests */
$sId = (is_numeric($var_subpage)) ? $var_subpage : 0;
switch($var_id)
{
case "external-news":
$sTable = "ext";
break;
case "press":
$sTable = "press";
break;
case "related-sites":
$sTable = "sites";
break;
default:
die();
}
if($var_last == "approve")
{
$visible = ($sTable == "ext") ? ", `Visible` = '1'" : "";
$query = "UPDATE {$sTable} SET `Approved` = '1'{$visible}, `Mod` = '{$_SESSION['userid']}' WHERE `Id` = '{$sId}'";
$message = "The item has been approved.";
}
elseif($var_last == "reject")
{
$query = "UPDATE {$sTable} SET `Deleted` = '1', `Mod` = '{$_SESSION['userid']}' WHERE `Id` = '{$sId}'";
$message = "The item has been rejected.";
}
if(!mysql_query($query))
{
echo("An error occurred.");
}
else
{
echo($message);
}
?>