Empty commit

This commit is contained in:
Git 2013-10-10 08:01:46 +00:00
parent 59df8f7927
commit ed6863ea32
24 changed files with 655 additions and 702 deletions

View File

@ -49,10 +49,12 @@ public static function render_artist_tile($Artist, $Category) {
} }
private static function render_tile($Url, $Name, $Image) { private static function render_tile($Url, $Name, $Image) {
if (!empty($Image)) { ?> if (!empty($Image)) {
$Name = htmlspecialchars($Name);
?>
<li> <li>
<a href="<?=$Url?><?=$Name?>"> <a href="<?=$Url?><?=$Name?>">
<img class="tooltip large_tile" title="<?=$Name?>" src="<?=ImageTools::process($Image)?>" /> <img class="tooltip large_tile" alt="<?=$Name?>" title="<?=$Name?>" src="<?=ImageTools::process($Image)?>" />
</a> </a>
</li> </li>
<? } <? }
@ -75,12 +77,11 @@ private static function render_list($Url, $Name, $Image) {
if (!empty($Image)) { if (!empty($Image)) {
$UseTooltipster = !isset(G::$LoggedUser['Tooltipster']) || G::$LoggedUser['Tooltipster']; $UseTooltipster = !isset(G::$LoggedUser['Tooltipster']) || G::$LoggedUser['Tooltipster'];
$Image = ImageTools::process($Image); $Image = ImageTools::process($Image);
$Title = "title=\"<img class='large_tile' src='$Image'/>\""; $Title = "title=\"&lt;img class=&quot;large_tile&quot; src=&quot;$Image&quot; alt=&quot;&quot; />\"";
$Name = htmlspecialchars($Name);
?> ?>
<li> <li>
<a class="tooltip_image" <?=$Title?> href="<?=$Url?><?=$Name?>"> <a class="tooltip_image" <?=$Title?> href="<?=$Url?><?=$Name?>"><?=$Name?></a>
<?=$Name?>
</a>
</li> </li>
<? } <? }
} }

View File

@ -1,20 +0,0 @@
<?
if (!check_perms('admin_reports')) {
error(403);
}
if (!is_number($_GET['id'])) {
error(0);
}
$DB->query("
UPDATE reportsv2
SET Status = 'New'
WHERE ID = ".$_GET['id']."
AND Status != 'Resolved'");
if ($DB->affected_rows() > 0) {
//Win
} else {
echo 'You just tried to grab a resolved or nonexistent report!';
}
?>

View File

@ -47,12 +47,6 @@
case 'torrent_info': case 'torrent_info':
require('torrent_info.php'); require('torrent_info.php');
break; break;
case 'giveback_report':
require('giveback_report.php');
break;
case 'grab_report':
require('grab_report.php');
break;
case 'stats': case 'stats':
require(SERVER_ROOT . '/sections/ajax/stats.php'); require(SERVER_ROOT . '/sections/ajax/stats.php');
break; break;

View File

@ -1,10 +1,10 @@
<? <?
if (!check_perms('admin_reports')) { if (!check_perms('admin_reports')) {
error(403); die('403');
} }
if (!is_number($_GET['id'])) { if (!is_number($_GET['id'])) {
error(0); die();
} }
$DB->query(" $DB->query("

View File

@ -89,15 +89,10 @@
LastChangeTime = '".sqltime()."', LastChangeTime = '".sqltime()."',
ModComment = 'Report already dealt with (torrent deleted)' ModComment = 'Report already dealt with (torrent deleted)'
WHERE ID = $ReportID"); WHERE ID = $ReportID");
$Cache->decrement('num_torrent_reportsv2');
?> ?>
<div> <div id="report<?=$ReportID?>" class="report box pad center" data-reportid="<?=$ReportID?>">
<table class="layout"> <a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Report <?=$ReportID?></a> for torrent <?=$TorrentID?> (deleted) has been automatically resolved. <input type="button" value="Clear" onclick="ClearReport(<?=$ReportID?>);" />
<tr>
<td class="center">
<a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Report <?=$ReportID?></a> for torrent <?=$TorrentID?> (deleted) has been automatically resolved. <input type="button" value="Clear" onclick="ClearReport(<?=$ReportID?>);" />
</td>
</tr>
</table>
</div> </div>
<? <?
die(); die();
@ -133,7 +128,7 @@
$BBName = "[url=artist.php?id=$ArtistID]".$ArtistName."[/url] - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] ".($HasCue ? ' (Cue)' : '').($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)'; $BBName = "[url=artist.php?id=$ArtistID]".$ArtistName."[/url] - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] ".($HasCue ? ' (Cue)' : '').($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
} }
?> ?>
<div id="report<?=$ReportID?>"> <div id="report<?=$ReportID?>" class="report" data-reportid="<?=$ReportID?>">
<form class="edit_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post"> <form class="edit_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post">
<? <?
/* /*
@ -142,7 +137,6 @@
?> ?>
<div> <div>
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" id="newreportid" name="newreportid" value="<?=$ReportID?>" />
<input type="hidden" id="reportid<?=$ReportID?>" name="reportid" value="<?=$ReportID?>" /> <input type="hidden" id="reportid<?=$ReportID?>" name="reportid" value="<?=$ReportID?>" />
<input type="hidden" id="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" /> <input type="hidden" id="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" />
<input type="hidden" id="uploader<?=$ReportID?>" name="uploader" value="<?=$UploaderName?>" /> <input type="hidden" id="uploader<?=$ReportID?>" name="uploader" value="<?=$UploaderName?>" />
@ -152,7 +146,7 @@
<input type="hidden" id="type<?=$ReportID?>" name="type" value="<?=$Type?>" /> <input type="hidden" id="type<?=$ReportID?>" name="type" value="<?=$Type?>" />
<input type="hidden" id="categoryid<?=$ReportID?>" name="categoryid" value="<?=$CategoryID?>" /> <input type="hidden" id="categoryid<?=$ReportID?>" name="categoryid" value="<?=$CategoryID?>" />
</div> </div>
<table class="layout" cellpadding="5"> <table class="box layout" cellpadding="5">
<tr> <tr>
<td class="label"><a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Reported</a> torrent:</td> <td class="label"><a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Reported</a> torrent:</td>
<td colspan="3"> <td colspan="3">
@ -428,9 +422,4 @@
</tr> </tr>
</table> </table>
</form> </form>
<br />
</div> </div>
<script type="text/javascript">//<![CDATA[
Load('<?=$ReportID?>');
//]]>
</script>

View File

@ -6,51 +6,54 @@
enforce_login(); enforce_login();
include('array.php'); include(SERVER_ROOT.'/sections/reportsv2/array.php');
if (isset($_REQUEST['action'])) { if (isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'report': case 'report':
include('report.php'); include(SERVER_ROOT.'/sections/reportsv2/report.php');
break; break;
case 'takereport': case 'takereport':
include('takereport.php'); include(SERVER_ROOT.'/sections/reportsv2/takereport.php');
break; break;
case 'takeresolve': case 'takeresolve':
include('takeresolve.php'); include(SERVER_ROOT.'/sections/reportsv2/takeresolve.php');
break; break;
case 'take_pm': case 'take_pm':
include('take_pm.php'); include(SERVER_ROOT.'/sections/reportsv2/take_pm.php');
break; break;
case 'search': case 'search':
include('search.php'); include(SERVER_ROOT.'/sections/reportsv2/search.php');
break; break;
case 'new': case 'new':
include(SERVER_ROOT.'/sections/reportsv2/reports.php'); include(SERVER_ROOT.'/sections/reportsv2/reports.php');
break; break;
case 'ajax_new_report': case 'ajax_new_report':
include('ajax_new_report.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_new_report.php');
break; break;
case 'ajax_report': case 'ajax_report':
include('ajax_report.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_report.php');
break; break;
case 'ajax_change_resolve': case 'ajax_change_resolve':
include('ajax_change_resolve.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_change_resolve.php');
break; break;
case 'ajax_take_pm': case 'ajax_take_pm':
include('ajax_take_pm.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_take_pm.php');
break; break;
case 'ajax_grab_report': case 'ajax_grab_report':
include('ajax_grab_report.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_grab_report.php');
break;
case 'ajax_giveback_report':
include(SERVER_ROOT.'/sections/reportsv2/ajax_giveback_report.php');
break; break;
case 'ajax_update_comment': case 'ajax_update_comment':
require('ajax_update_comment.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_update_comment.php');
break; break;
case 'ajax_update_resolve': case 'ajax_update_resolve':
require('ajax_update_resolve.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_update_resolve.php');
break; break;
case 'ajax_create_report': case 'ajax_create_report':
require('ajax_create_report.php'); include(SERVER_ROOT.'/sections/reportsv2/ajax_create_report.php');
break; break;
} }
} else { } else {

View File

@ -9,19 +9,17 @@
} }
View::show_header('Reports V2!', 'reportsv2'); View::show_header('Reports V2!', 'reportsv2');
?> ?>
<div class="header"> <div class="header">
<h2>New reports, auto assigned!</h2> <h2>New reports, auto assigned!</h2>
<? include('header.php'); ?> <? include('header.php'); ?>
</div> </div>
<div class="buttonbox thin center"> <div class="buttonbox pad center">
<input type="button" onclick="AddMore();" value="Add more" /> <input type="text" name="repop_amount" id="repop_amount" size="2" value="10" /> <input type="button" onclick="AddMore();" value="Add more" /> <input type="text" name="repop_amount" id="repop_amount" size="2" value="10" />
| <span class="tooltip" title="Changes whether to automatically replace resolved ones with new ones"><input type="checkbox" checked="checked" id="dynamic" /> <label for="dynamic">Dynamic</label></span> | <span class="tooltip" title="Changes whether to automatically replace resolved ones with new ones"><input type="checkbox" checked="checked" id="dynamic" /> <label for="dynamic">Dynamic</label></span>
| <span class="tooltip" title="Resolves *all* checked reports with their respective resolutions"><input type="button" onclick="MultiResolve();" value="Multi-resolve" /></span> | <span class="tooltip" title="Resolves *all* checked reports with their respective resolutions"><input type="button" onclick="MultiResolve();" value="Multi-resolve" /></span>
| <span class="tooltip" title="Unclaim all of the reports currently displayed"><input type="button" onclick="GiveBack();" value="Unclaim all" /></span> | <span class="tooltip" title="Unclaim all of the reports currently displayed"><input type="button" onclick="GiveBack();" value="Unclaim all" /></span>
</div> </div>
<br />
<div id="all_reports" style="width: 80%; margin-left: auto; margin-right: auto;"> <div id="all_reports" style="width: 80%; margin-left: auto; margin-right: auto;">
</div> </div>
<? <?

View File

@ -211,37 +211,31 @@
$PageLinks = Format::get_pages($Page, $Results, REPORTS_PER_PAGE, 11); $PageLinks = Format::get_pages($Page, $Results, REPORTS_PER_PAGE, 11);
View::show_header('Reports V2!', 'reportsv2,bbcode'); View::show_header('Reports V2!', 'reportsv2,bbcode');
?> ?>
<div class="header"> <div class="header">
<h2><?=$Title?></h2> <h2><?=$Title?></h2>
<? include('header.php'); ?> <? include('header.php'); ?>
</div> </div>
<div class="buttonbox thin center"> <div class="buttonbox pad center">
<? if ($View !== 'resolved') { ?> <? if ($View !== 'resolved') { ?>
<span class="tooltip" title="Resolves *all* checked reports with their respective resolutions"><input type="button" onclick="MultiResolve();" value="Multi-resolve" /></span> <span class="tooltip" title="Resolves *all* checked reports with their respective resolutions"><input type="button" onclick="MultiResolve();" value="Multi-resolve" /></span>
<span class="tooltip" title="Assigns all of the reports on the page to you!"><input type="button" onclick="Grab();" value="Claim all" /></span> <span class="tooltip" title="Assigns all of the reports on the page to you!"><input type="button" onclick="Grab();" value="Claim all" /></span>
<? } <? }
if ($View === 'staff' && $LoggedUser['ID'] == $ID) { ?> if ($View === 'staff' && $LoggedUser['ID'] == $ID) { ?>
| <span class="tooltip" title="Unclaim all of the reports currently displayed"><input type="button" onclick="GiveBack();" value="Unclaim all" /></span> | <span class="tooltip" title="Unclaim all of the reports currently displayed"><input type="button" onclick="GiveBack();" value="Unclaim all" /></span>
<? } ?> <? } ?>
</div> </div>
<br /> <? if ($PageLinks) { ?>
<div class="linkbox"> <div class="linkbox">
<?=$PageLinks?> <?=$PageLinks?>
</div> </div>
<? } ?>
<div id="all_reports" style="width: 80%; margin-left: auto; margin-right: auto;"> <div id="all_reports" style="width: 80%; margin-left: auto; margin-right: auto;">
<? <?
if (count($Reports) === 0) { if (count($Reports) === 0) {
?> ?>
<div> <div class="box pad center">
<table class="layout"> <strong>No new reports! \o/</strong>
<tr>
<td class="center">
<strong>No new reports! \o/</strong>
</td>
</tr>
</table>
</div> </div>
<? <?
} else { } else {
@ -262,14 +256,8 @@
WHERE ID = $ReportID"); WHERE ID = $ReportID");
$Cache->decrement('num_torrent_reportsv2'); $Cache->decrement('num_torrent_reportsv2');
?> ?>
<div id="report<?=$ReportID?>"> <div id="report<?=$ReportID?>" class="report box pad center">
<table class="layout"> <a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Report <?=$ReportID?></a> for torrent <?=$TorrentID?> (deleted) has been automatically resolved. <input type="button" value="Hide" onclick="ClearReport(<?=$ReportID?>);" />
<tr>
<td class="center">
<a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Report <?=$ReportID?></a> for torrent <?=$TorrentID?> (deleted) has been automatically resolved. <input type="button" value="Hide" onclick="ClearReport(<?=$ReportID?>);" />
</td>
</tr>
</table>
</div> </div>
<? <?
} else { } else {
@ -307,42 +295,41 @@
$BBName = "[url=artist.php?id=$ArtistID]".$ArtistName."[/url] - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] ".($HasCue ? ' (Cue)' : '').($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)'; $BBName = "[url=artist.php?id=$ArtistID]".$ArtistName."[/url] - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] ".($HasCue ? ' (Cue)' : '').($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
} }
?> ?>
<div id="report<?=$ReportID?>"> <div id="report<?=$ReportID?>">
<form class="manage_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post"> <form class="manage_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post">
<? <?
/* /*
* Some of these are for takeresolve, namely the ones that aren't inputs, some for the JavaScript. * Some of these are for takeresolve, namely the ones that aren't inputs, some for the JavaScript.
*/ */
?> ?>
<div> <div>
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" id="newreportid" name="newreportid" value="<?=$ReportID?>" /> <input type="hidden" id="reportid<?=$ReportID?>" name="reportid" value="<?=$ReportID?>" />
<input type="hidden" id="reportid<?=$ReportID?>" name="reportid" value="<?=$ReportID?>" /> <input type="hidden" id="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" />
<input type="hidden" id="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" /> <input type="hidden" id="uploader<?=$ReportID?>" name="uploader" value="<?=$UploaderName?>" />
<input type="hidden" id="uploader<?=$ReportID?>" name="uploader" value="<?=$UploaderName?>" /> <input type="hidden" id="uploaderid<?=$ReportID?>" name="uploaderid" value="<?=$UploaderID?>" />
<input type="hidden" id="uploaderid<?=$ReportID?>" name="uploaderid" value="<?=$UploaderID?>" /> <input type="hidden" id="reporterid<?=$ReportID?>" name="reporterid" value="<?=$ReporterID?>" />
<input type="hidden" id="reporterid<?=$ReportID?>" name="reporterid" value="<?=$ReporterID?>" /> <input type="hidden" id="report_reason<?=$ReportID?>" name="report_reason" value="<?=$UserComment?>" />
<input type="hidden" id="report_reason<?=$ReportID?>" name="report_reason" value="<?=$UserComment?>" /> <input type="hidden" id="raw_name<?=$ReportID?>" name="raw_name" value="<?=$RawName?>" />
<input type="hidden" id="raw_name<?=$ReportID?>" name="raw_name" value="<?=$RawName?>" /> <input type="hidden" id="type<?=$ReportID?>" name="type" value="<?=$Type?>" />
<input type="hidden" id="type<?=$ReportID?>" name="type" value="<?=$Type?>" /> <input type="hidden" id="categoryid<?=$ReportID?>" name="categoryid" value="<?=$CategoryID?>" />
<input type="hidden" id="categoryid<?=$ReportID?>" name="categoryid" value="<?=$CategoryID?>" /> </div>
</div> <table class="box layout" cellpadding="5">
<table class="layout" cellpadding="5"> <tr>
<tr> <td class="label"><a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Reported</a> torrent:</td>
<td class="label"><a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Reported</a> torrent:</td> <td colspan="3">
<td colspan="3">
<? if (!$GroupID) { ?> <? if (!$GroupID) { ?>
<a href="log.php?search=Torrent+<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted) <a href="log.php?search=Torrent+<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted)
<? } else { ?> <? } else { ?>
<?=$LinkName?> <?=$LinkName?>
<a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a> <a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a>
uploaded by <a href="user.php?id=<?=$UploaderID?>"><?=$UploaderName?></a> <?=time_diff($Time)?> uploaded by <a href="user.php?id=<?=$UploaderID?>"><?=$UploaderName?></a> <?=time_diff($Time)?>
<br /> <br />
<? if ($ReporterName == '') { <? if ($ReporterName == '') {
$ReporterName = 'System'; $ReporterName = 'System';
} ?> } ?>
<div style="text-align: right;">was reported by <a href="user.php?id=<?=$ReporterID?>"><?=$ReporterName?></a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div> <div style="text-align: right;">was reported by <a href="user.php?id=<?=$ReporterID?>"><?=$ReporterName?></a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div>
<? if ($Status != 'Resolved') { <? if ($Status != 'Resolved') {
$DB->query(" $DB->query("
@ -354,9 +341,9 @@
$GroupOthers = ($DB->record_count() - 1); $GroupOthers = ($DB->record_count() - 1);
if ($GroupOthers > 0) { ?> if ($GroupOthers > 0) { ?>
<div style="text-align: right;"> <div style="text-align: right;">
<a href="reportsv2.php?view=group&amp;id=<?=$GroupID?>">There <?=(($GroupOthers > 1) ? "are $GroupOthers other reports" : "is 1 other report")?> for torrent(s) in this group</a> <a href="reportsv2.php?view=group&amp;id=<?=$GroupID?>">There <?=(($GroupOthers > 1) ? "are $GroupOthers other reports" : "is 1 other report")?> for torrent(s) in this group</a>
</div> </div>
<? } <? }
$DB->query(" $DB->query("
@ -368,9 +355,9 @@
$UploaderOthers = ($DB->record_count() - 1); $UploaderOthers = ($DB->record_count() - 1);
if ($UploaderOthers > 0) { ?> if ($UploaderOthers > 0) { ?>
<div style="text-align: right;"> <div style="text-align: right;">
<a href="reportsv2.php?view=uploader&amp;id=<?=$UploaderID?>">There <?=(($UploaderOthers > 1) ? "are $UploaderOthers other reports" : "is 1 other report")?> for torrent(s) uploaded by this user</a> <a href="reportsv2.php?view=uploader&amp;id=<?=$UploaderID?>">There <?=(($UploaderOthers > 1) ? "are $UploaderOthers other reports" : "is 1 other report")?> for torrent(s) uploaded by this user</a>
</div> </div>
<? } <? }
$DB->query(" $DB->query("
@ -388,279 +375,283 @@
$Requests = ($DB->has_results()); $Requests = ($DB->has_results());
if ($Requests > 0) { if ($Requests > 0) {
while (list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) { while (list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) {
?> ?>
<div style="text-align: right;"> <div style="text-align: right;">
<strong class="important_text"><a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a> used this torrent to fill <a href="requests.php?action=view&amp;id=<?=$RequestID?>">this request</a> <?=time_diff($FilledTime)?></strong> <strong class="important_text"><a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a> used this torrent to fill <a href="requests.php?action=view&amp;id=<?=$RequestID?>">this request</a> <?=time_diff($FilledTime)?></strong>
</div> </div>
<? } <? }
} }
} }
} }
?>
</td>
</tr>
<? if ($Tracks) { ?>
<tr>
<td class="label">Relevant tracks:</td>
<td colspan="3">
<?=str_replace(' ', ', ', $Tracks)?>
</td>
</tr>
<?
}
if ($Links) { ?>
<tr>
<td class="label">Relevant links:</td>
<td colspan="3">
<?
$Links = explode(' ', $Links);
foreach ($Links as $Link) {
if ($local_url = $Text->local_url($Link)) {
$Link = $local_url;
} ?>
<a href="<?=$Link?>"><?=$Link?></a>
<? } ?>
</td>
</tr>
<?
}
if ($ExtraIDs) { ?>
<tr>
<td class="label">Relevant other torrents:</td>
<td colspan="3">
<?
$First = true;
$Extras = explode(' ', $ExtraIDs);
foreach ($Extras as $ExtraID) {
$DB->query("
SELECT
tg.Name,
tg.ID,
CASE COUNT(ta.GroupID)
WHEN 1 THEN aa.ArtistID
WHEN 0 THEN '0'
ELSE '0'
END AS ArtistID,
CASE COUNT(ta.GroupID)
WHEN 1 THEN aa.Name
WHEN 0 THEN ''
ELSE 'Various Artists'
END AS ArtistName,
tg.Year,
t.Time,
t.Remastered,
t.RemasterTitle,
t.RemasterYear,
t.Media,
t.Format,
t.Encoding,
t.Size,
t.HasCue,
t.HasLog,
t.LogScore,
t.UserID AS UploaderID,
uploader.Username
FROM torrents AS t
LEFT JOIN torrents_group AS tg ON tg.ID = t.GroupID
LEFT JOIN torrents_artists AS ta ON ta.GroupID = tg.ID AND ta.Importance = '1'
LEFT JOIN artists_alias AS aa ON aa.AliasID = ta.AliasID
LEFT JOIN users_main AS uploader ON uploader.ID = t.UserID
WHERE t.ID = '$ExtraID'
GROUP BY tg.ID");
list($ExtraGroupName, $ExtraGroupID, $ExtraArtistID, $ExtraArtistName, $ExtraYear, $ExtraTime, $ExtraRemastered, $ExtraRemasterTitle,
$ExtraRemasterYear, $ExtraMedia, $ExtraFormat, $ExtraEncoding, $ExtraSize, $ExtraHasCue, $ExtraHasLog, $ExtraLogScore, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record());
if ($ExtraGroupName) {
$ExtraRemasterDisplayString = Reports::format_reports_remaster_info($ExtraRemastered, $ExtraRemasterTitle, $ExtraRemasterYear);
if ($ArtistID == 0 && empty($ArtistName)) {
$ExtraLinkName = "<a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]$ExtraRemasterDisplayString</a> " . ($ExtraHasCue == '1' ? ' (Cue)' : '').($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$ExtraID&amp;groupid=$ExtraGroupID\">(Log: $ExtraLogScore %)</a>" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)';
} elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') {
$ExtraLinkName = "Various Artists - <a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]$ExtraRemasterDisplayString</a> " . ($ExtraHasCue == '1' ? ' (Cue)' : '').($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$ExtraID&amp;groupid=$ExtraGroupID\">(Log: $ExtraLogScore %)</a>" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)';
} else {
$ExtraLinkName = "<a href=\"artist.php?id=$ExtraArtistID\">$ExtraArtistName</a> - <a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]$ExtraRemasterDisplayString</a> " . ($ExtraHasCue == '1' ? ' (Cue)' : '').($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$ExtraID&amp;groupid=$ExtraGroupID\">(Log: $ExtraLogScore %)</a>" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)';
}
?> ?>
<?=($First ? '' : '<br />')?> </td>
<?=$ExtraLinkName?> </tr>
<a href="torrents.php?action=download&amp;id=<?=$ExtraID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a> <? if ($Tracks) { ?>
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a> <tr>
<td class="label">Relevant tracks:</td>
<td colspan="3">
<?=str_replace(' ', ', ', $Tracks)?>
</td>
</tr>
<? <?
$First = false; }
if ($Links) { ?>
<tr>
<td class="label">Relevant links:</td>
<td colspan="3">
<?
$Links = explode(' ', $Links);
foreach ($Links as $Link) {
if ($local_url = $Text->local_url($Link)) {
$Link = $local_url;
}
?>
<a href="<?=$Link?>"><?=$Link?></a>
<? } ?>
</td>
</tr>
<?
}
if ($ExtraIDs) { ?>
<tr>
<td class="label">Relevant other torrents:</td>
<td colspan="3">
<?
$First = true;
$Extras = explode(' ', $ExtraIDs);
foreach ($Extras as $ExtraID) {
$DB->query("
SELECT
tg.Name,
tg.ID,
CASE COUNT(ta.GroupID)
WHEN 1 THEN aa.ArtistID
WHEN 0 THEN '0'
ELSE '0'
END AS ArtistID,
CASE COUNT(ta.GroupID)
WHEN 1 THEN aa.Name
WHEN 0 THEN ''
ELSE 'Various Artists'
END AS ArtistName,
tg.Year,
t.Time,
t.Remastered,
t.RemasterTitle,
t.RemasterYear,
t.Media,
t.Format,
t.Encoding,
t.Size,
t.HasCue,
t.HasLog,
t.LogScore,
t.UserID AS UploaderID,
uploader.Username
FROM torrents AS t
LEFT JOIN torrents_group AS tg ON tg.ID = t.GroupID
LEFT JOIN torrents_artists AS ta ON ta.GroupID = tg.ID AND ta.Importance = '1'
LEFT JOIN artists_alias AS aa ON aa.AliasID = ta.AliasID
LEFT JOIN users_main AS uploader ON uploader.ID = t.UserID
WHERE t.ID = '$ExtraID'
GROUP BY tg.ID");
list($ExtraGroupName, $ExtraGroupID, $ExtraArtistID, $ExtraArtistName, $ExtraYear, $ExtraTime, $ExtraRemastered, $ExtraRemasterTitle,
$ExtraRemasterYear, $ExtraMedia, $ExtraFormat, $ExtraEncoding, $ExtraSize, $ExtraHasCue, $ExtraHasLog, $ExtraLogScore, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record());
if ($ExtraGroupName) {
$ExtraRemasterDisplayString = Reports::format_reports_remaster_info($ExtraRemastered, $ExtraRemasterTitle, $ExtraRemasterYear);
if ($ArtistID == 0 && empty($ArtistName)) {
$ExtraLinkName = "<a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]$ExtraRemasterDisplayString</a> " . ($ExtraHasCue == '1' ? ' (Cue)' : '').($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$ExtraID&amp;groupid=$ExtraGroupID\">(Log: $ExtraLogScore %)</a>" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)';
} elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') {
$ExtraLinkName = "Various Artists - <a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]$ExtraRemasterDisplayString</a> " . ($ExtraHasCue == '1' ? ' (Cue)' : '').($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$ExtraID&amp;groupid=$ExtraGroupID\">(Log: $ExtraLogScore %)</a>" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)';
} else {
$ExtraLinkName = "<a href=\"artist.php?id=$ExtraArtistID\">$ExtraArtistName</a> - <a href=\"torrents.php?id=$ExtraGroupID\">$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')."</a> <a href=\"torrents.php?torrentid=$ExtraID\"> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]$ExtraRemasterDisplayString</a> " . ($ExtraHasCue == '1' ? ' (Cue)' : '').($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&amp;torrentid=$ExtraID&amp;groupid=$ExtraGroupID\">(Log: $ExtraLogScore %)</a>" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)';
} }
} ?> ?>
</td> <?=($First ? '' : '<br />')?>
</tr> <?=$ExtraLinkName?>
<a href="torrents.php?action=download&amp;id=<?=$ExtraID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a>
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
<? <?
$First = false;
}
} }
?>
</td>
</tr>
<?
}
if ($Images) { ?> if ($Images) {
<tr> ?>
<td class="label">Relevant images:</td> <tr>
<td colspan="3"> <td class="label">Relevant images:</td>
<td colspan="3">
<? <?
$Images = explode(' ', $Images); $Images = explode(' ', $Images);
foreach ($Images as $Image) { foreach ($Images as $Image) {
?> ?>
<img style="max-width: 200px;" onclick="lightbox.init(this, 200);" src="<?=ImageTools::process($Image)?>" alt="Relevant image" /> <img style="max-width: 200px;" onclick="lightbox.init(this, 200);" src="<?=ImageTools::process($Image)?>" alt="Relevant image" />
<? } ?> <? } ?>
</td> </td>
</tr> </tr>
<? <?
} ?> } ?>
<tr> <tr>
<td class="label">User comment:</td> <td class="label">User comment:</td>
<td colspan="3" class="wrap_overflow"><?=$Text->full_format($UserComment)?></td> <td colspan="3" class="wrap_overflow"><?=$Text->full_format($UserComment)?></td>
</tr> </tr>
<? // END REPORTED STUFF :|: BEGIN MOD STUFF <? // END REPORTED STUFF :|: BEGIN MOD STUFF
if ($Status == 'InProgress') { ?> if ($Status == 'InProgress') { ?>
<tr> <tr>
<td class="label">In progress by:</td> <td class="label">In progress by:</td>
<td colspan="3"> <td colspan="3">
<a href="user.php?id=<?=$ResolverID?>"><?=$ResolverName?></a> <a href="user.php?id=<?=$ResolverID?>"><?=$ResolverName?></a>
</td> </td>
</tr> </tr>
<? } <? }
if ($Status != 'Resolved') { ?> if ($Status != 'Resolved') { ?>
<tr> <tr>
<td class="label">Report comment:</td> <td class="label">Report comment:</td>
<td colspan="3"> <td colspan="3">
<input type="text" name="comment" id="comment<?=$ReportID?>" size="45" value="<?=$ModComment?>" /> <input type="text" name="comment" id="comment<?=$ReportID?>" size="45" value="<?=$ModComment?>" />
<input type="button" value="Update now" onclick="UpdateComment(<?=$ReportID?>);" /> <input type="button" value="Update now" onclick="UpdateComment(<?=$ReportID?>);" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
<a href="javascript:Load('<?=$ReportID?>')" class="tooltip" title="Click here to reset the resolution options to their default values.">Resolve</a> <a href="javascript:Load('<?=$ReportID?>')" class="tooltip" title="Click here to reset the resolution options to their default values.">Resolve</a>
</td> </td>
<td colspan="3"> <td colspan="3">
<select name="resolve_type" id="resolve_type<?=$ReportID?>" onchange="ChangeResolve(<?=$ReportID?>);"> <select name="resolve_type" id="resolve_type<?=$ReportID?>" onchange="ChangeResolve(<?=$ReportID?>);">
<? <?
$TypeList = $Types['master'] + $Types[$CategoryID]; $TypeList = $Types['master'] + $Types[$CategoryID];
$Priorities = array(); $Priorities = array();
foreach ($TypeList as $Key => $Value) { foreach ($TypeList as $Key => $Value) {
$Priorities[$Key] = $Value['priority']; $Priorities[$Key] = $Value['priority'];
} }
array_multisort($Priorities, SORT_ASC, $TypeList); array_multisort($Priorities, SORT_ASC, $TypeList);
foreach ($TypeList as $Type => $Data) { ?> foreach ($TypeList as $Type => $Data) { ?>
<option value="<?=$Type?>"><?=$Data['title']?></option> <option value="<?=$Type?>"><?=$Data['title']?></option>
<? } ?> <? } ?>
</select>
<span id="options<?=$ReportID?>">
<? if (check_perms('users_mod')) { ?>
<span class="tooltip" title="Delete torrent?">
<label for="delete<?=$ReportID?>"><strong>Delete</strong></label>
<input type="checkbox" name="delete" id="delete<?=$ReportID?>" />
</span>
<? } ?>
<span class="tooltip" title="Warning length in weeks">
<strong>Warning</strong>
<select name="warning" id="warning<?=$ReportID?>">
<? for ($i = 0; $i < 9; $i++) { ?>
<option value="<?=$i?>"><?=$i?></option>
<? } ?>
</select> </select>
<span id="options<?=$ReportID?>"> </span>
<? if (check_perms('users_mod')) { ?> <span class="tooltip" title="Remove upload privileges?">
<span class="tooltip" title="Delete torrent?"> <label for="upload<?=$ReportID?>"><strong>Remove upload privileges</strong></label>
<label for="delete<?=$ReportID?>"><strong>Delete</strong></label> <input type="checkbox" name="upload" id="upload<?=$ReportID?>" />
<input type="checkbox" name="delete" id="delete<?=$ReportID?>" /> </span>
</span> &nbsp;&nbsp;
<? } ?> <span class="tooltip" title="Update resolve type">
<span class="tooltip" title="Warning length in weeks"> <input type="button" name="update_resolve" id="update_resolve<?=$ReportID?>" value="Update now" onclick="UpdateResolve(<?=$ReportID?>);" />
<strong>Warning</strong> </span>
<select name="warning" id="warning<?=$ReportID?>"> </span>
<? for ($i = 0; $i < 9; $i++) { ?> </td>
<option value="<?=$i?>"><?=$i?></option> </tr>
<? } ?> <tr>
</select> <td class="label tooltip" title="Uploader: Appended to the regular message unless using &quot;Send now&quot;. Reporter: Must be used with &quot;Send now&quot;.">
</span> PM
<span class="tooltip" title="Remove upload privileges?"> <select name="pm_type" id="pm_type<?=$ReportID?>">
<label for="upload<?=$ReportID?>"><strong>Remove upload privileges</strong></label> <option value="Uploader">Uploader</option>
<input type="checkbox" name="upload" id="upload<?=$ReportID?>" /> <option value="Reporter">Reporter</option>
</span> </select>:
&nbsp;&nbsp; </td>
<span class="tooltip" title="Update resolve type"> <td colspan="3">
<input type="button" name="update_resolve" id="update_resolve<?=$ReportID?>" value="Update now" onclick="UpdateResolve(<?=$ReportID?>);" /> <textarea name="uploader_pm" id="uploader_pm<?=$ReportID?>" cols="50" rows="1"></textarea>
</span> <input type="button" value="Send now" onclick="SendPM(<?=$ReportID?>);" />
</span> </td>
</td> </tr>
</tr> <tr>
<tr> <td class="label"><strong>Extra</strong> log message:</td>
<td class="label tooltip" title="Uploader: Appended to the regular message unless using &quot;Send now&quot;. Reporter: Must be used with &quot;Send now&quot;."> <td>
PM <input type="text" name="log_message" id="log_message<?=$ReportID?>" size="40"
<select name="pm_type" id="pm_type<?=$ReportID?>"> <? if ($ExtraIDs) {
<option value="Uploader">Uploader</option> $Extras = explode(' ', $ExtraIDs);
<option value="Reporter">Reporter</option> $Value = '';
</select>: foreach ($Extras as $ExtraID) {
</td> $Value .= 'https://'.SSL_SITE_URL."/torrents.php?torrentid=$ExtraID ";
<td colspan="3"> }
<textarea name="uploader_pm" id="uploader_pm<?=$ReportID?>" cols="50" rows="1"></textarea> echo 'value="'.trim($Value).'"';
<input type="button" value="Send now" onclick="SendPM(<?=$ReportID?>);" /> } ?>
</td> />
</tr> </td>
<tr> <td class="label"><strong>Extra</strong> staff notes:</td>
<td class="label"><strong>Extra</strong> log message:</td> <td>
<td> <input type="text" name="admin_message" id="admin_message<?=$ReportID?>" size="40" />
<input type="text" name="log_message" id="log_message<?=$ReportID?>" size="40" <? if ($ExtraIDs) { </td>
$Extras = explode(' ', $ExtraIDs); </tr>
$Value = ''; <tr>
foreach ($Extras as $ExtraID) { <td colspan="4" style="text-align: center;">
$Value .= 'https://'.SSL_SITE_URL."/torrents.php?torrentid=$ExtraID "; <input type="button" value="Invalidate report" onclick="Dismiss(<?=$ReportID?>);" />
} <input type="button" value="Resolve report manually" onclick="ManualResolve(<?=$ReportID?>);" />
echo 'value="'.trim($Value).'"';
} ?>/>
</td>
<td class="label"><strong>Extra</strong> staff notes:</td>
<td>
<input type="text" name="admin_message" id="admin_message<?=$ReportID?>" size="40" />
</td>
</tr>
<tr>
<td colspan="4" style="text-align: center;">
<input type="button" value="Invalidate report" onclick="Dismiss(<?=$ReportID?>);" />
<input type="button" value="Resolve report manually" onclick="ManualResolve(<?=$ReportID?>);" />
<? if ($Status == 'InProgress' && $LoggedUser['ID'] == $ResolverID) { ?> <? if ($Status == 'InProgress' && $LoggedUser['ID'] == $ResolverID) { ?>
| <input type="button" value="Unclaim" onclick="GiveBack(<?=$ReportID?>);" /> | <input type="button" value="Unclaim" onclick="GiveBack(<?=$ReportID?>);" />
<? } else { ?> <? } else { ?>
| <input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" /> | <input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" />
<? } ?> <? } ?>
| Multi-resolve <input type="checkbox" name="multi" id="multi<?=$ReportID?>" checked="checked" /> | Multi-resolve <input type="checkbox" name="multi" id="multi<?=$ReportID?>" checked="checked" />
| <input type="button" id="submit_<?=$ReportID?>" value="Submit" onclick="TakeResolve(<?=$ReportID?>);" /> | <input type="button" id="submit_<?=$ReportID?>" value="Submit" onclick="TakeResolve(<?=$ReportID?>);" />
</td> </td>
</tr> </tr>
<? } else { ?> <? } else { ?>
<tr> <tr>
<td class="label">Resolver:</td> <td class="label">Resolver:</td>
<td colspan="3"> <td colspan="3">
<a href="user.php?id=<?=$ResolverID?>"><?=$ResolverName?></a> <a href="user.php?id=<?=$ResolverID?>"><?=$ResolverName?></a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label">Resolve time:</td> <td class="label">Resolve time:</td>
<td colspan="3"> <td colspan="3">
<?=time_diff($LastChangeTime); echo "\n"; ?> <?=time_diff($LastChangeTime); echo "\n"; ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label">Report comments:</td> <td class="label">Report comments:</td>
<td colspan="3"> <td colspan="3">
<?=$ModComment; echo "\n"; ?> <?=$ModComment; echo "\n"; ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label">Log message:</td> <td class="label">Log message:</td>
<td colspan="3"> <td colspan="3">
<?=$LogMessage; echo "\n"; ?> <?=$LogMessage; echo "\n"; ?>
</td> </td>
</tr> </tr>
<? if ($GroupID) { ?> <? if ($GroupID) { ?>
<tr> <tr>
<td colspan="4" style="text-align: center;"> <td colspan="4" style="text-align: center;">
<input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" /> <input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" />
</td> </td>
</tr> </tr>
<? } <? }
} ?> } ?>
</table> </table>
</form> </form>
<br /> </div>
</div> <script type="text/javascript">//<![CDATA[
<script type="text/javascript">//<![CDATA[ Load(<?=$ReportID?>);
Load('<?=$ReportID?>'); //]]>
//]]> </script>
</script>
<? <?
} }
} }
@ -668,7 +659,6 @@
?> ?>
</div> </div>
<? if ($PageLinks) { ?> <? if ($PageLinks) { ?>
<div class="linkbox pager"><?=$PageLinks?></div> <div class="linkbox pager"><?=$PageLinks?></div>
<? } ?> <? } ?>
</div>
<? View::show_footer(); ?> <? View::show_footer(); ?>

