mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 04:01:35 +00:00
Empty commit
This commit is contained in:
parent
96f6aa69fe
commit
a7310292f8
@ -126,13 +126,13 @@ public function header () {
|
||||
<table id="manage_collage_table">
|
||||
<thead>
|
||||
<tr class="colhead">
|
||||
<th style="width: 7%;">Order</th>
|
||||
<th style="width: 7%;" data-sorter="false">Order</th>
|
||||
<th style="width: 1%;"><span><abbr class="tooltip" title="Current order">#</abbr></span></th>
|
||||
<th style="width: 1%;"><span>Year</span></th>
|
||||
<th style="width: 15%;"><span>Artist</span></th>
|
||||
<th><span>Torrent</span></th>
|
||||
<th style="width: 5%;"><span>Bookmarked</span></th>
|
||||
<th style="width: 1%;" id="check_all"><span>Remove</span></th>
|
||||
<th style="width: 15%;" data-sorter="ignoreArticles"><span>Artist</span></th>
|
||||
<th data-sorter="ignoreArticles"><span>Torrent</span></th>
|
||||
<th style="width: 5%;" data-sorter="relativeTime"><span>Bookmarked</span></th>
|
||||
<th style="width: 1%;" id="check_all" data-sorter="false"><span>Remove</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -12,7 +12,6 @@
|
||||
'site_upload' => 'Upload torrent access.',
|
||||
'site_vote' => 'Request vote access.',
|
||||
'site_submit_requests' => 'Request create access.',
|
||||
'site_see_old_requests' => 'View old requests.',
|
||||
'site_advanced_search' => 'Advanced search access.',
|
||||
'site_top10' => 'Top 10 access.',
|
||||
'site_advanced_top10' => 'Advanced Top 10 access.',
|
||||
@ -125,7 +124,6 @@ function permissions_form() {
|
||||
display_perm('site_upload','Can upload.');
|
||||
display_perm('site_vote','Can vote on requests.');
|
||||
display_perm('site_submit_requests','Can submit requests.');
|
||||
display_perm('site_see_old_requests','Can see old requests.');
|
||||
display_perm('site_advanced_search','Can use advanced search.');
|
||||
display_perm('site_top10','Can access top 10.');
|
||||
display_perm('site_torrents_notify','Can access torrents notifications system.');
|
||||
|
@ -1,5 +1,17 @@
|
||||
CHANGE LOG
|
||||
|
||||
2014-03-16 by hateradio
|
||||
Update TableSorter JS; remove minified version; improve table sorting by adding attributes to table headings instead of relying on JS to disable columns.
|
||||
|
||||
2014-03-16 by alderaan
|
||||
Remove permission "site_see_old_requests"
|
||||
|
||||
2014-03-16 by alderaan
|
||||
Remove sections/requests/requests.php.presphinx
|
||||
|
||||
2014-03-16 by alderaan
|
||||
requests.php: Add <label> elements for the "include filled" and "include old" check boxes
|
||||
|
||||
2014-03-12 by Ajax
|
||||
Open donor icon links in a new tab
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@
|
||||
}
|
||||
$OrderBy = $_GET['order'];
|
||||
|
||||
if (!empty($_GET['sort']) && $_GET['sort'] == 'asc') {
|
||||
if (!empty($_GET['sort']) && $_GET['sort'] === 'asc') {
|
||||
$OrderWay = 'asc';
|
||||
} else {
|
||||
$_GET['sort'] = 'desc';
|
||||
@ -49,7 +49,7 @@
|
||||
|
||||
if (empty($_GET['type'])) {
|
||||
$Title = 'Requests';
|
||||
if (!check_perms('site_see_old_requests') || empty($_GET['showall'])) {
|
||||
if (empty($_GET['showall'])) {
|
||||
$SphQL->where('visible', 1);
|
||||
}
|
||||
} else {
|
||||
@ -289,7 +289,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET['requestor']) && check_perms('site_see_old_requests')) {
|
||||
if (!empty($_GET['requestor'])) {
|
||||
if (is_number($_GET['requestor'])) {
|
||||
$SphQL->where('userid', $_GET['requestor']);
|
||||
} else {
|
||||
|
@ -38,7 +38,7 @@
|
||||
$TorrentList = array();
|
||||
}
|
||||
|
||||
View::show_header("Manage collage: $Name", 'jquery-ui,jquery.tablesorter.min,sort');
|
||||
View::show_header("Manage collage: $Name", 'jquery-ui,jquery.tablesorter,sort');
|
||||
|
||||
?>
|
||||
<div class="thin">
|
||||
@ -66,14 +66,14 @@
|
||||
<table id="manage_collage_table">
|
||||
<thead>
|
||||
<tr class="colhead">
|
||||
<th style="width: 7%;">Order</th>
|
||||
<th style="width: 7%;" data-sorter="false">Order</th>
|
||||
<th style="width: 1%;"><span><abbr class="tooltip" title="Current rank">#</abbr></span></th>
|
||||
<th style="width: 7%;"><span>Cat. #</span></th>
|
||||
<th style="width: 1%;"><span>Year</span></th>
|
||||
<th style="width: 15%;"><span>Artist</span></th>
|
||||
<th><span>Torrent group</span></th>
|
||||
<th style="width: 15%;" data-sorter="ignoreArticles"><span>Artist</span></th>
|
||||
<th data-sorter="ignoreArticles"><span>Torrent</span></th>
|
||||
<th style="width: 1%;"><span>User</span></th>
|
||||
<th style="width: 1%; text-align: right;" class="nobr"><span><abbr class="tooltip" title="Modify an individual row">Tweak</abbr></span></th>
|
||||
<th style="width: 1%; text-align: right;" class="nobr" data-sorter="false"><span><abbr class="tooltip" title="Modify an individual row">Tweak</abbr></span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -32,7 +32,7 @@
|
||||
$Artists = $DB->to_array('ArtistID', MYSQLI_ASSOC);
|
||||
|
||||
|
||||
View::show_header("Manage collage $Name", 'jquery-ui,jquery.tablesorter.min,sort');
|
||||
View::show_header("Manage collage $Name", 'jquery-ui,jquery.tablesorter,sort');
|
||||
|
||||
?>
|
||||
|
||||
@ -61,11 +61,11 @@
|
||||
<table id="manage_collage_table">
|
||||
<thead>
|
||||
<tr class="colhead">
|
||||
<th style="width: 7%;">Order</th>
|
||||
<th style="width: 7%;" data-sorter="false">Order</th>
|
||||
<th style="width: 1%;"><span><abbr class="tooltip" title="Current rank">#</abbr></span></th>
|
||||
<th style="text-align: left;"><span>Artist</span></th>
|
||||
<th style="width: 7%;"><span>User</span></th>
|
||||
<th style="width: 7%; text-align: right;" class="nobr"><span><abbr class="tooltip" title="Modify an individual row.">Tweak</abbr></span></th>
|
||||
<th style="text-align: left;" data-sorter="ignoreArticles"><span>Artist</span></th>
|
||||
<th style="width: 7%;" data-sorter="ignoreArticles"><span>User</span></th>
|
||||
<th style="width: 7%; text-align: right;" class="nobr" data-sorter="false"><span><abbr class="tooltip" title="Modify an individual row.">Tweak</abbr></span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
$OrderBy = $_GET['order'];
|
||||
|
||||
if (!empty($_GET['sort']) && $_GET['sort'] == 'asc') {
|
||||
if (!empty($_GET['sort']) && $_GET['sort'] === 'asc') {
|
||||
$OrderWay = 'asc';
|
||||
} else {
|
||||
$_GET['sort'] = 'desc';
|
||||
@ -49,7 +49,7 @@
|
||||
|
||||
if (empty($_GET['type'])) {
|
||||
$Title = 'Requests';
|
||||
if (!check_perms('site_see_old_requests') || empty($_GET['showall'])) {
|
||||
if (empty($_GET['showall'])) {
|
||||
$SphQL->where('visible', 1);
|
||||
}
|
||||
} else {
|
||||
@ -291,7 +291,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET['requestor']) && check_perms('site_see_old_requests')) {
|
||||
if (!empty($_GET['requestor'])) {
|
||||
if (is_number($_GET['requestor'])) {
|
||||
$SphQL->where('userid', $_GET['requestor']);
|
||||
} else {
|
||||
@ -388,26 +388,25 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="include_filled">
|
||||
<td class="label">Include filled:</td>
|
||||
<td class="label"><label for="include_filled_box">Include filled:</label></td>
|
||||
<td>
|
||||
<input type="checkbox" name="show_filled"<? if (!$Submitted || !empty($_GET['show_filled']) || (!$Submitted && !empty($_GET['type']) && $_GET['type'] === 'filled')) { ?> checked="checked"<? } ?> />
|
||||
<input type="checkbox" id="include_filled_box" name="show_filled"<? if (!$Submitted || !empty($_GET['show_filled']) || (!$Submitted && !empty($_GET['type']) && $_GET['type'] === 'filled')) { ?> checked="checked"<? } ?> />
|
||||
</td>
|
||||
</tr>
|
||||
<? if (check_perms('site_see_old_requests')) { ?>
|
||||
<tr id="include_old">
|
||||
<td class="label">Include old:</td>
|
||||
<td class="label"><label for="include_old_box">Include old:</label></td>
|
||||
<td>
|
||||
<input type="checkbox" name="showall"<? if (!empty($_GET['showall'])) { ?> checked="checked"<? } ?> />
|
||||
<input type="checkbox" id="include_old_box" name="showall"<? if (!empty($_GET['showall'])) { ?> checked="checked"<? } ?> />
|
||||
</td>
|
||||
</tr>
|
||||
<? /* ?>
|
||||
<? /* ?>
|
||||
<tr>
|
||||
<td class="label">Requested by:</td>
|
||||
<td>
|
||||
<input type="text" name="requester" size="75" value="<?=display_str($_GET['requester'])?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<? */} ?>
|
||||
<? */ ?>
|
||||
</table>
|
||||
<table class="layout cat_list">
|
||||
<?
|
||||
|
@ -1,504 +0,0 @@
|
||||
<?php
|
||||
|
||||
list($Page, $Limit) = page_limit(REQUESTS_PER_PAGE);
|
||||
$OrderWays = array('name', 'votes', 'bounty', 'filler', 'requestor', 'created', 'lastvote', 'filled');
|
||||
$Wheres = array();
|
||||
$ExtraJoins = array();
|
||||
|
||||
$Submitted = !empty($_GET['submit']);
|
||||
|
||||
if (!empty($_GET['search'])) {
|
||||
$Words = explode(' ', $_GET['search']);
|
||||
$SearchWords = array();
|
||||
foreach ($Words AS $Word) {
|
||||
$Wheres[] = "LOCATE('".db_string($Word)."', r.Title)";
|
||||
}
|
||||
}
|
||||
|
||||
$TagMatcher = (!empty($_GET['tagmatcher']) && $_GET['tagmatcher'] === 'any') ? 'any' : 'all';
|
||||
|
||||
if (!empty($_GET['tags'])) {
|
||||
$Tags = explode(',', $_GET['tags']);
|
||||
$TagNames = array();
|
||||
foreach ($Tags as $Tag) {
|
||||
$Tag = Misc::sanitize_tag($Tag);
|
||||
if (!empty($Tag)) {
|
||||
$TagNames[] = $Tag;
|
||||
}
|
||||
}
|
||||
|
||||
if ($TagMatcher === 'any') {
|
||||
$ExtraJoins[] = "LEFT JOIN requests_tags AS rt ON r.ID=rt.RequestID";
|
||||
$ExtraJoins[] = "LEFT JOIN tags AS t ON t.ID=rt.TagID";
|
||||
$Wheres[] = "t.Name IN ('".implode("', '", $TagNames)."')";
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET['requestor']) && check_perms('site_see_old_requests')) {
|
||||
$Wheres[] = "u.Username LIKE ".db_string($_GET['requestor']);
|
||||
}
|
||||
|
||||
if (!empty($_GET['filter_cat'])) {
|
||||
$Keys = array_keys($_GET['filter_cat']);
|
||||
$Wheres[] = "r.CategoryID IN (".implode(", ", $Keys).")";
|
||||
}
|
||||
|
||||
if (!empty($_GET['releases'])) {
|
||||
$ReleaseArray = $_GET['releases'];
|
||||
if (count($ReleaseArray) !== count($ReleaseTypes)) {
|
||||
foreach ($ReleaseArray as $Index => $Value) {
|
||||
if (is_number($Value)) {
|
||||
$Wheres[] = "r.ReleaseType = $Value";
|
||||
} else {
|
||||
error(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET['formats'])) {
|
||||
$FormatArray = $_GET['formats'];
|
||||
if (count($FormatArray) !== count($Formats)) {
|
||||
$FormatNameArray = array();
|
||||
foreach ($FormatArray as $Index => $MasterIndex) {
|
||||
if (array_key_exists($Index, $Formats)) {
|
||||
$FormatNameArray[$Index] = $Formats[$MasterIndex];
|
||||
} else {
|
||||
//Hax
|
||||
error(0);
|
||||
}
|
||||
}
|
||||
foreach ($FormatNameArray as $Index => $Name) {
|
||||
$Wheres[] = "LOCATE('".db_string($Name)."', r.FormatList)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET['media'])) {
|
||||
$MediaArray = $_GET['media'];
|
||||
if (count($MediaArray) !== count($Media)) {
|
||||
$MediaNameArray = array();
|
||||
foreach ($MediaArray as $Index => $MasterIndex) {
|
||||
if (array_key_exists($Index, $Media)) {
|
||||
$MediaNameArray[$Index] = $Media[$MasterIndex];
|
||||
} else {
|
||||
//Hax
|
||||
error(0);
|
||||
}
|
||||
}
|
||||
foreach ($MediaNameArray as $Index => $Name) {
|
||||
$Wheres[] = "LOCATE('".db_string($Name)."', r.MediaList)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_GET['bitrates'])) {
|
||||
$BitrateArray = $_GET['bitrates'];
|
||||
if (count($BitrateArray) !== count($Bitrates)) {
|
||||
$BitrateNameArray = array();
|
||||
foreach ($BitrateArray as $Index => $MasterIndex) {
|
||||
if (array_key_exists($Index, $Bitrates)) {
|
||||
$BitrateNameArray[$Index] = $Bitrates[$MasterIndex];
|
||||
} else {
|
||||
//Hax
|
||||
error(0);
|
||||
}
|
||||
}
|
||||
foreach ($BitrateNameArray as $Index => $Name) {
|
||||
$Wheres[] = "LOCATE('".db_string($Name)."', r.BitrateList)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($_GET['type'])) {
|
||||
$Title = 'Requests';
|
||||
if (!check_perms('site_see_old_requests') || empty($_GET['showall'])) {
|
||||
$Wheres[] = "(TorrentID = 0 OR (TimeFilled > (NOW() - INTERVAL 3 DAY)))";
|
||||
}
|
||||
} else {
|
||||
switch ($_GET['type']) {
|
||||
case 'created':
|
||||
$Title = 'My requests';
|
||||
$Wheres[] = "r.UserID = ".$LoggedUser['ID'];
|
||||
break;
|
||||
case 'voted':
|
||||
$Title = "Requests I've voted on";
|
||||
$Wheres[] = "_rv.UserID = ".$LoggedUser['ID'];
|
||||
$ExtraJoins[] = "LEFT JOIN requests_votes AS _rv ON _rv.RequestID=r.ID";
|
||||
break;
|
||||
case 'filled':
|
||||
if (empty($_GET['userid']) || !is_number($_GET['userid'])) {
|
||||
error(404);
|
||||
} else {
|
||||
$Title = "Requests filled";
|
||||
$Wheres = "r.FillerID = ".$_GET['userid'];
|
||||
}
|
||||
default:
|
||||
error(404);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (empty($_GET['order'])) {
|
||||
$CurrentOrder = 'created';
|
||||
$CurrentSort = 'desc';
|
||||
$NewSort = 'asc';
|
||||
} else {
|
||||
if (in_array($_GET['order'], $OrderWays)) {
|
||||
$CurrentOrder = $_GET['order'];
|
||||
if ($_GET['sort'] === 'asc' || $_GET['sort'] === 'desc') {
|
||||
$CurrentSort = $_GET['sort'];
|
||||
$NewSort = ($_GET['sort'] === 'asc') ? 'desc' : 'asc';
|
||||
} else {
|
||||
error(404);
|
||||
}
|
||||
} else {
|
||||
error(404);
|
||||
}
|
||||
}
|
||||
|
||||
$CurrentURL = get_url(array('order', 'sort'));
|
||||
|
||||
switch ($CurrentOrder) {
|
||||
case 'name':
|
||||
$OrderBy = "r.Title";
|
||||
break;
|
||||
case 'votes':
|
||||
$OrderBy = "Votes";
|
||||
break;
|
||||
case 'bounty':
|
||||
$OrderBy = "Bounty";
|
||||
break;
|
||||
case 'filler':
|
||||
$OrderBy = "r.FillerID";
|
||||
break;
|
||||
case 'requestor':
|
||||
$OrderBy = "r.UserID";
|
||||
break;
|
||||
case 'created':
|
||||
$OrderBy = "r.ID";
|
||||
break;
|
||||
case 'lastvote':
|
||||
$OrderBy = "r.LastVote";
|
||||
break;
|
||||
case 'filled':
|
||||
$OrderBy = "r.TimeFilled";
|
||||
break;
|
||||
default:
|
||||
$OrderBy = "r.ID";
|
||||
break;
|
||||
}
|
||||
$OrderBy = "$OrderBy $CurrentSort";
|
||||
|
||||
$Matcher = 'AND';
|
||||
if (count($Wheres)) {
|
||||
$Where = 'WHERE ('.implode(") $Matcher (", $Wheres).')';
|
||||
} else {
|
||||
$Where = '';
|
||||
}
|
||||
|
||||
if (count($ExtraJoins)) {
|
||||
$ExtraJoin = implode(' ', $ExtraJoins);
|
||||
} else {
|
||||
$ExtraJoin = '';
|
||||
}
|
||||
|
||||
// Build SQL query
|
||||
$DB->query("
|
||||
SELECT
|
||||
SQL_CALC_FOUND_ROWS
|
||||
r.ID,
|
||||
r.CategoryID,
|
||||
r.Title,
|
||||
r.Year,
|
||||
SUM(rv.Bounty) AS Bounty,
|
||||
COUNT(rv.UserID) AS Votes,
|
||||
r.FillerID,
|
||||
filler.Username,
|
||||
r.TorrentID,
|
||||
r.TimeFilled,
|
||||
r.UserID,
|
||||
u.Username,
|
||||
r.TimeAdded,
|
||||
r.LastVote
|
||||
FROM requests AS r
|
||||
LEFT JOIN users_main AS u ON u.ID = r.UserID
|
||||
LEFT JOIN users_main AS filler ON filler.ID = FillerID
|
||||
LEFT JOIN requests_votes AS rv ON rv.RequestID = r.ID
|
||||
$ExtraJoin
|
||||
$Where
|
||||
GROUP BY r.ID
|
||||
ORDER BY $OrderBy
|
||||
LIMIT $Limit");
|
||||
|
||||
$Requests = $DB->to_array();
|
||||
|
||||
$DB->query('SELECT FOUND_ROWS()');
|
||||
list($Results) = $DB->next_record();
|
||||
$PageLinks = get_pages($Page, $Results, REQUESTS_PER_PAGE, 11);
|
||||
|
||||
show_header($Title, 'requests');
|
||||
|
||||
?>
|
||||
<div class="thin">
|
||||
<div class="header">
|
||||
<h2><?=$Title?></h2>
|
||||
<div class="linkbox">
|
||||
<? if (check_perms('site_submit_requests')) { ?>
|
||||
<a href="requests.php?action=new" class="brackets">New request</a>
|
||||
<a href="requests.php?type=created" class="brackets">My requests</a>
|
||||
<? }
|
||||
if (check_perms('site_vote')) { ?>
|
||||
<a href="requests.php?type=voted" class="brackets">Requests I've voted on</a>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center">
|
||||
<form class="search_form" name="requests" action="" method="get">
|
||||
<input type="hidden" name="submit" value="true" />
|
||||
<table cellpadding="6" cellspacing="1" border="0" class="layout border" width="100%">
|
||||
<tr>
|
||||
<td class="label">Search terms:</td>
|
||||
<td>
|
||||
<input type="text" name="search" size="75" value="<? if (isset($_GET['search'])) { echo display_str($_GET['search']); } ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Tags (comma-separated):</td>
|
||||
<td>
|
||||
<input type="text" name="tags" size="60" value="<?=display_str(implode(', ', $TagNames))?>" />
|
||||
<input type="radio" name="tagmatcher" value="any"<?=((empty($TagMatcher) || $TagMatcher === 'any') ? ' checked="checked"' : '') ?> />Any
|
||||
<input type="radio" name="tagmatcher" value="all"<?=((!empty($TagMatcher) && $TagMatcher === 'all') ? ' checked="checked"' : '') ?> />All
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? if (check_perms('site_see_old_requests')) { ?>
|
||||
<tr>
|
||||
<td class="label">Include filled:</td>
|
||||
<td>
|
||||
<input type="checkbox" name="showall"<? if ($_GET['showall']) { ?> checked="checked"<? } ?> />
|
||||
</td>
|
||||
</tr>
|
||||
<? /* ?>
|
||||
<tr>
|
||||
<td class="label">Requested by:</td>
|
||||
<td>
|
||||
<input type="text" name="requester" size="75" value="<?=display_str($_GET['requester'])?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<? */} ?>
|
||||
</table>
|
||||
<table class="layout cat_list">
|
||||
<?
|
||||
$x = 1;
|
||||
reset($Categories);
|
||||
foreach ($Categories as $CatKey => $CatName) {
|
||||
if ($x % 8 === 0 || $x === 1) {
|
||||
?>
|
||||
<tr class="cat_list">
|
||||
<? } ?>
|
||||
<td>
|
||||
<input type="checkbox" name="filter_cat[<?=($CatKey+1)?>]" id="cat_<?=($CatKey+1)?>" value="1"<? if (isset($_GET['filter_cat'][$CatKey + 1])) { ?> checked="checked"<? } ?> />
|
||||
<label for="cat_<?=($CatKey + 1)?>"><?=$CatName?></label>
|
||||
</td>
|
||||
<? if ($x % 7 === 0) { ?>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
$x++;
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<table class="layout">
|
||||
<tr id="release_list">
|
||||
<td class="label">Release Types</td>
|
||||
<td>
|
||||
<input type="checkbox" id="toggle_releases" onchange="Toggle('releases');" /> Toggle All
|
||||
<?
|
||||
$i = 0;
|
||||
foreach ($ReleaseTypes as $Key => $Val) {
|
||||
if ($i % 8 === 0) {
|
||||
echo "<br />";
|
||||
} ?>
|
||||
<input type="checkbox" name="releases[]" value="<?=$Key?>"
|
||||
<?=(((!$Submitted) || !empty($ReleaseArray) && in_array($Key, $ReleaseArray)) ? ' checked="checked" ' : '')?>
|
||||
/> <?=$Val?>
|
||||
<?
|
||||
$i++;
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="format_list">
|
||||
<td class="label">Formats</td>
|
||||
<td>
|
||||
<input type="checkbox" id="toggle_formats" onchange="Toggle('formats');" /> Toggle All
|
||||
<?
|
||||
foreach ($Formats as $Key => $Val) {
|
||||
if ($Key % 8 === 0) {
|
||||
echo "<br />";
|
||||
} ?>
|
||||
<input type="checkbox" name="formats[]" value="<?=$Key?>"
|
||||
<?=(((!$Submitted) || !empty($FormatArray) && in_array($Key, $FormatArray)) ? ' checked="checked" ' : '')?>
|
||||
/> <?=$Val?>
|
||||
<? } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="bitrate_list">
|
||||
<td class="label">Bitrates</td>
|
||||
<td>
|
||||
<input type="checkbox" id="toggle_bitrates" onchange="Toggle('bitrates');" /> Toggle All
|
||||
<?
|
||||
foreach ($Bitrates as $Key => $Val) {
|
||||
if ($Key % 8 === 0) {
|
||||
echo "<br />";
|
||||
} ?>
|
||||
<input type="checkbox" name="bitrates[]" value="<?=$Key?>"
|
||||
<?=(((!$Submitted) || !empty($BitrateArray) && in_array($Key, $BitrateArray)) ? ' checked="checked" ' : '')?>
|
||||
/> <?=$Val?>
|
||||
<? } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="media_list">
|
||||
<td class="label">Media</td>
|
||||
<td>
|
||||
<input type="checkbox" id="toggle_media" onchange="Toggle('media');" /> Toggle All
|
||||
<?
|
||||
foreach ($Media as $Key => $Val) {
|
||||
if ($Key % 8 === 0) {
|
||||
echo "<br />";
|
||||
} ?>
|
||||
<input type="checkbox" name="media[]" value="<?=$Key?>"
|
||||
<?=(((!$Submitted) || !empty($MediaArray) && in_array($Key, $MediaArray)) ? ' checked="checked" ' : '')?>
|
||||
/> <?=$Val?>
|
||||
<? } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="center">
|
||||
<input type="submit" value="Search requests" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div class="linkbox">
|
||||
<?=$PageLinks?>
|
||||
</div>
|
||||
<table id="request_table" class="request_table" cellpadding="6" cellspacing="1" border="0" class="border" width="100%">
|
||||
<tr class="colhead_dark">
|
||||
<td style="width: 38%;">
|
||||
<a href="requests.php?order=name&sort=<?=(($CurrentOrder === 'name') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>"><strong>Request Name</strong></a>
|
||||
</td>
|
||||
<td>
|
||||
<strong><a href="requests.php?order=votes&sort=<?=(($CurrentOrder === 'votes') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>">Vote (20MB)</a></strong></td>
|
||||
<td>
|
||||
<a href="requests.php?order=bounty&sort=<?=(($CurrentOrder === 'bounty') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>"><strong>Bounty</strong></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="requests.php?order=filled&sort=<?=(($CurrentOrder === 'filled') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>"><strong>Filled</strong></a>
|
||||
<td>
|
||||
<a href="requests.php?order=filler&sort=<?=(($CurrentOrder === 'filler') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>"><strong>Filled by</strong></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="requests.php?order=requestor&sort=<?=(($CurrentOrder === 'requestor') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>"><strong>Requested by</strong></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="requests.php?order=created&sort=<?=(($CurrentOrder === 'created') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>"><strong>Created</strong></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="requests.php?order=lastvote&sort=<?=(($CurrentOrder === 'lastvote') ? $NewSort : 'asc')?>&<?=$CurrentURL ?>"><strong>Last vote</strong></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? if ($Results == 0) { ?>
|
||||
<tr class="rowb">
|
||||
<td colspan="7">
|
||||
Nothing found!
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
$Row = 'a';
|
||||
foreach ($Requests as $Request) {
|
||||
list($RequestID, $CategoryID, $Title, $Year, $Bounty, $Votes, $FillerID, $FillerName, $TorrentID, $TimeFilled, $RequestorID, $RequestorName, $TimeAdded, $LastVote) = $Request;
|
||||
|
||||
$CategoryName = $Categories[$CategoryID - 1];
|
||||
$IsFilled = ($TorrentID != 0);
|
||||
|
||||
if ($CategoryName === 'Music') {
|
||||
$ArtistForm = Requests::get_artists($RequestID);
|
||||
$ArtistLink = display_artists($ArtistForm, true, true);
|
||||
$FullName = "$ArtistLink<a href=\"requests.php?action=view&id=$RequestID\">$Title [$Year]</a>";
|
||||
} elseif ($CategoryName === 'Audiobooks' || $CategoryName === 'Comedy') {
|
||||
$FullName = "<a href=\"requests.php?action=view&id=$RequestID\">$Title [$Year]</a>";
|
||||
} else {
|
||||
$FullName = "<a href=\"requests.php?action=view&id=$RequestID\">$Title</a>";
|
||||
}
|
||||
|
||||
$Row = $Row === 'a' ? 'b' : 'a';
|
||||
|
||||
$Tags = Requests::get_tags($RequestID);
|
||||
?>
|
||||
<tr class="row<?=$Row?>">
|
||||
<td>
|
||||
<?=$FullName?>
|
||||
<div class="tags">
|
||||
<?
|
||||
$TagList = array();
|
||||
foreach ($Tags as $TagID => $TagName) {
|
||||
$TagList[] = "<a href=\"requests.php?tag=$TagID\">" . display_str($TagName) . '</a>';
|
||||
}
|
||||
$TagList = implode(', ', $TagList);
|
||||
?>
|
||||
<?=$TagList?>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?=$Votes?>
|
||||
<?
|
||||
if (!$IsFilled && check_perms('site_vote')) { ?>
|
||||
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<a href="javascript:Vote()" class="brackets"><strong>+</strong></a>
|
||||
<? } ?>
|
||||
</td>
|
||||
<td>
|
||||
<?=get_size($Bounty)?>
|
||||
</td>
|
||||
<td>
|
||||
<? if ($IsFilled) { ?>
|
||||
<a href="torrents.php?id=<?=$TorrentID?>"><strong>Yes - <?=$TimeFilled?></strong></a>
|
||||
<? } else { ?>
|
||||
<strong>No - <a href="upload.php?requestid=<?=$RequestID?>" class="brackets">Upload</a></strong>
|
||||
<? } ?>
|
||||
</td>
|
||||
<td>
|
||||
<? if ($IsFilled) { ?>
|
||||
<a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a>
|
||||
<? } else { ?>
|
||||
--
|
||||
<? } ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="user.php?id=<?=$RequestorID?>"><?=$RequestorName?></a>
|
||||
</td>
|
||||
<td>
|
||||
<?=time_diff($TimeAdded)?>
|
||||
</td>
|
||||
<td>
|
||||
<?=time_diff($LastVote)?>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
} // while
|
||||
} // else
|
||||
?>
|
||||
</table>
|
||||
<div class="linkbox">
|
||||
<?=$PageLinks?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
show_footer();
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
4
static/functions/jquery.tablesorter.min.js
vendored
4
static/functions/jquery.tablesorter.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,23 +1,43 @@
|
||||
var sortableTable;
|
||||
$(document).ready(function () {
|
||||
$(function () {
|
||||
|
||||
// tips/notes:
|
||||
// In HTML add data-sorter="false" to table headings (TH) that should not be sorted
|
||||
// or add data-sorter="myParser" to THs that require a custom parser
|
||||
|
||||
// sorts dates placed in the title attribute of a td
|
||||
$.tablesorter.addParser({
|
||||
id: 'relative_time',
|
||||
id: 'relativeTime',
|
||||
is: function (s) {
|
||||
return false;
|
||||
},
|
||||
format: function(str, table, td) {
|
||||
format: function (str, table, td) {
|
||||
return td.title;
|
||||
},
|
||||
type: 'text'
|
||||
});
|
||||
|
||||
// sort to ignore (English) articles
|
||||
// add data-sorter="ignoreArticles" to THs
|
||||
$.tablesorter.addParser({
|
||||
id: 'ignoreArticles',
|
||||
$format: $.tablesorter.getParserById('text').format,
|
||||
articlesRegEx: /^(?:the\s|a\s|an\s)/i,
|
||||
is: function () {
|
||||
return false;
|
||||
},
|
||||
format: function (s, table) {
|
||||
return this.$format((s || '').replace(this.articlesRegEx, ''), table);
|
||||
},
|
||||
type: 'text'
|
||||
});
|
||||
|
||||
sortableTable = {
|
||||
container : $('#manage_collage_table'),
|
||||
form : $('#drag_drop_collage_form'),
|
||||
serialInput : $('#drag_drop_collage_sort_order'),
|
||||
check : $('#check_all'),
|
||||
counter : function () {
|
||||
container: $('#manage_collage_table'),
|
||||
form: $('#drag_drop_collage_form'),
|
||||
serialInput: $('#drag_drop_collage_sort_order'),
|
||||
check: $('#check_all'),
|
||||
counter: function () {
|
||||
var x = 10;
|
||||
$('input.sort_numbers').each(function () {
|
||||
this.value = x;
|
||||
@ -25,7 +45,7 @@ $(document).ready(function () {
|
||||
});
|
||||
this.serializer();
|
||||
},
|
||||
color : function () {
|
||||
color: function () {
|
||||
var i = 0, css;
|
||||
$('tr.drag').each(function () {
|
||||
css = i % 2 === 0 ? ['rowa', 'rowb'] : ['rowb', 'rowa'];
|
||||
@ -33,19 +53,19 @@ $(document).ready(function () {
|
||||
i++;
|
||||
});
|
||||
},
|
||||
serializer : function () {
|
||||
serializer: function () {
|
||||
this.serialInput.val(this.container.sortable('serialize'));
|
||||
},
|
||||
save : function () {
|
||||
save: function () {
|
||||
sortableTable.form.submit();
|
||||
},
|
||||
widthFix : function(e, row) {
|
||||
widthFix: function (e, row) {
|
||||
row.children('td').each(function () {
|
||||
$(this).width($(this).width());
|
||||
});
|
||||
return row;
|
||||
},
|
||||
init : function () {
|
||||
init: function () {
|
||||
$('.drag_drop_save').removeClass('hidden');
|
||||
|
||||
this.noteToggle();
|
||||
@ -58,7 +78,7 @@ $(document).ready(function () {
|
||||
$('.save_sortable_collage').click(sortableTable.save);
|
||||
}
|
||||
},
|
||||
draggable : function () {
|
||||
draggable: function () {
|
||||
this.container.sortable({
|
||||
items: '.drag',
|
||||
axis: 'y',
|
||||
@ -68,25 +88,22 @@ $(document).ready(function () {
|
||||
stop: sortableTable.postSort
|
||||
});
|
||||
},
|
||||
tableSorter : function () {
|
||||
var obj = { 0: { sorter : false }, 6: { sorter : false } };
|
||||
if (this.check.length !== 0) {
|
||||
obj[5] = { sorter : 'relative_time' };
|
||||
}
|
||||
tableSorter: function () {
|
||||
this.container.tablesorter({
|
||||
cssHeader : 'headerSort',
|
||||
textExtraction: sortableTable.extractor,
|
||||
headers : obj
|
||||
cssHeader: 'headerSort',
|
||||
cssDesc: 'headerSortUp',
|
||||
cssAsc: 'headerSortDown',
|
||||
textExtraction: sortableTable.extractor
|
||||
}).on('sortEnd', sortableTable.postSort);
|
||||
},
|
||||
extractor : function (node) {
|
||||
extractor: function (node) {
|
||||
return node.textContent || node.innerText;
|
||||
},
|
||||
postSort : function () {
|
||||
postSort: function () {
|
||||
sortableTable.color();
|
||||
sortableTable.counter();
|
||||
},
|
||||
noteToggle : function () {
|
||||
noteToggle: function () {
|
||||
var span = $('<a href="#" class="brackets tooltip" title="Toggle note">Hide</a>').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#drag_drop_textnote > :first-child').toggle();
|
||||
@ -95,15 +112,15 @@ $(document).ready(function () {
|
||||
});
|
||||
$('#sorting_head').append(' ', span);
|
||||
},
|
||||
checks : function () {
|
||||
checks: function () {
|
||||
this.check.on('click', 'input', function () {
|
||||
var s = this.checked ?
|
||||
'td.center :checkbox:not(:checked)' :
|
||||
'td.center :checked';
|
||||
'td.center :checkbox:not(:checked)' :
|
||||
'td.center :checked';
|
||||
$(s).click();
|
||||
}).find('span').html('<input type="checkbox" />');
|
||||
|
||||
this.container.on('click', 'td > :checkbox', function() {
|
||||
this.container.on('click', 'td > :checkbox', function () {
|
||||
$(this).parents('tr').toggleClass('row_checked');
|
||||
}).on('dblclick', 'tr.drag', function () {
|
||||
$(this).find(':checkbox').click();
|
||||
|
@ -290,6 +290,12 @@ span.secondary_class {
|
||||
background: url("../common/table-order.png") no-repeat scroll right -79px transparent;
|
||||
}
|
||||
|
||||
.headerSort.sorter-false,
|
||||
.headerSort.sorter-false span {
|
||||
background-image: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.album_votes {
|
||||
text-align: center;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user