From 6d60a39a89cf2ff89be502cab5ee882d96989741 Mon Sep 17 00:00:00 2001 From: Git Date: Sat, 12 Jan 2013 08:00:39 +0000 Subject: [PATCH] Empty commit --- gazelle.sql | 4 +- sections/comments/artistcomments.php | 2 +- sections/forums/forum.php | 20 ++++ sections/forums/subscribe.php | 39 +++++-- sections/forums/take_new_thread.php | 16 ++- sections/tools/misc/update_geoip.php | 10 +- sections/user/lastfm.php | 24 ++--- sections/userhistory/subscriptions.php | 3 + static/functions/lastfm.js | 141 +++++++++++++++---------- 9 files changed, 165 insertions(+), 94 deletions(-) diff --git a/gazelle.sql b/gazelle.sql index 89d46797..857c77e4 100644 --- a/gazelle.sql +++ b/gazelle.sql @@ -852,8 +852,8 @@ CREATE TABLE `stylesheets` ( CREATE TABLE `subscribed_forums` ( `ForumID` int(10) NOT NULL, - `SubscriberID` int(10) NOT NULL, - PRIMARY KEY (`ForumID`,`SubscriberID`) + `UserID` int(10) NOT NULL, + PRIMARY KEY (`ForumID`,`UserID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE `subscribed_users` ( diff --git a/sections/comments/artistcomments.php b/sections/comments/artistcomments.php index 8e1446ca..6986c8c5 100644 --- a/sections/comments/artistcomments.php +++ b/sections/comments/artistcomments.php @@ -57,7 +57,7 @@ $permalink = "artist.php?id=$ArtistID&postid=$PostID#post$PostID"; $postheader = " on " . "$ArtistName"; - comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $EditedTime); + comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime); } /* end while loop*/ ?> diff --git a/sections/forums/forum.php b/sections/forums/forum.php index 4254071d..11a0ec8e 100644 --- a/sections/forums/forum.php +++ b/sections/forums/forum.php @@ -63,6 +63,23 @@ $ForumName = display_str($Forums[$ForumID]['Name']); if($LoggedUser['CustomForums'][$ForumID] != 1 && $Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class']) { error(403); } +$SubscribedForumIDs = $Cache->get("subscribed_forum_ids_".$LoggedUser['ID']); +if(empty($SubscribedForumIDs)) { + $SubscribedForumIDs = array(); + $DB->query("SELECT ForumID FROM subscribed_forums WHERE UserID = $LoggedUser[ID]"); + if($DB->record_count() > 0) { + $SubscribedForumIDs = $DB->collect('ForumID'); + } + $Cache->cache_value("subscribed_forum_ids_".$LoggedUser['ID'], $SubscribedForumIDs, 0); +} +$ForumSubscribeAction = "add"; +$ForumSubscribeActionText = "Subscribe"; +if(in_array($ForumID, $SubscribedForumIDs)) { + $ForumSubscribeAction = "remove"; + $ForumSubscribeActionText = "Unsubscribe"; + +} + // Start printing View::show_header('Forums > '. $Forums[$ForumID]['Name']); ?> @@ -73,6 +90,9 @@ [New Thread] [Search this Forum] + + [] +