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) {
if (!empty($Image)) { ?>
if (!empty($Image)) {
$Name = htmlspecialchars($Name);
?>
<li>
<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>
</li>
<? }
@ -75,12 +77,11 @@ private static function render_list($Url, $Name, $Image) {
if (!empty($Image)) {
$UseTooltipster = !isset(G::$LoggedUser['Tooltipster']) || G::$LoggedUser['Tooltipster'];
$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>
<a class="tooltip_image" <?=$Title?> href="<?=$Url?><?=$Name?>">
<?=$Name?>
</a>
<a class="tooltip_image" <?=$Title?> href="<?=$Url?><?=$Name?>"><?=$Name?></a>
</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':
require('torrent_info.php');
break;
case 'giveback_report':
require('giveback_report.php');
break;
case 'grab_report':
require('grab_report.php');
break;
case 'stats':
require(SERVER_ROOT . '/sections/ajax/stats.php');
break;

View File

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

View File

@ -89,15 +89,10 @@
LastChangeTime = '".sqltime()."',
ModComment = 'Report already dealt with (torrent deleted)'
WHERE ID = $ReportID");
$Cache->decrement('num_torrent_reportsv2');
?>
<div>
<table class="layout">
<tr>
<td class="center">
<div id="report<?=$ReportID?>" class="report box pad center" data-reportid="<?=$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>
<?
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)';
}
?>
<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">
<?
/*
@ -142,7 +137,6 @@
?>
<div>
<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="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" />
<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="categoryid<?=$ReportID?>" name="categoryid" value="<?=$CategoryID?>" />
</div>
<table class="layout" cellpadding="5">
<table class="box layout" cellpadding="5">
<tr>
<td class="label"><a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Reported</a> torrent:</td>
<td colspan="3">
@ -428,9 +422,4 @@
</tr>
</table>
</form>
<br />
</div>
<script type="text/javascript">//<![CDATA[
Load('<?=$ReportID?>');
//]]>
</script>

View File

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

View File

@ -9,19 +9,17 @@
}
View::show_header('Reports V2!', 'reportsv2');
?>
<div class="header">
<h2>New reports, auto assigned!</h2>
<? include('header.php'); ?>
<? include('header.php'); ?>
</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" />
| <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="Unclaim all of the reports currently displayed"><input type="button" onclick="GiveBack();" value="Unclaim all" /></span>
</div>
<br />
<div id="all_reports" style="width: 80%; margin-left: auto; margin-right: auto;">
</div>
<?

View File

@ -211,13 +211,12 @@
$PageLinks = Format::get_pages($Page, $Results, REPORTS_PER_PAGE, 11);
View::show_header('Reports V2!', 'reportsv2,bbcode');
?>
<div class="header">
<h2><?=$Title?></h2>
<? include('header.php'); ?>
</div>
<div class="buttonbox thin center">
<div class="buttonbox pad center">
<? 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="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>
<? } ?>
</div>
<br />
<? if ($PageLinks) { ?>
<div class="linkbox">
<?=$PageLinks?>
<?=$PageLinks?>
</div>
<? } ?>
<div id="all_reports" style="width: 80%; margin-left: auto; margin-right: auto;">
<?
if (count($Reports) === 0) {
?>
<div>
<table class="layout">
<tr>
<td class="center">
<div class="box pad center">
<strong>No new reports! \o/</strong>
</td>
</tr>
</table>
</div>
<?
} else {
@ -262,14 +256,8 @@
WHERE ID = $ReportID");
$Cache->decrement('num_torrent_reportsv2');
?>
<div id="report<?=$ReportID?>">
<table class="layout">
<tr>
<td class="center">
<div id="report<?=$ReportID?>" class="report box pad 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>
<?
} 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)';
}
?>
?>
<div id="report<?=$ReportID?>">
<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>
<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="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" />
<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="categoryid<?=$ReportID?>" name="categoryid" value="<?=$CategoryID?>" />
</div>
<table class="layout" cellpadding="5">
<table class="box layout" cellpadding="5">
<tr>
<td class="label"><a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Reported</a> torrent:</td>
<td colspan="3">
@ -388,7 +375,7 @@
$Requests = ($DB->has_results());
if ($Requests > 0) {
while (list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) {
?>
?>
<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>
</div>
@ -396,7 +383,7 @@
}
}
}
?>
?>
</td>
</tr>
<? if ($Tracks) { ?>
@ -419,7 +406,8 @@
if ($local_url = $Text->local_url($Link)) {
$Link = $local_url;
} ?>
}
?>
<a href="<?=$Link?>"><?=$Link?></a>
<? } ?>
</td>
@ -492,20 +480,22 @@
<?
$First = false;
}
} ?>
}
?>
</td>
</tr>
<?
}
if ($Images) { ?>
if ($Images) {
?>
<tr>
<td class="label">Relevant images:</td>
<td colspan="3">
<?
$Images = explode(' ', $Images);
foreach ($Images as $Image) {
?>
?>
<img style="max-width: 200px;" onclick="lightbox.init(this, 200);" src="<?=ImageTools::process($Image)?>" alt="Relevant image" />
<? } ?>
</td>
@ -593,14 +583,16 @@
<tr>
<td class="label"><strong>Extra</strong> log message:</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);
$Value = '';
foreach ($Extras as $ExtraID) {
$Value .= 'https://'.SSL_SITE_URL."/torrents.php?torrentid=$ExtraID ";
}
echo 'value="'.trim($Value).'"';
} ?>/>
} ?>
/>
</td>
<td class="label"><strong>Extra</strong> staff notes:</td>
<td>
@ -655,10 +647,9 @@
} ?>
</table>
</form>
<br />
</div>
<script type="text/javascript">//<![CDATA[
Load('<?=$ReportID?>');
Load(<?=$ReportID?>);
//]]>
</script>
<?
@ -668,7 +659,6 @@
?>
</div>
<? if ($PageLinks) { ?>
<div class="linkbox pager"><?=$PageLinks?></div>
<div class="linkbox pager"><?=$PageLinks?></div>
<? } ?>
</div>
<? View::show_footer(); ?>

View File

@ -312,7 +312,7 @@
$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) {
$DB->query("
UPDATE reportsv2
@ -323,16 +323,9 @@
WHERE ID = $ReportID");
}
} else {
//Someone beat us to it. Inform the staffer.
// Someone beat us to it. Inform the staffer.
?>
<table class="layout" cellpadding="5">
<tr>
<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>
<a href="reportsv2.php?view=report&amp;id=<?=$ReportID?>">Somebody has already resolved this report</a>
<input type="button" value="Clear" onclick="ClearReport(<?=$ReportID?>);" />
<?
}
?>

View File

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

View File

@ -13,7 +13,7 @@
shell_exec('unzip 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');
}
array_shift($Locations);
@ -32,7 +32,7 @@
echo 'There are '.count($CountryIDs).' CountryIDs';
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';
}
array_shift($Blocks);

View File

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

View File

@ -46,8 +46,8 @@
View::show_header('Delete torrent', 'reportsv2');
?>
<div class="thin center">
<div class="box" style="width: 600px; margin: 0px auto;">
<div class="thin">
<div class="box box2" style="width: 600px; margin-left: auto; margin-right: auto;">
<div class="head colhead">
Delete torrent
</div>
@ -56,6 +56,7 @@
<input type="hidden" name="action" value="takedelete" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
<div class="field_div">
<strong>Reason: </strong>
<select name="reason">
<option value="Dead">Dead</option>
@ -64,10 +65,12 @@
<option value="Rules Broken">Rules broken</option>
<option value="" selected="selected">Other</option>
</select>
&nbsp;
</div>
<div class="field_div">
<strong>Extra info: </strong>
<input type="text" name="extra" size="30" />
<input value="Delete" type="submit" />
</div>
</form>
</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)';
}
?>
<div id="report<?=$ReportID?>">
<div id="report<?=$ReportID?>" class="report">
<form class="create_form" name="report" id="reportform_<?=$ReportID?>" action="reports.php" method="post">
<?
/*
@ -160,7 +163,6 @@
?>
<div>
<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="torrentid<?=$ReportID?>" name="torrentid" value="<?=$TorrentID?>" />
<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="from_delete<?=$ReportID?>" name="from_delete" value="<?=$GroupID?>" />
</div>
<table cellpadding="5" class="layout">
<table cellpadding="5" class="box layout">
<tr>
<td class="label">Torrent:</td>
<td colspan="3">

View File

@ -37,7 +37,7 @@
/* uTorrent Remote and various scripts redownload .torrent files periodically.
To prevent this retardation from blowing bandwidth etc., let's block it
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("
SELECT 1
FROM users_downloads

View File

@ -1,54 +1,48 @@
function ChangeReportType() {
ajax.post("reportsv2.php?action=ajax_report","reportform", function (response) {
$('#dynamic_form').raw().innerHTML = response;
$.post("reportsv2.php?action=ajax_report", $('#reportform').serialize(), function(response) {
$('#dynamic_form').html(response);
});
}
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 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;
var url = 'reportsv2.php?action=ajax_change_resolve&id=' + reportid
+ '&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).raw().checked = (x[1] == '1' ? true : false);
$('#warning' + reportid).raw().selectedIndex = x[2];
$('#upload' + reportid).prop('checked', x[1] == '1');
$('#warning' + reportid).val(x[2]);
}
$('#update_resolve' + reportid).raw().disabled = false;
}
);
$('#update_resolve' + reportid).enable();
});
}
function Load(reportid) {
var t = $('#type' + reportid).raw().value;
for (var i = 0; i<$('#resolve_type' + reportid).raw().options.length; i++) {
if ($('#resolve_type' + reportid).raw().options[i].value == t) {
$('#resolve_type' + reportid).raw().selectedIndex = i;
break;
}
}
//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;
var type = $('#type' + reportid).val();
$('#resolve_type' + reportid + ' option[value="'+type+'"]').prop('selected', true);
// Can't use ChangeResolve() because we need it to block to do the uploader==reporter part
var url = 'reportsv2.php?action=ajax_change_resolve&id=' + reportid
+ '&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).raw().checked = (x[1] == '1' ? true : false);
$('#warning' + reportid).raw().selectedIndex = x[2];
$('#upload' + reportid).prop('checked', x[1] == '1');
$('#warning' + reportid).val(x[2]);
}
$('#update_resolve' + reportid).raw().disabled = false;
}
);
$('#update_resolve' + reportid).enable();
});
}
function ErrorBox(reportid, message) {
var div = document.createElement("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);
$('#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>');
}
function HideErrors() {
@ -59,15 +53,15 @@ function HideErrors() {
function TakeResolve(reportid) {
$('#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) {
ErrorBox(reportid, response);
} else {
if ($('#from_delete' + reportid).results()) {
window.location = location.protocol + '//' + location.host + location.pathname + "?id=" + $('#from_delete' + reportid).raw().value;
if ($('#from_delete' + reportid).size()) {
window.location.search = '?id=' + $('#from_delete' + reportid).val();
} else {
$('#report' + reportid).remove();
if ($('#dynamic').raw().checked) {
if ($('#dynamic').prop('checked')) {
NewReport(1);
}
}
@ -76,111 +70,87 @@ function TakeResolve(reportid) {
}
function NewReport(q, view, id) {
for (var i = 0; i < q; i++) {
var url = "reportsv2.php?action=ajax_new_report";
var url = 'reportsv2.php?action=ajax_new_report&uniqurl=' + q;
if (view) {
url += "&view=" + view;
url += '&view=' + view;
}
if (id) {
url += "&id=" + id;
url += '&id=' + id;
}
ajax.get(url, function (response) {
$.get(url, function (response) {
if (response) {
var div = document.createElement("div");
div.id = "report";
div.innerHTML = response;
$('#all_reports').raw().appendChild(div);
var id = $('#newreportid').raw().value;
var div = $(response);
var id = div.data("reportid");
if (!$('#report'+id).size()) {
$('#all_reports').append(div);
$('#no_reports').remove();
if ($('#type', div).size()) {
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);
// 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 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 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) {
ajax.post("reportsv2.php?action=ajax_take_pm", "reportform_" + reportid, function (response) {
if (response) {
$('#uploader_pm' + reportid).raw().value = response;
} else {
$('#uploader_pm' + reportid).raw().value = "";
}
$.post('reportsv2.php?action=ajax_take_pm', $('#reportform_' + reportid).serialize(), function(response) {
$('#uploader_pm' + reportid).val(response);
});
}
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) {
alert(response);
}
});
}
function GiveBack(id) {
if (!id) {
var x = document.getElementsByName("reportid");
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) {
function GiveBack(reportid) {
if (reportid) {
$.get("reportsv2.php?action=ajax_giveback_report&id=" + reportid, function(response) {
if (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) {
var option = document.createElement("OPTION");
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;
$('#resolve_type' + reportid).append('<option value="manual">Manual Resolve</option>').val('manual');
TakeResolve(reportid);
}
function Dismiss(reportid) {
var option = document.createElement("OPTION");
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;
$('#resolve_type' + reportid).append('<option value="dismiss">Invalid Report</option>').val('dismiss');
TakeResolve(reportid);
}
@ -190,56 +160,57 @@ function ClearReport(reportid) {
function Grab(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') {
$('#grab' + reportid).raw().disabled = true;
$('#grab' + reportid).disable();
} else {
alert('Grab failed for some reason :/');
}
});
} else {
var x = document.getElementsByName("reportid");
for (i = 0; i < x.length; i++) {
ajax.get("reportsv2.php?action=ajax_grab_report&id=" + x[i].value, function (response) {
if (response != '1') {
$('#all_reports input[name="reportid"]').each(function() {
var reportid = this.value
$.get("reportsv2.php?action=ajax_grab_report&id=" + reportid, function(response) {
if (response == '1') {
$('#grab' + reportid).disable();
} else {
alert("One of those grabs failed, sorry I can't be more useful :P");
}
});
$('#grab' + x[i].value).raw().disabled = true;
}
});
}
}
function MultiResolve() {
var multi = document.getElementsByName('multi');
for (var j = 0; j < multi.length; j++) {
if (multi[j].checked) {
TakeResolve(multi[j].id.substring(5));
}
}
$('input[name="multi"]:checked').each(function() {
TakeResolve(this.id.substr(5))
});
}
function UpdateResolve(reportid) {
var newresolve = $('#resolve_type' + reportid).raw().options[$('#resolve_type' + reportid).raw().selectedIndex].value;
ajax.get("reportsv2.php?action=ajax_update_resolve&reportid=" + reportid + "&newresolve=" + newresolve + "&categoryid=" + $('#categoryid' + reportid).raw().value, function (response) {
$('#update_resolve' + reportid).raw().disabled = true;
var newresolve = $('#resolve_type' + reportid).val();
var url = 'reportsv2.php?action=ajax_update_resolve&reportid=' + reportid
+ "&newresolve=" + newresolve
+ "&categoryid=" + $('#categoryid' + reportid).val();
$.get(url, function(response) {
$('#update_resolve' + reportid).disable();
});
}
function Switch(reportid, torrentid, otherid) {
//We want to switch positions of the reported torrent
//This entails invalidating the current report and creating a new with the correct preset.
// We want to switch positions of the reported torrent
// This entails invalidating the current report and creating a new with the correct preset.
Dismiss(reportid);
var report = new Array();
report['auth'] = authkey;
report['torrentid'] = otherid
report['type'] = $('#type' + reportid).raw().value;
report['otherid'] = torrentid
var report = {
auth: authkey,
torrentid: otherid,
type: $('#type' + reportid).val(),
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.
if (isNaN(response)) {
alert(response);

View File

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

View File

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

View File

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

View File

@ -1376,3 +1376,10 @@ table[width="100%"].user_options {
width: 400px;
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 {
font-size: 10pt;
background-color: #F7F6F2;
margin-bottom: 10px;
}
.box2 {
@ -538,12 +539,7 @@ p.min_padding {
.sidebar {
float: right;
width: 250px;
height: 100%;
}
.sidebar .box {
margin: 0px 5px 10px 5px;
width: 245px;
}
.body {
@ -551,11 +547,10 @@ p.min_padding {
}
.main_column {
margin: 0px 255px 10px 0px;
width: 590px;
width: 592px;
}
.main_column .box, .main_column table {
.main_column table {
margin-bottom: 10px;
}

View File

@ -2065,3 +2065,24 @@ div[class~=tooltipster-base] {
background-color: #F5F5F5;
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;
}
.reportsv2_views_container {
width: 90%;
.two_columns:first-of-type {
padding-right: 7px;
}
.two_columns:last-of-type {
padding-left: 7px;
}