Na het posten van een nieuw bericht krijg ik het volgende:
message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?
Als ik een antwoordvenster open, verschijnt daaronder ook:
Algemene Fout
Could not get most recent report
DEBUG MODE
SQL Error : 1146 Table 'modelautoforum_nl_-_forum.post_reports' doesn't exist
SELECT COUNT(report_id) as total FROM post_reports WHERE report_status = 1
Line : 256
File : functions_report.php
Zal waarschijnlijk komen omdat ik de links naar de rapporten nu in de header heb staan i.p.v. de footer. Hoe kan ik dit probleem oplossen?
Hele mod:
Code: Selecteer alles
##############################################################
## MOD Title: Report Posts
## MOD Author: wGEric < mods@best-dev.com > (Eric Faerber) http://mods.best-dev.com
## MOD Description: Allows registered users to report posts to moderators. Adds a page where all reports can be displayed and the option to email the moderators when a report is made
## MOD Version: 1.0.1
##
## Installation Level: Moderate
## Installation Time: 18 minutes
## Files To Edit: admin/admin_board.php
## includes/constants.php
## viewtopic.php
## includes/page_tail.php
## language/lang_english/lang_main.php
## templates/subSilver/admin/board_config_body.tpl
## templates/subSilver/subSilver.cfg
## templates/subSilver/viewtopic_body.tpl
## Included Files:
## viewpost_reports.php
## includes/functions_report.php
## language/lang_english/email/report_posts.tpl
## templates/subSilver/report_post.tpl
## templates/subSilver/reports_view.tpl
## templates/subSilver/images/icon_report.gif
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes: Enjoy :)
##############################################################
## MOD History:
##
## 2005-04-22 - Version 1.0.1
## - Fixed implode bug (Thanks to the multiple people that reported this)
## - Added flood interval (Thanks FuNEnD3R)
## - Added language for Config page in ACP (Thanks bbcentral)
## - Report post link displays the number of reports (Thanks Nuladion)
##
## 2005-04-12 - Version 1.0.0
## - First Stable release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy viewpost_reports.php to viewpost_reports.php
copy includes/functions_report.php to includes/functions_report.php
copy language/lang_english/email/report_post.tpl to language/lang_english/email/report_post.tpl
copy templates/subSilver/report_post.tpl to templates/subSilver/report_post.tpl
copy templates/subSilver/reports_view.tpl to templates/subSilver/reports_view.tpl
copy templates/subSilver/images/icon_report.gif to templates/subSilver/images/icon_report.gif
#
#-----[ SQL ]------------------------------------------
#
CREATE TABLE phpbb_post_reports (
report_id MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT ,
post_id MEDIUMINT( 8 ) NOT NULL ,
reporter_id MEDIUMINT( 8 ) NOT NULL ,
report_status TINYINT( 1 ) DEFAULT '0' NOT NULL ,
report_time INT( 11 ) DEFAULT '0' NOT NULL,
report_comments TEXT,
PRIMARY KEY ( report_id )
);
ALTER TABLE phpbb_users ADD user_report_optout TINYINT( 1 ) DEFAULT '0' NOT NULL ;
INSERT INTO phpbb_config ( config_name, config_value ) VALUES ('report_email', '1');
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
$smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$report_email_yes = ( $new['report_email'] ) ? 'checked="checked"' : '';
$report_email_no = ( !$new['report_email'] ) ? 'checked="checked"' : '';
#
#-----[ FIND ]------------------------------------------
#
"L_RESET" => $lang['Reset'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_REPORT_EMAIL' => $lang['Report_email'],
'REPORT_EMAIL_YES' => $report_email_yes,
'REPORT_EMAIL_NO' => $report_email_no,
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
if( $userdata['session_logged_in'] )
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// report post
//
if ( isset($HTTP_GET_VARS['report']) || isset($HTTP_POST_VARS['report']) )
{
include($phpbb_root_path . 'includes/functions_report.'.$phpEx);
$comments = ( !empty($HTTP_POST_VARS['comments']) ) ? htmlspecialchars(trim($HTTP_POST_VARS['comments'])) : '';
if ( empty($comments) )
{
// show form to add comments about topic
$page_title = $lang['Report_post'] . ' - ' . $topic_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'report_post.tpl')
);
$template->assign_vars(array(
'TOPIC_TITLE' => $topic_title,
'POST_ID' => $post_id,
'U_VIEW_TOPIC' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?' . POST_TOPIC_URL . '=' . $topic_id),
'L_REPORT_POST' => $lang['Report_post'],
'L_COMMENTS' => $lang['Comments'],
'L_SUBMIT' => $lang['Submit'],
'S_ACTION' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?report=true&' . POST_POST_URL . '=' . $post_id))
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
exit;
}
else
{
if ( !report_flood() )
{
message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
}
// insert the report
insert_report($post_id, $comments);
// email the report if need to
if ( $board_config['report_email'] )
{
email_report($forum_id, $post_id, $topic_title, $comments);
}
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
);
$message = $lang['Post_reported'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
}
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('postrow', array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if ( $userdata['session_logged_in'] )
{
$report_img = '<a href="' . append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?report=true&' . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '"><img src="' . $images['icon_report'] . '" border="0" width="20" height="20" alt="' . $lang['Report_post'] . '" title="' . $lang['Report_post'] . '" /></a>';
}
else
{
$report_img = '';
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
'REPORT_IMG' => $report_img,
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $phpbb_root_path . 'admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path . 'includes/functions_report.'.$phpEx);
$report_link = ( $userdata['user_level'] >= ADMIN ) ? ' <a href="' . append_sid($phpbb_root_path . 'viewpost_reports.'.$phpEx) . '">' . sprintf($lang['Post_reports_cp'], reports_count()) . '</a> ' : '';
#
#-----[ FIND ]------------------------------------------
#
'ADMIN_LINK' => $admin_link)
#
#-----[ IN-LINE FIND ]------------------------------------------
#
$admin_link
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
$report_link .
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['A_critical_error'] = 'A Critical Error Occurred';
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Report Post
//
$lang['Post_reports_cp'] = 'There are %s new Reported Post(s)';
$lang['Closed'] = 'Closed';
$lang['Close'] = 'Close';
$lang['Open'] = 'Open';
$lang['All'] = 'All';
$lang['Display'] = 'Display only';
$lang['Report_post'] = 'Report Post';
$lang['Comments'] = 'Comments';
$lang['Reporter'] = 'Reporter';
$lang['Status'] = 'Status';
$lang['Select_one'] = 'Select One';
$lang['Opt_in'] = 'Opt in to recieve emails when a report is submitted';
$lang['Opt_out'] = 'Opt out so you don\'t recieve emails when a report is submitted';
$lang['Post_reported'] = 'Post report submitted successfully.';
$lang['Close_success'] = 'Reports were Opened/Closed successfully.';
$lang['Opt_success'] = 'You have opt out/in successfully.';
$lang['Delete_success'] = 'Reports were deleted successfully.';
$lang['Click_return_reports'] = 'Click %shere%s to return to the Report Posts control panel.';
$lang['Report_email'] = 'Send Email when Post Reported';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_ENABLE_PRUNE}</td>
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_REPORT_EMAIL}</td>
<td class="row2"><input type="radio" name="report_email" value="1" {REPORT_EMAIL_YES} /> {L_YES} <input type="radio" name="report_email" value="0" {REPORT_EMAIL_NO} /> {L_NO}</td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]------------------------------------------
#
$images['voting_graphic'][4] = "$current_template_images/voting_bar.gif";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$images['icon_report'] = "$current_template_images/icon_report.gif";
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.IP_IMG}
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{postrow.REPORT_IMG}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Hoi! Ik ben een onderschrift virus, kopieer/plak mij in jouw onderschrift om mij te verspreiden!