diff --git a/classes/time.class.php b/classes/time.class.php index 3139bb54..46871e6c 100644 --- a/classes/time.class.php +++ b/classes/time.class.php @@ -16,11 +16,11 @@ function time_ago($TimeStamp) { return time() - $TimeStamp; } +/* + * Returns a by default but can optionally return the raw time + * difference in text (e.g. "16 hours and 28 minutes", "1 day, 18 hours"). + */ function time_diff($TimeStamp, $Levels = 2, $Span = true, $Lowercase = false) { - /* - Returns a by default but can optionally return the raw time - difference in text (e.g. "16 hours and 28 minutes", "1 day, 18 hours"). - */ if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp if ($TimeStamp == '0000-00-00 00:00:00') { return 'Never'; diff --git a/classes/users.class.php b/classes/users.class.php index d1d22007..66bbc491 100644 --- a/classes/users.class.php +++ b/classes/users.class.php @@ -630,19 +630,19 @@ public static function show_avatar($Avatar, $UserID, $Username, $Setting, $Size if (!empty($AvatarMouseOverText)) { $AvatarMouseOverText = "title=\"$AvatarMouseOverText\" alt=\"$AvatarMouseOverText\""; } else { - $AvatarMouseOverText = "alt=\"\""; + $AvatarMouseOverText = "alt=\"$Username's avatar\""; } if ($EnabledRewards['HasSecondAvatar'] && !empty($Rewards['SecondAvatar'])) { - $SecondAvatar = 'data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"'; + $SecondAvatar = ' data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"'; } // case 1 is avatars disabled switch ($Setting) { case 0: if (!empty($Avatar)) { - $ToReturn = ($ReturnHTML ? "" : $Avatar); + $ToReturn = ($ReturnHTML ? "" : $Avatar); } else { $URL = STATIC_SERVER.'common/avatars/default.png'; - $ToReturn = ($ReturnHTML ? "" : $URL); + $ToReturn = ($ReturnHTML ? "" : $URL); } break; case 2: @@ -683,14 +683,14 @@ public static function show_avatar($Avatar, $UserID, $Username, $Setting, $Size $URL = 'https://robohash.org/'.md5($Username)."?set=set$Type&size={$Size}x$Size"; } if ($ShowAvatar == true && !empty($Avatar)) { - $ToReturn = ($ReturnHTML ? "" : $Avatar); + $ToReturn = ($ReturnHTML ? "" : $Avatar); } else { - $ToReturn = ($ReturnHTML ? "" : $URL); + $ToReturn = ($ReturnHTML ? "" : $URL); } break; default: $URL = STATIC_SERVER.'common/avatars/default.png'; - $ToReturn = ($ReturnHTML ? "" : $URL); + $ToReturn = ($ReturnHTML ? "" : $URL); } return $ToReturn; } diff --git a/design/privatefooter.php b/design/privatefooter.php index 5338d013..22d5507a 100644 --- a/design/privatefooter.php +++ b/design/privatefooter.php @@ -31,7 +31,7 @@ Time: ms Used: Load: - Date: + Date: ,

diff --git a/design/privateheader.php b/design/privateheader.php index 5ac1eb28..1a1cb1dc 100644 --- a/design/privateheader.php +++ b/design/privateheader.php @@ -377,9 +377,9 @@ // Inbox if ($NotificationsManager->is_traditional(NotificationsManager::INBOX)) { $NotificationsManager->load_inbox(); - $NewMessages = $NotificationsManager->get_notifications()[NotificationsManager::INBOX]; - if (isset($NewMessages)) { - $Alerts[] = NotificationsManagerView::format_traditional($NewMessages); + $NewMessages = $NotificationsManager->get_notifications(); + if (isset($NewMessages[NotificationsManager::INBOX])) { + $Alerts[] = NotificationsManagerView::format_traditional($NewMessages[NotificationsManager::INBOX]); } $NotificationsManager->clear_notifications_array(); } @@ -393,9 +393,9 @@ // Torrents if ($NotificationsManager->is_traditional(NotificationsManager::TORRENTS)) { $NotificationsManager->load_torrent_notifications(); - $NewTorrents = $NotificationsManager->get_notifications()[NotificationsManager::TORRENTS]; - if (isset($NewTorrents)) { - $Alerts[] = NotificationsManagerView::format_traditional($NewTorrents); + $NewTorrents = $NotificationsManager->get_notifications(); + if (isset($NewTorrents[NotificationsManager::TORRENTS])) { + $Alerts[] = NotificationsManagerView::format_traditional($NewTorrents[NotificationsManager::TORRENTS]); } $NotificationsManager->clear_notifications_array(); } diff --git a/design/views/generic/reply/quickreply.php b/design/views/generic/reply/quickreply.php index 600784cd..655fada3 100644 --- a/design/views/generic/reply/quickreply.php +++ b/design/views/generic/reply/quickreply.php @@ -94,11 +94,11 @@ - + - + - +
@@ -106,7 +106,7 @@ -
onsubmit="quickpostform.submit_button.disabled=true;" > + onsubmit="quickpostform.submit_button.disabled = true;"> @@ -118,7 +118,8 @@
+ if (isset($SubscribeBox) && !isset($ForumID) && Subscriptions::has_subscribed_comments($Document, $InputID) === false) { +?> tabindex="2" /> + if (!Subscriptions::has_subscribed($InputID)) { +?> tabindex="2" /> - - - + + diff --git a/gazelle.sql b/gazelle.sql index c6689034..688e80dc 100644 --- a/gazelle.sql +++ b/gazelle.sql @@ -770,14 +770,6 @@ CREATE TABLE `requests_votes` ( KEY `Bounty` (`Bounty`) ) ENGINE=InnoDB CHARSET utf8; -CREATE TABLE `sacrifice` ( - `UserID` int(10) NOT NULL, - `Time` datetime NOT NULL, - `Sacrifice1` text NOT NULL, - `Sacrifice2` text NOT NULL, - `IsValid` tinyint(4) NOT NULL -) ENGINE=InnoDB CHARSET utf8; - CREATE TABLE `schedule` ( `NextHour` int(2) NOT NULL DEFAULT '0', `NextDay` int(2) NOT NULL DEFAULT '0', diff --git a/sections/collages/all_comments.php b/sections/collages/all_comments.php index 1d71ff8f..5d6c2530 100644 --- a/sections/collages/all_comments.php +++ b/sections/collages/all_comments.php @@ -37,7 +37,7 @@ - +
For user: />
- +
@@ -448,7 +435,9 @@ Description - full_format($Request['Description']);?> + +full_format($Request['Description']);?> + 'pageid', - 'InputID' => $RequestID, - 'Action' => 'comments.php?page=requests', - 'InputAction' => 'take_post', - 'SubscribeBox' => true - )); +View::parse('generic/reply/quickreply.php', array( + 'InputName' => 'pageid', + 'InputID' => $RequestID, + 'Action' => 'comments.php?page=requests', + 'InputAction' => 'take_post', + 'SubscribeBox' => true +)); ?>
diff --git a/sections/tools/managers/dnu_alter.php b/sections/tools/managers/dnu_alter.php index c55a0bbf..5fbfd5bc 100644 --- a/sections/tools/managers/dnu_alter.php +++ b/sections/tools/managers/dnu_alter.php @@ -6,11 +6,14 @@ authorize(); if ($_POST['submit'] == 'Reorder') { // Reorder - foreach ($_POST['item'] as $Position => $Item) { - $Position = db_string($Position); - $Item = db_string($Item); - $DB->query('UPDATE `do_not_upload` SET `Sequence` = ' . $Position . ' WHERE `id` = '. $Item); - } + foreach ($_POST['item'] as $Position => $Item) { + $Position = db_string($Position); + $Item = db_string($Item); + $DB->query(' + UPDATE `do_not_upload` + SET `Sequence` = ' . $Position . ' + WHERE `id` = '. $Item); + } } elseif ($_POST['submit'] == 'Delete') { //Delete if (!is_number($_POST['id']) || $_POST['id'] == '') { @@ -20,7 +23,7 @@ DELETE FROM do_not_upload WHERE ID = '.$_POST['id']); } else { //Edit & Create, Shared Validation - $Val->SetFields('name', '1', 'string', 'The name must be set, has a maximum length of 100 characters, and has a minimum length of 5 characters.', array('maxlength' => 100, 'minlength' => 5)); + $Val->SetFields('name', '1', 'string', 'The name must be set, have a maximum length of 100 characters, and have a minimum length of 5 characters.', array('maxlength' => 100, 'minlength' => 5)); $Val->SetFields('comment', '0', 'string', 'The description has a maximum length of 255 characters.', array('maxlength' => 255)); $Err = $Val->ValidateForm($_POST); // Validate the form if ($Err) { diff --git a/sections/torrents/details.php b/sections/torrents/details.php index 7289c4a3..1ff660da 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -558,25 +558,41 @@ function filelist($Str) { $Reports = $Cache->get_value("reports_torrent_$TorrentID"); if ($Reports === false) { $DB->query(" - SELECT r.ID, + SELECT + r.ID, r.ReporterID, r.Type, r.UserComment, r.ReportedTime FROM reportsv2 AS r WHERE TorrentID = $TorrentID - AND Type != 'edited' AND Status != 'Resolved'"); $Reports = $DB->to_array(); $Cache->cache_value("reports_torrent_$TorrentID", $Reports, 0); } - if (count($Reports) > 0) { + + // used to see if we have any non-"edited log" reports to display + $NumNonEditedLogReports = 0; + + foreach ($Reports as $Report) { + if ($Report['Type'] != 'edited') { + $NumNonEditedLogReports += 1; + } + } + + /* for regular users, don't display the torrent reports table if there + * are 0 non-"edited log" reports. + * always let staff (e.g. permission "admin_reports") view "edited + * log" reports. + */ + if ($NumNonEditedLogReports > 0 || (check_perms('admin_reports') && $Reports)) { $Reported = true; include(SERVER_ROOT.'/sections/reportsv2/array.php'); + $NumReports = check_perms('admin_reports') ? count($Reports) : $NumNonEditedLogReports; $ReportInfo = ' - + "; foreach ($Reports as $Report) { @@ -585,18 +601,27 @@ function filelist($Str) { $Reporter = Users::user_info($ReporterID); $ReporterName = $Reporter['Username']; + if ($ReportType == 'edited' && !check_perms('admin_reports')) { + // Edited Log report and the viewing user does not have adequate permission + continue; + } + if (array_key_exists($ReportType, $Types[$GroupCategoryID])) { $ReportType = $Types[$GroupCategoryID][$ReportType]; - } elseif (array_key_exists($ReportType,$Types['master'])) { + } elseif (array_key_exists($ReportType, $Types['master'])) { $ReportType = $Types['master'][$ReportType]; } else { //There was a type but it wasn't an option! $ReportType = $Types['master']['other']; } - $ReportInfo .= "\n\t\n\t\t\n\t"; + $ReportInfo .= " + + + '; } - $ReportInfo .= "\n
This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? 'reports' : 'report').":This torrent has '.$NumReports.' active '.($NumReports === 1 ? 'report' : 'reports').":
".(check_perms('admin_reports') ? "$ReporterName reported it " : 'Someone reported it ') . time_diff($ReportedTime, 2, true, true) . ' for the reason "' . $ReportType['title'] . '":'; - $ReportInfo .= "\n
".$Text->full_format($ReportReason)."
\n\t\t
".(check_perms('admin_reports') ? "$ReporterName reported it " : 'Someone reported it ') . time_diff($ReportedTime, 2, true, true) . ' for the reason "' . $ReportType['title'] . '": +
'.$Text->full_format($ReportReason).'
+
"; + $ReportInfo .= "\n\t\t"; } $CanEdit = (check_perms('torrents_edit') || (($UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki']) && !($Remastered && !$RemasterYear))); @@ -604,12 +629,15 @@ function filelist($Str) { $RegenLink = check_perms('users_mod') ? ' Regenerate' : ''; $FileTable = ' - '; + + + + '; if (substr($FileList, -3) == '}}}') { // Old style $FileListSplit = explode('|||', $FileList); foreach ($FileListSplit as $File) { diff --git a/sections/user/community_stats.php b/sections/user/community_stats.php index 39978833..b35bb374 100644 --- a/sections/user/community_stats.php +++ b/sections/user/community_stats.php @@ -82,7 +82,7 @@ -
  • >Collages contributed to: +
  • >Collages contributed to: View diff --git a/sections/user/user.php b/sections/user/user.php index 86b3d2f2..7d05ede8 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -26,10 +26,12 @@ $AvatarMouseOverText = ''; $SecondAvatar = ''; if ($EnabledRewards['HasAvatarMouseOverText'] && !empty($Rewards['AvatarMouseOverText'])) { - $AvatarMouseOverText = "title=\"$Rewards[AvatarMouseOverText]\" alt=\"$Rewards[AvatarMouseOverText]\""; + $AvatarMouseOverText = " title=\"$Rewards[AvatarMouseOverText]\" alt=\"$Rewards[AvatarMouseOverText]\""; +} else { + $AvatarMouseOverText = " alt=\"\""; } if ($EnabledRewards['HasSecondAvatar'] && !empty($Rewards['SecondAvatar'])) { - $SecondAvatar = 'data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"'; + $SecondAvatar = ' data-gazelle-second-avatar="' . ImageTools::process($Rewards['SecondAvatar']) . '"'; } @@ -187,7 +189,8 @@ function check_paranoia_here($Setting) {

  • - + - + - + - + - @@ -1189,7 +1217,7 @@ function check_paranoia_here($Setting) { - + @@ -1248,8 +1276,8 @@ function check_paranoia_here($Setting) { - - + - + @@ -1306,8 +1334,9 @@ function check_paranoia_here($Setting) {
    -
    File Names' . $RegenLink . '
    -
    ' . ($FilePath ? "/$FilePath/" : '') . '
    -
    - Size -
    +
    File Names' . $RegenLink . '
    +
    ' . ($FilePath ? "/$FilePath/" : '') . '
    +
    + Size +
    Uploaded:Uploaded:
    Downloaded:Downloaded: @@ -1077,7 +1104,7 @@ function check_paranoia_here($Setting) { if (check_perms('users_edit_invites')) { ?>
    Invites:Invites:
    FLS/Staff remark:FLS/Staff remark:
    Warning reason:Warning reason:
    Restricted forums:Restricted forums:
    Extra forums:Extra forums:
    - - @@ -1318,9 +1347,9 @@ function check_paranoia_here($Setting) { - Reason:
    + Reason: - + @@ -1337,7 +1366,8 @@ function check_paranoia_here($Setting) { -