View File

@ -312,7 +312,7 @@
$Cache->delete_value("reports_torrent_$TorrentID"); $Cache->delete_value("reports_torrent_$TorrentID");
//Now we've done everything, update the DB with values // Now we've done everything, update the DB with values
if ($Report) { if ($Report) {
$DB->query(" $DB->query("
UPDATE reportsv2 UPDATE reportsv2
@ -323,16 +323,9 @@
WHERE ID = $ReportID"); WHERE ID = $ReportID");
} }
} else { } else {
//Someone beat us to it. Inform the staffer. // Someone beat us to it. Inform the staffer.
?> ?>
<table class="layout" cellpadding="5"> <a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Somebody has already resolved this report</a>
<tr> <input type="button" value="Clear" onclick="ClearReport(<?=$ReportID?>);" />
<td>
<a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Somebody has already resolved this report</a>
<input type="button" value="Clear" onclick="ClearReport(<?=$ReportID?>);" />
</td>
</tr>
</table>
<? <?
} }
?>

View File

@ -26,9 +26,8 @@
<h2>Reports v2 Information!</h2> <h2>Reports v2 Information!</h2>
<? include('header.php'); ?> <? include('header.php'); ?>
</div> </div>
<br /> <div class="thin float_clear">
<div class="box pad thin reportsv2_views_container"> <div class="two_columns pad">
<table class="noborder"><tr><td class="noborder" style="width: 50%;">
<? <?
$DB->query(" $DB->query("
SELECT SELECT
@ -43,10 +42,10 @@
$Results = $DB->to_array(); $Results = $DB->to_array();
?> ?>
<h3>Reports resolved in the last 24 hours</h3> <h3>Reports resolved in the last 24 hours</h3>
<table class="border reportsv2_views_table"> <table class="box border">
<tr> <tr class="colhead">
<td class="head colhead_dark">Username</td> <td class="colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td> <td class="colhead_dark number_column">Reports</td>
</tr> </tr>
<? foreach ($Results as $Result) { <? foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result; list($UserID, $Username, $Reports) = $Result;
@ -57,7 +56,6 @@
</tr> </tr>
<? } ?> <? } ?>
</table> </table>
<br />
<? <?
$DB->query(" $DB->query("
SELECT SELECT
@ -72,10 +70,10 @@
$Results = $DB->to_array(); $Results = $DB->to_array();
?> ?>
<h3>Reports resolved in the last week</h3> <h3>Reports resolved in the last week</h3>
<table class="border reportsv2_views_table"> <table class="box border">
<tr> <tr class="colhead">
<td class="head colhead_dark">Username</td> <td class="colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td> <td class="colhead_dark number_column">Reports</td>
</tr> </tr>
<? foreach ($Results as $Result) { <? foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result; list($UserID, $Username, $Reports) = $Result;
@ -86,7 +84,6 @@
</tr> </tr>
<? } ?> <? } ?>
</table> </table>
<br />
<? <?
$DB->query(" $DB->query("
SELECT SELECT
@ -101,10 +98,10 @@
$Results = $DB->to_array(); $Results = $DB->to_array();
?> ?>
<h3>Reports resolved in the last month</h3> <h3>Reports resolved in the last month</h3>
<table class="border reportsv2_views_table"> <table class="box border">
<tr> <tr class="colhead">
<td class="head colhead_dark">Username</td> <td class="colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td> <td class="colhead_dark number_column">Reports</td>
</tr> </tr>
<? foreach ($Results as $Result) { <? foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result; list($UserID, $Username, $Reports) = $Result;
@ -115,7 +112,6 @@
</tr> </tr>
<? } ?> <? } ?>
</table> </table>
<br />
<? <?
$DB->query(" $DB->query("
SELECT SELECT
@ -129,10 +125,10 @@
$Results = $DB->to_array(); $Results = $DB->to_array();
?> ?>
<h3>Reports resolved since Reports v2 (2009-07-27)</h3> <h3>Reports resolved since Reports v2 (2009-07-27)</h3>
<table class="border reportsv2_views_table"> <table class="box border">
<tr> <tr class="colhead">
<td class="head colhead_dark">Username</td> <td class="colhead_dark">Username</td>
<td class="head colhead_dark">Reports</td> <td class="colhead_dark number_column">Reports</td>
</tr> </tr>
<? foreach ($Results as $Result) { <? foreach ($Results as $Result) {
list($UserID, $Username, $Reports) = $Result; list($UserID, $Username, $Reports) = $Result;
@ -143,72 +139,66 @@
</tr> </tr>
<? } ?> <? } ?>
</table> </table>
<br />
<h3>Different view modes by person</h3> <h3>Different view modes by person</h3>
<br /> <div class="box pad">
<strong>By ID of torrent reported:</strong> <strong>By ID of torrent reported:</strong>
<ul> <ul>
<li> <li>
Reports of torrents with ID = 1 Reports of torrents with ID = 1
</li> </li>
<li> <li>
<a href="reportsv2.php?view=torrent&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=torrent&amp;id=1</a> <a href="reportsv2.php?view=torrent&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=torrent&amp;id=1</a>
</li> </li>
</ul> </ul>
<br /> <strong>By group ID of torrent reported:</strong>
<strong>By group ID of torrent reported:</strong> <ul>
<ul> <li>
<li> Reports of torrents within the group with ID = 1
Reports of torrents within the group with ID = 1 </li>
</li> <li>
<li> <a href="reportsv2.php?view=group&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=group&amp;id=1</a>
<a href="reportsv2.php?view=group&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=group&amp;id=1</a> </li>
</li> </ul>
</ul> <strong>By report ID:</strong>
<br /> <ul>
<strong>By report ID:</strong> <li>
<ul> The report with ID = 1
<li> </li>
The report with ID = 1 <li>
</li> <a href="reportsv2.php?view=report&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=report&amp;id=1</a>
<li> </li>
<a href="reportsv2.php?view=report&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=report&amp;id=1</a> </ul>
</li> <strong>By reporter ID:</strong>
</ul> <ul>
<br /> <li>
<strong>By reporter ID:</strong> Reports created by <?=$Owner?>
<ul> </li>
<li> <li>
Reports created by <?=$Owner?> <a href="reportsv2.php?view=reporter&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=reporter&amp;id=<?=$OwnerID?></a>
</li> </li>
<li> </ul>
<a href="reportsv2.php?view=reporter&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=reporter&amp;id=<?=$OwnerID?></a> <strong>By uploader ID:</strong>
</li> <ul>
</ul> <li>
<br /> Reports for torrents uploaded by <?=$Owner?>
<strong>By uploader ID:</strong> </li>
<ul> <li>
<li> <a href="reportsv2.php?view=uploader&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=uploader&amp;id=<?=$OwnerID?></a>
Reports for torrents uploaded by <?=$Owner?> </li>
</li> </ul>
<li> <strong>By resolver ID:</strong>
<a href="reportsv2.php?view=uploader&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=uploader&amp;id=<?=$OwnerID?></a> <ul>
</li> <li>
</ul> Reports for torrents resolved by <?=$Owner?>
<br /> </li>
<strong>By resolver ID:</strong> <li>
<ul> <a href="reportsv2.php?view=resolver&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=resolver&amp;id=<?=$OwnerID?></a>
<li> </li>
Reports for torrents resolved by <?=$Owner?> </ul>
</li> <strong>For browsing anything more complicated than these, use the search feature.</strong>
<li> </div>
<a href="reportsv2.php?view=resolver&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=resolver&amp;id=<?=$OwnerID?></a> </div>
</li> <div class="two_columns pad">
</ul>
<br /><br />
<strong>For browsing anything more complicated than these, use the search feature.</strong>
</td>
<td class="noborder" style="vertical-align: top;">
<? <?
$DB->query(" $DB->query("
SELECT SELECT
@ -223,10 +213,10 @@
$Staff = $DB->to_array(); $Staff = $DB->to_array();
?> ?>
<h3>Currently assigned reports by staff member</h3> <h3>Currently assigned reports by staff member</h3>
<table class="border reportsv2_views_table"> <table class="box border">
<tr class="colhead"> <tr class="colhead">
<td>Staff Member</td> <td class="colhead_dark">Staff Member</td>
<td>Current Count</td> <td class="colhead_dark number_column">Current Count</td>
</tr> </tr>
<? <?
foreach ($Staff as $Array) { ?> foreach ($Staff as $Array) { ?>
@ -239,7 +229,6 @@
<? <?
} ?> } ?>
</table> </table>
<br />
<h3>Different view modes by report type</h3> <h3>Different view modes by report type</h3>
<? <?
$DB->query(" $DB->query("
@ -252,10 +241,10 @@
$Current = $DB->to_array(); $Current = $DB->to_array();
if (!empty($Current)) { if (!empty($Current)) {
?> ?>
<table class="border reportsv2_views_table"> <table class="box border">
<tr class="colhead"> <tr class="colhead">
<td>Type</td> <td class="colhead_dark">Type</td>
<td>Current Count</td> <td class="colhead_dark number_column">Current Count</td>
</tr> </tr>
<? <?
foreach ($Current as $Array) { foreach ($Current as $Array) {
@ -280,7 +269,7 @@
} }
?> ?>
</table> </table>
</td></tr></table> </div>
</div> </div>
<? <?
View::show_footer(); View::show_footer();

View File

@ -13,7 +13,7 @@
shell_exec('unzip GeoLiteCity-latest.zip'); shell_exec('unzip GeoLiteCity-latest.zip');
shell_exec('rm GeoLiteCity-latest.zip'); shell_exec('rm GeoLiteCity-latest.zip');
if (($Locations = file("GeoLiteCity_".date('Ym')."06/GeoLiteCity-Location.csv", FILE_IGNORE_NEW_LINES)) === false) { if (($Locations = file("GeoLiteCity_".date('Ym')."01/GeoLiteCity-Location.csv", FILE_IGNORE_NEW_LINES)) === false) {
error('Download or extraction of maxmind database failed'); error('Download or extraction of maxmind database failed');
} }
array_shift($Locations); array_shift($Locations);
@ -32,7 +32,7 @@
echo 'There are '.count($CountryIDs).' CountryIDs'; echo 'There are '.count($CountryIDs).' CountryIDs';
echo '<br />'; echo '<br />';
if (($Blocks = file("GeoLiteCity_".date('Ym')."06/GeoLiteCity-Blocks.csv", FILE_IGNORE_NEW_LINES)) === false) { if (($Blocks = file("GeoLiteCity_".date('Ym')."01/GeoLiteCity-Blocks.csv", FILE_IGNORE_NEW_LINES)) === false) {
echo 'Error'; echo 'Error';
} }
array_shift($Blocks); array_shift($Blocks);

View File

@ -12,7 +12,6 @@
$View = in_array($View, array('tiles', 'list')) ? $View : 'tiles'; $View = in_array($View, array('tiles', 'list')) ? $View : 'tiles';
switch ($Category) { switch ($Category) {
case 'weekly': case 'weekly':
$Artists = json_decode(LastFM::get_weekly_artists(LIMIT), true)['artists']['artist']; $Artists = json_decode(LastFM::get_weekly_artists(LIMIT), true)['artists']['artist'];
break; break;
@ -28,14 +27,15 @@
<div class="thin"> <div class="thin">
<div class="header"> <div class="header">
<h2>Last.fm</h2> <h2>Last.fm</h2>
<? Top10View::render_linkbox("lastfm"); ?> <? Top10View::render_linkbox("lastfm"); ?>
</div> </div>
<? Top10View::render_artist_links($Category, $View); ?> <? Top10View::render_artist_links($Category, $View); ?>
<? Top10View::render_artist_controls($Category, $View); ?> <? Top10View::render_artist_controls($Category, $View); ?>
<? if ($View == 'tiles') { ?> <? if ($View == 'tiles') { ?>
<div class="tiles_container"> <div class="tiles_container">
<ul class="tiles"> <ul class="tiles">
<? foreach ($Artists as $Artist) { <?
foreach ($Artists as $Artist) {
Top10View::render_artist_tile($Artist, $Category); Top10View::render_artist_tile($Artist, $Category);
} ?> } ?>
</ul> </ul>
@ -43,7 +43,8 @@
<? } else { ?> <? } else { ?>
<div class="list_container"> <div class="list_container">
<ul class="top_artist_list"> <ul class="top_artist_list">
<? foreach ($Artists as $Artist) { <?
foreach ($Artists as $Artist) {
Top10View::render_artist_list($Artist, $Category); Top10View::render_artist_list($Artist, $Category);
} ?> } ?>
</ul> </ul>

View File

@ -46,8 +46,8 @@
View::show_header('Delete torrent', 'reportsv2'); View::show_header('Delete torrent', 'reportsv2');
?> ?>
<div class="thin center"> <div class="thin">
<div class="box" style="width: 600px; margin: 0px auto;"> <div class="box box2" style="width: 600px; margin-left: auto; margin-right: auto;">
<div class="head colhead"> <div class="head colhead">
Delete torrent Delete torrent
</div> </div>
@ -56,18 +56,21 @@
<input type="hidden" name="action" value="takedelete" /> <input type="hidden" name="action" value="takedelete" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="torrentid" value="<?=$TorrentID?>" /> <input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
<strong>Reason: </strong> <div class="field_div">
<select name="reason"> <strong>Reason: </strong>
<option value="Dead">Dead</option> <select name="reason">
<option value="Dupe">Dupe</option> <option value="Dead">Dead</option>
<option value="Trumped">Trumped</option> <option value="Dupe">Dupe</option>
<option value="Rules Broken">Rules broken</option> <option value="Trumped">Trumped</option>
<option value="" selected="selected">Other</option> <option value="Rules Broken">Rules broken</option>
</select> <option value="" selected="selected">Other</option>
&nbsp; </select>
<strong>Extra info: </strong> </div>
<input type="text" name="extra" size="30" /> <div class="field_div">
<input value="Delete" type="submit" /> <strong>Extra info: </strong>
<input type="text" name="extra" size="30" />
<input value="Delete" type="submit" />
</div>
</form> </form>
</div> </div>
</div> </div>
@ -151,7 +154,7 @@
$BBName = "[url=artist.php?id=$ArtistID]".$ArtistName."[/url] - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] " . ($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)'; $BBName = "[url=artist.php?id=$ArtistID]".$ArtistName."[/url] - [url=torrents.php?id=$GroupID]$GroupName".($Year ? " ($Year)" : '')."[/url] [url=torrents.php?torrentid=$TorrentID][$Format/$Encoding/$Media]{$RemasterDisplayString}[/url] " . ($HasLog ? " [url=torrents.php?action=viewlog&amp;torrentid=$TorrentID&amp;groupid=$GroupID](Log: {$LogScore}%)[/url]" : '').' ('.number_format($Size / (1024 * 1024), 2).' MB)';
} }
?> ?>
<div id="report<?=$ReportID?>"> <div id="report<?=$ReportID?>" class="report">
<form class="create_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post"> <form class="create_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post">
<? <?
/* /*
@ -160,7 +163,6 @@
?> ?>
<div> <div>
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" id="newreportid" name="newreportid" value="<?=$ReportID?>" />
<input type="hidden" id="reportid<?=$ReportID?>" name="reportid" value="<?=$ReportID?>" /> <input type="hidden" id="reportid<?=$ReportID?>" name="reportid" value="<?=$ReportID?>" />
<input type="hidden" id="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" /> <input type="hidden" id="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" />
<input type="hidden" id="uploader<?=$ReportID?>" name="uploader" value="<?=$UploaderName?>" /> <input type="hidden" id="uploader<?=$ReportID?>" name="uploader" value="<?=$UploaderName?>" />
@ -172,7 +174,7 @@
<input type="hidden" id="pm_type<?=$ReportID?>" name="pm_type" value="Uploader" /> <input type="hidden" id="pm_type<?=$ReportID?>" name="pm_type" value="Uploader" />
<input type="hidden" id="from_delete<?=$ReportID?>" name="from_delete" value="<?=$GroupID?>" /> <input type="hidden" id="from_delete<?=$ReportID?>" name="from_delete" value="<?=$GroupID?>" />
</div> </div>
<table cellpadding="5" class="layout"> <table cellpadding="5" class="box layout">
<tr> <tr>
<td class="label">Torrent:</td> <td class="label">Torrent:</td>
<td colspan="3"> <td colspan="3">

View File

@ -37,7 +37,7 @@
/* uTorrent Remote and various scripts redownload .torrent files periodically. /* uTorrent Remote and various scripts redownload .torrent files periodically.
To prevent this retardation from blowing bandwidth etc., let's block it To prevent this retardation from blowing bandwidth etc., let's block it
if the .torrent file has been downloaded four times before */ if the .torrent file has been downloaded four times before */
if (strpos($_SERVER['HTTP_USER_AGENT'], 'BTWebClient') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Python-urllib') !== false) { if ((strpos($_SERVER['HTTP_USER_AGENT'], 'BTWebClient') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Python-urllib') !== false)) {
$DB->query(" $DB->query("
SELECT 1 SELECT 1
FROM users_downloads FROM users_downloads

View File

@ -1,54 +1,48 @@
function ChangeReportType() { function ChangeReportType() {
ajax.post("reportsv2.php?action=ajax_report","reportform", function (response) { $.post("reportsv2.php?action=ajax_report", $('#reportform').serialize(), function(response) {
$('#dynamic_form').raw().innerHTML = response; $('#dynamic_form').html(response);
}); });
} }
function ChangeResolve(reportid) { function ChangeResolve(reportid) {
ajax.get('reportsv2.php?action=ajax_change_resolve&id=' + reportid + '&type=' + $('#resolve_type' + reportid).raw().value + '&categoryid=' + $('#categoryid' + reportid).raw().value, function (response) { var url = 'reportsv2.php?action=ajax_change_resolve&id=' + reportid
var x = json.decode(response); + '&type=' + $('#resolve_type' + reportid).val()
$('#delete' + reportid).raw().checked = (x[0] == '1' ? true : false); + '&categoryid=' + $('#categoryid' + reportid).val();
if ($('#uploaderid' + reportid).raw().value == $('#reporterid' + reportid).raw().value) { $.getJSON(url, function(x) {
$('#warning' + reportid).raw().selectedIndex = 0; $('#delete' + reportid).prop('checked', x[0] == '1');
$('#upload' + reportid).raw().checked = false; if ($('#uploaderid' + reportid).val() == $('#reporterid' + reportid).val()) {
} else { $('#upload' + reportid).prop('checked', false);
$('#upload' + reportid).raw().checked = (x[1] == '1' ? true : false); $('#warning' + reportid).val('0');
$('#warning' + reportid).raw().selectedIndex = x[2]; } else {
} $('#upload' + reportid).prop('checked', x[1] == '1');
$('#update_resolve' + reportid).raw().disabled = false; $('#warning' + reportid).val(x[2]);
} }
); $('#update_resolve' + reportid).enable();
});
} }
function Load(reportid) { function Load(reportid) {
var t = $('#type' + reportid).raw().value; var type = $('#type' + reportid).val();
for (var i = 0; i<$('#resolve_type' + reportid).raw().options.length; i++) { $('#resolve_type' + reportid + ' option[value="'+type+'"]').prop('selected', true);
if ($('#resolve_type' + reportid).raw().options[i].value == t) { // Can't use ChangeResolve() because we need it to block to do the uploader==reporter part
$('#resolve_type' + reportid).raw().selectedIndex = i; var url = 'reportsv2.php?action=ajax_change_resolve&id=' + reportid
break; + '&type=' + $('#resolve_type' + reportid).val()
+ '&categoryid=' + $('#categoryid' + reportid).val();
$.getJSON(url, function(x) {
$('#delete' + reportid).prop('checked', x[0] == '1');
if ($('#uploaderid' + reportid).val() == $('#reporterid' + reportid).val()) {
$('#upload' + reportid).prop('checked', false);
$('#warning' + reportid).val('0');
} else {
$('#upload' + reportid).prop('checked', x[1] == '1');
$('#warning' + reportid).val(x[2]);
} }
} $('#update_resolve' + reportid).enable();
//Can't use ChangeResolve() because we need it to block to do the uploader==reporter part });
ajax.get('reportsv2.php?action=ajax_change_resolve&id=' + reportid + '&type=' + $('#resolve_type' + reportid).raw().value + '&categoryid=' + $('#categoryid' + reportid).raw().value, function (response) {
var x = json.decode(response);
$('#delete' + reportid).raw().checked = (x[0] == '1' ? true : false);
if ($('#uploaderid' + reportid).raw().value == $('#reporterid' + reportid).raw().value) {
$('#warning' + reportid).raw().selectedIndex = 0;
$('#upload' + reportid).raw().checked = false;
} else {
$('#upload' + reportid).raw().checked = (x[1] == '1' ? true : false);
$('#warning' + reportid).raw().selectedIndex = x[2];
}
$('#update_resolve' + reportid).raw().disabled = false;
}
);
} }
function ErrorBox(reportid, message) { function ErrorBox(reportid, message) {
var div = document.createElement("div"); $('#all_reports').prepend('<div class="box pad center" id="error_box">Message from report ' + reportid + ': ' + message + '\n<input type="button" value="Hide Errors" onclick="HideErrors();" /></div>');
div.id = "#error_box";
div.innerHTML = '<table class="layout"><tr><td class="center">Message from report ' + reportid + ': ' + message + '\n <input type="button" value="Hide Errors" onclick="HideErrors();" /></td></tr></table>';
$('#all_reports').raw().insertBefore(div, $('#all_reports').raw().firstChild);
} }
function HideErrors() { function HideErrors() {
@ -59,15 +53,15 @@ function HideErrors() {
function TakeResolve(reportid) { function TakeResolve(reportid) {
$('#submit_' + reportid).disable(); $('#submit_' + reportid).disable();
ajax.post("reportsv2.php?action=takeresolve","reportform_" + reportid, function (response) { $.post("reportsv2.php?action=takeresolve", $('#reportform_' + reportid).serialize(), function(response) {
if (response) { if (response) {
ErrorBox(reportid, response); ErrorBox(reportid, response);
} else { } else {
if ($('#from_delete' + reportid).results()) { if ($('#from_delete' + reportid).size()) {
window.location = location.protocol + '//' + location.host + location.pathname + "?id=" + $('#from_delete' + reportid).raw().value; window.location.search = '?id=' + $('#from_delete' + reportid).val();
} else { } else {
$('#report' + reportid).remove(); $('#report' + reportid).remove();
if ($('#dynamic').raw().checked) { if ($('#dynamic').prop('checked')) {
NewReport(1); NewReport(1);
} }
} }
@ -76,111 +70,87 @@ function TakeResolve(reportid) {
} }
function NewReport(q, view, id) { function NewReport(q, view, id) {
for (var i = 0; i < q; i++) { var url = 'reportsv2.php?action=ajax_new_report&uniqurl=' + q;
var url = "reportsv2.php?action=ajax_new_report"; if (view) {
if (view) { url += '&view=' + view;
url += "&view=" + view; }
} if (id) {
if (id) { url += '&id=' + id;
url += "&id=" + id; }
} $.get(url, function (response) {
if (response) {
ajax.get(url, function (response) { var div = $(response);
if (response) { var id = div.data("reportid");
var div = document.createElement("div"); if (!$('#report'+id).size()) {
div.id = "report"; $('#all_reports').append(div);
div.innerHTML = response; $('#no_reports').remove();
$('#all_reports').raw().appendChild(div); if ($('#type', div).size()) {
var id = $('#newreportid').raw().value; Load(id);
Load(id);
$('#newreportid').remove();
if ($('#no_reports').results()) {
$('#all_reports').raw().removeChild($('#no_reports').raw());
}
} else {
//No new reports at this time
if (!$('#report').results() && !$('#no_reports').results()) {
var div = document.createElement("div");
div.id = "no_reports";
div.innerHTML = '<table class="layout"><tr><td class="center"><strong>No new reports! \\o/</strong></td></tr></table>';
$('#all_reports').raw().appendChild(div);
} }
} }
});
}
}
function AddMore(view, id) {
//Function will add the amount of reports in the input box unless that will take it over 50
var x = 10;
var a = $('#repop_amount').raw().value;
if (a) {
if (!isNaN(a) && a <= 50) {
x = a;
}
}
if (document.getElementsByName("reportid").length + x <= 50) {
NewReport(x, view, id);
} else {
NewReport(50 - document.getElementsByName("reportid").length, view, id);
}
}
function SendPM(reportid) {
ajax.post("reportsv2.php?action=ajax_take_pm", "reportform_" + reportid, function (response) {
if (response) {
$('#uploader_pm' + reportid).raw().value = response;
} else { } else {
$('#uploader_pm' + reportid).raw().value = ""; // No new reports at this time
if (!$('.report').size() && !$('#no_reports') == 0) {
$('#all_reports').append($('<div id="no_reports" class="box pad center"><strong>No new reports! \o/</strong></div>'));
}
}
if (--q > 0) {
// Recursion to avoid grabbing the same report multiple times
NewReport(q, view, id);
} }
}); });
} }
function AddMore(view, id) {
// Function will add the amount of reports in the input box unless that will take it over 50
var num = parseInt($('#repop_amount').val()) || 10;
var curCount = $('.report').size();
if (curCount < 50) {
NewReport(Math.min(num, 50 - curCount), view, id)
}
}
function SendPM(reportid) {
$.post('reportsv2.php?action=ajax_take_pm', $('#reportform_' + reportid).serialize(), function(response) {
$('#uploader_pm' + reportid).val(response);
});
}
function UpdateComment(reportid) { function UpdateComment(reportid) {
ajax.post("reportsv2.php?action=ajax_update_comment", "reportform_" + reportid, function (response) { $.post('reportsv2.php?action=ajax_update_comment', $('#reportform_' + reportid).serialize(), function(response) {
if (response) { if (response) {
alert(response); alert(response);
} }
}); });
} }
function GiveBack(id) { function GiveBack(reportid) {
if (!id) { if (reportid) {
var x = document.getElementsByName("reportid"); $.get("reportsv2.php?action=ajax_giveback_report&id=" + reportid, function(response) {
for (i = 0; i < x.length; i++) {
/*ajax.get("ajax.php?action=giveback_report&id=" + x[i].value, function (response) {
if (response) {
alert(response);
}
});*/
$('#report' + x[i].value).remove();
}
} else {
ajax.get("ajax.php?action=giveback_report&id=" + id, function (response) {
if (response) { if (response) {
alert(response); alert(response);
} }
}); });
$('#report' + id).remove(); $('#report' + reportid).remove();
} else {
$('#all_reports input[name="reportid"]').each(function() {
$.get("reportsv2.php?action=ajax_giveback_report&id=" + this.value, function(response) {
if (response) {
alert(response);
}
});
$('#report' + this.value).remove();
});
} }
} }
function ManualResolve(reportid) { function ManualResolve(reportid) {
var option = document.createElement("OPTION"); $('#resolve_type' + reportid).append('<option value="manual">Manual Resolve</option>').val('manual');
option.value = "manual";
option.text = "Manual Resolve";
$('#resolve_type' + reportid).raw().options.add(option);
$('#resolve_type' + reportid).raw().selectedIndex = $('#resolve_type' + reportid).raw().options.length - 1;
TakeResolve(reportid); TakeResolve(reportid);
} }
function Dismiss(reportid) { function Dismiss(reportid) {
var option = document.createElement("OPTION"); $('#resolve_type' + reportid).append('<option value="dismiss">Invalid Report</option>').val('dismiss');
option.value = "dismiss";
option.text = "Invalid Report";
$('#resolve_type' + reportid).raw().options.add(option);
$('#resolve_type' + reportid).raw().selectedIndex = $('#resolve_type' + reportid).raw().options.length - 1;
TakeResolve(reportid); TakeResolve(reportid);
} }
@ -190,56 +160,57 @@ function ClearReport(reportid) {
function Grab(reportid) { function Grab(reportid) {
if (reportid) { if (reportid) {
ajax.get("reportsv2.php?action=ajax_grab_report&id=" + reportid, function (response) { $.get("reportsv2.php?action=ajax_grab_report&id=" + reportid, function(response) {
if (response == '1') { if (response == '1') {
$('#grab' + reportid).raw().disabled = true; $('#grab' + reportid).disable();
} else { } else {
alert('Grab failed for some reason :/'); alert('Grab failed for some reason :/');
} }
}); });
} else { } else {
var x = document.getElementsByName("reportid"); $('#all_reports input[name="reportid"]').each(function() {
for (i = 0; i < x.length; i++) { var reportid = this.value
ajax.get("reportsv2.php?action=ajax_grab_report&id=" + x[i].value, function (response) { $.get("reportsv2.php?action=ajax_grab_report&id=" + reportid, function(response) {
if (response != '1') { if (response == '1') {
$('#grab' + reportid).disable();
} else {
alert("One of those grabs failed, sorry I can't be more useful :P"); alert("One of those grabs failed, sorry I can't be more useful :P");
} }
}); });
$('#grab' + x[i].value).raw().disabled = true; });
}
} }
} }
function MultiResolve() { function MultiResolve() {
var multi = document.getElementsByName('multi'); $('input[name="multi"]:checked').each(function() {
for (var j = 0; j < multi.length; j++) { TakeResolve(this.id.substr(5))
if (multi[j].checked) { });
TakeResolve(multi[j].id.substring(5));
}
}
} }
function UpdateResolve(reportid) { function UpdateResolve(reportid) {
var newresolve = $('#resolve_type' + reportid).raw().options[$('#resolve_type' + reportid).raw().selectedIndex].value; var newresolve = $('#resolve_type' + reportid).val();
ajax.get("reportsv2.php?action=ajax_update_resolve&reportid=" + reportid + "&newresolve=" + newresolve + "&categoryid=" + $('#categoryid' + reportid).raw().value, function (response) { var url = 'reportsv2.php?action=ajax_update_resolve&reportid=' + reportid
$('#update_resolve' + reportid).raw().disabled = true; + "&newresolve=" + newresolve
+ "&categoryid=" + $('#categoryid' + reportid).val();
$.get(url, function(response) {
$('#update_resolve' + reportid).disable();
}); });
} }
function Switch(reportid, torrentid, otherid) { function Switch(reportid, torrentid, otherid) {
//We want to switch positions of the reported torrent // We want to switch positions of the reported torrent
//This entails invalidating the current report and creating a new with the correct preset. // This entails invalidating the current report and creating a new with the correct preset.
Dismiss(reportid); Dismiss(reportid);
var report = new Array(); var report = {
report['auth'] = authkey; auth: authkey,
report['torrentid'] = otherid torrentid: otherid,
report['type'] = $('#type' + reportid).raw().value; type: $('#type' + reportid).val(),
report['otherid'] = torrentid otherid: torrentid
}
ajax.post('reportsv2.php?action=ajax_create_report', report, function (response) { $.post('reportsv2.php?action=ajax_create_report', report, function(response) {
//Returns new report ID. //Returns new report ID.
if (isNaN(response)) { if (isNaN(response)) {
alert(response); alert(response);

View File

@ -366,6 +366,7 @@ p.min_padding {
font-size: 8pt; font-size: 8pt;
background-color: #DCB881; background-color: #DCB881;
border: 1px solid #65430F; border: 1px solid #65430F;
margin-bottom: 10px;
} }
.box2 { .box2 {
@ -382,12 +383,7 @@ p.min_padding {
.sidebar { .sidebar {
float: right; float: right;
width: 250px; width: 245px;
height: 100%;
}
.sidebar .box {
margin: 0px 5px 10px 5px;
} }
#AddArtists input { #AddArtists input {
@ -406,11 +402,10 @@ p.min_padding {
} }
.main_column { .main_column {
margin: 0px 255px 10px 0px; width: 592px;
width: 590px;
} }
.main_column .box, .main_column table { .main_column table {
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -863,6 +858,6 @@ div[class~=tooltipster-content] > a {
font-weight: normal; font-weight: normal;
} }
.reportsv2_views_container { .reportsv2_views_table {
width: 100%; width: 100%;
} }

View File

@ -2044,3 +2044,17 @@ div[class~=tooltipster-base] {
div[class~=tooltipster-content] > a { div[class~=tooltipster-content] > a {
color: #007DC6; color: #007DC6;
} }
/*
Consistent .box and .pad
TODO: Make these rules apply globally and add exceptions where needed
*/
#reportsv2 .box {
background-color: #212121;
border: 1px solid #1a1a1a;
margin: 0 0 20px 0;
}
#reportsv2 .pad {
padding: 10px !important;
}

View File

@ -629,3 +629,23 @@ tr.torrent .bookmark>a:after {
margin-right: auto; margin-right: auto;
padding: 10px 20px 20px 20px; padding: 10px 20px 20px 20px;
} }
.noborder {
border: none;
}
.two_columns {
float: left;
width: 50%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.field_div {
margin-bottom: 10px;
}
.field_div:last-of-type {
margin-bottom: 0;
}

View File

@ -476,10 +476,6 @@ p.min_padding {
} }
.sidebar .pad { .sidebar .pad {
padding: 4px;
}
#index .sidebar .pad {
padding: 9px; padding: 9px;
} }
@ -491,6 +487,7 @@ p.min_padding {
font-size: 8pt; font-size: 8pt;
background-color: #282828; background-color: #282828;
border: 1px solid #303030; border: 1px solid #303030;
margin-bottom: 10px;
} }
.box2 { .box2 {
@ -507,12 +504,7 @@ p.min_padding {
.sidebar { .sidebar {
float: right; float: right;
width: 250px; width: 245px;
height: 100%;
}
.sidebar .box {
margin: 0px 5px 10px 5px;
} }
.head { .head {
@ -527,11 +519,10 @@ p.min_padding {
} }
.main_column { .main_column {
margin: 0px 255px 10px 0px; width: 592px;
width: 590px;
} }
.main_column .box,.main_column table { .main_column table {
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -939,6 +930,6 @@ tr.torrent .bookmark > a:after { color:#999; }
color: red; color: red;
} }
.reportsv2_views_container { .reportsv2_views_table {
width: 100%; width: 100%;
} }

View File

@ -374,6 +374,7 @@ p.min_padding {
font-size: 8pt; font-size: 8pt;
background-color: #EAEAEA; background-color: #EAEAEA;
border: 1px solid #666666; border: 1px solid #666666;
margin-bottom: 10px;
} }
.box2 { .box2 {
@ -390,12 +391,7 @@ p.min_padding {
.sidebar { .sidebar {
float: right; float: right;
width: 250px; width: 245px;
height: 100%;
}
.sidebar .box {
margin: 0px 5px 10px 5px;
} }
.head { .head {
@ -410,11 +406,10 @@ p.min_padding {
} }
.main_column { .main_column {
margin: 0px 255px 10px 0px; width: 592px;
width: 590px;
} }
.main_column .box, .main_column table { .main_column table {
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -816,6 +811,6 @@ div[class~=tooltipster-content] > a {
color: red; color: red;
} }
.reportsv2_views_container { .reportsv2_views_table {
width: 100%; width: 100%;
} }

View File

@ -1376,3 +1376,10 @@ table[width="100%"].user_options {
width: 400px; width: 400px;
max-width: 100%; max-width: 100%;
} }
/*
Consistent .box and .pad
TODO: Make these rules apply globally and add exceptions where needed
*/
#reportsv2 .pad { padding: 10px !important; }
#reportsv2 .box { margin-bottom: 10px; background-color: rgb(255,255,255); border: 1px solid #aaa; color: #777; }

View File

@ -523,6 +523,7 @@ p.min_padding {
.box { .box {
font-size: 10pt; font-size: 10pt;
background-color: #F7F6F2; background-color: #F7F6F2;
margin-bottom: 10px;
} }
.box2 { .box2 {
@ -538,12 +539,7 @@ p.min_padding {
.sidebar { .sidebar {
float: right; float: right;
width: 250px; width: 245px;
height: 100%;
}
.sidebar .box {
margin: 0px 5px 10px 5px;
} }
.body { .body {
@ -551,11 +547,10 @@ p.min_padding {
} }
.main_column { .main_column {
margin: 0px 255px 10px 0px; width: 592px;
width: 590px;
} }
.main_column .box, .main_column table { .main_column table {
margin-bottom: 10px; margin-bottom: 10px;
} }

View File

@ -2065,3 +2065,24 @@ div[class~=tooltipster-base] {
background-color: #F5F5F5; background-color: #F5F5F5;
color: #575757; color: #575757;
} }
.reportsv2_views_table {
width: 90%;
}
/*
Consistent .box and .pad
TODO: Make these rules apply globally and add exceptions where needed
*/
#reportsv2 .box {
background-color: #f5f5f5;
border: 1px solid #dcdcdc;
margin: 0 0 20px 0;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
#reportsv2 .pad {
padding: 10px !important;
}

View File

@ -826,6 +826,10 @@ div[class~=tooltipster-base] {
margin-left: 0; margin-left: 0;
} }
.reportsv2_views_container { .two_columns:first-of-type {
width: 90%; padding-right: 7px;
}
.two_columns:last-of-type {
padding-left: 7px;
} }