discourse-legacysite-perl/site/runshops/comments_validate.php
2024-06-17 22:42:14 +10:00

84 lines
2.8 KiB
PHP

<?PHP
include("config.php");
if(!is_admin()){
header('Location: '.$site_url);
exit();
}
// Query to fetch non-validated shops:
$results = mysql_query("SELECT * FROM ".$prefix."RunshopsComment WHERE comment_valid = 0 ORDER BY comment_time DESC") OR die(mysql_error());
// check to see if set is empty
$none = FALSE;
if (mysql_num_rows($results) == 0) { $none = TRUE; }
// set the page title
$pagetitle = "Admin: Comment Validation";
// set meta tags
$meta_keywords = "";
$meta_description = "";
?>
<? include("include_common_head.php"); ?>
<? include("include_common_content.php"); ?>
<!-- Start outer -->
<div id="outer">
<!-- BODY -->
<div class="content">
<!-- LEFT COLUMN -->
<!-- End left column -->
<!-- Content col -->
<h1 class="content-title"><strong>Unvalidated Comments</strong></h1>
<form method="post" action="comments_validate_X.php" enctype="multipart/form-data">
<div class="indent">
<?
if($none == TRUE){
echo "There are no comments waiting to be validated.";
}
?>
<table border="0" cellspacing="1" cellpadding="1" width="100%">
<?
$x = 0;
while($arrComments = mysql_fetch_array($results)){
$x++;
if($x % 2 == 0){ $bg = '#cecece'; }else{ $bg = '#ececec'; }
$arrCommenters = mysql_fetch_array(mysql_query("SELECT user_username FROM ".$prefix."User WHERE user_id = ".$arrComments[user_id_fk]." LIMIT 1"));
$arrRaces = mysql_fetch_array(mysql_query("SELECT runshop_name FROM ".$prefix."Runshops WHERE runshop_id = ".$arrComments[runshop_id_fk]." LIMIT 1"));
$commenter_user_username = $arrCommenters[user_username];
$runshop_name = $arrRaces[runshop_name];
?>
<tr bgcolor="<? echo "$bg"; ?>"><td><span class="sub-hdr" style="margin-left: 5px;"><strong><? echo $arrComments[comment_subject]; ?></strong></span><div class="indent">Reviewed by: <? echo "<a href=\"http://forum.slowtwitch.com/gforum.cgi?username=".$commenter_user_username.";\" target=\"_blank\">".$commenter_user_username."</a>"; echo " on ".date("F j, Y g:i A", $arrComments[comment_time]); echo " about <a href=\"".$site_url."/individual.php?runshop_id=".$arrComments[runshop_id_fk]."\">".$runshop_name."</a>";?></div><div class="indent" style="background-color: #eeeef9; border: 1px solid black; margin-top: 2px; margin-right: 5px; margin-bottom: 5px; padding: 5px; ">
<? echo stripslashes(stripslashes($arrComments[comment_message])); ?>
</div><div class="indent"><input type="checkbox" value="<? echo($arrComments[comment_id]); ?>" name="validate[]"> Validate this comment. <input type="checkbox" value="<? echo($arrComments[comment_id]); ?>" name="delete[]"> Delete this comment.<br /></div></td></tr>
<?
}
?>
</table>
<br />
<input type="submit" value="Process Selected Comments">
</div>
</form>
<!-- End content col -->
</div>
<!-- End BODY -->
</div>
<!-- End Outer -->
<? include("include_common_footer.php"); ?>