diff --git a/classes/class_text.php b/classes/class_text.php index 030b6253..fce2fdf6 100644 --- a/classes/class_text.php +++ b/classes/class_text.php @@ -62,6 +62,12 @@ class TEXT { * @var int $InQuotes */ private $InQuotes = 0; + + /** + * Used to [hide] quote trains beyond the specified depth + * @var int $QuoteHideDepth + */ + private $QuoteHideDepth = 5; /** * Array of headlines for Table Of Contents (TOC) @@ -684,17 +690,24 @@ private function to_html ($Array) { case 'quote': $this->NoImg++; // No images inside quote tags $this->InQuotes++; + if($this->InQuotes == $this->QuoteHideDepth) { //Put quotes that are nested beyond the specified limit in [hide] tags. + $Str.='Older quotes: Show'; + $Str.='
'; // Ensure new line after quote train hiding + } $this->NoImg--; $this->InQuotes--; break; diff --git a/classes/class_tools.php b/classes/class_tools.php index 855e9c05..1f33e489 100644 --- a/classes/class_tools.php +++ b/classes/class_tools.php @@ -111,7 +111,7 @@ public static function lookup_ip($IP) { if(count($Output) != 5) { return false; } else { - return $Output[4]; + return trim($Output[4]); } } diff --git a/sections/forums/thread.php b/sections/forums/thread.php index e883eeeb..86ec5f2e 100644 --- a/sections/forums/thread.php +++ b/sections/forums/thread.php @@ -153,7 +153,6 @@ } */ -// Start printing View::show_header($ThreadInfo['Title'] . ' < '.$Forums[$ForumID]['Name'].' < '. 'Forums','comments,subscriptions,bbcode,jquery'); ?>
diff --git a/sections/reports/ajax_resolve_report.php b/sections/reports/ajax_resolve_report.php new file mode 100644 index 00000000..184e0d2a --- /dev/null +++ b/sections/reports/ajax_resolve_report.php @@ -0,0 +1,64 @@ +query("SELECT Type FROM reports WHERE ID = ".$ReportID); +list($Type) = $DB->next_record(); +if(!check_perms('admin_reports')) { + if(check_perms('site_moderate_forums')) { + if(!in_array($Type, array('collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment'))) { + ajax_error(); + } + } else if(check_perms('project_team')) { + if($Type != "request_update") { + ajax_error(); + } + } +} + +$DB->query("UPDATE reports + SET Status='Resolved', + ResolvedTime='".sqltime()."', + ResolverID='".$LoggedUser['ID']."' + WHERE ID='".db_string($ReportID)."'"); + + +$Channels = array(); + +if($Type == "request_update") { + $Channels[] = "#requestedits"; + $Cache->decrement('num_update_reports'); +} + +if(in_array($Type, array('collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment'))) { + $Channels[] = "#forumreports"; + $Cache->decrement('num_forum_reports'); +} + + +$DB->query("SELECT COUNT(ID) FROM reports WHERE Status = 'New'"); +list($Remaining) = $DB->next_record(); + +foreach($Channels as $Channel) { + send_irc("PRIVMSG ".$Channel." :Report ".$ReportID." resolved by ".preg_replace("/^(.{2})/", "$1ยท", $LoggedUser['Username'])." on site (".(int)$Remaining." remaining)."); +} + +$Cache->delete_value('num_other_reports'); + +ajax_success(); + +function ajax_error($Error = "error") { + echo json_encode(array("status"=>$Error)); + die(); +} + +function ajax_success() { + echo json_encode(array("status"=>"success")); + die(); +} +?> diff --git a/sections/reports/index.php b/sections/reports/index.php index 73a1e161..f9cb206a 100644 --- a/sections/reports/index.php +++ b/sections/reports/index.php @@ -33,6 +33,9 @@ case 'unclaim': include(SERVER_ROOT.'/sections/reports/ajax_unclaim_report.php'); break; + case 'resolve': + include(SERVER_ROOT.'/sections/reports/ajax_resolve_report.php'); + break; default: include(SERVER_ROOT.'/sections/reports/reports.php'); break; diff --git a/sections/reports/reports.php b/sections/reports/reports.php index 997aa96b..12bdd113 100644 --- a/sections/reports/reports.php +++ b/sections/reports/reports.php @@ -93,7 +93,7 @@ $Type = $Types[$Short]; $Reference = "reports.php?id=" . $ReportID . "#report" . $ReportID; ?> -
+
@@ -230,9 +230,8 @@
Report #
-
+ - )" name="submit" value="Resolve" />
diff --git a/sections/rules/upload.php b/sections/rules/upload.php index 223d1796..04823039 100644 --- a/sections/rules/upload.php +++ b/sections/rules/upload.php @@ -231,7 +231,7 @@
  • ↑_ 2.1.24. Lossy AAC torrents may only be uploaded when they represent exclusive content not currently available in any other format (e.g., an iTunes WEB exclusive release).
  • ↑_ 2.1.25. No HDCD content may be uploaded to the site. There are inherent problems with ripping this format, and other forms of high-resolution audio are both more prevalent and preferred at this time (e.g., vinyl, SACD, Blu-ray, etc.). Any CD bearing the HDCD logo can still be ripped using the usual methods for ripping normal audio CDs. See this wiki for more details on the media format.
  • -
  • ↑_ 2.1.26. Downsampling of digital sources is allowed for certain media types. Downsampling of CD sources is strictly prohibited. Downsampling of WEB sources is allowed for audio files sampled at 96 kHz and above. If the WEB source is already sampled at a rate of either 44.1 kHz or 48 kHz you may not downsample the audio files any further. Downsampling of SACD, DVD, or Blu-ray sources is allowed in certain cases. See 2.8.5, 2.7.3, and 2.9.5 for more information.
  • +
  • ↑_ 2.1.26. Downsampling of digital sources is allowed for certain media types. Downsampling of CD sources is strictly prohibited. Downsampling of WEB sources is allowed for audio files sampled at 88.2 kHz and above. If the WEB source is already sampled at a rate of either 44.1 kHz or 48 kHz you may not downsample the audio files any further. Downsampling of SACD, DVD, or Blu-ray sources is allowed in certain cases. See 2.8.5, 2.7.3, and 2.9.5 for more information.
  • 2.2. Duplicates & Trumping
    diff --git a/static/functions/reports.js b/static/functions/reports.js index 80e18e55..6ea5e4c3 100644 --- a/static/functions/reports.js +++ b/static/functions/reports.js @@ -45,14 +45,26 @@ function unClaim(id) { } function resolve(id, claimer) { + var answer = true; if (!claimer) { if ($('#claimed_' + id).raw()) { var answer = confirm("This is a claimed report, are you sure you want to resolve it?"); if (answer) - return true; + answer = true; else - return false; + answer = false; } } - return true; + if (answer) { + ajax.post('reports.php?action=resolve', 'report_form_' + id, function (response) { + var json = JSON.parse(response); + if (json['status'] == 'success') { + $('#report_' + id).remove(); + } else { + alert(json['status']); + } + } + ); + } + return false; }