Author: Skywalker » Mon May 29, 2006 5:12 am
could someone port this to IM
- Code: Select all
################################################################ MOD Title]phpmix.com > (Markus) [url=http://www.phpmix.com#]http://www.phpmix.com#[/url]# MOD Description: Disallows editing replied posts, except for Admins and Moderators. It also adds a new## forum permissions setting to allow Admins to define who have rights to edit replied posts.## MOD Version: 1.1.0#### Installation Level: Intermediate## Installation Time: 30 Minutes## Files To Edit: 9## posting.php## viewtopic.php## admin/admin_forums.php## admin/admin_forumauth.php## admin/admin_ug_auth.php## includes/auth.php## includes/constants.php## language/lang_english/lang_admin.php## language/lang_english/lang_main.php## Included Files: 0################################################################ For Security Purposes, Please Check: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] 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: [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]############################################################### Author Notes: #### *** CREDITS ***#### Initial idea to create this MOD was posted by Jacobus here:## [url=http://www.phpbb.com/phpBB/viewtopic.php?t=223802]http://www.phpbb.com/phpBB/viewtopic.php?t=223802[/url] ###### *** WARNING ***#### General:## This MOD updates your database (it adds 2 fields to existing tables).## Please, make backups BEFORE installing this MOD.## This MOD can be installed with EasyMOD. Please, try it. It works. :-)#### Manual installation:## Please, carefully follow installation instructions detailed in this MOD script.## If something goes wrong, please take the time to check the changes made again.## Specially, take care of the IN-LINE actions. You might want to check this tutorial:## How to install MODs -> [url=http://www.phpbb.com/kb/article.php?article_id=150#]http://www.phpbb.com/kb/article.php?article_id=150#[/url]# Before asking for support, try to restore your backups and re-try. It should work.## Thanks for you understanding and collaboration. :-)#### Known Issues:## This MOD is NOT compatible with Categories Hierarchy MOD, yet!################################################################## MOD History:#### 2004/10/06 - 1.1.0## - Added support for forum permissions (all, reg, private, etc).#### 2004/09/09 - 1.0.0## - Just changed version number to submit to MODs Database.#### 2004/09/08 - 0.0.1## - Initial Beta Release################################################################## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD############################################################## ##-----[ SQL ]-------------------------------------------------#ALTER TABLE phpbb_forums ADD auth_edit_replied TINYINT(2) DEFAULT '1' NOT NULL AFTER auth_edit;ALTER TABLE phpbb_auth_access ADD auth_edit_replied TINYINT(1) DEFAULT '1' NOT NULL AFTER auth_edit;##-----[ OPEN ]------------------------------------------------#posting.php##-----[ FIND ]------------------------------------------# $post_data['poster_id'] = $post_info['poster_id'];##-----[ AFTER, ADD ]------------------------------------------# //+MOD: Disallow editing replied posts if( !$post_data['last_post'] ) { $is_auth_type = 'auth_edit_replied'; }//-MOD: Disallow editing replied posts##-----[ OPEN ]------------------------------------------------#viewtopic.php##-----[ FIND ]------------------------------------------------## NOTE --- The line to look for should be similar to this:# $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "#$sql = "SELECT t.topic_id,##-----[ BEFORE, ADD ]-----------------------------------------#//+MOD: Disallow editing replied posts// Added new 'f.auth_edit_replied' field//-MOD: Disallow editing replied posts##-----[ IN-LINE FIND ]----------------------------------------#, f.auth_edit##-----[ IN-LINE AFTER, ADD ]----------------------------------#, f.auth_edit_replied##-----[ FIND ]------------------------------------------------# $edit = '<a>' . $lang['Edit_delete_post'] . '</a>';##-----[ AFTER, ADD ]------------------------------------------#//+MOD: Disallow editing replied posts // // Hide Edit Button If: Not_Last_Post AND Not_Authorized AND Not_Moderator // if( $postrow[$i]['post_id'] != $forum_topic_data['topic_last_post_id'] && !$is_auth['auth_edit_replied'] && !$is_auth['auth_mod'] ) { $edit_img = ''; $edit = ''; }//-MOD: Disallow editing replied posts##-----[ OPEN ]------------------------------------------------#admin/admin_forums.php##-----[ FIND ]------------------------------------------------# "auth_edit" => AUTH_REG,##-----[ AFTER, ADD ]------------------------------------------# "auth_edit_replied" => AUTH_REG,##-----[ OPEN ]------------------------------------------------#admin/admin_forumauth.php##-----[ FIND ]------------------------------------------------## NOTE --- The line to look for should be similar to this:# // View Read Post Reply Edit Delete Sticky Announce Vote Poll#// View##-----[ AFTER, ADD ]------------------------------------------#//+MOD: Disallow editing replied posts// Appended new 'Edit Replied' option//-MOD: Disallow editing replied posts##-----[ FIND ]------------------------------------------------# 0 => array(##-----[ IN-LINE FIND ]----------------------------------------#),##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, AUTH_REG##-----[ FIND ]------------------------------------------------# 1 => array(##-----[ IN-LINE FIND ]----------------------------------------#),##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, AUTH_REG##-----[ FIND ]------------------------------------------------# 2 => array(##-----[ IN-LINE FIND ]----------------------------------------#),##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, AUTH_REG##-----[ FIND ]------------------------------------------------# 3 => array(##-----[ IN-LINE FIND ]----------------------------------------#),##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, AUTH_ACL##-----[ FIND ]------------------------------------------------# 4 => array(##-----[ IN-LINE FIND ]----------------------------------------#),##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, AUTH_ACL##-----[ FIND ]------------------------------------------------# 5 => array(##-----[ IN-LINE FIND ]----------------------------------------#),##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, AUTH_MOD##-----[ FIND ]------------------------------------------------# 6 => array(##-----[ IN-LINE FIND ]----------------------------------------#),##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, AUTH_MOD##-----[ FIND ]------------------------------------------------#$forum_auth_fields = array(##-----[ IN-LINE FIND ]----------------------------------------#);##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, 'auth_edit_replied'##-----[ FIND ]------------------------------------------------# 'auth_edit' => $lang['Edit'],##-----[ AFTER, ADD ]------------------------------------------# 'auth_edit_replied' => $lang['Edit_replied'],##-----[ OPEN ]------------------------------------------------#admin/admin_ug_auth.php##-----[ FIND ]------------------------------------------------#$forum_auth_fields = array(##-----[ IN-LINE FIND ]----------------------------------------#);##-----[ IN-LINE BEFORE, ADD ]---------------------------------#, 'auth_edit_replied'##-----[ FIND ]------------------------------------------------#$auth_field_match = array(## NOTE --- No other action takes place here, just skip to next FIND.##-----[ FIND ]------------------------------------------------#);##-----[ IN-LINE FIND ]----------------------------------------#);##-----[ IN-LINE REPLACE WITH ]--------------------------------#,##-----[ AFTER, ADD ]------------------------------------------#//+MOD: Disallow editing replied posts 'auth_edit_replied' => AUTH_EDIT_REPLIED);//-MOD: Disallow editing replied posts##-----[ FIND ]------------------------------------------------#']);##-----[ IN-LINE FIND ]----------------------------------------#);##-----[ IN-LINE REPLACE WITH ]--------------------------------#,##-----[ AFTER, ADD ]------------------------------------------#//+MOD: Disallow editing replied posts 'auth_edit_replied' => $lang['Edit_replied']);//-MOD: Disallow editing replied posts##-----[ FIND ]------------------------------------------------#SET auth_view = 0,WHERE##-----[ IN-LINE FIND ]----------------------------------------#, auth_edit = 0##-----[ IN-LINE AFTER, ADD ]----------------------------------#, auth_edit_replied = 0##-----[ FIND ]------------------------------------------------#SET auth_view = 0,WHERE##-----[ IN-LINE FIND ]----------------------------------------#, auth_edit = 0##-----[ IN-LINE AFTER, ADD ]----------------------------------#, auth_edit_replied = 0##-----[ OPEN ]------------------------------------------------#includes/auth.php##-----[ FIND ]------------------------------------------------#case AUTH_ALL:$a_sql = '##-----[ IN-LINE FIND ]----------------------------------------#, a.auth_edit##-----[ IN-LINE AFTER, ADD ]----------------------------------#, a.auth_edit_replied##-----[ FIND ]------------------------------------------------#$auth_fields = array(##-----[ IN-LINE FIND ]----------------------------------------#, 'auth_edit'##-----[ IN-LINE AFTER, ADD ]----------------------------------#, 'auth_edit_replied'##-----[ FIND ]------------------------------------------------# case AUTH_EDIT: $a_sql = 'a.auth_edit'; $auth_fields = array('auth_edit'); break;##-----[ AFTER, ADD ]------------------------------------------# case AUTH_EDIT_REPLIED: $a_sql = 'a.auth_edit_replied'; $auth_fields = array('auth_edit_replied'); break;##-----[ OPEN ]------------------------------------------------#includes/constants.php##-----[ FIND ]------------------------------------------------#define('AUTH_ATTACH', 11);##-----[ AFTER, ADD ]------------------------------------------#define('AUTH_EDIT_REPLIED', 99); // Change the number if it conflics with other AUTH definitions.##-----[ OPEN ]------------------------------------------------## NOTE --- Remember to do this for all installed languages#language/lang_english/lang_admin.php##-----[ FIND ]------------------------------------------------#$lang['Edit']##-----[ AFTER, ADD ]------------------------------------------#//+MOD: Disallow editing replied posts$lang['Edit_replied'] = "Edit Replied";//-MOD: Disallow editing replied posts##-----[ OPEN ]------------------------------------------------## NOTE --- Remember to do this for all installed languages#language/lang_english/lang_main.php##-----[ FIND ]------------------------------------------------#$lang['Sorry_auth_edit']##-----[ AFTER, ADD ]------------------------------------------#//+MOD: Disallow editing replied posts$lang['Sorry_auth_edit_replied'] = "Sorry, but only %s can edit replied posts in this forum."; //-MOD: Disallow editing replied posts##-----[ SAVE/CLOSE ALL FILES ]--------------------------------## EoM
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.