Code: Alles auswählen
#################################################################
## MOD Title: Advanced Report Hack
## MOD Author: S2B < mods@s2b-project.de > (S. Praetorius) http://www.s2b-project.de
## MOD Description: This MOD adds a report system to the phpBB. The administrator can create categories
## the users can select during they write a report. The reports are listed in a list
## that can be shown either in the admin panel or in the board. The reports can be
## marked as "cleared", as "in process" or as "not cleared" and can also be deleted
## there.
## Advanced Report Hack v3 comes with a report post, a report topic and a report user
## system.
##
## MOD Version: 3.0.1
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: includes/constants.php
## includes/page_header.php
## includes/usercp_viewprofile.php
## admin/index.php
## viewonline.php
## viewtopic.php
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/overall_header.tpl
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/subSilver.cfg
## templates/subSilver/viewtopic_body.tpl
##
## Included Files: includes/functions_report.php
## admin/admin_report.php
## admin/admin_report_list.php
## report.php
## language/lang_english/email/report_notify.tpl
## templates/subSilver/report_body.tpl
## templates/subSilver/report_list_body.tpl
## templates/subSilver/admin/report_body.tpl
## templates/subSilver/admin/report_cat_delete_body.tpl
## templates/subSilver/admin/report_cat_edit_body.tpl
## templates/subSilver/admin/report_list_body.tpl
## templates/subSilver/images/reportpost.gif
## templates/subSilver/images/reportpost_clear.gif
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
#################################################################
## For Security Purposes, Please Check: http://www.s2b-project.de for the
## latest version of this MOD.
#################################################################
##
## Author Notes:
## To update from Advanced Report Hack v2, simply execute update_from_2.2.sql in phpmyadmin or
## another db administration software. Because Advanced Report Hack v3 was written completely
## new, you cannot update the files of v2. To update to v3, you have to undo the file changes
## of v2 and do the changes in this file.
## Advanced Report Hack needs 3 Extension-Categories (report posts, report topics and report users)
## to work properly. If you don't have these categories, you have to create them. You also have
## to change the values of the 3 constants REPORT_POST_ID, REPORT_TOPIC_ID and REPORT_USER_ID to
## the ids of these categories.
##
#################################################################
##
## MOD History:
## v3.0.1
## - corrected some bugs
##
## v3.0
## - added report posts feature
## - added report topics feature
## - added report users feature
## - added new status "in process"
## - added private message link
## - added category authorisation
## - added multi language support (using language variables in name/description fields)
## - improved report list design/usability
## - improved email notification
## - improved code
## - to update from v2.2, read the author notes
##
## v2.2a
## - added update_from_2.1.2_2.txt because of an error in v2.1.2
##
## v2.2
## - corrected 2 errors in page_header.php
## - corrected link in admin/index.php
## - auto_increment is used
## - sql compatibility to other dbms
## - deleted message_die titles
## - added some missing error messages
## - improved code
## - corrected "delete all" error
##
## v2.1.2
## - checking ID's in the URL's with intval()
## - Email-notification added
## - PAGE_-constant changed
## - error in ACP corrected (Admins couldn't change colors)
## - & in URL's replaced with &
##
## v2.1.1
## - MOD Template Syntax corrected
## - Link "Write a report" not visible for Guests
##
## v2.1.0
## - Now the report list is listed in the admin panel everytime.
## - better codedesign
## - Before deleting a category/report, the user will be asked if that
## should really happen.
##
## v2.0.0
## - Initial Release.
##
## v1.0
## - The old version of the mod, version 2.0 was written completely new.
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ SQL ]--------------------------------------------
#
CREATE TABLE phpbb_report_cat (
cat_id mediumint(8) NOT NULL auto_increment,
cat_name varchar(100) NOT NULL default '',
cat_type tinyint(1) NOT NULL default '0',
cat_auth tinyint(1) NOT NULL default '0',
cat_explain text NOT NULL,
PRIMARY KEY (cat_id)
);
CREATE TABLE phpbb_report (
report_id mediumint(8) NOT NULL auto_increment,
cat_id mediumint(8) NOT NULL,
report_status tinyint(1) NOT NULL default '0',
report_date int(11) NOT NULL default '0',
report_user_id mediumint(8) NOT NULL default '0',
report_info varchar(100) NOT NULL default '',
report_text text NOT NULL,
PRIMARY KEY (report_id),
KEY cat_id (cat_id)
);
INSERT INTO phpbb_report_cat (cat_id, cat_name, cat_type, cat_auth, cat_explain) VALUES (1, 'Report Post', 1, 0, '');
INSERT INTO phpbb_report_cat (cat_id, cat_name, cat_type, cat_auth, cat_explain) VALUES (2, 'Report Topic', 1, 0, '');
INSERT INTO phpbb_report_cat (cat_id, cat_name, cat_type, cat_auth, cat_explain) VALUES (3, 'Report User', 1, 0, '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('report_color_not_cleared', '#A8371D');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('report_color_in_process', '#1B75BE');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('report_color_cleared', '#297F3F');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('report_list', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('report_notify', '0');
#
#-----[ COPY ]-------------------------------------------
#
copy root/*.* to *.*
#
#-----[ OPEN ]-------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]-------------------------------------------
#
// SQL codes
#
#-----[ BEFORE, ADD ]------------------------------------
#
// BEGIN Advanced_Report_Hack
// Report category types
define('REPORT_NORMAL', 0);
define('REPORT_EXT', 1);
// Report status
define('REPORT_NOT_CLEARED', 0);
define('REPORT_IN_PROCESS', 1);
define('REPORT_CLEARED', 2);
// Special categories
define('REPORT_POST_ID', 1);
define('REPORT_TOPIC_ID', 2);
define('REPORT_USER_ID', 3);
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
define('PAGE_GROUPCP', -11);
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
define('PAGE_REPORT', -2041);
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
define('RANKS_TABLE', $table_prefix.'ranks');
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
define('REPORT_CAT_TABLE', $table_prefix.'report_cat');
define('REPORT_TABLE', $table_prefix.'report');
// END Advanced_Report_Hack
#
#-----[ OPEN ]-------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]-------------------------------------------
#
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$l_privmsgs_text_unread = '';
$s_privmsg_new = 0;
}
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
$report_info = '';
if (($userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) && $board_config['report_list'] == 0 && empty($gen_simple_header))
{
include_once($phpbb_root_path . 'includes/functions_report.'.$phpEx);
$report_count = report_count('notcleared');
switch ($report_count)
{
case 0:
$report_info = $lang['No_new_reports'];
break;
case 1:
$report_info = $lang['New_report'];
break;
default:
$report_info = sprintf($lang['New_reports'], $report_count);
}
$report_info = '<a href="' . append_sid("report.$phpEx") . '" class="mainmenu">' . $report_info . '</a>';
}
else if ($userdata['user_id'] != ANONYMOUS)
{
$report_info = '<a href="' . append_sid("report.$phpEx?mode=report") . '" class="mainmenu">' . $lang['Report_Write_Report'] . '</a>';
}
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
'REPORT_INFO' => $report_info,
// END Advanced_Report_Hack
#
#-----[ OPEN ]-------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]-------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
$s_report_user = '';
if ($userdata['user_id'] != ANONYMOUS)
{
$temp_url = append_sid("report.$phpEx?mode=reportuser&id=" . $profiledata['user_id']);
$s_report_user = '<a href="' . $temp_url . '" class="gen">' . $lang['Report_user'] . '</a>';
}
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
#
#-----[ BEFORE, ADD ]------------------------------------
#
'S_REPORT_USER' => $s_report_user,
#
#-----[ OPEN ]-------------------------------------------
#
admin/index.php
#
#-----[ FIND ]-------------------------------------------
#
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
$location_url = "index.$phpEx?pane=right";
break;
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
case PAGE_REPORT:
$location = $lang['Write_report'];
$location_url = "index.$phpEx?pane=right";
break;
// END Advanced_Report_Hack
#
#-----[ OPEN ]-------------------------------------------
#
viewonline.php
#
#-----[ FIND ]-------------------------------------------
#
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
$location_url = "faq.$phpEx";
break;
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
case PAGE_REPORT:
$location = $lang['Write_report'];
$location_url = "report.$phpEx?mode=report";
break;
// END Advanced_Report_Hack
#
#-----[ OPEN ]-------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]-------------------------------------------
#
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
include_once($phpbb_root_path . 'includes/functions_report.'.$phpEx);
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
$s_watching_topic_img = ( isset($images['Topic_watch']) ) ? "<a href=\"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&watch=topic&start=$start&sid=" . $userdata['session_id'] . '"><img src="' . $images['Topic_watch'] . '" alt="' . $lang['Start_watching_topic'] . '" title="' . $lang['Start_watching_topic'] . '" border="0"></a>' : '';
}
}
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
$s_report_topic = '';
if ($userdata['session_logged_in'])
{
for ($i = 0; $i < $total_posts; $i++)
{
$post_ids[] = $postrow[$i]['post_id'];
}
$reported_info = get_report_status('topic_posts', $topic_id, $post_ids);
unset($post_ids);
if (($userdata['user_level'] == ADMIN || $is_auth['auth_mod']) && $reported_info[-1] == REPORT_NOT_CLEARED && $board_config['report_list'] == 0)
{
$report_url = append_sid("report.$phpEx?mode=cleartopic&id=$topic_id");
$report_title = $lang['Mark_cleared'];
}
else if ($reported_info[-1] == REPORT_NOT_CLEARED)
{
$report_url = '';
$report_title = $lang['Topic_already_reported'];
}
else
{
$report_url = append_sid("report.$phpEx?mode=reporttopic&id=$topic_id");
$report_title = $lang['Report_topic'];
}
$s_report_topic = (!empty($report_url)) ? '<a href="' . $report_url . '" class="genmed">' . $report_title . '</a>' : $report_title;
}
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
'S_WATCH_TOPIC_IMG' => $s_watching_topic_img,
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
'S_REPORT_TOPIC' => $s_report_topic,
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
$delpost = '';
}
}
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
$s_report_post_img = '';
if ($userdata['session_logged_in'])
{
if (($userdata['user_level'] == ADMIN || $is_auth['auth_mod']) && $reported_info[$postrow[$i]['post_id']] == REPORT_NOT_CLEARED && $board_config['report_list'] == 0)
{
$report_url = append_sid("report.$phpEx?mode=clearpost&id=" . $postrow[$i]['post_id']);
$report_img = $images['icon_reportpost_clear'];
$report_title = $lang['Mark_cleared'];
}
else if ($reported_info[$postrow[$i]['post_id']] == REPORT_NOT_CLEARED)
{
$report_url = '';
$report_img = $images['icon_reportpost_clear'];
$report_title = $lang['Post_already_reported'];
}
else
{
$report_url = append_sid("report.$phpEx?mode=reportpost&id=" . $postrow[$i]['post_id']);
$report_img = $images['icon_reportpost'];
$report_title = $lang['Report_post'];
}
if (!empty($report_img))
{
if (!empty($report_url))
{
$s_report_post_img = '<a href="' . $report_url . '"><img src="' . $report_img . '" alt="' . $report_title . '" title="' . $report_title . '" border="0" /></a>';
}
else
{
$s_report_post_img = '<img src="' . $report_img . '" alt="' . $report_title . '" title="' . $report_title . '" border="0" />';
}
}
}
// END Advanced_Report_Hack
#
#-----[ FIND ]-------------------------------------------
#
'DELETE' => $delpost,
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
'REPORT_IMG' => $s_report_post_img,
// END Advanced_Report_Hack
#
#-----[ OPEN ]-------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]-------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------
#
//
// Reports
//
$lang['Reports'] = 'Reports';
$lang['List'] = 'List';
$lang['Report_Admin_title'] = 'Reports Administration';
$lang['Report_Admin_explain'] = 'On this page you can create, edit or delete report categories. You can also change a few settings concerning reports.';
$lang['Report_count'] = 'Report Count';
$lang['Type'] = 'Type';
$lang['Report_Type_normal'] = 'normal';
$lang['Report_Type_extension'] = 'extension';
$lang['Authorisation'] = 'Authorisation';
$lang['Description'] = 'Description';
$lang['Standard_categories'] = 'Standard categories';
$lang['No_standard_categories'] = 'there are no standard categories.';
$lang['Extension_categories'] = 'Extensions';
$lang['No_extension_categories'] = 'there are no extensions.';
$lang['Administrators_moderators'] = 'Administrators and Moderators';
$lang['Only_administrators'] = 'only Administrators';
$lang['Report_color_not_cleared'] = 'Color for reports that haven\'t been cleared';
$lang['Report_color_in_process'] = 'Color for reports that are in process';
$lang['Report_color_cleared'] = 'Color for reports that are cleared';
$lang['Reportlist_type'] = 'Report list type';
$lang['Reportlist_type_admin'] = 'Admin-Panel';
$lang['Reportlist_type_external'] = 'Admin-Panel and external list';
$lang['Report_notify'] = 'Email-notification';
$lang['No_name_entered'] = 'You have to enter a valid name.';
$lang['Category_deleted'] = 'The category was deleted successfully.';
$lang['Confirm_delete_category'] = 'Are you sure you want to delete this category?';
$lang['Confirm_delete_category_reportdel'] = ' All reports in this category will be deleted, too.';
$lang['Reports_delete'] = 'Delete reports';
$lang['Reports_move'] = 'Move reports to: %s';
$lang['Category_created'] = 'The category was created successfully.';
$lang['Category_edited'] = 'The category was edited successfully.';
$lang['Click_return_catadmin'] = 'Click %shere%s to return to the category administration.';
#
#-----[ OPEN ]-------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]-------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------
#
//
// Reports
//
$lang['Reportlist_title'] = 'Reports';
$lang['Reportlist_explain'] = 'On this page you can maintain the reports that were sent to staff.';
$lang['No_new_reports'] = 'No new Reports';
$lang['New_report'] = '1 new Report';
$lang['New_reports'] = '%d new Reports';
$lang['Report_count_0'] = 'No reports';
$lang['Report_count_1'] = 'One report';
$lang['Report_count_2'] = '%d reports';
$lang['Write_report'] = 'Write a report';
$lang['Report_post'] = 'Report post';
$lang['Report_topic'] = 'Report topic';
$lang['Report_user'] = 'Report user';
$lang['Categories'] = 'Categories';
$lang['Change_category'] = 'Change category';
$lang['Category_description'] = 'Description of the category';
$lang['Status'] = 'Status';
$lang['Report_subject'] = 'Subject';
$lang['Report_text'] = 'Text';
$lang['Report_status_not_cleared'] = 'not cleared';
$lang['Report_status_in_process'] = 'in process';
$lang['Report_status_cleared'] = 'cleared';
$lang['Mark_cleared'] = 'mark as \'cleared\'';
$lang['No_reports'] = 'There are no reports to be shown.';
$lang['Show_all_categories'] = 'Show all categories';
$lang['Report_notification'] = 'Report Notification';
$lang['Confirm_delete_report'] = 'Are you sure you want to delete this report?';
$lang['Report_deleted'] = 'The report was deleted successfully.';
$lang['Confirm_delete_reports'] = 'Are you sure you want to delete these reports?';
$lang['Reports_deleted'] = 'The reports were deleted successfully.';
$lang['Report_sent'] = 'The report was sent to the Moderators successfully.';
$lang['No_categories'] = 'There is no cateory to be shown.';
$lang['No_category_selected'] = 'No category was selected.';
$lang['No_text_entered'] = 'You have to enter a text.';
$lang['Post_already_reported'] = 'This post has already been reported.';
$lang['Topic_already_reported'] = 'This topic has already been reported.';
$lang['Report_not_authorised'] = 'You are not authorised to view this site.';
$lang['Click_return_reportlist'] = 'Click %shere%s to return to the report list.';
$lang['Click_return_post'] = 'Click %shere%s to return to the post.';
$lang['Click_return_profile'] = 'Click %shere%s to return to the profile.';
#
#-----[ OPEN ]-------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]-------------------------------------------
#
<td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu"> <a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a> <a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a> <a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a> </span></td>
#
#-----[ IN-LINE FIND ]-----------------------------------
#
alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>
#
#-----[ IN-LINE AFTER, ADD ]-----------------------------
#
{REPORT_INFO}
#
#-----[ OPEN ]-------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]-------------------------------------------
#
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="right"><span class="nav"><br />{JUMPBOX}</span></td>
#
#-----[ BEFORE, ADD ]------------------------------------
#
<tr>
<td class="catBottom" colspan="2" align="center">{S_REPORT_USER}</td>
</tr>
#
#-----[ 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.EDIT_IMG}
#
#-----[ IN-LINE AFTER, ADD ]-----------------------------
#
{postrow.REPORT_IMG}
#
#-----[ FIND ]-------------------------------------------
#
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}</span><br />
#
#-----[ IN-LINE FIND ]-----------------------------------
#
{S_WATCH_TOPIC}
#
#-----[ IN-LINE AFTER, ADD ]-----------------------------
#
<br />{S_REPORT_TOPIC}
#
#-----[ OPEN ]-------------------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]-------------------------------------------
#
$images['icon_delpost'] = "$current_template_images/icon_delete.gif";
#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Advanced_Report_Hack
$images['icon_reportpost'] = "$current_template_images/reportpost.gif";
$images['icon_reportpost_clear'] = "$current_template_images/reportpost_clear.gif";
// END Advanced_Report_Hack
#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------
#
# EoM