Quellcode durchsuchen

make updateReport to support passing an array of ids as parameter

Signed-off-by: Suki <[email protected]>
Suki vor 11 Jahren
Ursprung
Commit
37ddc0df84
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 1 1
      Sources/ReportedPosts.php
  2. 3 3
      Sources/Subs-ReportedPosts.php

+ 1 - 1
Sources/ReportedPosts.php

@@ -378,6 +378,6 @@ function HandleReport()
 	updateReport($action, $value, $report_id);
 
 	// Done!
-	redirectexit($scripturl . '?action=moderate;area=reports;sa=details;rid=' . $report_id);
+	redirectexit($scripturl . '?action=moderate;area=reports');
 }
 ?>

+ 3 - 3
Sources/Subs-ReportedPosts.php

@@ -21,7 +21,7 @@ if (!defined('SMF'))
  *
  * @param string $action The action to perform. Accepts "closed" and "ignore".
  * @param integer $value The new value to update.
- * @params integer $report_id The affected report.
+ * @params integer|array $report_id The affected report.
  */
 function updateReport($action, $value, $report_id)
 {
@@ -38,8 +38,8 @@ function updateReport($action, $value, $report_id)
 	// Update the report...
 	$smcFunc['db_query']('', '
 		UPDATE {db_prefix}log_reported
-		SET  {text:action} = {int:value}
-		WHERE id_report = {int:id_report}
+		SET  {string:action} = {int:value}
+		'. (is_array($report_id) ? 'WHERE id_report IN ({array_int:report_list})' : 'WHERE id_report = {int:id_report}') .'
 			AND ' . $user_info['mod_cache']['bq'],
 		array(
 			'action' => $action,