Gazelle/sections/reportsv2/report.php

154 lines
5.8 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
/*
* This is the frontend of reporting a torrent, it's what users see when
* they visit reportsv2.php?id=xxx
*/
2013-04-17 08:00:58 +00:00
include(SERVER_ROOT.'/sections/torrents/functions.php');
2013-05-27 08:00:58 +00:00
include(SERVER_ROOT.'/classes/text.class.php');
2013-04-17 08:00:58 +00:00
$Text = NEW TEXT;
2011-03-28 14:21:28 +00:00
//If we're not coming from torrents.php, check we're being returned because of an error.
2013-05-04 08:00:48 +00:00
if (!isset($_GET['id']) || !is_number($_GET['id'])) {
if (!isset($Err)) {
2011-03-28 14:21:28 +00:00
error(404);
}
} else {
2013-04-19 08:00:55 +00:00
$TorrentID = $_GET['id'];
2013-05-27 08:00:58 +00:00
$DB->query("
SELECT tg.CategoryID, t.GroupID
FROM torrents_group AS tg
2013-07-10 00:08:53 +00:00
LEFT JOIN torrents AS t ON t.GroupID = tg.ID
WHERE t.ID = " . $_GET['id']);
2013-04-19 08:00:55 +00:00
list($CategoryID, $GroupID) = $DB->next_record();
$Artists = Artists::get_artist($GroupID);
$TorrentCache = get_group_info($GroupID, true, $RevisionID);
$GroupDetails = $TorrentCache[0];
$TorrentList = $TorrentCache[1];
// Resolve the torrentlist to the one specific torrent being reported
foreach ($TorrentList as &$Torrent) {
// Remove unneeded entries
if ($Torrent['ID'] != $TorrentID)
unset($TorrentList[$Torrent['ID']]);
}
// Group details
list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupYear,
$GroupRecordLabel, $GroupCatalogueNumber, $ReleaseType, $GroupCategoryID,
$GroupTime, $GroupVanityHouse, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
$TagPositiveVotes, $TagNegativeVotes, $GroupFlags) = array_values($GroupDetails);
2013-04-17 08:00:58 +00:00
2013-04-19 08:00:55 +00:00
$DisplayName = $GroupName;
$AltName = $GroupName; // Goes in the alt text of the image
$Title = $GroupName; // goes in <title>
$WikiBody = $Text->full_format($WikiBody);
2013-04-17 08:00:58 +00:00
2013-04-19 08:00:55 +00:00
//Get the artist name, group name etc.
$Artists = Artists::get_artist($GroupID);
if ($Artists) {
2013-07-10 00:08:53 +00:00
$DisplayName = '<span dir="ltr">' . Artists::display_artists($Artists, true) . "<a href=\"torrents.php?torrentid=$TorrentID\">$DisplayName</a></span>";
2013-04-19 08:00:55 +00:00
$AltName = display_str(Artists::display_artists($Artists, false)) . $AltName;
$Title = $AltName;
}
if ($GroupYear > 0) {
2013-07-10 00:08:53 +00:00
$DisplayName .= " [$GroupYear]";
$AltName .= " [$GroupYear]";
$Title .= " [$GroupYear]";
2013-04-19 08:00:55 +00:00
}
if ($GroupVanityHouse) {
2013-09-05 08:00:49 +00:00
$DisplayName .= ' [Vanity House]';
$AltName .= ' [Vanity House]';
2013-04-19 08:00:55 +00:00
}
if ($GroupCategoryID == 1) {
2013-09-05 08:00:49 +00:00
$DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
$AltName .= ' [' . $ReleaseTypes[$ReleaseType] . ']';
2013-04-19 08:00:55 +00:00
}
2011-03-28 14:21:28 +00:00
}
2013-06-27 08:01:06 +00:00
View::show_header('Report', 'reportsv2,browse,torrent,bbcode,recommend');
2011-03-28 14:21:28 +00:00
?>
<div class="thin">
2012-08-19 08:00:19 +00:00
<div class="header">
<h2>Report a torrent</h2>
</div>
2013-04-17 08:00:58 +00:00
<div class="header">
<h3><?=$DisplayName?></h3>
</div>
<div class="thin">
2013-05-27 08:00:58 +00:00
<table class="torrent_table details<?=($GroupFlags['IsSnatched'] ? ' snatched' : '')?>" id="torrent_details">
2013-04-17 08:00:58 +00:00
<tr class="colhead_dark">
<td width="80%"><strong>Reported torrent</strong></td>
<td><strong>Size</strong></td>
2013-10-26 08:00:58 +00:00
<td class="sign"><img src="static/styles/<?=($LoggedUser['StyleName'])?>/images/snatched.png" class="tooltip" alt="Snatches" title="Snatches" /></td>
<td class="sign"><img src="static/styles/<?=($LoggedUser['StyleName'])?>/images/seeders.png" class="tooltip" alt="Seeders" title="Seeders" /></td>
<td class="sign"><img src="static/styles/<?=($LoggedUser['StyleName'])?>/images/leechers.png" class="tooltip" alt="Leechers" title="Leechers" /></td>
2013-04-17 08:00:58 +00:00
</tr>
<?
build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Text, $Username, $ReportedTimes);
?>
</table>
</div>
2011-03-28 14:21:28 +00:00
2012-09-15 08:00:25 +00:00
<form class="create_form" name="report" action="reportsv2.php?action=takereport" enctype="multipart/form-data" method="post" id="reportform">
2011-03-28 14:21:28 +00:00
<div>
<input type="hidden" name="submit" value="true" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
<input type="hidden" name="categoryid" value="<?=$CategoryID?>" />
</div>
2013-02-22 08:00:24 +00:00
2013-09-11 08:00:55 +00:00
<h3>Report Information</h3>
2011-03-28 14:21:28 +00:00
<div class="box pad">
2013-04-19 08:00:55 +00:00
<table class="layout">
<tr>
<td class="label">Reason:</td>
<td>
2013-10-26 08:00:58 +00:00
<select id="type" name="type" onchange="ChangeReportType();">
2013-04-19 08:00:55 +00:00
<?
2013-04-17 08:00:58 +00:00
if (!empty($Types[$CategoryID])) {
2013-04-19 08:00:55 +00:00
$TypeList = $Types['master'] + $Types[$CategoryID];
$Priorities = array();
foreach ($TypeList as $Key => $Value) {
$Priorities[$Key] = $Value['priority'];
}
array_multisort($Priorities, SORT_ASC, $TypeList);
2013-04-17 08:00:58 +00:00
} else {
2013-04-19 08:00:55 +00:00
$TypeList = $Types['master'];
2013-04-17 08:00:58 +00:00
}
foreach ($TypeList as $Type => $Data) {
2013-04-19 08:00:55 +00:00
?>
2013-05-16 16:15:57 +00:00
<option value="<?=($Type)?>"><?=($Data['title'])?></option>
2013-04-19 08:00:55 +00:00
<? } ?>
</select>
</td>
</tr>
</table>
2011-03-28 14:21:28 +00:00
<p>Fields that contain lists of values (for example, listing more than one track number) should be separated by a space.</p>
<br />
<p><strong>Following the below report type specific guidelines will help the moderators deal with your report in a timely fashion. </strong></p>
<br />
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
<div id="dynamic_form">
2013-05-16 16:15:57 +00:00
<?
2011-03-28 14:21:28 +00:00
/*
* THIS IS WHERE SEXY AJAX COMES IN
2013-05-27 08:00:58 +00:00
* The following malarky is needed so that if you get sent back here, the fields are filled in.
2013-02-22 08:00:24 +00:00
*/
2011-03-28 14:21:28 +00:00
?>
<input id="sitelink" type="hidden" name="sitelink" size="50" value="<?=(!empty($_POST['sitelink']) ? display_str($_POST['sitelink']) : '')?>" />
<input id="image" type="hidden" name="image" size="50" value="<?=(!empty($_POST['image']) ? display_str($_POST['image']) : '')?>" />
<input id="track" type="hidden" name="track" size="8" value="<?=(!empty($_POST['track']) ? display_str($_POST['track']) : '')?>" />
<input id="link" type="hidden" name="link" size="50" value="<?=(!empty($_POST['link']) ? display_str($_POST['link']) : '')?>" />
<input id="extra" type="hidden" name="extra" value="<?=(!empty($_POST['extra']) ? display_str($_POST['extra']) : '')?>" />
<script type="text/javascript">ChangeReportType();</script>
</div>
</div>
<input type="submit" value="Submit report" />
</form>
</div>
<?
2012-10-11 08:00:15 +00:00
View::show_footer();
2013-04-19 08:00:55 +00:00
?>