2011-03-28 14:21:28 +00:00
< ?
include ( SERVER_ROOT . '/sections/reports/array.php' );
2013-04-17 08:00:58 +00:00
if ( empty ( $_GET [ 'type' ]) || empty ( $_GET [ 'id' ]) || ! is_number ( $_GET [ 'id' ])) {
2011-03-28 14:21:28 +00:00
error ( 404 );
}
2013-04-17 08:00:58 +00:00
if ( ! array_key_exists ( $_GET [ 'type' ], $Types )) {
2011-03-28 14:21:28 +00:00
error ( 403 );
}
$Short = $_GET [ 'type' ];
2013-02-22 08:00:24 +00:00
$Type = $Types [ $Short ];
2011-03-28 14:21:28 +00:00
$ID = $_GET [ 'id' ];
2013-04-17 08:00:58 +00:00
switch ( $Short ) {
2011-10-01 08:00:08 +00:00
case " user " :
$DB -> query ( " SELECT Username FROM users_main WHERE ID= " . $ID );
2013-04-17 08:00:58 +00:00
if ( $DB -> record_count () < 1 ) {
2011-10-01 08:00:08 +00:00
error ( 404 );
}
list ( $Username ) = $DB -> next_record ();
break ;
case " request_update " :
$NoReason = true ;
$DB -> query ( " SELECT Title, Description, TorrentID, CategoryID, Year FROM requests WHERE ID= " . $ID );
2013-04-17 08:00:58 +00:00
if ( $DB -> record_count () < 1 ) {
2011-10-01 08:00:08 +00:00
error ( 404 );
}
list ( $Name , $Desc , $Filled , $CategoryID , $Year ) = $DB -> next_record ();
2013-04-17 08:00:58 +00:00
if ( $Filled || ( $CategoryID != 0 && ( $Categories [ $CategoryID - 1 ] != " Music " || $Year != 0 ))) {
2011-10-01 08:00:08 +00:00
error ( 403 );
}
break ;
case " request " :
$DB -> query ( " SELECT Title, Description, TorrentID FROM requests WHERE ID= " . $ID );
2013-04-17 08:00:58 +00:00
if ( $DB -> record_count () < 1 ) {
2011-10-01 08:00:08 +00:00
error ( 404 );
}
list ( $Name , $Desc , $Filled ) = $DB -> next_record ();
break ;
case " collage " :
$DB -> query ( " SELECT Name, Description FROM collages WHERE ID= " . $ID );
2013-04-17 08:00:58 +00:00
if ( $DB -> record_count () < 1 ) {
2011-10-01 08:00:08 +00:00
error ( 404 );
}
list ( $Name , $Desc ) = $DB -> next_record ();
break ;
case " thread " :
$DB -> query ( " SELECT ft.Title, ft.ForumID, um.Username FROM forums_topics AS ft JOIN users_main AS um ON um.ID=ft.AuthorID WHERE ft.ID= " . $ID );
2013-04-17 08:00:58 +00:00
if ( $DB -> record_count () < 1 ) {
2011-10-01 08:00:08 +00:00
error ( 404 );
}
list ( $Title , $ForumID , $Username ) = $DB -> next_record ();
$DB -> query ( " SELECT MinClassRead FROM forums WHERE ID = " . $ForumID );
list ( $MinClassRead ) = $DB -> next_record ();
2013-04-17 08:00:58 +00:00
if ( ! empty ( $LoggedUser [ 'DisableForums' ]) ||
2012-03-28 08:00:20 +00:00
( $MinClassRead > $LoggedUser [ 'EffectiveClass' ] && ( ! isset ( $LoggedUser [ 'CustomForums' ][ $ForumID ]) || $LoggedUser [ 'CustomForums' ][ $ForumID ] == 0 )) ||
2011-10-01 08:00:08 +00:00
( isset ( $LoggedUser [ 'CustomForums' ][ $ForumID ]) && $LoggedUser [ 'CustomForums' ][ $ForumID ] == 0 )) {
error ( 403 );
}
break ;
case " post " :
$DB -> query ( " SELECT fp.Body, fp.TopicID, um.Username FROM forums_posts AS fp JOIN users_main AS um ON um.ID=fp.AuthorID WHERE fp.ID= " . $ID );
2013-04-17 08:00:58 +00:00
if ( $DB -> record_count () < 1 ) {
2011-10-01 08:00:08 +00:00
error ( 404 );
}
list ( $Body , $TopicID , $Username ) = $DB -> next_record ();
$DB -> query ( " SELECT ForumID FROM forums_topics WHERE ID = " . $TopicID );
list ( $ForumID ) = $DB -> next_record ();
$DB -> query ( " SELECT MinClassRead FROM forums WHERE ID = " . $ForumID );
list ( $MinClassRead ) = $DB -> next_record ();
2013-04-17 08:00:58 +00:00
if ( ! empty ( $LoggedUser [ 'DisableForums' ]) ||
2012-03-28 08:00:20 +00:00
( $MinClassRead > $LoggedUser [ 'EffectiveClass' ] && ( ! isset ( $LoggedUser [ 'CustomForums' ][ $ForumID ]) || $LoggedUser [ 'CustomForums' ][ $ForumID ] == 0 )) ||
2011-10-01 08:00:08 +00:00
( isset ( $LoggedUser [ 'CustomForums' ][ $ForumID ]) && $LoggedUser [ 'CustomForums' ][ $ForumID ] == 0 )) {
error ( 403 );
}
break ;
case " requests_comment " :
2012-10-27 08:00:09 +00:00
case " torrents_comment " :
case " artist_comment " :
2011-10-01 08:00:08 +00:00
case " collages_comment " :
$Table = $Short . 's' ;
2013-04-17 08:00:58 +00:00
if ( $Short == " collages_comment " ) {
2011-10-01 08:00:08 +00:00
$Column = " UserID " ;
} else {
$Column = " AuthorID " ;
}
$DB -> query ( " SELECT " . $Short . " .Body, um.Username FROM " . $Table . " AS " . $Short . " JOIN users_main AS um ON um.ID= " . $Short . " . " . $Column . " WHERE " . $Short . " .ID= " . $ID );
2013-04-17 08:00:58 +00:00
if ( $DB -> record_count () < 1 ) {
2011-10-01 08:00:08 +00:00
error ( 404 );
}
2012-03-02 08:00:27 +00:00
list ( $Body , $Username ) = $DB -> next_record ();
2011-10-01 08:00:08 +00:00
break ;
}
2012-10-11 08:00:15 +00:00
View :: show_header ( 'Report a ' . $Type [ 'title' ], 'bbcode' );
2011-03-28 14:21:28 +00:00
?>
< div class = " thin " >
2012-08-19 08:00:19 +00:00
< div class = " header " >
< h2 > Report < ? = $Type [ 'title' ] ?> </h2>
</ div >
2011-03-28 14:21:28 +00:00
< h3 > Reporting guidelines </ h3 >
< div class = " box pad " >
< p > Following these guidelines will help the moderators deal with your report in a timely fashion . </ p >
< ul >
< ?
2013-04-17 08:00:58 +00:00
foreach ( $Type [ 'guidelines' ] as $Guideline ) {
2011-03-28 14:21:28 +00:00
?>
< li >< ? = $Guideline ?> </li>
< ? } ?>
</ ul >
< p > In short , please include as much detail as possible when reporting . Thank you . </ p >
</ div >
< ?
include ( SERVER_ROOT . '/classes/class_text.php' ); // Text formatting class
$Text = new TEXT ;
2013-04-17 08:00:58 +00:00
switch ( $Short ) {
2011-03-28 14:21:28 +00:00
case " user " :
?>
< p > You are reporting the user < strong >< ? = display_str ( $Username ) ?> </strong></p>
< ?
break ;
case " request_update " :
?>
< p > You are reporting the request :</ p >
< table >
< tr class = " colhead " >
< td > Title </ td >
< td > Description </ td >
< td > Filled ? </ td >
</ tr >
< tr >
< td >< ? = display_str ( $Name ) ?> </td>
2013-02-22 08:00:24 +00:00
< td >< ? = $Text -> full_format ( $Desc ) ?> </td>
2011-03-28 14:21:28 +00:00
< td >< strong >< ? = ( $Filled == 0 ? 'No' : 'Yes' ) ?> </strong></td>
</ tr >
</ table >
< br />
< div class = " box pad center " >
2012-09-09 08:00:26 +00:00
< p >< strong > It will greatly increase the turnover rate of the updates if you can fill in as much of the following details as possible .</ strong ></ p >
2012-09-15 08:00:25 +00:00
< form class = " create_form " name = " report " action = " " method = " post " >
2011-03-28 14:21:28 +00:00
< input type = " hidden " name = " action " value = " takereport " />
< input type = " hidden " name = " auth " value = " <?= $LoggedUser['AuthKey'] ?> " />
< input type = " hidden " name = " id " value = " <?= $ID ?> " />
< input type = " hidden " name = " type " value = " <?= $Short ?> " />
2012-09-01 08:00:24 +00:00
< table class = " layout " >
2011-03-28 14:21:28 +00:00
< tr >
< td class = " label " > Year ( required ) </ td >
< td >
< input type = " text " size = " 4 " name = " year " />
</ td >
</ tr >
< tr >
< td class = " label " > Release Type </ td >
< td >
< select id = " releasetype " name = " releasetype " >
< option value = '0' >---</ option >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
foreach ( $ReleaseTypes as $Key => $Val ) {
?> <option value='<?=$Key?>' <?=(!empty($ReleaseType) ? ($Key == $ReleaseType ?" selected='selected'" : "") : '') ?>><?=$Val?></option>
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
}
?>
</ select >
</ td >
</ tr >
< tr >
< td class = " label " > Comment </ td >
< td >
< textarea rows = " 8 " cols = " 80 " name = " comment " ></ textarea >
</ td >
</ tr >
</ table >
< br />
< br />
< input type = " submit " value = " Submit report " />
</ form >
</ div >
< ?
break ;
case " request " :
?>
< p > You are reporting the request :</ p >
< table >
< tr class = " colhead " >
< td > Title </ td >
< td > Description </ td >
< td > Filled ? </ td >
</ tr >
< tr >
< td >< ? = display_str ( $Name ) ?> </td>
2013-02-22 08:00:24 +00:00
< td >< ? = $Text -> full_format ( $Desc ) ?> </td>
2011-03-28 14:21:28 +00:00
< td >< strong >< ? = ( $Filled == 0 ? 'No' : 'Yes' ) ?> </strong></td>
</ tr >
</ table >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
break ;
case " collage " :
?>
< p > You are reporting the collage :</ p >
< table >
< tr class = " colhead " >
< td > Title </ td >
< td > Description </ td >
</ tr >
< tr >
2013-02-22 08:00:24 +00:00
< td >< ? = display_str ( $Name ) ?> </td>
2011-03-28 14:21:28 +00:00
< td >< ? = $Text -> full_format ( $Desc ) ?> </td>
</ tr >
</ table >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
break ;
case " thread " :
?>
< p > You are reporting the thread :</ p >
< table >
< tr class = " colhead " >
< td > Username </ td >
< td > Title </ td >
</ tr >
< tr >
2013-02-22 08:00:24 +00:00
< td >< ? = display_str ( $Username ) ?> </td>
2011-03-28 14:21:28 +00:00
< td >< ? = display_str ( $Title ) ?> </td>
</ tr >
</ table >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
break ;
case " post " :
?>
< p > You are reporting the post :</ p >
< table >
< tr class = " colhead " >
< td > Username </ td >
< td > Body </ td >
</ tr >
< tr >
2013-02-22 08:00:24 +00:00
< td >< ? = display_str ( $Username ) ?> </td>
2011-03-28 14:21:28 +00:00
< td >< ? = $Text -> full_format ( $Body ) ?> </td>
</ tr >
</ table >
2013-02-22 08:00:24 +00:00
< ?
2011-03-28 14:21:28 +00:00
break ;
case " requests_comment " :
2012-10-27 08:00:09 +00:00
case " torrents_comment " :
case " artist_comment " :
2011-03-28 14:21:28 +00:00
case " collages_comment " :
?>
< p > You are reporting the < ? = $Types [ $Short ][ 'title' ] ?> :</p>
< table >
< tr class = " colhead " >
< td > Username </ td >
< td > Body </ td >
</ tr >
< tr >
2013-02-22 08:00:24 +00:00
< td >< ? = display_str ( $Username ) ?> </td>
2011-03-28 14:21:28 +00:00
< td >< ? = $Text -> full_format ( $Body ) ?> </td>
</ tr >
</ table >
2013-02-22 08:00:24 +00:00
< ?
break ;
2011-03-28 14:21:28 +00:00
}
2013-04-17 08:00:58 +00:00
if ( empty ( $NoReason )) {
2011-03-28 14:21:28 +00:00
?>
< h3 > Reason </ h3 >
< div class = " box pad center " >
2012-09-15 08:00:25 +00:00
< form class = " create_form " name = " report " action = " " method = " post " >
2011-03-28 14:21:28 +00:00
< input type = " hidden " name = " action " value = " takereport " />
< input type = " hidden " name = " auth " value = " <?= $LoggedUser['AuthKey'] ?> " />
< input type = " hidden " name = " id " value = " <?= $ID ?> " />
< input type = " hidden " name = " type " value = " <?= $Short ?> " />
< textarea rows = " 10 " cols = " 95 " name = " reason " ></ textarea >< br />< br />
< input type = " submit " value = " Submit report " />
</ form >
</ div >
< ?
}
// close <div class="thin"> ?>
</ div >
< ?
2012-10-11 08:00:15 +00:00
View :: show_footer ();
2012-10-27 08:00:09 +00:00
?>