From fe9d522bd44e8c311a6a39dc5d561dc8834b630b Mon Sep 17 00:00:00 2001 From: Git Date: Sun, 5 Feb 2012 08:00:20 +0000 Subject: [PATCH] Empty commit --- sections/better/files.php | 19 +++++++++++--- sections/better/folders.php | 17 ++++++++++-- sections/better/single.php | 14 +++++++++- sections/better/snatch.php | 22 ++++++++++++---- sections/better/tags.php | 17 ++++++++++-- sections/better/transcode.php | 22 ++++++++++++---- sections/better/upload.php | 22 ++++++++++++---- sections/index/private.php | 22 +++++++++++++--- sections/requests/takedelete.php | 8 ++++-- sections/requests/takefill.php | 3 +++ sections/requests/takeunfill.php | 8 ++++-- sections/torrents/details.php | 2 +- sections/torrents/functions.php | 2 +- static/functions/torrent.js | 45 ++++++++++++++++++++++++++++++++ 14 files changed, 190 insertions(+), 33 deletions(-) diff --git a/sections/better/files.php b/sections/better/files.php index ae316388..47b1bf27 100644 --- a/sections/better/files.php +++ b/sections/better/files.php @@ -44,7 +44,7 @@ $Info) { - list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]); + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]); $DisplayName = ''; if(count($Artists)>0) { @@ -58,12 +58,25 @@ if($ExtraInfo) { $DisplayName.=' - '.$ExtraInfo; } + + $TagList=array(); + if($TorrentTags!='') { + $TorrentTags=explode(' ',$TorrentTags); + foreach ($TorrentTags as $TagKey => $TagName) { + $TagName = str_replace('_','.',$TagName); + $TagList[]=''.$TagName.''; + } + $PrimaryTag = $TorrentTags[0]; + $TagList = implode(', ', $TagList); + $TorrentTags='
'.$TagList.'
'; + } ?> $Info) { - list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]); + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]); $DisplayName = ''; if(count($Artists)>0) { @@ -58,12 +58,25 @@ if($ExtraInfo) { $DisplayName.=' - '.$ExtraInfo; } + + $TagList=array(); + if($TorrentTags!='') { + $TorrentTags=explode(' ',$TorrentTags); + foreach ($TorrentTags as $TagKey => $TagName) { + $TagName = str_replace('_','.',$TagName); + $TagList[]=''.$TagName.''; + } + $PrimaryTag = $TorrentTags[0]; + $TagList = implode(', ', $TagList); + $TorrentTags='
'.$TagList.'
'; + } ?> $Group) { - list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); $FlacID = $GroupIDs[$GroupID]['TorrentID']; $DisplayName = ''; @@ -35,11 +35,23 @@ $DisplayName.=''.$GroupName.''; if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; } + $TagList=array(); + if($TorrentTags!='') { + $TorrentTags=explode(' ',$TorrentTags); + foreach ($TorrentTags as $TagKey => $TagName) { + $TagName = str_replace('_','.',$TagName); + $TagList[]=''.$TagName.''; + } + $PrimaryTag = $TorrentTags[0]; + $TagList = implode(', ', $TagList); + $TorrentTags='
'.$TagList.'
'; + } ?> diff --git a/sections/better/snatch.php b/sections/better/snatch.php index f3c9ee1b..f079be19 100644 --- a/sections/better/snatch.php +++ b/sections/better/snatch.php @@ -71,7 +71,7 @@ $Group) { - list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); $FlacID = $Snatches[$GroupID]['fid']; $DisplayName = ''; @@ -89,15 +89,27 @@ } } + $TagList=array(); + if($TorrentTags!='') { + $TorrentTags=explode(' ',$TorrentTags); + foreach ($TorrentTags as $TagKey => $TagName) { + $TagName = str_replace('_','.',$TagName); + $TagList[]=''.$TagName.''; + } + $PrimaryTag = $TorrentTags[0]; + $TagList = implode(', ', $TagList); + $TorrentTags='
'.$TagList.'
'; + } ?> - - - + + +
[DL] - [X] - + [X] + +
[DL] - [X] + [X] +
[DL] +
- [DL]YES':'NO'?>YES':'NO'?>YES':'NO'?> + [DL] + YES':'NO'?>YES':'NO'?>YES':'NO'?>
diff --git a/sections/better/tags.php b/sections/better/tags.php index 1de1d648..225d7d27 100644 --- a/sections/better/tags.php +++ b/sections/better/tags.php @@ -44,7 +44,7 @@ $Info) { - list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]); + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]); $DisplayName = ''; if(count($Artists)>0) { $DisplayName = display_artists(array('1'=>$Artists)); @@ -57,12 +57,25 @@ if($ExtraInfo) { $DisplayName.=' - '.$ExtraInfo; } + + $TagList=array(); + if($TorrentTags!='') { + $TorrentTags=explode(' ',$TorrentTags); + foreach ($TorrentTags as $TagKey => $TagName) { + $TagName = str_replace('_','.',$TagName); + $TagList[]=''.$TagName.''; + } + $PrimaryTag = $TorrentTags[0]; + $TagList = implode(', ', $TagList); + $TorrentTags='
'.$TagList.'
'; + } ?> $Data) { $Debug->log_var($Data); - list($Artists, $GroupCatalogueNumber, $ExtendedArtists, $GroupID2, $GroupName, $GroupRecordLabel, $ReleaseType, $TagList, $Torrents, $GroupVanityHouse, $GroupYear, $CategoryID, $FreeTorrent, $HasCue, $HasLog, $TotalLeechers, $LogScore, $ReleaseType, $ReleaseType, $TotalSeeders, $MaxSize, $TotalSnatched, $GroupTime) = array_values($Data); + list($Artists, $GroupCatalogueNumber, $ExtendedArtists, $GroupID2, $GroupName, $GroupRecordLabel, $ReleaseType, $TorrentTags, $Torrents, $GroupVanityHouse, $GroupYear, $CategoryID, $FreeTorrent, $HasCue, $HasLog, $TotalLeechers, $LogScore, $ReleaseType, $ReleaseType, $TotalSeeders, $MaxSize, $TotalSnatched, $GroupTime) = array_values($Data); $DisplayName = ''; if(count($Artists)>0) { @@ -118,15 +118,27 @@ continue; } + $TagList=array(); + if($TorrentTags!='') { + $TorrentTags=explode(' ',$TorrentTags); + foreach ($TorrentTags as $TagKey => $TagName) { + $TagName = str_replace('_','.',$TagName); + $TagList[]=''.$TagName.''; + } + $PrimaryTag = $TorrentTags[0]; + $TagList = implode(', ', $TagList); + $TorrentTags='
'.$TagList.'
'; + } ?> - - - + + +
[DL] - [X] + [X] +
- [DL]YES':'NO'?>YES':'NO'?>YES':'NO'?> + [DL] + YES':'NO'?>YES':'NO'?>YES':'NO'?>
diff --git a/sections/better/upload.php b/sections/better/upload.php index 42f6d991..9692913b 100644 --- a/sections/better/upload.php +++ b/sections/better/upload.php @@ -58,7 +58,7 @@ $Group) { - list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); $FlacID = $Uploads[$GroupID]['ID']; $DisplayName = ''; @@ -76,15 +76,27 @@ } } + $TagList=array(); + if($TorrentTags!='') { + $TorrentTags=explode(' ',$TorrentTags); + foreach ($TorrentTags as $TagKey => $TagName) { + $TagName = str_replace('_','.',$TagName); + $TagList[]=''.$TagName.''; + } + $PrimaryTag = $TorrentTags[0]; + $TagList = implode(', ', $TagList); + $TorrentTags='
'.$TagList.'
'; + } ?> - [DL] - YES':'NO'?> - YES':'NO'?> - YES':'NO'?> + [DL] + + YES':'NO'?> + YES':'NO'?> + YES':'NO'?> diff --git a/sections/index/private.php b/sections/index/private.php index 18d40376..d6788eff 100644 --- a/sections/index/private.php +++ b/sections/index/private.php @@ -348,7 +348,8 @@ tr.GroupID, tr.UserID, u.Username, - tg.Name + tg.Name, + tg.TagList FROM torrents_recommended AS tr JOIN torrents_group AS tg ON tg.ID=tr.GroupID LEFT JOIN users_main AS u ON u.ID=tr.UserID @@ -373,11 +374,24 @@ $Tag "; + } + $TagStr = "
\n
".implode(', ', $TagLinks).'
'; + } ?> - - + diff --git a/sections/requests/takedelete.php b/sections/requests/takedelete.php index bab72bf7..2609ca46 100644 --- a/sections/requests/takedelete.php +++ b/sections/requests/takedelete.php @@ -11,10 +11,11 @@ $DB->query("SELECT UserID, Title, - CategoryID + CategoryID, + GroupID FROM requests WHERE ID = ".$RequestID); -list($UserID, $Title, $CategoryID) = $DB->next_record(); +list($UserID, $Title, $CategoryID, $GroupID) = $DB->next_record(); if($LoggedUser['ID'] != $UserID && !check_perms('site_moderate_requests')) { error(403); @@ -52,6 +53,9 @@ $Cache->delete_value('request_'.$RequestID); $Cache->delete_value('request_votes_'.$RequestID); +if ($GroupID) { + $Cache->delete_value('requests_group_'.$GroupID); +} update_sphinx_requests($RequestID); header('Location: requests.php'); diff --git a/sections/requests/takefill.php b/sections/requests/takefill.php index fa26946c..03000695 100644 --- a/sections/requests/takefill.php +++ b/sections/requests/takefill.php @@ -194,6 +194,9 @@ $Cache->delete_value('user_stats_'.$FillerID); $Cache->delete_value('request_'.$RequestID); +if ($GroupID) { + $Cache->delete_value('requests_group_'.$GroupID); +} diff --git a/sections/requests/takeunfill.php b/sections/requests/takeunfill.php index 17c8b27c..e5287737 100644 --- a/sections/requests/takeunfill.php +++ b/sections/requests/takeunfill.php @@ -14,11 +14,12 @@ r.UserID, r.FillerID, r.Title, - u.Uploaded + u.Uploaded, + r.GroupID FROM requests AS r LEFT JOIN users_main AS u ON u.ID=FillerID WHERE r.ID= ".$RequestID); -list($CategoryID, $UserID, $FillerID, $Title, $Uploaded) = $DB->next_record(); +list($CategoryID, $UserID, $FillerID, $Title, $Uploaded, $GroupID) = $DB->next_record(); if((($LoggedUser['ID'] != $UserID && $LoggedUser['ID'] != $FillerID) && !check_perms('site_moderate_requests')) || $FillerID == 0) { error(403); @@ -63,6 +64,9 @@ $Cache->delete_value('request_'.$RequestID); $Cache->delete_value('request_artists_'.$RequestID); +if ($GroupID) { + $Cache->delete_value('requests_group_'.$GroupID); +} update_sphinx_requests($RequestID); diff --git a/sections/torrents/details.php b/sections/torrents/details.php index 8cece809..84f19509 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -81,7 +81,7 @@ function compare($X, $Y){ } // Start output -show_header($Title,'browse,comments,torrent,bbcode,requests'); +show_header($Title,'browse,comments,torrent,bbcode'); ?>

diff --git a/sections/torrents/functions.php b/sections/torrents/functions.php index 37c98639..e3282069 100644 --- a/sections/torrents/functions.php +++ b/sections/torrents/functions.php @@ -156,7 +156,7 @@ function get_group_requests($GroupID) { $Requests = $Cache->get_value('requests_group_'.$GroupID); if ($Requests === FALSE) { - $DB->query("SELECT ID FROM requests WHERE GroupID = $GroupID"); + $DB->query("SELECT ID FROM requests WHERE GroupID = $GroupID AND TimeFilled = '0000-00-00 00:00:00'"); $Requests = $DB->collect('ID'); $Cache->cache_value('requests_group_'.$GroupID, $Requests, 0); } diff --git a/static/functions/torrent.js b/static/functions/torrent.js index e12207d4..0c804d34 100644 --- a/static/functions/torrent.js +++ b/static/functions/torrent.js @@ -200,3 +200,48 @@ function ArtistManagerDelete() { ArtistManagerSubmit(); $('#manager_action').raw().value = 'manage'; } + +function Vote(amount, requestid) { + if(typeof amount == 'undefined') { + amount = parseInt($('#amount').raw().value); + } + if(amount == 0) { + amount = 20 * 1024 * 1024; + } + + var index; + var votecount; + if(!requestid) { + requestid = $('#requestid').raw().value; + votecount = $('#votecount').raw(); + index = false; + } else { + votecount = $('#vote_count_' + requestid).raw(); + bounty = $('#bounty_' + requestid).raw(); + index = true; + } + + ajax.get('requests.php?action=takevote&id=' + requestid + '&auth=' + $('#auth').raw().value + '&amount=' + amount, function (response) { + if(response == 'bankrupt') { + error_message("You do not have sufficient upload credit to add " + get_size(amount) + " to this request"); + return; + } else if (response == 'dupesuccess') { + //No increment + } else if (response == 'success') { + votecount.innerHTML = (parseInt(votecount.innerHTML)) + 1; + } + + if($('#total_bounty').results() > 0) { + totalBounty = parseInt($('#total_bounty').raw().value); + totalBounty += (amount * (1 - $('#request_tax').raw().value)); + $('#total_bounty').raw().value = totalBounty; + $('#formatted_bounty').raw().innerHTML = get_size(totalBounty); + + save_message("Your vote of " + get_size(amount) + ", adding a " + get_size(amount * (1 - $('#request_tax').raw().value)) + " bounty, has been added"); + $('#button').raw().disabled = true; + } else { + save_message("Your vote of " + get_size(amount) + " has been added"); + } + } + ); +} \ No newline at end of file