Fifth pass at adding key files
This commit is contained in:
		
							
								
								
									
										35
									
								
								site/runshops/comments_validate_X.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								site/runshops/comments_validate_X.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
<?PHP 
 | 
			
		||||
 | 
			
		||||
include("config.php");
 | 
			
		||||
 | 
			
		||||
if ((!isset($_POST['delete']) && !isset($_POST['validate'])) || !is_admin()) {
 | 
			
		||||
	header('Location: '.$site_url);
 | 
			
		||||
	die("comment_validation_error");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if (isset($_POST['delete'])) {	
 | 
			
		||||
	// convert the array to a SQL friendly format
 | 
			
		||||
	$deleteList = "(".implode(",", $_POST['delete']).")";
 | 
			
		||||
	
 | 
			
		||||
	// build the SQL query to delete the edits that are bad
 | 
			
		||||
	$sql = "DELETE FROM ".$prefix."RunshopsComment WHERE comment_id IN $deleteList";
 | 
			
		||||
			  
 | 
			
		||||
	mysql_query($sql) or die(mysql_error());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if (isset($_POST['validate'])) {
 | 
			
		||||
	// convert the array to a SQL friendly format
 | 
			
		||||
	$comment_idlist = "(".implode(",", $_POST['validate']).")";
 | 
			
		||||
	
 | 
			
		||||
	// build the SQL query
 | 
			
		||||
	$sql = "UPDATE ".$prefix."RunshopsComment
 | 
			
		||||
			  SET comment_valid = 1
 | 
			
		||||
			  WHERE comment_id IN $comment_idlist;";
 | 
			
		||||
			  
 | 
			
		||||
	mysql_query($sql) or die(mysql_error());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
header('Location: '.$site_url.'/comments_validate.php');
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
		Reference in New Issue
	
	Block a user