mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-31 02:21:36 +00:00
Empty commit
This commit is contained in:
parent
0600c2106f
commit
e68e81c8d8
@ -92,7 +92,7 @@ function compare($X, $Y){
|
||||
FROM requests AS r
|
||||
LEFT JOIN requests_votes AS rv ON rv.RequestID=r.ID
|
||||
LEFT JOIN requests_artists AS ra ON r.ID=ra.RequestID
|
||||
WHERE ra.ArtistID = ".$ArtistID."
|
||||
WHERE ra.ArtistID = '$ArtistID'
|
||||
AND r.TorrentID = 0
|
||||
GROUP BY r.ID
|
||||
ORDER BY Votes DESC");
|
||||
@ -221,6 +221,31 @@ function compare($X, $Y){
|
||||
$NumLeechers+=$Torrent['Leechers'];
|
||||
$NumSnatches+=$Torrent['Snatched'];
|
||||
}
|
||||
foreach ($Torrents as $Torrent) {
|
||||
$InnerTorrents[] = array(
|
||||
'id' => (int) $Torrent['ID'],
|
||||
'groupId' => (int) $Torrent['GroupID'],
|
||||
'media' => $Torrent['Media'],
|
||||
'format' => $Torrent['Format'],
|
||||
'encoding' => $Torrent['Encoding'],
|
||||
'remasterYear' => $Torrent['RemasterYear'],
|
||||
'remastered' => $Torrent['Remastered'] == 1,
|
||||
'remasterTitle' => $Torrent['RemasterTitle'],
|
||||
'remasterRecordLabel' => $Torrent['RemasterRecordLabel'],
|
||||
'scene' => $Torrent['Scene'] == 1,
|
||||
'hasLog' => $Torrent['HasLog'] == 1,
|
||||
'hasCue' => $Torrent['HasCue'] == 1,
|
||||
'logScore' => (int) $Torrent['LogScore'],
|
||||
'fileCount' => (int) $Torrent['FileCount'],
|
||||
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
|
||||
'size' => (int) $Torrent['Size'],
|
||||
'leechers' => (int) $Torrent['Leechers'],
|
||||
'seeders' => (int) $Torrent['Seeders'],
|
||||
'snatched' => (int) $Torrent['Snatched'],
|
||||
'time' => $Torrent['Time'],
|
||||
'hasFile' => (int) $Torrent['HasFile']
|
||||
);
|
||||
}
|
||||
$JsonTorrents[] = array(
|
||||
'groupId' => $GroupID,
|
||||
'groupName' => $GroupName,
|
||||
@ -228,6 +253,10 @@ function compare($X, $Y){
|
||||
'groupRecordLabel' => $GroupRecordLabel,
|
||||
'groupCatalogueNumber' => $GroupCatalogueNumber,
|
||||
'tags' => $TagList,
|
||||
'releaseType' => (int) $ReleaseType,
|
||||
'groupVanityHouse' => $GroupVanityHouse == 1,
|
||||
'hasBookmarked' => $hasBookmarked = has_bookmarked('torrent', $GroupID),
|
||||
'torrent' => $InnerTorrents,
|
||||
'releaseType' => $ReleaseType,
|
||||
'groupVanityHouse' => $GroupVanityHouse,
|
||||
'hasBookmarked' => $hasBookmarked = has_bookmarked('torrent', $GroupID),
|
||||
@ -256,6 +285,10 @@ function compare($X, $Y){
|
||||
$SimilarArray = $DB->to_array();
|
||||
foreach ($SimilarArray as $Similar) {
|
||||
$JsonSimilar[] = array(
|
||||
'artistId' => (int) $Similar['ArtistID'],
|
||||
'name' => $Similar['Name'],
|
||||
'score' => (int) $Similar['Score'],
|
||||
'similarId' => (int) $Similar['SimilarID'],
|
||||
'artistId' => $Similar['ArtistID'],
|
||||
'name' => $Similar['Name'],
|
||||
'score' => $Similar['Score'],
|
||||
@ -269,6 +302,13 @@ function compare($X, $Y){
|
||||
foreach ($Requests as $Request) {
|
||||
list($RequestID, $CategoryID, $Title, $Year, $TimeAdded, $Votes, $Bounty) = $Request;
|
||||
$JsonRequests[] = array(
|
||||
'requestId' => (int) $RequestID,
|
||||
'categoryId' => (int) $CategoryID,
|
||||
'title' => $Title,
|
||||
'year' => $Year,
|
||||
'timeAdded' => $TimeAdded,
|
||||
'votes' => (int) $Votes,
|
||||
'bounty' => (int) $Bounty,
|
||||
'requestId' => $RequestID,
|
||||
'categoryId' => $CategoryID,
|
||||
'title' => $Title,
|
||||
|
38
sections/ajax/better/index.php
Normal file
38
sections/ajax/better/index.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?
|
||||
//Include all the basic stuff...
|
||||
|
||||
enforce_login();
|
||||
if(isset($_GET['method'])) {
|
||||
switch($_GET['method']) {
|
||||
case 'transcode':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/transcode.php');
|
||||
break;
|
||||
case 'single':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/single.php');
|
||||
break;
|
||||
case 'snatch':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/snatch.php');
|
||||
break;
|
||||
case 'artistless':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/artistless.php');
|
||||
break;
|
||||
case 'tags':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/tags.php');
|
||||
break;
|
||||
case 'folders':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/folders.php');
|
||||
break;
|
||||
case 'files':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/files.php');
|
||||
break;
|
||||
case 'upload':
|
||||
include(SERVER_ROOT.'/sections/ajax/better/upload.php');
|
||||
break;
|
||||
default:
|
||||
print json_encode(array('status' => 'failure'));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
print json_encode(array('status' => 'failure'));
|
||||
}
|
||||
?>
|
47
sections/ajax/better/single.php
Normal file
47
sections/ajax/better/single.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?
|
||||
if(($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
|
||||
$DB->query("SELECT t.ID AS TorrentID,
|
||||
t.GroupID AS GroupID
|
||||
FROM xbt_files_users AS x
|
||||
JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE t.Format='FLAC'
|
||||
GROUP BY x.fid
|
||||
HAVING COUNT(x.uid) = 1
|
||||
ORDER BY t.LogScore DESC, t.Time ASC LIMIT 30");
|
||||
|
||||
$GroupIDs = $DB->to_array('GroupID');
|
||||
$Cache->cache_value('better_single_groupids', $GroupIDs, 30*60);
|
||||
}
|
||||
|
||||
$Results = get_groups(array_keys($GroupIDs));
|
||||
|
||||
$Results = $Results['matches'];
|
||||
|
||||
$JsonResults = array();
|
||||
foreach ($Results as $GroupID=>$Group) {
|
||||
list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group);
|
||||
$FlacID = $GroupIDs[$GroupID]['TorrentID'];
|
||||
|
||||
$DisplayName = '';
|
||||
if(count($Artists)>0) {
|
||||
$DisplayName = display_artists(array('1'=>$Artists));
|
||||
}
|
||||
$DisplayName.='<a href="torrents.php?id='.$GroupID.'&torrentid='.$FlacID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
|
||||
|
||||
$JsonResults[] = array(
|
||||
'torrentId' => $FlacID,
|
||||
'groupId' => $GroupID,
|
||||
'artist' => $Artists,
|
||||
'groupName' => $GroupName,
|
||||
'groupYear' => $GroupYear,
|
||||
'downloadUrl' => 'torrents.php?action=download&id='.$FlacID.'&authkey='.$LoggedUser['AuthKey'].'&torrent_pass='.$LoggedUser['torrent_pass']
|
||||
);
|
||||
}
|
||||
|
||||
print json_encode(
|
||||
array(
|
||||
'status' => 'success',
|
||||
'response' => $JsonResults
|
||||
)
|
||||
);
|
111
sections/ajax/better/transcode.php
Normal file
111
sections/ajax/better/transcode.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?
|
||||
if(!isset($_GET['type']) || !is_number($_GET['type']) || $_GET['type'] > 3) { error(0); }
|
||||
|
||||
$Options = array('v0','v2','320');
|
||||
|
||||
if ($_GET['type'] == 3) {
|
||||
$List = "!(v0 | v2 | 320)";
|
||||
} else {
|
||||
$List = '!'.$Options[$_GET['type']];
|
||||
if($_GET['type'] == 0) {
|
||||
$_GET['type'] = '0';
|
||||
} else {
|
||||
$_GET['type'] = display_str($_GET['type']);
|
||||
}
|
||||
}
|
||||
|
||||
$Query = '@format FLAC @encoding '.$List;
|
||||
|
||||
if(!empty($_GET['search'])) {
|
||||
$Query.=' @(groupname,artistname,yearfulltext) '.$SS->EscapeString($_GET['search']);
|
||||
}
|
||||
|
||||
$SS->SetFilter('logscore', array(100));
|
||||
$SS->SetSortMode(SPH_SORT_EXTENDED, "@random");
|
||||
$SS->limit(0, TORRENTS_PER_PAGE);
|
||||
|
||||
$SS->set_index(SPHINX_INDEX.' delta');
|
||||
|
||||
$Results = $SS->search($Query, '', 0, array(), '', '');
|
||||
|
||||
if(count($Results) == 0) { error('No results found!'); }
|
||||
/*
|
||||
// If some were fetched from memcached, get their artists
|
||||
if(!empty($Results['matches'])) { // Fetch the artists for groups
|
||||
$GroupIDs = array_keys($Results['matches']);
|
||||
$Artists = get_artists($GroupIDs);
|
||||
foreach($Artists as $GroupID=>$Data) {
|
||||
if(!empty($Data[1])) {
|
||||
$Results['matches'][$GroupID]['Artists']=$Data[1]; // Only use main artists
|
||||
}
|
||||
ksort($Results['matches'][$GroupID]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
// These ones were not found in the cache, run SQL
|
||||
if(!empty($Results['notfound'])) {
|
||||
$SQLResults = get_groups($Results['notfound']);
|
||||
|
||||
if(is_array($SQLResults['notfound'])) { // Something wasn't found in the db, remove it from results
|
||||
reset($SQLResults['notfound']);
|
||||
foreach($SQLResults['notfound'] as $ID) {
|
||||
unset($SQLResults['matches'][$ID]);
|
||||
unset($Results['matches'][$ID]);
|
||||
}
|
||||
}
|
||||
|
||||
// Merge SQL results with memcached results
|
||||
foreach($SQLResults['matches'] as $ID=>$SQLResult) {
|
||||
$Results['matches'][$ID] = array_merge($Results['matches'][$ID], $SQLResult);
|
||||
ksort($Results['matches'][$ID]);
|
||||
}
|
||||
}
|
||||
|
||||
$Results = $Results['matches'];
|
||||
|
||||
$JsonResults = array();
|
||||
foreach($Results as $GroupID=>$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);
|
||||
|
||||
$DisplayName = '';
|
||||
if(count($Artists)>0) {
|
||||
$DisplayName = display_artists(array('1'=>$Artists));
|
||||
}
|
||||
$DisplayName.='<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
|
||||
|
||||
$MissingEncodings = array('V0 (VBR)'=>1, 'V2 (VBR)'=>1, '320'=>1);
|
||||
$FlacID = 0;
|
||||
|
||||
foreach($Torrents as $Torrent) {
|
||||
if(!empty($MissingEncodings[$Torrent['Encoding']])) {
|
||||
$MissingEncodings[$Torrent['Encoding']] = 0;
|
||||
} elseif($Torrent['Format'] == 'FLAC' && $FlacID == 0) {
|
||||
$FlacID = $Torrent['ID'];
|
||||
}
|
||||
}
|
||||
|
||||
if($_GET['type'] == '3' && in_array(0, $MissingEncodings)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$JsonResults[] = array(
|
||||
'torrentId' => $TorrentID,
|
||||
'groupId' => $GroupID,
|
||||
'artist' => $DisplayName,
|
||||
'groupName' => $GroupName,
|
||||
'groupYear' => $GroupYear,
|
||||
'missingV2' => $MissingEncodings['V2 (VBR)'] == 0,
|
||||
'missingV0' => $MissingEncodings['V0 (VBR)'] == 0,
|
||||
'missing320' => $MissingEncodings['320'] == 0,
|
||||
'downloadUrl' => 'torrents.php?action=download&id='.$FlacID.'&authkey='.$LoggedUser['AuthKey'].'&torrent_pass='.$LoggedUser['torrent_pass']
|
||||
);
|
||||
}
|
||||
|
||||
print json_encode(
|
||||
array(
|
||||
'status' => 'success',
|
||||
'response' => $JsonResults
|
||||
)
|
||||
);
|
60
sections/ajax/bookmarks/artists.php
Normal file
60
sections/ajax/bookmarks/artists.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?
|
||||
|
||||
if(!empty($_GET['userid'])) {
|
||||
if(!check_perms('users_override_paranoia')) {
|
||||
print
|
||||
json_encode(
|
||||
array(
|
||||
'status' => 'failure'
|
||||
)
|
||||
);
|
||||
die();
|
||||
}
|
||||
$UserID = $_GET['userid'];
|
||||
$Sneaky = ($UserID != $LoggedUser['ID']);
|
||||
if(!is_number($UserID)) {
|
||||
print
|
||||
json_encode(
|
||||
array(
|
||||
'status' => 'failure'
|
||||
)
|
||||
);
|
||||
die();
|
||||
}
|
||||
$DB->query("SELECT Username FROM users_main WHERE ID='$UserID'");
|
||||
list($Username) = $DB->next_record();
|
||||
} else {
|
||||
$UserID = $LoggedUser['ID'];
|
||||
}
|
||||
|
||||
$Sneaky = ($UserID != $LoggedUser['ID']);
|
||||
|
||||
//$ArtistList = all_bookmarks('artist', $UserID);
|
||||
|
||||
$DB->query('SELECT ag.ArtistID, ag.Name
|
||||
FROM bookmarks_artists AS ba
|
||||
INNER JOIN artists_group AS ag ON ba.ArtistID = ag.ArtistID
|
||||
WHERE ba.UserID = '.$UserID);
|
||||
|
||||
$ArtistList = $DB->to_array();
|
||||
|
||||
$JsonArtists = array();
|
||||
foreach($ArtistList as $Artist) {
|
||||
list($ArtistID, $Name) = $Artist;
|
||||
$JsonArtists[] = array(
|
||||
'artistId' => (int) $ArtistID,
|
||||
'artistName' => $Name
|
||||
);
|
||||
}
|
||||
|
||||
print
|
||||
json_encode(
|
||||
array(
|
||||
'status' => 'success',
|
||||
'response' => array(
|
||||
'artists' => $JsonArtists
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
35
sections/ajax/bookmarks/index.php
Normal file
35
sections/ajax/bookmarks/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?
|
||||
authorize(true);
|
||||
include(SERVER_ROOT.'/sections/bookmarks/functions.php');
|
||||
|
||||
// Number of users per page
|
||||
define('BOOKMARKS_PER_PAGE', '20');
|
||||
|
||||
if (empty($_REQUEST['type'])) { $_REQUEST['type'] = 'torrents'; }
|
||||
switch ($_REQUEST['type']) {
|
||||
case 'torrents':
|
||||
require(SERVER_ROOT.'/sections/ajax/bookmarks/torrents.php');
|
||||
break;
|
||||
case 'artists':
|
||||
require(SERVER_ROOT.'/sections/ajax/bookmarks/artists.php');
|
||||
break;
|
||||
case 'collages':
|
||||
$_GET['bookmarks'] = 1;
|
||||
require(SERVER_ROOT.'/sections/ajax/collages/browse.php');
|
||||
break;
|
||||
case 'requests':
|
||||
include(SERVER_ROOT.'/sections/requests/functions.php');
|
||||
$_GET['type'] = 'bookmarks';
|
||||
require(SERVER_ROOT.'/sections/ajax/requests/requests.php');
|
||||
break;
|
||||
default:
|
||||
print
|
||||
json_encode(
|
||||
array(
|
||||
'status' => 'failure'
|
||||
)
|
||||
);
|
||||
die();
|
||||
}
|
||||
|
||||
?>
|
246
sections/ajax/bookmarks/torrents.php
Normal file
246
sections/ajax/bookmarks/torrents.php
Normal file
@ -0,0 +1,246 @@
|
||||
<?
|
||||
ini_set('memory_limit', -1);
|
||||
//~~~~~~~~~~~ Main bookmarks page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
||||
authorize(true);
|
||||
|
||||
function compare($X, $Y){
|
||||
return($Y['count'] - $X['count']);
|
||||
}
|
||||
|
||||
if(!empty($_GET['userid'])) {
|
||||
if(!check_perms('users_override_paranoia')) {
|
||||
error(403);
|
||||
}
|
||||
$UserID = $_GET['userid'];
|
||||
if(!is_number($UserID)) { error(404); }
|
||||
$DB->query("SELECT Username FROM users_main WHERE ID='$UserID'");
|
||||
list($Username) = $DB->next_record();
|
||||
} else {
|
||||
$UserID = $LoggedUser['ID'];
|
||||
}
|
||||
|
||||
$Sneaky = ($UserID != $LoggedUser['ID']);
|
||||
|
||||
$Data = $Cache->get_value('bookmarks_torrent_'.$UserID.'_full');
|
||||
|
||||
if($Data) {
|
||||
$Data = unserialize($Data);
|
||||
list($K, list($TorrentList, $CollageDataList)) = each($Data);
|
||||
} else {
|
||||
// Build the data for the collage and the torrent list
|
||||
$DB->query("SELECT
|
||||
bt.GroupID,
|
||||
tg.WikiImage,
|
||||
tg.CategoryID,
|
||||
bt.Time
|
||||
FROM bookmarks_torrents AS bt
|
||||
JOIN torrents_group AS tg ON tg.ID=bt.GroupID
|
||||
WHERE bt.UserID='$UserID'
|
||||
ORDER BY bt.Time");
|
||||
|
||||
$GroupIDs = $DB->collect('GroupID');
|
||||
$CollageDataList=$DB->to_array('GroupID', MYSQLI_ASSOC);
|
||||
if(count($GroupIDs)>0) {
|
||||
$TorrentList = get_groups($GroupIDs);
|
||||
$TorrentList = $TorrentList['matches'];
|
||||
} else {
|
||||
$TorrentList = array();
|
||||
}
|
||||
}
|
||||
|
||||
$Title = ($Sneaky)?"$Username's bookmarked torrents":'Your bookmarked torrents';
|
||||
|
||||
|
||||
// Loop through the result set, building up $Collage and $TorrentTable
|
||||
// Then we print them.
|
||||
$Collage = array();
|
||||
$TorrentTable = '';
|
||||
|
||||
$NumGroups = 0;
|
||||
$Artists = array();
|
||||
$Tags = array();
|
||||
|
||||
foreach ($TorrentList as $GroupID=>$Group) {
|
||||
list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists) = array_values($Group);
|
||||
list($GroupID2, $Image, $GroupCategoryID, $AddedTime) = array_values($CollageDataList[$GroupID]);
|
||||
|
||||
// Handle stats and stuff
|
||||
$NumGroups++;
|
||||
|
||||
if($GroupArtists) {
|
||||
foreach($GroupArtists as $Artist) {
|
||||
if(!isset($Artists[$Artist['id']])) {
|
||||
$Artists[$Artist['id']] = array('name'=>$Artist['name'], 'count'=>1);
|
||||
} else {
|
||||
$Artists[$Artist['id']]['count']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$TagList = explode(' ',str_replace('_','.',$TagList));
|
||||
|
||||
$TorrentTags = array();
|
||||
foreach($TagList as $Tag) {
|
||||
if(!isset($Tags[$Tag])) {
|
||||
$Tags[$Tag] = array('name'=>$Tag, 'count'=>1);
|
||||
} else {
|
||||
$Tags[$Tag]['count']++;
|
||||
}
|
||||
$TorrentTags[]='<a href="torrents.php?taglist='.$Tag.'">'.$Tag.'</a>';
|
||||
}
|
||||
$PrimaryTag = $TagList[0];
|
||||
$TorrentTags = implode(', ', $TorrentTags);
|
||||
$TorrentTags='<br /><div class="tags">'.$TorrentTags.'</div>';
|
||||
|
||||
$DisplayName = '';
|
||||
if(count($GroupArtists)>0) {
|
||||
$DisplayName = display_artists(array('1'=>$GroupArtists));
|
||||
}
|
||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
|
||||
if($GroupVanityHouse) { $DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]'; }
|
||||
|
||||
// Start an output buffer, so we can store this output in $TorrentTable
|
||||
ob_start();
|
||||
if(count($Torrents)>1 || $GroupCategoryID==1) {
|
||||
// Grouped torrents
|
||||
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1);
|
||||
$LastRemasterYear = '-';
|
||||
$LastRemasterTitle = '';
|
||||
$LastRemasterRecordLabel = '';
|
||||
$LastRemasterCatalogueNumber = '';
|
||||
$LastMedia = '';
|
||||
|
||||
$EditionID = 0;
|
||||
unset($FirstUnknown);
|
||||
|
||||
foreach ($Torrents as $TorrentID => $Torrent) {
|
||||
|
||||
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
|
||||
$FirstUnknown = !isset($FirstUnknown);
|
||||
}
|
||||
|
||||
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
||||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
||||
|
||||
$EditionID++;
|
||||
if($Torrent['Remastered'] && $Torrent['RemasterYear'] != 0) {
|
||||
|
||||
$RemasterName = $Torrent['RemasterYear'];
|
||||
$AddExtra = " - ";
|
||||
if($Torrent['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterRecordLabel']); $AddExtra=' / '; }
|
||||
if($Torrent['RemasterCatalogueNumber']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterCatalogueNumber']); $AddExtra=' / '; }
|
||||
if($Torrent['RemasterTitle']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterTitle']); $AddExtra=' / '; }
|
||||
$RemasterName .= $AddExtra.display_str($Torrent['Media']);
|
||||
|
||||
} else {
|
||||
$AddExtra = " / ";
|
||||
if (!$Torrent['Remastered']) {
|
||||
$MasterName = "Original Release";
|
||||
if($GroupRecordLabel) { $MasterName .= $AddExtra.$GroupRecordLabel; $AddExtra=' / '; }
|
||||
if($GroupCatalogueNumber) { $MasterName .= $AddExtra.$GroupCatalogueNumber; $AddExtra=' / '; }
|
||||
} else {
|
||||
$MasterName = "Unknown Release(s)";
|
||||
}
|
||||
$MasterName .= $AddExtra.display_str($Torrent['Media']);
|
||||
}
|
||||
}
|
||||
$LastRemasterTitle = $Torrent['RemasterTitle'];
|
||||
$LastRemasterYear = $Torrent['RemasterYear'];
|
||||
$LastRemasterRecordLabel = $Torrent['RemasterRecordLabel'];
|
||||
$LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
|
||||
$LastMedia = $Torrent['Media'];
|
||||
}
|
||||
} else {
|
||||
// Viewing a type that does not require grouping
|
||||
|
||||
list($TorrentID, $Torrent) = each($Torrents);
|
||||
|
||||
$DisplayName = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
|
||||
if(!empty($Torrent['FreeTorrent'])) {
|
||||
$DisplayName .=' <strong>Freeleech!</strong>';
|
||||
}
|
||||
}
|
||||
$TorrentTable.=ob_get_clean();
|
||||
|
||||
// Album art
|
||||
|
||||
ob_start();
|
||||
|
||||
$DisplayName = '';
|
||||
if(!empty($GroupArtists)) {
|
||||
$DisplayName.= display_artists(array('1'=>$GroupArtists), false);
|
||||
}
|
||||
$DisplayName .= $GroupName;
|
||||
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
|
||||
$Collage[]=ob_get_clean();
|
||||
|
||||
}
|
||||
|
||||
uasort($Tags, 'compare');
|
||||
$i = 0;
|
||||
foreach ($Tags as $TagName => $Tag) {
|
||||
$i++;
|
||||
if($i>5) { break; }
|
||||
uasort($Artists, 'compare');
|
||||
$i = 0;
|
||||
foreach ($Artists as $ID => $Artist) {
|
||||
$i++;
|
||||
if($i>10) { break; }
|
||||
}
|
||||
}
|
||||
|
||||
$JsonBookmarks = array();
|
||||
foreach ($TorrentList as $Torrent) {
|
||||
$JsonTorrents = array();
|
||||
foreach ($Torrent['Torrents'] as $GroupTorrents) {
|
||||
$JsonTorrents[] = array(
|
||||
'id' => (int) $GroupTorrents['ID'],
|
||||
'groupId' => (int) $GroupTorrents['GroupID'],
|
||||
'media' => $GroupTorrents['Media'],
|
||||
'format' => $GroupTorrents['Format'],
|
||||
'encoding' => $GroupTorrents['Encoding'],
|
||||
'remasterYear' => $GroupTorrents['RemasterYear'],
|
||||
'remastered' => $GroupTorrents['Remastered'] == 1,
|
||||
'remasterTitle' => $GroupTorrents['RemasterTitle'],
|
||||
'remasterRecordLabel' => $GroupTorrents['RemasterRecordLabel'],
|
||||
'remasterCatalogueNumber' => $GroupTorrents['RemasterCatalogueNumber'],
|
||||
'scene' => $GroupTorrents['Scene'] == 1,
|
||||
'hasLog' => $GroupTorrents['HasLog'] == 1,
|
||||
'hasCue' => $GroupTorrents['HasCue'] == 1,
|
||||
'logScore' => (float) $GroupTorrents['LogScore'],
|
||||
'fileCount' => (int) $GroupTorrents['FileCount'],
|
||||
'freeTorrent' => $GroupTorrents['FreeTorrent'] == 1,
|
||||
'size' => (float) $GroupTorrents['Size'],
|
||||
'leechers' => (int) $GroupTorrents['Leechers'],
|
||||
'seeders' => (int) $GroupTorrents['Seeders'],
|
||||
'snatched' => (int) $GroupTorrents['Snatched'],
|
||||
'time' => $GroupTorrents['Time'],
|
||||
'hasFile' => (int) $GroupTorrents['HasFile']
|
||||
);
|
||||
}
|
||||
$JsonBookmarks[] = array(
|
||||
'id' => (int) $Torrent['ID'],
|
||||
'name' => $Torrent['Name'],
|
||||
'year' => $Torrent['Year'],
|
||||
'recordLabel' => $Torrent['RecordLabel'],
|
||||
'catalogueNumber' => $Torrent['CatalogueNumber'],
|
||||
'tagList' => $Torrent['TagList'],
|
||||
'releaseType' => $Torrent['ReleaseType'],
|
||||
'vanityHouse' => $Torrent['VanityHouse'] == 1,
|
||||
'torrents' => $JsonTorrents
|
||||
);
|
||||
}
|
||||
|
||||
print
|
||||
json_encode(
|
||||
array(
|
||||
'status' => 'success',
|
||||
'response' => array(
|
||||
'bookmarks' => $JsonBookmarks
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
@ -47,6 +47,8 @@
|
||||
case 'top10':
|
||||
require(SERVER_ROOT.'/sections/ajax/top10/index.php');
|
||||
break;
|
||||
case 'bookmarks':
|
||||
require(SERVER_ROOT.'/sections/ajax/bookmarks/index.php');
|
||||
case 'artist':
|
||||
require(SERVER_ROOT.'/sections/ajax/artist.php');
|
||||
break;
|
||||
@ -71,6 +73,9 @@
|
||||
case 'notifications':
|
||||
require(SERVER_ROOT.'/sections/ajax/notifications.php');
|
||||
break;
|
||||
case 'better':
|
||||
require(SERVER_ROOT.'/sections/ajax/better/index.php');
|
||||
break;
|
||||
default:
|
||||
// If they're screwing around with the query string
|
||||
print json_encode(array('status' => 'failure'));
|
||||
|
@ -93,7 +93,6 @@
|
||||
|
||||
$DB->query("SELECT ID FROM stylesheets WHERE `Default`='1'");
|
||||
list($StyleID) = $DB->next_record();
|
||||
update_tracker('add_user', array('id' => $UserID, 'passkey' => $torrent_pass));
|
||||
$AuthKey = make_secret();
|
||||
|
||||
$DB->query("INSERT INTO users_info (UserID,StyleID,AuthKey, Inviter, JoinDate) VALUES ('$UserID','$StyleID','".db_string($AuthKey)."', '$InviterID', '".sqltime()."')");
|
||||
@ -186,6 +185,7 @@
|
||||
$TPL->set('SITE_URL',SITE_URL);
|
||||
|
||||
send_email($_REQUEST['email'],'New account confirmation at '.SITE_NAME,$TPL->get(),'noreply');
|
||||
update_tracker('add_user', array('id' => $UserID, 'passkey' => $torrent_pass));
|
||||
$Sent=1;
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@
|
||||
$PM .= "\nMessage from ".$LoggedUser['Username'].": ".$PMMessage;
|
||||
}
|
||||
|
||||
$PM .= "\n\nReport was handled by ".$LoggedUser['Username'].".";
|
||||
$PM .= "\n\nReport was handled by [user]".$LoggedUser['Username']."[/user].";
|
||||
|
||||
send_pm($UploaderID, 0, db_string($Escaped['raw_name']), db_string($PM));
|
||||
}
|
||||
|
@ -173,11 +173,11 @@
|
||||
<td><?=time_diff($Current['StartTime'])?></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<?=display_str($Current['CurrentIP'])?> (<?=get_cc($Current['CurrentIP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['CurrentIP'])?>" title="Search">S</a>]<br />
|
||||
<?=display_str($Current['CurrentIP'])?> (<?=get_cc($Current['CurrentIP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['CurrentIP'])?>" title="Search">S</a>] [<a href="http://whatismyipaddress.com/ip/<?=display_str($Current['CurrentIP'])?>" title="WIPA">WI</a>]<br />
|
||||
<?=get_host($Current['CurrentIP'])?>
|
||||
</td>
|
||||
<td>
|
||||
<?=display_str($Current['IP'])?> (<?=get_cc($Current['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['IP'])?>" title="Search">S</a>]<br />
|
||||
<?=display_str($Current['IP'])?> (<?=get_cc($Current['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['IP'])?>" title="Search">S</a>] [<a href="http://whatismyipaddress.com/ip/<?=display_str($Current['IP'])?>" title="WIPA">WI</a>]<br />
|
||||
<?=get_host($Current['IP'])?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -192,7 +192,7 @@
|
||||
<td><?=time_diff($Match['EndTime'])?></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<?=display_str($Match['IP'])?> (<?=get_cc($Match['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" title="Search">S</a>]<br />
|
||||
<?=display_str($Match['IP'])?> (<?=get_cc($Match['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" title="Search">S</a>] [<a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" title="WIPA">WI</a>]<br />
|
||||
<?=get_host($Match['IP'])?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -229,7 +229,7 @@
|
||||
<td><?=time_diff($Match['EndTime'])?></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<?=display_str($Match['IP'])?> (<?=get_cc($Match['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" title="Search">S</a>]<br />
|
||||
<?=display_str($Match['IP'])?> (<?=get_cc($Match['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" title="Search">S</a>] [<a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" title="WIPA">WI</a>]<br />
|
||||
<?=get_host($Match['IP'])?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -248,7 +248,7 @@
|
||||
<td><?=time_diff($Record['EndTime'])?></td>
|
||||
<td><?=time_diff($Record['ElapsedTime'])?></td>
|
||||
<td>
|
||||
<?=display_str($Record['IP'])?> (<?=get_cc($Record['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Record['IP'])?>" title="Search">S</a>]<br />
|
||||
<?=display_str($Record['IP'])?> (<?=get_cc($Record['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Record['IP'])?>" title="Search">S</a>] [<a href="http://whatismyipaddress.com/ip/<?=display_str($Record['IP'])?>" title="WIPA">WI</a>]<br />
|
||||
<?=get_host($Record['IP'])?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -287,7 +287,7 @@
|
||||
<td><?=time_diff($Match['EndTime'])?></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<?=display_str($Match['IP'])?> (<?=get_cc($Match['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" title="Search">S</a>]<br />
|
||||
<?=display_str($Match['IP'])?> (<?=get_cc($Match['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" title="Search">S</a>] [<a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" title="WIPA">WI</a>]<br />
|
||||
<?=get_host($Match['IP'])?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -305,7 +305,7 @@
|
||||
<td><?=time_diff($Invite['EndTime'])?></td>
|
||||
<td><?=time_diff($Invite['AccountAge'])?></td>
|
||||
<td>
|
||||
<?=display_str($Invite['IP'])?> (<?=get_cc($Invite['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Invite['IP'])?>" title="Search">S</a>]<br />
|
||||
<?=display_str($Invite['IP'])?> (<?=get_cc($Invite['IP'])?>) [<a href="user.php?action=search&ip_history=on&ip=<?=display_str($Invite['IP'])?>" title="Search">S</a>] [<a href="http://whatismyipaddress.com/ip/<?=display_str($Invite['IP'])?>" title="WIPA">WI</a>]<br />
|
||||
<?=get_host($Invite['IP'])?>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user