2013-05-28 08:01:02 +00:00
|
|
|
<?php
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL = new SphinxqlQuery();
|
|
|
|
$SphQL->select('id, votes, bounty')->from('requests, requests_delta');
|
|
|
|
|
|
|
|
$SortOrders = array(
|
|
|
|
'votes' => 'votes',
|
|
|
|
'bounty' => 'bounty',
|
|
|
|
'lastvote' => 'lastvote',
|
|
|
|
'filled' => 'timefilled',
|
|
|
|
'year' => 'year',
|
|
|
|
'created' => 'timeadded',
|
|
|
|
'random' => false);
|
|
|
|
|
|
|
|
if (empty($_GET['order']) || !isset($SortOrders[$_GET['order']])) {
|
|
|
|
$_GET['order'] = 'created';
|
|
|
|
}
|
|
|
|
$OrderBy = $_GET['order'];
|
2012-01-27 08:00:19 +00:00
|
|
|
|
2014-03-16 08:00:50 +00:00
|
|
|
if (!empty($_GET['sort']) && $_GET['sort'] === 'asc') {
|
2013-09-13 08:00:53 +00:00
|
|
|
$OrderWay = 'asc';
|
|
|
|
} else {
|
|
|
|
$_GET['sort'] = 'desc';
|
|
|
|
$OrderWay = 'desc';
|
|
|
|
}
|
|
|
|
$NewSort = $_GET['sort'] === 'asc' ? 'desc' : 'asc';
|
|
|
|
|
|
|
|
if ($OrderBy === 'random') {
|
|
|
|
$SphQL->order_by('RAND()', '');
|
|
|
|
unset($_GET['page']);
|
|
|
|
} else {
|
|
|
|
$SphQL->order_by($SortOrders[$OrderBy], $OrderWay);
|
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
|
|
|
|
$Submitted = !empty($_GET['submit']);
|
2013-02-22 08:00:24 +00:00
|
|
|
|
|
|
|
//Paranoia
|
2013-09-13 08:00:53 +00:00
|
|
|
if (!empty($_GET['userid'])) {
|
|
|
|
if (!is_number($_GET['userid'])) {
|
|
|
|
json_die("failure");
|
|
|
|
}
|
|
|
|
$UserInfo = Users::user_info($_GET['userid']);
|
|
|
|
if (empty($UserInfo)) {
|
|
|
|
json_die("failure");
|
|
|
|
}
|
|
|
|
$Perms = Permissions::get_permissions($UserInfo['PermissionID']);
|
|
|
|
$UserClass = $Perms['Class'];
|
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
$BookmarkView = false;
|
|
|
|
|
2013-04-17 08:00:58 +00:00
|
|
|
if (empty($_GET['type'])) {
|
2012-01-27 08:00:19 +00:00
|
|
|
$Title = 'Requests';
|
2014-03-16 08:00:50 +00:00
|
|
|
if (empty($_GET['showall'])) {
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->where('visible', 1);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
} else {
|
2013-05-01 08:00:16 +00:00
|
|
|
switch ($_GET['type']) {
|
2012-01-27 08:00:19 +00:00
|
|
|
case 'created':
|
2013-09-13 08:00:53 +00:00
|
|
|
if (!empty($UserInfo)) {
|
|
|
|
if (!check_paranoia('requestsvoted_list', $UserInfo['Paranoia'], $Perms['Class'], $UserInfo['ID'])) {
|
|
|
|
json_die("failure");
|
|
|
|
}
|
|
|
|
$Title = "Requests created by $UserInfo[Username]";
|
|
|
|
$SphQL->where('userid', $UserInfo['ID']);
|
|
|
|
} else {
|
|
|
|
$Title = 'My requests';
|
|
|
|
$SphQL->where('userid', $LoggedUser['ID']);
|
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
break;
|
|
|
|
case 'voted':
|
2013-09-13 08:00:53 +00:00
|
|
|
if (!empty($UserInfo)) {
|
|
|
|
if (!check_paranoia('requestsvoted_list', $UserInfo['Paranoia'], $Perms['Class'], $UserInfo['ID'])) {
|
2013-04-24 08:00:23 +00:00
|
|
|
json_die("failure");
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
2013-09-13 08:00:53 +00:00
|
|
|
$Title = "Requests voted for by $UserInfo[Username]";
|
|
|
|
$SphQL->where('voter', $UserInfo['ID']);
|
2012-01-27 08:00:19 +00:00
|
|
|
} else {
|
2013-09-13 08:00:53 +00:00
|
|
|
$Title = 'Requests I have voted on';
|
|
|
|
$SphQL->where('voter', $LoggedUser['ID']);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'filled':
|
2013-09-13 08:00:53 +00:00
|
|
|
if (!empty($UserInfo)) {
|
|
|
|
if (!check_paranoia('requestsfilled_list', $UserInfo['Paranoia'], $Perms['Class'], $UserInfo['ID'])) {
|
2013-04-24 08:00:23 +00:00
|
|
|
json_die("failure");
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
2013-09-13 08:00:53 +00:00
|
|
|
$Title = "Requests filled by $UserInfo[Username]";
|
|
|
|
$SphQL->where('fillerid', $UserInfo['ID']);
|
|
|
|
} else {
|
|
|
|
$Title = 'Requests I have filled';
|
|
|
|
$SphQL->where('fillerid', $LoggedUser['ID']);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'bookmarks':
|
|
|
|
$Title = 'Your bookmarked requests';
|
|
|
|
$BookmarkView = true;
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->where('bookmarker', $LoggedUser['ID']);
|
2012-01-27 08:00:19 +00:00
|
|
|
break;
|
|
|
|
default:
|
2013-04-24 08:00:23 +00:00
|
|
|
json_die("failure");
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-17 08:00:58 +00:00
|
|
|
if ($Submitted && empty($_GET['show_filled'])) {
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->where('torrentid', 0);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2013-09-13 08:00:53 +00:00
|
|
|
$EnableNegation = false; // Sphinx needs at least one positive search condition to support the NOT operator
|
|
|
|
|
|
|
|
if (!empty($_GET['formats'])) {
|
|
|
|
$FormatArray = $_GET['formats'];
|
|
|
|
if (count($FormatArray) !== count($Formats)) {
|
|
|
|
$FormatNameArray = array();
|
|
|
|
foreach ($FormatArray as $Index => $MasterIndex) {
|
|
|
|
if (isset($Formats[$MasterIndex])) {
|
|
|
|
$FormatNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Formats[$MasterIndex]), '-.', ' ') . '"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (count($FormatNameArray) >= 1) {
|
|
|
|
$EnableNegation = true;
|
|
|
|
if (!empty($_GET['formats_strict'])) {
|
|
|
|
$SearchString = '(' . implode(' | ', $FormatNameArray) . ')';
|
2012-01-27 08:00:19 +00:00
|
|
|
} else {
|
2013-09-13 08:00:53 +00:00
|
|
|
$SearchString = '(any | ' . implode(' | ', $FormatNameArray) . ')';
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->where_match($SearchString, 'formatlist', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($_GET['media'])) {
|
|
|
|
$MediaArray = $_GET['media'];
|
|
|
|
if (count($MediaArray) !== count($Media)) {
|
|
|
|
$MediaNameArray = array();
|
|
|
|
foreach ($MediaArray as $Index => $MasterIndex) {
|
|
|
|
if (isset($Media[$MasterIndex])) {
|
|
|
|
$MediaNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Media[$MasterIndex]), '-.', ' ') . '"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count($MediaNameArray) >= 1) {
|
|
|
|
$EnableNegation = true;
|
|
|
|
if (!empty($_GET['media_strict'])) {
|
|
|
|
$SearchString = '(' . implode(' | ', $MediaNameArray) . ')';
|
|
|
|
} else {
|
|
|
|
$SearchString = '(any | ' . implode(' | ', $MediaNameArray) . ')';
|
|
|
|
}
|
|
|
|
$SphQL->where_match($SearchString, 'medialist', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($_GET['bitrates'])) {
|
|
|
|
$BitrateArray = $_GET['bitrates'];
|
|
|
|
if (count($BitrateArray) !== count($Bitrates)) {
|
|
|
|
$BitrateNameArray = array();
|
|
|
|
foreach ($BitrateArray as $Index => $MasterIndex) {
|
|
|
|
if (isset($Bitrates[$MasterIndex])) {
|
|
|
|
$BitrateNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Bitrates[$MasterIndex]), '-.', ' ') . '"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count($BitrateNameArray) >= 1) {
|
|
|
|
$EnableNegation = true;
|
|
|
|
if (!empty($_GET['bitrate_strict'])) {
|
|
|
|
$SearchString = '(' . implode(' | ', $BitrateNameArray) . ')';
|
|
|
|
} else {
|
|
|
|
$SearchString = '(any | ' . implode(' | ', $BitrateNameArray) . ')';
|
|
|
|
}
|
|
|
|
$SphQL->where_match($SearchString, 'bitratelist', false);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
2013-09-13 08:00:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($_GET['search'])) {
|
|
|
|
$SearchString = trim($_GET['search']);
|
|
|
|
if ($SearchString !== '') {
|
|
|
|
$SearchWords = array('include' => array(), 'exclude' => array());
|
|
|
|
$Words = explode(' ', $SearchString);
|
|
|
|
foreach ($Words as $Word) {
|
|
|
|
$Word = trim($Word);
|
|
|
|
// Skip isolated hyphens to enable "Artist - Title" searches
|
|
|
|
if ($Word === '-') {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if ($Word[0] === '!' && strlen($Word) >= 2) {
|
|
|
|
if (strpos($Word, '!', 1) === false) {
|
|
|
|
$SearchWords['exclude'][] = $Word;
|
|
|
|
} else {
|
|
|
|
$SearchWords['include'][] = $Word;
|
|
|
|
$EnableNegation = true;
|
|
|
|
}
|
|
|
|
} elseif ($Word !== '') {
|
|
|
|
$SearchWords['include'][] = $Word;
|
|
|
|
$EnableNegation = true;
|
|
|
|
}
|
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-13 08:00:53 +00:00
|
|
|
if (!isset($_GET['tags_type']) || $_GET['tags_type'] === '1') {
|
|
|
|
$TagType = 1;
|
|
|
|
$_GET['tags_type'] = '1';
|
|
|
|
} else {
|
|
|
|
$TagType = 0;
|
|
|
|
$_GET['tags_type'] = '0';
|
|
|
|
}
|
2013-05-04 08:00:48 +00:00
|
|
|
if (!empty($_GET['tags'])) {
|
2014-04-06 08:00:49 +00:00
|
|
|
$SearchTags = array('include' => array(), 'exclude' => array());
|
2012-01-27 08:00:19 +00:00
|
|
|
$Tags = explode(',', $_GET['tags']);
|
|
|
|
foreach ($Tags as $Tag) {
|
2014-04-06 08:00:49 +00:00
|
|
|
$Tag = trim($Tag);
|
|
|
|
if ($Tag[0] === '!' && strlen($Tag) >= 2) {
|
|
|
|
if (strpos($Tag, '!', 1) === false) {
|
|
|
|
$SearchTags['exclude'][] = $Tag;
|
|
|
|
} else {
|
|
|
|
$SearchTags['include'][] = $Tag;
|
|
|
|
$EnableNegation = true;
|
|
|
|
}
|
|
|
|
} elseif ($Tag !== '') {
|
|
|
|
$SearchTags['include'][] = $Tag;
|
|
|
|
$EnableNegation = true;
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-06 08:00:49 +00:00
|
|
|
$TagFilter = Tags::tag_filter_sph($SearchTags, $EnableNegation, $TagType);
|
|
|
|
|
|
|
|
if (!empty($TagFilter['predicate'])) {
|
|
|
|
$SphQL->where_match($TagFilter['predicate'], 'taglist', false);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
2013-09-13 08:00:53 +00:00
|
|
|
} elseif (!isset($_GET['tags_type']) || $_GET['tags_type'] !== '0') {
|
|
|
|
$_GET['tags_type'] = 1;
|
2012-01-27 08:00:19 +00:00
|
|
|
} else {
|
2013-09-13 08:00:53 +00:00
|
|
|
$_GET['tags_type'] = 0;
|
|
|
|
}
|
|
|
|
|
2014-04-06 08:00:49 +00:00
|
|
|
if (isset($SearchWords)) {
|
|
|
|
$QueryParts = array();
|
|
|
|
if (!$EnableNegation && !empty($SearchWords['exclude'])) {
|
|
|
|
$SearchWords['include'] = array_merge($SearchWords['include'], $SearchWords['exclude']);
|
|
|
|
unset($SearchWords['exclude']);
|
|
|
|
}
|
|
|
|
foreach ($SearchWords['include'] as $Word) {
|
|
|
|
$QueryParts[] = Sphinxql::sph_escape_string($Word);
|
|
|
|
}
|
|
|
|
if (!empty($SearchWords['exclude'])) {
|
|
|
|
foreach ($SearchWords['exclude'] as $Word) {
|
|
|
|
$QueryParts[] = '!' . Sphinxql::sph_escape_string(substr($Word, 1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!empty($QueryParts)) {
|
|
|
|
$SearchString = implode(' ', $QueryParts);
|
|
|
|
$SphQL->where_match($SearchString, '*', false);
|
2013-09-13 08:00:53 +00:00
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2013-04-17 08:00:58 +00:00
|
|
|
if (!empty($_GET['filter_cat'])) {
|
2012-08-12 08:00:16 +00:00
|
|
|
$CategoryArray = array_keys($_GET['filter_cat']);
|
2013-07-10 00:08:53 +00:00
|
|
|
if (count($CategoryArray) !== count($Categories)) {
|
2013-04-17 08:00:58 +00:00
|
|
|
foreach ($CategoryArray as $Key => $Index) {
|
2013-05-04 08:00:48 +00:00
|
|
|
if (!isset($Categories[$Index - 1])) {
|
2012-08-12 08:00:16 +00:00
|
|
|
unset($CategoryArray[$Key]);
|
|
|
|
}
|
|
|
|
}
|
2013-04-17 08:00:58 +00:00
|
|
|
if (count($CategoryArray) >= 1) {
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->where('categoryid', $CategoryArray);
|
2012-08-12 08:00:16 +00:00
|
|
|
}
|
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2013-04-17 08:00:58 +00:00
|
|
|
if (!empty($_GET['releases'])) {
|
2012-01-27 08:00:19 +00:00
|
|
|
$ReleaseArray = $_GET['releases'];
|
2013-07-10 00:08:53 +00:00
|
|
|
if (count($ReleaseArray) !== count($ReleaseTypes)) {
|
2013-04-17 08:00:58 +00:00
|
|
|
foreach ($ReleaseArray as $Index => $Value) {
|
|
|
|
if (!isset($ReleaseTypes[$Value])) {
|
2012-08-12 08:00:16 +00:00
|
|
|
unset($ReleaseArray[$Index]);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
2013-04-17 08:00:58 +00:00
|
|
|
if (count($ReleaseArray) >= 1) {
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->where('releasetype', $ReleaseArray);
|
2012-08-12 08:00:16 +00:00
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-16 08:00:50 +00:00
|
|
|
if (!empty($_GET['requestor'])) {
|
2013-04-17 08:00:58 +00:00
|
|
|
if (is_number($_GET['requestor'])) {
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->where('userid', $_GET['requestor']);
|
2012-01-27 08:00:19 +00:00
|
|
|
} else {
|
2013-09-13 08:00:53 +00:00
|
|
|
error(404);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-17 08:00:58 +00:00
|
|
|
if (isset($_GET['year'])) {
|
2013-09-13 08:00:53 +00:00
|
|
|
if (is_number($_GET['year']) || $_GET['year'] === '0') {
|
|
|
|
$SphQL->where('year', $_GET['year']);
|
2012-01-27 08:00:19 +00:00
|
|
|
} else {
|
2013-09-13 08:00:53 +00:00
|
|
|
error(404);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-17 08:00:58 +00:00
|
|
|
if (!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
|
2012-08-12 08:00:16 +00:00
|
|
|
$Page = $_GET['page'];
|
2013-09-13 08:00:53 +00:00
|
|
|
$Offset = ($Page - 1) * REQUESTS_PER_PAGE;
|
|
|
|
$SphQL->limit($Offset, REQUESTS_PER_PAGE, $Offset + REQUESTS_PER_PAGE);
|
2012-01-27 08:00:19 +00:00
|
|
|
} else {
|
|
|
|
$Page = 1;
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQL->limit(0, REQUESTS_PER_PAGE, REQUESTS_PER_PAGE);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
|
2013-09-13 08:00:53 +00:00
|
|
|
$SphQLResult = $SphQL->query();
|
|
|
|
$NumResults = (int)$SphQLResult->get_meta('total_found');
|
|
|
|
if ($NumResults > 0) {
|
|
|
|
$SphRequests = $SphQLResult->to_array('id');
|
|
|
|
if ($OrderBy === 'random') {
|
|
|
|
$NumResults = count($RequestIDs);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
2013-09-13 08:00:53 +00:00
|
|
|
if ($NumResults > REQUESTS_PER_PAGE) {
|
|
|
|
if (($Page - 1) * REQUESTS_PER_PAGE > $NumResults) {
|
|
|
|
$Page = 0;
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-11 08:00:22 +00:00
|
|
|
if ($NumResults == 0) {
|
2013-05-14 08:00:34 +00:00
|
|
|
json_die("success", array(
|
|
|
|
'currentPage' => 1,
|
|
|
|
'pages' => 1,
|
|
|
|
'results' => array()
|
|
|
|
));
|
2012-02-11 08:00:22 +00:00
|
|
|
} else {
|
|
|
|
$JsonResults = array();
|
2012-01-27 08:00:19 +00:00
|
|
|
$TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18
|
2013-09-13 08:00:53 +00:00
|
|
|
$Requests = Requests::get_requests(array_keys($SphRequests));
|
|
|
|
foreach ($SphRequests as $RequestID => $SphRequest) {
|
|
|
|
$Request = $Requests[$RequestID];
|
|
|
|
$VoteCount = $SphRequest['votes'];
|
|
|
|
$Bounty = $SphRequest['bounty'] * 1024; // Sphinx stores bounty in kB
|
|
|
|
$Requestor = Users::user_info($Request['UserID']);
|
|
|
|
$Filler = $Request['FillerID'] ? Users::user_info($Request['FillerID']) : null;
|
|
|
|
|
|
|
|
if ($Request['CategoryID'] == 0) {
|
2013-05-05 08:00:31 +00:00
|
|
|
$CategoryName = 'Unknown';
|
2012-01-27 08:00:19 +00:00
|
|
|
} else {
|
2013-09-13 08:00:53 +00:00
|
|
|
$CategoryName = $Categories[$Request['CategoryID'] - 1];
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
2013-02-22 08:00:24 +00:00
|
|
|
|
2012-02-18 08:00:22 +00:00
|
|
|
$JsonArtists = array();
|
2013-05-05 08:00:31 +00:00
|
|
|
if ($CategoryName == 'Music') {
|
2013-05-13 08:00:33 +00:00
|
|
|
$ArtistForm = Requests::get_artists($RequestID);
|
2012-02-18 08:00:22 +00:00
|
|
|
$JsonArtists = array_values($ArtistForm);
|
2012-01-27 08:00:19 +00:00
|
|
|
}
|
2012-02-11 08:00:22 +00:00
|
|
|
|
|
|
|
$Tags = $Request['Tags'];
|
2013-02-22 08:00:24 +00:00
|
|
|
|
2012-01-27 08:00:19 +00:00
|
|
|
$JsonResults[] = array(
|
2013-09-13 08:00:53 +00:00
|
|
|
'requestId' => (int)$RequestID,
|
|
|
|
'requestorId' => (int)$Requestor['ID'],
|
|
|
|
'requestorName' => $Requestor['Username'],
|
|
|
|
'timeAdded' => $Request['TimeAdded'],
|
|
|
|
'lastVote' => $Request['LastVote'],
|
|
|
|
'voteCount' => (int)$VoteCount,
|
|
|
|
'bounty' => (int)$Bounty,
|
|
|
|
'categoryId' => (int)$Request['CategoryID'],
|
2012-02-11 08:00:22 +00:00
|
|
|
'categoryName' => $CategoryName,
|
2012-02-18 08:00:22 +00:00
|
|
|
'artists' => $JsonArtists,
|
2013-09-13 08:00:53 +00:00
|
|
|
'title' => $Request['Title'],
|
|
|
|
'year' => (int)$Request['Year'],
|
|
|
|
'image' => $Request['Image'],
|
|
|
|
'description' => $Request['Description'],
|
|
|
|
'recordLabel' => $Request['RecordLabel'],
|
|
|
|
'catalogueNumber' => $Request['CatalogueNumber'],
|
|
|
|
'releaseType' => $ReleaseTypes[$Request['ReleaseType']],
|
|
|
|
'bitrateList' => $Request['BitrateList'],
|
|
|
|
'formatList' => $Request['FormatList'],
|
|
|
|
'mediaList' => $Request['MediaList'],
|
|
|
|
'logCue' => $Request['LogCue'],
|
|
|
|
'isFilled' => ($Request['TorrentID'] > 0),
|
|
|
|
'fillerId' => (int)$Request['FillerID'],
|
|
|
|
'fillerName' => $Filler ? $Filler['Username'] : '',
|
|
|
|
'torrentId' => (int)$Request['TorrentID'],
|
|
|
|
'timeFilled' => $Request['TimeFilled'] == 0 ? '' : $Request['TimeFilled']
|
2012-01-27 08:00:19 +00:00
|
|
|
);
|
|
|
|
}
|
2013-09-13 08:00:53 +00:00
|
|
|
|
2013-05-14 08:00:34 +00:00
|
|
|
json_die("success", array(
|
|
|
|
'currentPage' => intval($Page),
|
|
|
|
'pages' => ceil($NumResults / REQUESTS_PER_PAGE),
|
|
|
|
'results' => $JsonResults
|
|
|
|
));
|
2012-02-11 08:00:22 +00:00
|
|
|
}
|
2012-01-27 08:00:19 +00:00
|
|
|
?>
|