2011-03-28 14:21:28 +00:00
< ?
/*
* This page is used for viewing reports in every viewpoint except auto .
* It doesn ' t AJAX grab a new report when you resolve each one , use auto
* for that ( reports . php ) . If you wanted to add a new view , you ' d simply
2013-02-22 08:00:24 +00:00
* add to the case statement ( s ) below and add an entry to views . php to
2011-03-28 14:21:28 +00:00
* explain it .
2013-02-22 08:00:24 +00:00
* Any changes made to this page within the foreach () should probably be
2011-03-28 14:21:28 +00:00
* replicated on the auto page ( reports . php ) .
*/
2013-04-15 08:00:54 +00:00
if ( ! check_perms ( 'admin_reports' )){
2011-03-28 14:21:28 +00:00
error ( 403 );
}
include ( SERVER_ROOT . '/classes/class_text.php' );
$Text = NEW TEXT ;
define ( 'REPORTS_PER_PAGE' , '10' );
2012-10-11 08:00:15 +00:00
list ( $Page , $Limit ) = Format :: page_limit ( REPORTS_PER_PAGE );
2011-03-28 14:21:28 +00:00
2013-04-15 08:00:54 +00:00
if ( isset ( $_GET [ 'view' ])){
2011-03-28 14:21:28 +00:00
$View = $_GET [ 'view' ];
} else {
error ( 404 );
}
2013-04-15 08:00:54 +00:00
if ( isset ( $_GET [ 'id' ])) {
if ( ! is_number ( $_GET [ 'id' ]) && $View != " type " ) {
2011-03-28 14:21:28 +00:00
error ( 404 );
} else {
$ID = db_string ( $_GET [ 'id' ]);
}
} else {
$ID = '' ;
}
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
$Order = " ORDER BY r.ReportedTime ASC " ;
2013-04-15 08:00:54 +00:00
if ( ! $ID ) {
2011-03-28 14:21:28 +00:00
switch ( $View ) {
2013-04-15 08:00:54 +00:00
case 'resolved' :
$Title = 'All the old smelly reports' ;
2011-03-28 14:21:28 +00:00
$Where = " WHERE r.Status = 'Resolved' " ;
2013-04-15 08:00:54 +00:00
$Order = 'ORDER BY r.LastChangeTime DESC' ;
2011-03-28 14:21:28 +00:00
break ;
2013-04-15 08:00:54 +00:00
case 'unauto' :
$Title = 'New reports, not auto assigned!' ;
2011-03-28 14:21:28 +00:00
$Where = " WHERE r.Status = 'New' " ;
break ;
default :
error ( 404 );
break ;
}
} else {
switch ( $View ) {
2013-04-15 08:00:54 +00:00
case 'staff' :
2011-03-28 14:21:28 +00:00
$DB -> query ( " SELECT Username FROM users_main WHERE ID= " . $ID );
list ( $Username ) = $DB -> next_record ();
2013-04-15 08:00:54 +00:00
if ( $Username ) {
2012-12-27 08:00:27 +00:00
$Title = $Username . " 's in-progress reports " ;
2011-03-28 14:21:28 +00:00
} else {
2012-12-27 08:00:27 +00:00
$Title = $ID . " 's in-progress reports " ;
2011-03-28 14:21:28 +00:00
}
$Where = " WHERE r.Status = 'InProgress' AND r.ResolverID = " . $ID ;
break ;
2013-04-15 08:00:54 +00:00
case 'resolver' :
2011-03-28 14:21:28 +00:00
$DB -> query ( " SELECT Username FROM users_main WHERE ID= " . $ID );
list ( $Username ) = $DB -> next_record ();
2013-04-15 08:00:54 +00:00
if ( $Username ) {
2012-12-27 08:00:27 +00:00
$Title = $Username . " 's resolved reports " ;
2011-03-28 14:21:28 +00:00
} else {
2012-12-27 08:00:27 +00:00
$Title = $ID . " 's resolved reports " ;
2011-03-28 14:21:28 +00:00
}
$Where = " WHERE r.Status = 'Resolved' AND r.ResolverID = " . $ID ;
2013-04-15 08:00:54 +00:00
$Order = 'ORDER BY r.LastChangeTime DESC' ;
2011-03-28 14:21:28 +00:00
break ;
2013-04-15 08:00:54 +00:00
case 'group' :
$Title = " Unresolved reports for the group $ID " ;
2011-03-28 14:21:28 +00:00
$Where = " WHERE r.Status != 'Resolved' AND tg.ID = " . $ID ;
break ;
2013-04-15 08:00:54 +00:00
case 'torrent' :
$Title = 'All reports for the torrent ' . $ID ;
$Where = 'WHERE r.TorrentID = ' . $ID ;
2011-03-28 14:21:28 +00:00
break ;
2013-04-15 08:00:54 +00:00
case 'report' :
$Title = 'Viewing resolution of report ' . $ID ;
$Where = 'WHERE r.ID = ' . $ID ;
2011-03-28 14:21:28 +00:00
break ;
2013-04-15 08:00:54 +00:00
case 'reporter' :
2011-03-28 14:21:28 +00:00
$DB -> query ( " SELECT Username FROM users_main WHERE ID= " . $ID );
2013-02-22 08:00:24 +00:00
list ( $Username ) = $DB -> next_record ();
2013-04-15 08:00:54 +00:00
if ( $Username ) {
$Title = 'All torrents reported by ' . $Username ;
2011-03-28 14:21:28 +00:00
} else {
2013-04-15 08:00:54 +00:00
$Title = 'All torrents reported by user ' . $ID ;
2011-03-28 14:21:28 +00:00
}
2013-04-15 08:00:54 +00:00
$Where = 'WHERE r.ReporterID = ' . $ID ;
$Order = 'ORDER BY r.ReportedTime DESC' ;
2011-03-28 14:21:28 +00:00
break ;
2013-04-15 08:00:54 +00:00
case 'uploader' :
2011-03-28 14:21:28 +00:00
$DB -> query ( " SELECT Username FROM users_main WHERE ID= " . $ID );
2013-02-22 08:00:24 +00:00
list ( $Username ) = $DB -> next_record ();
2013-04-15 08:00:54 +00:00
if ( $Username ) {
$Title = 'All reports for torrents uploaded by ' . $Username ;
2011-03-28 14:21:28 +00:00
} else {
2013-04-15 08:00:54 +00:00
$Title = 'All reports for torrents uploaded by user ' . $ID ;
2011-03-28 14:21:28 +00:00
}
$Where = " WHERE r.Status != 'Resolved' AND t.UserID = " . $ID ;
break ;
2013-04-15 08:00:54 +00:00
case 'type' :
$Title = 'All new reports for the chosen type' ;
2011-03-28 14:21:28 +00:00
$Where = " WHERE r.Status = 'New' AND r.Type = ' " . $ID . " ' " ;
break ;
break ;
default :
error ( 404 );
break ;
}
}
$DB -> query ( " SELECT SQL_CALC_FOUND_ROWS
r . ID ,
r . ReporterID ,
reporter . Username ,
r . TorrentID ,
r . Type ,
r . UserComment ,
r . ResolverID ,
resolver . Username ,
r . Status ,
r . ReportedTime ,
r . LastChangeTime ,
r . ModComment ,
r . Track ,
r . Image ,
r . ExtraID ,
r . Link ,
r . LogMessage ,
tg . Name ,
tg . ID ,
CASE COUNT ( ta . GroupID )
WHEN 1 THEN aa . ArtistID
WHEN 0 THEN '0'
ELSE '0'
END AS ArtistID ,
CASE COUNT ( ta . GroupID )
WHEN 1 THEN aa . Name
WHEN 0 THEN ''
ELSE 'Various Artists'
END AS ArtistName ,
tg . Year ,
tg . CategoryID ,
t . Time ,
t . Remastered ,
t . RemasterTitle ,
t . RemasterYear ,
t . Media ,
t . Format ,
t . Encoding ,
t . Size ,
t . HasCue ,
t . HasLog ,
t . LogScore ,
t . UserID AS UploaderID ,
uploader . Username
FROM reportsv2 AS r
2013-04-15 08:00:54 +00:00
LEFT JOIN torrents AS t ON t . ID = r . TorrentID
LEFT JOIN torrents_group AS tg ON tg . ID = t . GroupID
LEFT JOIN torrents_artists AS ta ON ta . GroupID = tg . ID AND ta . Importance = '1'
LEFT JOIN artists_alias AS aa ON aa . AliasID = ta . AliasID
LEFT JOIN users_main AS resolver ON resolver . ID = r . ResolverID
LEFT JOIN users_main AS reporter ON reporter . ID = r . ReporterID
LEFT JOIN users_main AS uploader ON uploader . ID = t . UserID "
2011-03-28 14:21:28 +00:00
. $Where . "
2013-02-22 08:00:24 +00:00
GROUP BY r . ID "
2011-03-28 14:21:28 +00:00
. $Order . "
LIMIT " . $Limit );
$Reports = $DB -> to_array ();
$DB -> query ( 'SELECT FOUND_ROWS()' );
list ( $Results ) = $DB -> next_record ();
2012-10-11 08:00:15 +00:00
$PageLinks = Format :: get_pages ( $Page , $Results , REPORTS_PER_PAGE , 11 );
2011-03-28 14:21:28 +00:00
2012-10-11 08:00:15 +00:00
View :: show_header ( 'Reports V2!' , 'reportsv2,bbcode' );
2011-03-28 14:21:28 +00:00
?>
2012-08-19 08:00:19 +00:00
< div class = " header " >
< h2 >< ? = $Title ?> </h2>
2013-04-15 08:00:54 +00:00
< ? include ( 'header.php' ); ?>
2012-08-19 08:00:19 +00:00
</ div >
2011-03-28 14:21:28 +00:00
< div class = " buttonbox thin center " >
2013-04-15 08:00:54 +00:00
< ? if ( $View != 'resolved' ) { ?>
2013-03-04 08:00:25 +00:00
< span title = " Resolves *all* checked reports with their respective resolutions " >< input type = " button " onclick = " MultiResolve(); " value = " Multi-resolve " /></ span >
2013-03-05 08:00:26 +00:00
< span title = " Assigns all of the reports on the page to you! " >< input type = " button " onclick = " Grab(); " value = " Claim all " /></ span >
2013-04-15 08:00:54 +00:00
< ? }
if ( $View == 'staff' && $LoggedUser [ 'ID' ] == $ID ) { ?>
| < span title = " Unclaim all of the reports currently displayed " >< input type = " button " onclick = " GiveBack(); " value = " Unclaim all " /></ span >
< ? } ?>
2011-03-28 14:21:28 +00:00
</ div >
< br />
< div class = " linkbox " >
< ? = $PageLinks ?>
</ div >
2013-04-15 08:00:54 +00:00
< div id = " all_reports " style = " width: 80%; margin-left: auto; margin-right: auto; " >
2011-03-28 14:21:28 +00:00
< ?
2013-04-15 08:00:54 +00:00
if ( count ( $Reports ) == 0 ) {
2011-03-28 14:21:28 +00:00
?>
< div >
2012-09-01 08:00:24 +00:00
< table class = " layout " >
2011-03-28 14:21:28 +00:00
< tr >
2012-10-09 08:00:17 +00:00
< td class = " center " >
2011-03-28 14:21:28 +00:00
< strong > No new reports ! \o /</ strong >
</ td >
</ tr >
</ table >
</ div >
< ?
} else {
2013-04-15 08:00:54 +00:00
foreach ( $Reports as $Report ) {
2011-03-28 14:21:28 +00:00
2013-02-22 08:00:24 +00:00
list ( $ReportID , $ReporterID , $ReporterName , $TorrentID , $Type , $UserComment , $ResolverID , $ResolverName , $Status , $ReportedTime , $LastChangeTime ,
$ModComment , $Tracks , $Images , $ExtraIDs , $Links , $LogMessage , $GroupName , $GroupID , $ArtistID , $ArtistName , $Year , $CategoryID , $Time , $Remastered , $RemasterTitle ,
2012-10-11 08:00:15 +00:00
$RemasterYear , $Media , $Format , $Encoding , $Size , $HasCue , $HasLog , $LogScore , $UploaderID , $UploaderName ) = Misc :: display_array ( $Report , array ( " ModComment " ));
2011-03-28 14:21:28 +00:00
2013-04-15 08:00:54 +00:00
if ( ! $GroupID && $Status != 'Resolved' ) {
2011-03-28 14:21:28 +00:00
//Torrent already deleted
$DB -> query ( " UPDATE reportsv2 SET
Status = 'Resolved' ,
LastChangeTime = '".sqltime()."' ,
2012-12-21 08:00:21 +00:00
ModComment = 'Report already dealt with (torrent deleted)'
2011-03-28 14:21:28 +00:00
WHERE ID = " . $ReportID );
$Cache -> decrement ( 'num_torrent_reportsv2' );
?>
2012-09-01 08:00:24 +00:00
< div id = " report<?= $ReportID ?> " >
< table class = " layout " >
2011-03-28 14:21:28 +00:00
< tr >
2012-09-01 08:00:24 +00:00
< td class = " center " >
2011-03-28 14:21:28 +00:00
< a href = " reportsv2.php?view=report&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 {
2013-04-15 08:00:54 +00:00
if ( ! $CategoryID ) {
2011-03-28 14:21:28 +00:00
//Torrent was deleted
} else {
if ( array_key_exists ( $Type , $Types [ $CategoryID ])) {
$ReportType = $Types [ $CategoryID ][ $Type ];
2013-04-15 08:00:54 +00:00
} elseif ( array_key_exists ( $Type , $Types [ 'master' ])) {
2011-03-28 14:21:28 +00:00
$ReportType = $Types [ 'master' ][ $Type ];
} else {
//There was a type but it wasn't an option!
$Type = 'other' ;
$ReportType = $Types [ 'master' ][ 'other' ];
}
}
if ( $ArtistID == 0 && empty ( $ArtistName )) {
2013-04-15 08:00:54 +00:00
$RawName = $GroupName . ( $Year ? " ( $Year ) " : '' ) . ( $Format || $Encoding || $Media ? " [ $Format / $Encoding / $Media ] " : '' ) . ( $Remastered ? " < $RemasterTitle - $RemasterYear > " : '' ) . ( $HasCue ? ' (Cue)' : '' ) . ( $HasLog ? " (Log: $LogScore %) " : '' ) . ' (' . number_format ( $Size / ( 1024 * 1024 ), 2 ) . ' MB)' ;
$LinkName = " <a href= \" torrents.php?id= $GroupID\ " > $GroupName " .( $Year ? " ( $Year ) " : ''). " </ a > < a href = \ " torrents.php?torrentid= $TorrentID\ " > " .( $Format || $Encoding || $Media ? " [ $Format / $Encoding / $Media ] " : '').( $Remastered ? " & lt ; $RemasterTitle - $RemasterYear & gt ; " : '').'</a> '.( $HasCue ? ' (Cue)' : '').( $HasLog ? " < a href = \ " torrents.php?action=viewlog&torrentid= $TorrentID &groupid= $GroupID\ " > ( Log : $LogScore % ) </ a > " : ''). " ( " .number_format( $Size /(1024*1024), 2). " MB ) " ;
$BBName = " [url=torrents.php?id= $GroupID ] $GroupName " . ( $Year ? " ( $Year ) " : '' ) . " [/url] [url=torrents.php?torrentid= $TorrentID ][ $Format / $Encoding / $Media ] " . ( $Remastered ? " < $RemasterTitle - $RemasterYear > " : '' ) . '[/url] ' . ( $HasCue ? ' (Cue)' : '' ) . ( $HasLog ? " [url=torrents.php?action=viewlog&torrentid= $TorrentID &groupid= $GroupID ](Log: $LogScore %)[/url] " : '' ) . ' (' . number_format ( $Size / ( 1024 * 1024 ), 2 ) . ' MB)' ;
2011-03-28 14:21:28 +00:00
} elseif ( $ArtistID == 0 && $ArtistName == 'Various Artists' ) {
2013-04-15 08:00:54 +00:00
$RawName = " Various Artists - $GroupName " . ( $Year ? " ( $Year ) " : '' ) . " [ $Format / $Encoding / $Media ] " . ( $Remastered ? " < $RemasterTitle - $RemasterYear > " : '' ) . ( $HasCue ? ' (Cue)' : '' ) . ( $HasLog ? " (Log: $LogScore %) " : '' ) . ' (' . number_format ( $Size / ( 1024 * 1024 ), 2 ) . ' MB)' ;
$LinkName = " Various Artists - <a href= \" torrents.php?id= $GroupID\ " > $GroupName " .( $Year ? " ( $Year ) " : ''). " </ a > < a href = \ " torrents.php?torrentid= $TorrentID\ " > [ $Format / $Encoding / $Media ] " .( $Remastered ? " & lt ; $RemasterTitle - $RemasterYear & gt ; " : '').'</a> '.( $HasCue ? ' (Cue)' : '').( $HasLog ? " < a href = \ " torrents.php?action=viewlog&torrentid= $TorrentID &groupid= $GroupID\ " > ( Log : $LogScore % ) </ a > " : '').' ('.number_format( $Size / (1024 * 1024), 2).' MB)';
$BBName = " Various Artists - [url=torrents.php?id= $GroupID ] $GroupName " . ( $Year ? " ( $Year ) " : '' ) . " [/url] [url=torrents.php?torrentid= $TorrentID ][ $Format / $Encoding / $Media ] " . ( $Remastered ? " < $RemasterTitle - $RemasterYear > " : '' ) . '[/url] ' . ( $HasCue ? ' (Cue)' : '' ) . ( $HasLog ? " [url=torrents.php?action=viewlog&torrentid= $TorrentID &groupid= $GroupID ](Log: $LogScore %)[/url] " : '' ) . ' (' . number_format ( $Size / ( 1024 * 1024 ), 2 ) . ' MB)' ;
2011-03-28 14:21:28 +00:00
} else {
2013-04-15 08:00:54 +00:00
$RawName = " $ArtistName - $GroupName " . ( $Year ? " ( $Year ) " : '' ) . " [ $Format / $Encoding / $Media ] " . ( $Remastered ? " < $RemasterTitle - $RemasterYear > " : '' ) . ( $HasCue ? ' (Cue)' : '' ) . ( $HasLog ? " (Log: $LogScore %) " : '' ) . ' (' . number_format ( $Size / ( 1024 * 1024 ), 2 ) . ' MB)' ;
$LinkName = " <a href='artist.php?id= $ArtistID '> $ArtistName </a> - <a href= \" torrents.php?id= $GroupID\ " > $GroupName " .( $Year ? " ( $Year ) " : ''). " </ a > < a href = \ " torrents.php?torrentid= $TorrentID\ " > [ $Format / $Encoding / $Media ] " .( $Remastered ? " & lt ; $RemasterTitle - $RemasterYear & gt ; " : '').'</a> '.( $HasCue ? ' (Cue)' : '').( $HasLog ? " < a href = \ " torrents.php?action=viewlog&torrentid= $TorrentID &groupid= $GroupID\ " > ( Log : $LogScore % ) </ a > " : '').' ('.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 ] " . ( $Remastered ? " < $RemasterTitle - $RemasterYear > " : '' ) . '[/url] ' . ( $HasCue ? ' (Cue)' : '' ) . ( $HasLog ? " [url=torrents.php?action=viewlog&torrentid= $TorrentID &groupid= $GroupID ](Log: $LogScore %)[/url] " : '' ) . ' (' . number_format ( $Size / ( 1024 * 1024 ), 2 ) . ' MB)' ;
2013-02-22 08:00:24 +00:00
}
?>
2011-03-28 14:21:28 +00:00
< div id = " report<?= $ReportID ?> " >
2012-09-15 08:00:25 +00:00
< form class = " manage_form " name = " report " id = " reportform_<?= $ReportID ?> " action = " reports.php " method = " post " >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
/*
2012-12-21 08:00:21 +00:00
* Some of these are for takeresolve , namely the ones that aren ' t inputs , some for the JavaScript .
2011-03-28 14:21:28 +00:00
*/
?>
< 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 ?> " />
< input type = " hidden " id = " uploaderid<?= $ReportID ?> " name = " uploaderid " value = " <?= $UploaderID ?> " />
< input type = " hidden " id = " reporterid<?= $ReportID ?> " name = " reporterid " value = " <?= $ReporterID ?> " />
< input type = " hidden " id = " report_reason<?= $ReportID ?> " name = " report_reason " value = " <?= $UserComment ?> " />
< input type = " hidden " id = " raw_name<?= $ReportID ?> " name = " raw_name " value = " <?= $RawName ?> " />
< input type = " hidden " id = " type<?= $ReportID ?> " name = " type " value = " <?= $Type ?> " />
< input type = " hidden " id = " categoryid<?= $ReportID ?> " name = " categoryid " value = " <?= $CategoryID ?> " />
</ div >
2012-09-01 08:00:24 +00:00
< table class = " layout " cellpadding = " 5 " >
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " >< a href = " reportsv2.php?view=report&id=<?= $ReportID ?> " > Reported </ a > torrent :</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
2013-04-15 08:00:54 +00:00
< ? if ( ! $GroupID ) { ?>
2011-03-28 14:21:28 +00:00
< a href = " log.php?search=Torrent+<?= $TorrentID ?> " >< ? = $TorrentID ?> </a> (Deleted)
2013-04-15 08:00:54 +00:00
< ? } else { ?>
2011-03-28 14:21:28 +00:00
< ? = $LinkName ?>
2013-02-09 08:01:01 +00:00
< a href = " torrents.php?action=download&id=<?= $TorrentID ?>&authkey=<?= $LoggedUser['AuthKey'] ?>&torrent_pass=<?= $LoggedUser['torrent_pass'] ?> " title = " Download " class = " brackets " > DL </ a >
2011-03-28 14:21:28 +00:00
uploaded by < a href = " user.php?id=<?= $UploaderID ?> " >< ? = $UploaderName ?> </a> <?=time_diff($Time)?>
< br />
2013-04-15 08:00:54 +00:00
< ? if ( $ReporterName == '' ) {
$ReporterName = 'System' ;
} ?>
2011-03-28 14:21:28 +00:00
< div style = " text-align: right; " > was reported by < a href = " user.php?id=<?= $ReporterID ?> " >< ? = $ReporterName ?> </a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div>
2013-04-15 08:00:54 +00:00
< ? if ( $Status != 'Resolved' ) {
2013-02-22 08:00:24 +00:00
$DB -> query ( " SELECT r.ID
FROM reportsv2 AS r
2013-04-15 08:00:54 +00:00
LEFT JOIN torrents AS t ON t . ID = r . TorrentID
2011-03-28 14:21:28 +00:00
WHERE r . Status != 'Resolved'
AND t . GroupID = $GroupID " );
$GroupOthers = ( $DB -> record_count () - 1 );
2013-02-22 08:00:24 +00:00
2013-04-15 08:00:54 +00:00
if ( $GroupOthers > 0 ) { ?>
2011-03-28 14:21:28 +00:00
< div style = " text-align: right; " >
< a href = " reportsv2.php?view=group&id=<?= $GroupID ?> " > There < ? = (( $GroupOthers > 1 ) ? " are $GroupOthers other reports " : " is 1 other report " ) ?> for torrent(s) in this group</a>
</ div >
2013-04-15 08:00:54 +00:00
< ? }
2013-02-22 08:00:24 +00:00
$DB -> query ( " SELECT t.UserID
FROM reportsv2 AS r
2013-04-15 08:00:54 +00:00
JOIN torrents AS t ON t . ID = r . TorrentID
2011-03-28 14:21:28 +00:00
WHERE r . Status != 'Resolved'
2013-04-15 08:00:54 +00:00
AND t . UserID = $UploaderID " );
2011-03-28 14:21:28 +00:00
$UploaderOthers = ( $DB -> record_count () - 1 );
2013-02-22 08:00:24 +00:00
2013-04-15 08:00:54 +00:00
if ( $UploaderOthers > 0 ) { ?>
2011-03-28 14:21:28 +00:00
< div style = " text-align: right; " >
< a href = " reportsv2.php?view=uploader&id=<?= $UploaderID ?> " > There < ? = (( $UploaderOthers > 1 ) ? " are $UploaderOthers other reports " : " is 1 other report " ) ?> for torrent(s) uploaded by this user</a>
</ div >
2013-04-15 08:00:54 +00:00
< ? }
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
$DB -> query ( " SELECT DISTINCT req.ID,
2013-04-15 08:00:54 +00:00
req . FillerID ,
um . Username ,
req . TimeFilled
2013-02-22 08:00:24 +00:00
FROM requests AS req
2013-04-15 08:00:54 +00:00
LEFT JOIN torrents AS t ON t . ID = req . TorrentID
LEFT JOIN reportsv2 AS rep ON rep . TorrentID = t . ID
JOIN users_main AS um ON um . ID = req . FillerID
2011-03-28 14:21:28 +00:00
WHERE rep . Status != 'Resolved'
2013-04-15 08:00:54 +00:00
AND req . TimeFilled > '2010-03-04 02:31:49'
AND req . TorrentID = $TorrentID " );
2011-03-28 14:21:28 +00:00
$Requests = ( $DB -> record_count ());
2013-04-15 08:00:54 +00:00
if ( $Requests > 0 ) {
while ( list ( $RequestID , $FillerID , $FillerName , $FilledTime ) = $DB -> next_record ()) {
2011-03-28 14:21:28 +00:00
?>
< div style = " text-align: right; " >
2013-02-01 08:00:18 +00:00
< strong class = " important_text " >< a href = " user.php?id=<?= $FillerID ?> " >< ? = $FillerName ?> </a> used this torrent to fill <a href="requests.php?action=view&id=<?=$RequestID?>">this request</a> <?=time_diff($FilledTime)?></strong>
2011-03-28 14:21:28 +00:00
</ div >
2013-04-15 08:00:54 +00:00
< ? }
2011-03-28 14:21:28 +00:00
}
}
}
?>
</ td >
</ tr >
2013-04-15 08:00:54 +00:00
< ? if ( $Tracks ) { ?>
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Relevant tracks :</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
2013-04-15 08:00:54 +00:00
< ? = str_replace ( ' ' , ', ' , $Tracks ) ?>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
2013-04-15 08:00:54 +00:00
< ? }
2013-02-22 08:00:24 +00:00
2013-04-15 08:00:54 +00:00
if ( $Links ) { ?>
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Relevant links :</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
2013-04-15 08:00:54 +00:00
< ?
$Links = explode ( ' ' , $Links );
foreach ( $Links as $Link ) {
2013-02-22 08:00:24 +00:00
2011-08-31 08:00:08 +00:00
if ( $local_url = $Text -> local_url ( $Link )) {
$Link = $local_url ;
2013-04-15 08:00:54 +00:00
} ?>
2011-03-28 14:21:28 +00:00
< a href = " <?= $Link ?> " >< ? = $Link ?> </a>
2013-04-15 08:00:54 +00:00
< ?
} ?>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
2013-04-15 08:00:54 +00:00
< ?
2011-03-28 14:21:28 +00:00
}
2013-02-22 08:00:24 +00:00
2013-04-15 08:00:54 +00:00
if ( $ExtraIDs ) { ?>
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Relevant other torrents :</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
2013-04-15 08:00:54 +00:00
< ?
2011-03-28 14:21:28 +00:00
$First = true ;
2013-04-15 08:00:54 +00:00
$Extras = explode ( ' ' , $ExtraIDs );
foreach ( $Extras as $ExtraID ) {
2011-03-28 14:21:28 +00:00
2013-02-22 08:00:24 +00:00
$DB -> query ( " SELECT
2011-03-28 14:21:28 +00:00
tg . Name ,
tg . ID ,
CASE COUNT ( ta . GroupID )
WHEN 1 THEN aa . ArtistID
WHEN 0 THEN '0'
ELSE '0'
END AS ArtistID ,
CASE COUNT ( ta . GroupID )
WHEN 1 THEN aa . Name
WHEN 0 THEN ''
ELSE 'Various Artists'
END AS ArtistName ,
tg . Year ,
t . Time ,
t . Remastered ,
t . RemasterTitle ,
t . RemasterYear ,
t . Media ,
t . Format ,
t . Encoding ,
t . Size ,
t . HasCue ,
t . HasLog ,
t . LogScore ,
t . UserID AS UploaderID ,
uploader . Username
FROM torrents AS t
2013-04-15 08:00:54 +00:00
LEFT JOIN torrents_group AS tg ON tg . ID = t . GroupID
LEFT JOIN torrents_artists AS ta ON ta . GroupID = tg . ID AND ta . Importance = '1'
LEFT JOIN artists_alias AS aa ON aa . AliasID = ta . AliasID
LEFT JOIN users_main AS uploader ON uploader . ID = t . UserID
2011-03-28 14:21:28 +00:00
WHERE t . ID = '$ExtraID'
GROUP BY tg . ID " );
2013-02-22 08:00:24 +00:00
list ( $ExtraGroupName , $ExtraGroupID , $ExtraArtistID , $ExtraArtistName , $ExtraYear , $ExtraTime , $ExtraRemastered , $ExtraRemasterTitle ,
2012-10-11 08:00:15 +00:00
$ExtraRemasterYear , $ExtraMedia , $ExtraFormat , $ExtraEncoding , $ExtraSize , $ExtraHasCue , $ExtraHasLog , $ExtraLogScore , $ExtraUploaderID , $ExtraUploaderName ) = Misc :: display_array ( $DB -> next_record ());
2013-02-22 08:00:24 +00:00
2013-04-15 08:00:54 +00:00
if ( $ExtraGroupName ) {
2011-03-28 14:21:28 +00:00
if ( $ArtistID == 0 && empty ( $ArtistName )) {
2013-04-15 08:00:54 +00:00
$ExtraLinkName = " <a href= \" torrents.php?id= $ExtraGroupID\ " > $ExtraGroupName " .( $ExtraYear ? " ( $ExtraYear ) " : ''). " </ a > < a href = \ " torrents.php?torrentid= $ExtraID\ " > [ $ExtraFormat / $ExtraEncoding / $ExtraMedia ] " .( $ExtraRemastered ? " & lt ; $ExtraRemasterTitle - $ExtraRemasterYear & gt ; " : '').'</a> '.( $ExtraHasCue == '1' ? ' (Cue)' : '').( $ExtraHasLog == '1' ? " < a href = \ " torrents.php?action=viewlog&torrentid= $ExtraID &groupid= $ExtraGroupID\ " > ( Log : $ExtraLogScore % ) </ a > " : '').' ('.number_format( $ExtraSize / (1024 * 1024), 2).' MB)';
2011-03-28 14:21:28 +00:00
} elseif ( $ArtistID == 0 && $ArtistName == 'Various Artists' ) {
2013-04-15 08:00:54 +00:00
$ExtraLinkName = " Various Artists - <a href= \" torrents.php?id= $ExtraGroupID\ " > $ExtraGroupName " .( $ExtraYear ? " ( $ExtraYear ) " : ''). " </ a > < a href = \ " torrents.php?torrentid= $ExtraID\ " > [ $ExtraFormat / $ExtraEncoding / $ExtraMedia ] " .( $ExtraRemastered ? " & lt ; $ExtraRemasterTitle - $ExtraRemasterYear & gt ; " : '').'</a> '.( $ExtraHasCue == '1' ? ' (Cue)' : '').( $ExtraHasLog == '1' ? " < a href = \ " torrents.php?action=viewlog&torrentid= $ExtraID &groupid= $ExtraGroupID\ " > ( Log : $ExtraLogScore % ) </ a > " : '').' ('.number_format( $ExtraSize / (1024 * 1024), 2).' MB)';
2011-03-28 14:21:28 +00:00
} else {
2013-04-15 08:00:54 +00:00
$ExtraLinkName = " <a href= \" artist.php?id= $ExtraArtistID\ " > $ExtraArtistName </ a > - < a href = \ " torrents.php?id= $ExtraGroupID\ " > $ExtraGroupName " .( $ExtraYear ? " ( $ExtraYear ) " : ''). " </ a > < a href = \ " torrents.php?torrentid= $ExtraID\ " > [ $ExtraFormat / $ExtraEncoding / $ExtraMedia ] " .( $ExtraRemastered ? " & lt ; $ExtraRemasterTitle - $ExtraRemasterYear & gt ; " : '').'</a> '.( $ExtraHasCue == '1' ? ' (Cue)' : '').( $ExtraHasLog == '1' ? " < a href = \ " torrents.php?action=viewlog&torrentid= $ExtraID &groupid= $ExtraGroupID\ " > ( Log : $ExtraLogScore % ) </ a > " : '').' ('.number_format( $ExtraSize / (1024 * 1024), 2).' MB)';
2013-02-22 08:00:24 +00:00
}
2011-03-28 14:21:28 +00:00
?>
2013-04-15 08:00:54 +00:00
< ? = ( $First ? '' : '<br />' ) ?>
2011-03-28 14:21:28 +00:00
< ? = $ExtraLinkName ?>
2013-02-09 08:01:01 +00:00
< a href = " torrents.php?action=download&id=<?= $ExtraID ?>&authkey=<?= $LoggedUser['AuthKey'] ?>&torrent_pass=<?= $LoggedUser['torrent_pass'] ?> " title = " Download " class = " brackets " > DL </ a >
uploaded by < a href = " user.php?id=<?= $ExtraUploaderID ?> " >< ? = $ExtraUploaderName ?> </a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
2013-04-15 08:00:54 +00:00
< ?
2011-03-28 14:21:28 +00:00
$First = false ;
}
2013-04-15 08:00:54 +00:00
} ?>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
2013-04-15 08:00:54 +00:00
< ?
2011-03-28 14:21:28 +00:00
}
2013-02-22 08:00:24 +00:00
2013-04-15 08:00:54 +00:00
if ( $Images ) { ?>
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Relevant images :</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
2013-04-15 08:00:54 +00:00
< ?
$Images = explode ( ' ' , $Images );
foreach ( $Images as $Image ) {
2011-03-28 14:21:28 +00:00
?>
2013-04-30 18:18:07 +00:00
< img style = " max-width: 200px; " onclick = " lightbox.init(this,200); " src = " <?=ImageTools::process( $Image )?> " alt = " Relevant image " />
2013-04-15 08:00:54 +00:00
< ?
} ?>
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
2013-04-15 08:00:54 +00:00
< ?
} ?>
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > User comment :</ td >
2013-03-30 08:00:31 +00:00
< td colspan = " 3 " class = " wrap_overflow " >< ? = $Text -> full_format ( $UserComment ) ?> </td>
2011-03-28 14:21:28 +00:00
</ tr >
2013-04-15 08:00:54 +00:00
< ? // END REPORTED STUFF :|: BEGIN MOD STUFF
if ( $Status == 'InProgress' ) { ?>
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > In progress by :</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
< a href = " user.php?id=<?= $ResolverID ?> " >< ? = $ResolverName ?> </a>
</ td >
</ tr >
2013-04-15 08:00:54 +00:00
< ? }
if ( $Status != 'Resolved' ) { ?>
2011-03-28 14:21:28 +00:00
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Report comment :</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
< input type = " text " name = " comment " id = " comment<?= $ReportID ?> " size = " 45 " value = " <?= $ModComment ?> " />
< input type = " button " value = " Update now " onclick = " UpdateComment(<?= $ReportID ?>) " />
</ td >
</ tr >
< tr >
< td class = " label " >
2013-03-05 08:00:26 +00:00
< a href = " javascript:Load('<?= $ReportID ?>') " title = " Click here to reset the resolution options to their default values. " > Resolve </ a >
2011-03-28 14:21:28 +00:00
</ td >
< td colspan = " 3 " >
< select name = " resolve_type " id = " resolve_type<?= $ReportID ?> " onchange = " ChangeResolve(<?= $ReportID ?>) " >
2013-04-15 08:00:54 +00:00
< ?
2011-03-28 14:21:28 +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-02-22 08:00:24 +00:00
2013-04-15 08:00:54 +00:00
foreach ( $TypeList as $Type => $Data ) { ?>
2011-03-28 14:21:28 +00:00
< option value = " <?= $Type ?> " >< ? = $Data [ 'title' ] ?> </option>
2013-04-15 08:00:54 +00:00
< ? } ?>
2011-03-28 14:21:28 +00:00
</ select >
< span id = " options<?= $ReportID ?> " >
2013-04-15 08:00:54 +00:00
< ? if ( check_perms ( 'users_mod' )) { ?>
2012-12-21 08:00:21 +00:00
< span title = " Delete torrent? " >
2013-03-05 08:00:26 +00:00
< label for = " delete<?= $ReportID ?> " >< strong > Delete </ strong ></ label >
2012-12-21 08:00:21 +00:00
< input type = " checkbox " name = " delete " id = " delete<?= $ReportID ?> " />
2011-03-28 14:21:28 +00:00
</ span >
2013-04-15 08:00:54 +00:00
< ? } ?>
2011-03-28 14:21:28 +00:00
< span title = " Warning length in weeks " >
< strong > Warning </ strong >
< select name = " warning " id = " warning<?= $ReportID ?> " >
2013-04-15 08:00:54 +00:00
< ?
for ( $i = 0 ; $i < 9 ; $i ++ ) { ?>
2011-03-28 14:21:28 +00:00
< option value = " <?= $i ?> " >< ? = $i ?> </option>
2013-04-15 08:00:54 +00:00
< ?
} ?>
2011-03-28 14:21:28 +00:00
</ select >
</ span >
< span title = " Remove upload privileges? " >
2013-03-05 08:00:26 +00:00
< label for = " upload<?= $ReportID ?> " >< strong > Remove upload privileges </ strong ></ label >
2012-12-21 08:00:21 +00:00
< input type = " checkbox " name = " upload " id = " upload<?= $ReportID ?> " />
2011-03-28 14:21:28 +00:00
</ span >
& nbsp ; & nbsp ;
< span title = " Update resolve type " >
< input type = " button " name = " update_resolve " id = " update_resolve<?= $ReportID ?> " value = " Update now " onclick = " UpdateResolve(<?= $ReportID ?>) " />
</ span >
</ span >
</ td >
</ tr >
< tr >
< td class = " label " >
PM
< select name = " pm_type " id = " pm_type<?= $ReportID ?> " >
< option value = " Uploader " > Uploader </ option >
< option value = " Reporter " > Reporter </ option >
</ select >:
2013-02-22 08:00:24 +00:00
</ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
2013-03-04 08:00:25 +00:00
< span title = " Uploader: Appended to the regular message unless using "Send now". Reporter: Must be used with "Send now". " >
2011-03-28 14:21:28 +00:00
< textarea name = " uploader_pm " id = " uploader_pm<?= $ReportID ?> " cols = " 50 " rows = " 1 " ></ textarea >
</ span >
2013-03-04 08:00:25 +00:00
< input type = " button " value = " Send now " onclick = " SendPM(<?= $ReportID ?>) " />
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " >< strong > Extra </ strong > log message :</ td >
2011-03-28 14:21:28 +00:00
< td >
2013-04-15 08:00:54 +00:00
< input type = " text " name = " log_message " id = " log_message<?= $ReportID ?> " size = " 40 " < ? if ( $ExtraIDs ) {
$Extras = explode ( ' ' , $ExtraIDs );
$Value = '' ;
foreach ( $Extras as $ExtraID ) {
2013-02-09 08:01:01 +00:00
$Value .= 'https://' . SSL_SITE_URL . '/torrents.php?torrentid=' . $ExtraID . ' ' ;
2011-03-28 14:21:28 +00:00
}
echo 'value="' . trim ( $Value ) . '"' ;
} ?> />
</ td >
2013-03-04 08:00:25 +00:00
< td class = " label " >< strong > Extra </ strong > staff notes :</ td >
2011-03-28 14:21:28 +00:00
< td >
< input type = " text " name = " admin_message " id = " admin_message<?= $ReportID ?> " size = " 40 " />
</ td >
</ tr >
< tr >
< td colspan = " 4 " style = " text-align: center; " >
2013-03-04 08:00:25 +00:00
< input type = " button " value = " Invalidate report " onclick = " Dismiss(<?= $ReportID ?>); " />
2013-03-05 08:00:26 +00:00
< input type = " button " value = " Resolve report manually " onclick = " ManualResolve(<?= $ReportID ?>); " />
2013-04-15 08:00:54 +00:00
< ? if ( $Status == 'InProgress' && $LoggedUser [ 'ID' ] == $ResolverID ) { ?>
2013-03-09 08:00:18 +00:00
| < input type = " button " value = " Unclaim " onclick = " GiveBack(<?= $ReportID ?>); " />
2011-03-28 14:21:28 +00:00
< ? } else { ?>
2013-03-05 08:00:26 +00:00
| < input id = " grab<?= $ReportID ?> " type = " button " value = " Claim " onclick = " Grab(<?= $ReportID ?>); " />
2011-03-28 14:21:28 +00:00
< ? } ?>
2013-03-04 08:00:25 +00:00
| Multi - resolve < input type = " checkbox " name = " multi " id = " multi<?= $ReportID ?> " checked = " checked " />
2011-03-28 14:21:28 +00:00
| < input type = " button " id = " submit_<?= $ReportID ?> " value = " Submit " onclick = " TakeResolve(<?= $ReportID ?>); " />
</ td >
</ tr >
< ?
} else {
?>
< tr >
2013-02-22 08:00:24 +00:00
< td class = " label " > Resolver </ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
< a href = " user.php?id=<?= $ResolverID ?> " >< ? = $ResolverName ?> </a>
</ td >
</ tr >
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Resolve time </ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
< ? = time_diff ( $LastChangeTime ) ?>
</ td >
</ tr >
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Report comments </ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
< ? = $ModComment ?>
</ td >
</ tr >
< tr >
2013-03-04 08:00:25 +00:00
< td class = " label " > Log message </ td >
2011-03-28 14:21:28 +00:00
< td colspan = " 3 " >
< ? = $LogMessage ?>
</ td >
</ tr >
2013-04-15 08:00:54 +00:00
< ? if ( $GroupID ) { ?>
2011-03-28 14:21:28 +00:00
< tr >
< td colspan = " 4 " style = " text-align: center; " >
2013-03-05 08:00:26 +00:00
< input id = " grab<?= $ReportID ?> " type = " button " value = " Claim " onclick = " Grab(<?= $ReportID ?>); " />
2011-03-28 14:21:28 +00:00
</ td >
</ tr >
< ? }
}
?>
</ table >
</ form >
< br />
</ div >
2013-02-09 08:01:01 +00:00
< script type = " text/javascript " >//<! [ CDATA [
2012-12-21 08:00:21 +00:00
Load ( '<?=$ReportID?>' );
//]]>
</ script >
2011-03-28 14:21:28 +00:00
< ?
}
}
}
?>
</ div >
< div class = " linkbox " >
< ? = $PageLinks ?>
</ div >
< ?
2012-10-11 08:00:15 +00:00
View :: show_footer ();
2011-03-28 14:21:28 +00:00
?>