diff --git a/classes/class_torrents.php b/classes/class_torrents.php index e3fb6364..7d11622c 100644 --- a/classes/class_torrents.php +++ b/classes/class_torrents.php @@ -455,7 +455,7 @@ public static function regenerate_filelist($TorrentID) { $TmpFileList[] = self::filelist_format_file($File); } $FilePath = isset($Tor->Val['info']->Val['files']) ? Format::make_utf8($Tor->get_name()) : ""; - $FileString = Format::make_utf8(implode("\n", $TmpFileList)); + $FileString = implode("\n", $TmpFileList); $DB->query("UPDATE torrents SET Size = ".$TotalSize.", FilePath = '".db_string($FilePath)."', FileList = '".db_string($FileString)."' WHERE ID = ".$TorrentID); $Cache->delete_value('torrents_details_'.$GroupID); } @@ -482,8 +482,8 @@ public static function filelist_format_file($File) { list($Size, $Name) = $File; $Name = Format::make_utf8(strtr($Name, "\n\r\t", " ")); $ExtPos = strrpos($Name, '.'); - $Ext = $ExtPos ? substr($Name, $ExtPos) : ''; - return sprintf("%s s%ds %s %s", $Ext, $Size, $Name, self::filelist_delim()); + $Ext = $ExtPos ? trim(substr($Name, $ExtPos+1)) : ''; + return sprintf("%s s%ds %s %s", ".$Ext", $Size, $Name, self::filelist_delim()); } /** diff --git a/design/privateheader.php b/design/privateheader.php index d16a8f2b..bf1b8e99 100644 --- a/design/privateheader.php +++ b/design/privateheader.php @@ -242,6 +242,34 @@ $Alerts[] = ''.'New Blog Post!'.''; } +// Staff blog +if(check_perms('users_mod')) { + global $SBlogReadTime, $LatestSBlogTime; + if (!$SBlogReadTime && ($SBlogReadTime = $Cache->get_value('staff_blog_read_'.$LoggedUser['ID'])) === false) { + $DB->query("SELECT Time FROM staff_blog_visits WHERE UserID = ".$LoggedUser['ID']); + if (list($SBlogReadTime) = $DB->next_record()) { + $SBlogReadTime = strtotime($SBlogReadTime); + } else { + $SBlogReadTime = 0; + } + $Cache->cache_value('staff_blog_read_'.$LoggedUser['ID'], $SBlogReadTime, 1209600); + } + if (!$LatestSBlogTime && ($LatestSBlogTime = $Cache->get_value('staff_blog_latest_time')) === false) { + $DB->query("SELECT MAX(Time) FROM staff_blog"); + if (list($LatestSBlogTime) = $DB->next_record()) { + $LatestSBlogTime = strtotime($LatestSBlogTime); + } else { + $LatestSBlogTime = 0; + } + $Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600); + } + if ($SBlogReadTime < $LatestSBlogTime) { + global $Debug; + $Debug->log_var(array('b' => $SBlogReadTime, 'l' => $LatestSBlogTime), 'Times'); + $Alerts[] = ''.'New Staff Blog Post!'.''; + } +} + //Staff PM $NewStaffPMs = $Cache->get_value('staff_pm_new_'.$LoggedUser['ID']); if ($NewStaffPMs === false) { diff --git a/design/views/generic/reply/staffpm.php b/design/views/generic/reply/staffpm.php index 7b8ddceb..1803555d 100644 --- a/design/views/generic/reply/staffpm.php +++ b/design/views/generic/reply/staffpm.php @@ -1,25 +1,25 @@ -
Record Label | +Record label | =$RecordLabel?> | @@ -293,39 +293,39 @@ } if(!empty($CatalogueNumber)) { ?>|
Catalogue Number | +Catalogue number | =$CatalogueNumber?> | |
Release Type | +Release type | =$ReleaseName?> | |
Acceptable Bitrates | +Acceptable bitrates | =$BitrateString?> | |
Acceptable Formats | +Acceptable formats | =$FormatString?> | |
Acceptable Media | +Acceptable media | =$MediaString?> | |
Required CD FLAC only extra(s) | +Required CD FLAC only extras | =$LogCue?> | @@ -358,23 +358,23 @@ $GroupLink = Artists::display_artists($Group['ExtendedArtists']).''.$Group['Name'].'';*/ ?>|
Torrent Group | +Torrent group | torrents.php?id==$GroupID?> | |
Votes | - =$VoteCount?> + =number_format($VoteCount)?> if($CanVote) { ?> - (+) + + Costs =Format::get_size($MinimumVote, 0)?> } ?> | ||
Last Voted | +Last voted | =time_diff($LastVote)?> | @@ -429,7 +429,7 @@ Yes, by user =Users::format_username($FillerID, false, false, false)?> if($LoggedUser['ID'] == $RequestorID || $LoggedUser['ID'] == $FillerID || check_perms('site_moderate_requests')) { ?> - (Unfill) Unfilling a request without a valid, nontrivial reason will result in a warning. + Unfill Unfilling a request without a valid, nontrivial reason will result in a warning. } ?>|
Request Log | +Request log | ||
diff --git a/sections/requests/requests.php b/sections/requests/requests.php
index dcdfdcd3..d2cf3989 100644
--- a/sections/requests/requests.php
+++ b/sections/requests/requests.php
@@ -331,6 +331,23 @@
=$Title?>
+ if (!$BookmarkView) {
+ if (check_perms('site_submit_requests')) { ?>
+ New request
+ My requests
+ }
+ if (check_perms('site_vote')) { ?>
+ Requests I've voted on
+ } ?>
+ Bookmarked requests
+ } else { ?>
+ Torrents
+ Artists
+ Collages
+ Requests
+ } ?>
+
|
@@ -415,10 +415,10 @@ foreach($Categories as $CatKey => $CatName) { $Row = 'a'; foreach ($Requests as $Request) { list($RequestID, $CategoryID, $Title, $Year, $Bounty, $Votes, $FillerID, $FillerName, $TorrentID, $TimeFilled, $RequestorID, $RequestorName, $TimeAdded, $LastVote) = $Request; - + $CategoryName = $Categories[$CategoryID - 1]; $IsFilled = ($TorrentID != 0); - + if($CategoryName == "Music") { $ArtistForm = get_request_artists($RequestID); $ArtistLink = display_artists($ArtistForm, true, true); @@ -428,16 +428,16 @@ foreach($Categories as $CatKey => $CatName) { } else { $FullName ="".$Title.""; } - + $Row = ($Row == 'a') ? 'b' : 'a'; - + $Tags = get_request_tags($RequestID); ?> | |||||||
=$FullName?> |
=get_size($Bounty)?>
diff --git a/sections/staffblog/index.php b/sections/staffblog/index.php
index 40eacb48..cd4374e1 100644
--- a/sections/staffblog/index.php
+++ b/sections/staffblog/index.php
@@ -5,8 +5,10 @@
error(403);
}
+$DB->query("INSERT INTO staff_blog_visits (UserID, Time) VALUES (".$LoggedUser['ID'].", NOW()) ON DUPLICATE KEY UPDATE Time=NOW()");
+$Cache->delete_value('staff_blog_read_'.$LoggedUser['ID']);
+
define('ANNOUNCEMENT_FORUM_ID', 19);
-View::show_header('Staff Blog','bbcode');
require(SERVER_ROOT.'/classes/class_text.php');
$Text = new TEXT;
@@ -49,9 +51,10 @@
}
$Title = db_string($_POST['title']);
$Body = db_string($_POST['body']);
-
- $DB->query("INSERT INTO staff_blog (UserID, Title, Body, Time) VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', '".sqltime()."')");
+
+ $DB->query("INSERT INTO staff_blog (UserID, Title, Body, Time) VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', NOW())");
$Cache->delete_value('staff_blog');
+ $Cache->delete_value('staff_blog_latest_time');
send_irc("PRIVMSG ".ADMIN_CHAN." :!blog " . $_POST['title']);
@@ -59,7 +62,7 @@
break;
}
}
-
+ View::show_header('Staff Blog','bbcode');
?>
@@ -88,11 +91,13 @@
+} else { + View::show_header('Staff Blog','bbcode'); } ?>
-if (!$Blog = $Cache->get_value('staff_blog')) {
+if (($Blog = $Cache->get_value('staff_blog')) === false) {
$DB->query("SELECT
b.ID,
um.Username,
@@ -101,15 +106,13 @@
b.Time
FROM staff_blog AS b LEFT JOIN users_main AS um ON b.UserID=um.ID
ORDER BY Time DESC");
- $Blog = $DB->to_array();
- $Cache->cache_value('Blog',$Blog,1209600);
+ $Blog = $DB->to_array(false, MYSQLI_NUM);
+ $Cache->cache_value('staff_blog', $Blog, 1209600);
}
-$DB->query("INSERT INTO staff_blog_visits (UserID, Time) VALUES (".$LoggedUser['ID'].", NOW()) ON DUPLICATE KEY UPDATE Time=NOW()");
-$Cache->delete_value('staff_blog_read_'.$LoggedUser['ID']);
-
foreach ($Blog as $BlogItem) {
list($BlogID, $Author, $Title, $Body, $BlogTime) = $BlogItem;
+ $BlogTime = strtotime($BlogTime);
?>
diff --git a/sections/tools/data/bitcoin_balance.php b/sections/tools/data/bitcoin_balance.php
index 788c0bde..048aa7a9 100644
--- a/sections/tools/data/bitcoin_balance.php
+++ b/sections/tools/data/bitcoin_balance.php
@@ -17,7 +17,7 @@
|
- =($GroupID ? '[ DL ]' : '(Deleted)')?>
+ =($GroupID ? 'DL' : '(Deleted)')?>
=$DisplayName?>
=$TorrentTags?>
|
diff --git a/sections/torrents/index.php b/sections/torrents/index.php
index 9d22ac80..35b18ba7 100644
--- a/sections/torrents/index.php
+++ b/sections/torrents/index.php
@@ -156,6 +156,7 @@ function js_pages($Action, $TorrentID, $NumResults, $CurrentPage) {
case 'notify_clear':
case 'notify_clear_item':
+ case 'notify_clear_items':
case 'notify_clearitem':
case 'notify_clear_filter':
case 'notify_cleargroup':
diff --git a/sections/torrents/notify.php b/sections/torrents/notify.php
index b18d3c72..79aa991d 100644
--- a/sections/torrents/notify.php
+++ b/sections/torrents/notify.php
@@ -195,7 +195,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
|