Empty commit

This commit is contained in:
Git 2012-02-08 08:00:20 +00:00
parent 73409741fe
commit 096ad190af
5 changed files with 50 additions and 2 deletions

View File

@ -1,7 +1,12 @@
<?
include(SERVER_ROOT.'/classes/class_feed.php'); // RSS feeds
include(SERVER_ROOT.'/classes/class_text.php'); // strip_bbcode
authorize();
if (!can_bookmark($_GET['type'])) { error(404); }
$Feed = new FEED;
$Text = new TEXT;
$Type = $_GET['type'];
@ -20,6 +25,36 @@
$Cache->delete_value('bookmarks_'.$Type.'_'.$LoggedUser['ID']);
if ($Type == 'torrent') {
$Cache->delete_value('bookmarks_torrent_'.$LoggedUser['ID'].'_full');
$GroupID = $_GET['id'];
$DB->query("SELECT Name, Year, WikiBody, TagList FROM torrents_group WHERE ID = '$GroupID'");
list($GroupTitle, $Year, $Body, $TagList) = $DB->next_record();
$TagList = str_replace('_','.',$TagList);
$DB->query("SELECT ID, Format, Encoding, HasLog, HasCue, LogScore, Media, Scene, FreeTorrent, UserID FROM torrents WHERE GroupID = '$GroupID'");
// RSS feed stuff
while ($Torrent = $DB->next_record()) {
$Title = $GroupTitle;
list($TorrentID, $Format, $Bitrate, $HasLog, $HasCue, $LogScore, $Media, $Scene, $Freeleech, $UploaderID) = $Torrent;
$Title .= " [".$Year."] - ";
$Title .= $Format." / ".$Bitrate;
if ($HasLog == "'1'") { $Title .= " / Log"; }
if ($HasLog) { $Title .= " / ".$LogScore.'%'; }
if ($HasCue == "'1'") { $Title .= " / Cue"; }
$Title .= " / ".trim($Media);
if ($Scene == "1") { $Title .= " / Scene"; }
if ($Freeleech == "1") { $Title .= " / Freeleech!"; }
if ($Freeleech == "2") { $Title .= " / Neutral leech!"; }
$UploaderInfo = user_info($UploaderID);
$Item = $Feed->item($Title,
$Text->strip_bbcode($Body),
'torrents.php?action=download&amp;authkey=[[AUTHKEY]]&amp;torrent_pass=[[PASSKEY]]&amp;id='.$TorrentID,
$UploaderInfo['Username'],
'torrents.php?id='.$GroupID,
trim($TagList));
$Feed->populate('torrents_bookmarks_t_'.$LoggedUser['torrent_pass'], $Item);
}
} elseif ($Type == 'request') {
$DB->query("SELECT UserID FROM $Table WHERE $Col='".db_string($_GET['id'])."'");
$Bookmarkers = $DB->collect('UserID');

View File

@ -308,7 +308,7 @@ function compare($X, $Y){
show_header($Title, 'browse,collage');
?>
<div class="thin">
<h2><?=$Title?></h2>
<h2><? if (!$Sneaky) { ?><a href="feeds.php?feed=torrents_bookmarks_t_<?=$LoggedUser['torrent_pass']?>&amp;user=<?=$LoggedUser['ID']?>&amp;auth=<?=$LoggedUser['RSS_Auth']?>&amp;passkey=<?=$LoggedUser['torrent_pass']?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;name=<?=urlencode(SITE_NAME.': Bookmarked Torrents')?>"><img src="<?=STATIC_SERVER?>/common/symbols/rss.png" alt="RSS feed" /></a>&nbsp;<? } ?><?=$Title?></h2>
<div class="linkbox">
<a href="bookmarks.php?type=torrents">[Torrents]</a>
<a href="bookmarks.php?type=artists">[Artists]</a>

View File

@ -158,6 +158,10 @@
// Specific personalized torrent notification channel
$Feed->channel(display_str($_GET['name']), 'Personal RSS feed: '.display_str($_GET['name']));
$Feed->retrieve($_GET['feed'],$_GET['authkey'],$_GET['passkey']);
} elseif(!empty($_GET['name']) && substr($_GET['feed'], 0, 21) == 'torrents_bookmarks_t_') {
// Bookmarks
$Feed->channel('Bookmarked torrent notifications', 'RSS feed for bookmarked torrents.');
$Feed->retrieve($_GET['feed'],$_GET['authkey'],$_GET['passkey']);
} else {
$Feed->channel('All Torrents', 'RSS feed for all new torrent uploads.');
$Feed->retrieve('torrents_all',$_GET['authkey'],$_GET['passkey']);

View File

@ -888,6 +888,15 @@
}
}
// RSS for bookmarks
$DB->query("SELECT u.ID, u.torrent_pass
FROM users_main AS u
JOIN bookmarks_torrents AS b ON b.UserID = u.ID
WHERE b.GroupID = $GroupID");
while (list($UserID, $Passkey) = $DB->next_record()) {
$Feed->populate('torrents_bookmarks_t_'.$Passkey, $Item);
}
$Feed->populate('torrents_all',$Item);
if($Type == 'Music'){

File diff suppressed because one or more lines are too long