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">
<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?>);" /> <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,13 +211,12 @@
$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>
@ -226,22 +225,17 @@
| <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">
<tr>
<td class="center">
<strong>No new reports! \o/</strong> <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">
<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?>);" /> <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,17 +295,16 @@
$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?>" />
@ -328,7 +315,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">
@ -388,7 +375,7 @@
$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>
@ -396,7 +383,7 @@
} }
} }
} }
?> ?>
</td> </td>
</tr> </tr>
<? if ($Tracks) { ?> <? if ($Tracks) { ?>
@ -419,7 +406,8 @@
if ($local_url = $Text->local_url($Link)) { if ($local_url = $Text->local_url($Link)) {
$Link = $local_url; $Link = $local_url;
} ?> }
?>
<a href="<?=$Link?>"><?=$Link?></a> <a href="<?=$Link?>"><?=$Link?></a>
<? } ?> <? } ?>
</td> </td>
@ -492,20 +480,22 @@
<? <?
$First = false; $First = false;
} }
} ?> }
?>
</td> </td>
</tr> </tr>
<? <?
} }
if ($Images) { ?> if ($Images) {
?>
<tr> <tr>
<td class="label">Relevant images:</td> <td class="label">Relevant images:</td>
<td colspan="3"> <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>
@ -593,14 +583,16 @@
<tr> <tr>
<td class="label"><strong>Extra</strong> log message:</td> <td class="label"><strong>Extra</strong> log message:</td>
<td> <td>
<input type="text" name="log_message" id="log_message<?=$ReportID?>" size="40" <? if ($ExtraIDs) { <input type="text" name="log_message" id="log_message<?=$ReportID?>" size="40"
<? if ($ExtraIDs) {
$Extras = explode(' ', $ExtraIDs); $Extras = explode(' ', $ExtraIDs);
$Value = ''; $Value = '';
foreach ($Extras as $ExtraID) { foreach ($Extras as $ExtraID) {
$Value .= 'https://'.SSL_SITE_URL."/torrents.php?torrentid=$ExtraID "; $Value .= 'https://'.SSL_SITE_URL."/torrents.php?torrentid=$ExtraID ";
} }
echo 'value="'.trim($Value).'"'; echo 'value="'.trim($Value).'"';
} ?>/> } ?>
/>
</td> </td>
<td class="label"><strong>Extra</strong> staff notes:</td> <td class="label"><strong>Extra</strong> staff notes:</td>
<td> <td>
@ -655,10 +647,9 @@
} ?> } ?>
</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,9 +139,8 @@
</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>
@ -155,7 +150,6 @@
<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>
@ -165,7 +159,6 @@
<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>
<br />
<strong>By report ID:</strong> <strong>By report ID:</strong>
<ul> <ul>
<li> <li>
@ -175,7 +168,6 @@
<a href="reportsv2.php?view=report&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=report&amp;id=1</a> <a href="reportsv2.php?view=report&amp;id=1">https://<?=SSL_SITE_URL?>/reportsv2.php?view=report&amp;id=1</a>
</li> </li>
</ul> </ul>
<br />
<strong>By reporter ID:</strong> <strong>By reporter ID:</strong>
<ul> <ul>
<li> <li>
@ -185,7 +177,6 @@
<a href="reportsv2.php?view=reporter&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=reporter&amp;id=<?=$OwnerID?></a> <a href="reportsv2.php?view=reporter&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=reporter&amp;id=<?=$OwnerID?></a>
</li> </li>
</ul> </ul>
<br />
<strong>By uploader ID:</strong> <strong>By uploader ID:</strong>
<ul> <ul>
<li> <li>
@ -195,7 +186,6 @@
<a href="reportsv2.php?view=uploader&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=uploader&amp;id=<?=$OwnerID?></a> <a href="reportsv2.php?view=uploader&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=uploader&amp;id=<?=$OwnerID?></a>
</li> </li>
</ul> </ul>
<br />
<strong>By resolver ID:</strong> <strong>By resolver ID:</strong>
<ul> <ul>
<li> <li>
@ -205,10 +195,10 @@
<a href="reportsv2.php?view=resolver&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=resolver&amp;id=<?=$OwnerID?></a> <a href="reportsv2.php?view=resolver&amp;id=<?=$OwnerID?>">https://<?=SSL_SITE_URL?>/reportsv2.php?view=resolver&amp;id=<?=$OwnerID?></a>
</li> </li>
</ul> </ul>
<br /><br />
<strong>For browsing anything more complicated than these, use the search feature.</strong> <strong>For browsing anything more complicated than these, use the search feature.</strong>
</td> </div>
<td class="noborder" style="vertical-align: top;"> </div>
<div class="two_columns pad">
<? <?
$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,6 +56,7 @@
<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?>" />
<div class="field_div">
<strong>Reason: </strong> <strong>Reason: </strong>
<select name="reason"> <select name="reason">
<option value="Dead">Dead</option> <option value="Dead">Dead</option>
@ -64,10 +65,12 @@
<option value="Rules Broken">Rules broken</option> <option value="Rules Broken">Rules broken</option>
<option value="" selected="selected">Other</option> <option value="" selected="selected">Other</option>
</select> </select>
&nbsp; </div>
<div class="field_div">
<strong>Extra info: </strong> <strong>Extra info: </strong>
<input type="text" name="extra" size="30" /> <input type="text" name="extra" size="30" />
<input value="Delete" type="submit" /> <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()) {
$('#upload' + reportid).prop('checked', false);
$('#warning' + reportid).val('0');
} else { } else {
$('#upload' + reportid).raw().checked = (x[1] == '1' ? true : false); $('#upload' + reportid).prop('checked', x[1] == '1');
$('#warning' + reportid).raw().selectedIndex = x[2]; $('#warning' + reportid).val(x[2]);
} }
$('#update_resolve' + reportid).raw().disabled = false; $('#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) {
//Can't use ChangeResolve() because we need it to block to do the uploader==reporter part $('#delete' + reportid).prop('checked', x[0] == '1');
ajax.get('reportsv2.php?action=ajax_change_resolve&id=' + reportid + '&type=' + $('#resolve_type' + reportid).raw().value + '&categoryid=' + $('#categoryid' + reportid).raw().value, function (response) { if ($('#uploaderid' + reportid).val() == $('#reporterid' + reportid).val()) {
var x = json.decode(response); $('#upload' + reportid).prop('checked', false);
$('#delete' + reportid).raw().checked = (x[0] == '1' ? true : false); $('#warning' + reportid).val('0');
if ($('#uploaderid' + reportid).raw().value == $('#reporterid' + reportid).raw().value) {
$('#warning' + reportid).raw().selectedIndex = 0;
$('#upload' + reportid).raw().checked = false;
} else { } else {
$('#upload' + reportid).raw().checked = (x[1] == '1' ? true : false); $('#upload' + reportid).prop('checked', x[1] == '1');
$('#warning' + reportid).raw().selectedIndex = x[2]; $('#warning' + reportid).val(x[2]);
} }
$('#update_resolve' + reportid).raw().disabled = false; $('#update_resolve' + reportid).enable();
} });
);
} }
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) {
ajax.get(url, function (response) {
if (response) { if (response) {
var div = document.createElement("div"); var div = $(response);
div.id = "report"; var id = div.data("reportid");
div.innerHTML = response; if (!$('#report'+id).size()) {
$('#all_reports').raw().appendChild(div); $('#all_reports').append(div);
var id = $('#newreportid').raw().value; $('#no_reports').remove();
if ($('#type', div).size()) {
Load(id); Load(id);
$('#newreportid').remove(); }
if ($('#no_reports').results()) {
$('#all_reports').raw().removeChild($('#no_reports').raw());
} }
} else { } else {
//No new reports at this time // No new reports at this time
if (!$('#report').results() && !$('#no_reports').results()) { if (!$('.report').size() && !$('#no_reports') == 0) {
var div = document.createElement("div"); $('#all_reports').append($('<div id="no_reports" class="box pad center"><strong>No new reports! \o/</strong></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);
} }
} }
if (--q > 0) {
// Recursion to avoid grabbing the same report multiple times
NewReport(q, view, id);
}
}); });
}
} }
function AddMore(view, id) { function AddMore(view, id) {
//Function will add the amount of reports in the input box unless that will take it over 50 // Function will add the amount of reports in the input box unless that will take it over 50
var x = 10; var num = parseInt($('#repop_amount').val()) || 10;
var a = $('#repop_amount').raw().value; var curCount = $('.report').size();
if (a) { if (curCount < 50) {
if (!isNaN(a) && a <= 50) { NewReport(Math.min(num, 50 - curCount), view, id)
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) { function SendPM(reportid) {
ajax.post("reportsv2.php?action=ajax_take_pm", "reportform_" + reportid, function (response) { $.post('reportsv2.php?action=ajax_take_pm', $('#reportform_' + reportid).serialize(), function(response) {
if (response) { $('#uploader_pm' + reportid).val(response);
$('#uploader_pm' + reportid).raw().value = response;
} else {
$('#uploader_pm' + reportid).raw().value = "";
}
}); });
} }
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;
} }