Page 1 of 4

Only Admin Edit Post

Posted: Sun Jun 21, 2009 2:11 pm
by Extensions Robot
Modification name: Only Admin Edit Post
Author: RMcGirr83
Modification description: Makes it so that only an Administrator that made a post can edit/delete his/her own post. Active for as long as the user is Administrator or has any Administrative Permission. Does not allow a Moderator to edit an Administrator's post. Other Administrator's can still edit posts which will be logged in the ACP.

In the attached pic RMcGirr83 is the administrator and this is being viewed from a Global Moderator account.

Custom support is given at this forum
Modification version: 1.0.5
Tested on phpBB version: 3.0.11

Download file: only_admin_edit_post_1_0_5.zip
File size: 43.89 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extensions Team may not be able to provide support.

-->Modification support<--

Only Admin Edit Post

Posted: Sun Jun 21, 2009 2:11 pm
by DavidIQ
Modification validated/released

Notes:

Only Admin Edit Post

Posted: Sun Jun 21, 2009 2:11 pm
by RMcGirr83
Thank you David and validation team.

Re: Only Admin Edit Post

Posted: Sun Jun 21, 2009 9:19 pm
by A_O_C
Rich,

Any changes from the package I tested? ;) :D

Re: Only Admin Edit Post

Posted: Mon Jun 22, 2009 10:01 am
by RMcGirr83
Don't believe so and thanks for being the guinea pig!! :D

Re: Only Admin Edit Post

Posted: Thu Jul 02, 2009 2:19 pm
by Richazey
Cool mod, installed fine, thanks

Re: Only Admin Edit Post

Posted: Mon Jul 06, 2009 6:28 pm
by Gadget27
Cool mod very easy to install. Thanks

But Is it possible to enable the founder to edit all the posts admin :?:

Many thanks to your answer ;)

Re: Only Admin Edit Post

Posted: Tue Jul 07, 2009 10:27 am
by RMcGirr83
Gadget27 wrote:But Is it possible to enable the founder to edit all the posts admin :?:
OPEN

posting.php

FIND

Code: Select all

if ($is_authed && ($mode == 'edit' || $mode == 'delete') && (in_array($post_data['poster_id'], $admin_only_arry) && $user->data['user_id'] != $post_data['poster_id']))
REPLACE WITH

Code: Select all

if ($is_authed && ($mode == 'edit' || $mode == 'delete') && (in_array($post_data['poster_id'], $admin_only_arry) && $user->data['user_id'] != $post_data['poster_id']) && !$user->data['user_type'] == USER_FOUNDER)
OPEN

viewtopic.php

FIND

Code: Select all

'U_EDIT'			=> (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || ($auth->acl_get('m_edit', $forum_id) && !in_array($poster_id, $admin_only_arry) || $user->data['user_id'] == $poster_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : ''),
REPLACE WITH

Code: Select all

'U_EDIT'			=> (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || ($auth->acl_get('m_edit', $forum_id) && !in_array($poster_id, $admin_only_arry) || $user->data['user_id'] == $poster_id) || $user->data['user_type'] == USER_FOUNDER) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : ''),
FIND

Code: Select all

'U_DELETE'			=> (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || ($auth->acl_get('m_delete', $forum_id) && !in_array($poster_id, $admin_only_arry) || $user->data['user_id'] == $poster_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : ''),
REPLACE WITH

Code: Select all

'U_DELETE'			=> (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || ($auth->acl_get('m_delete', $forum_id) && !in_array($poster_id, $admin_only_arry) || $user->data['user_id'] == $poster_id) || $user->data['user_type'] == USER_FOUNDER) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : ''),

Re: Only Admin Edit Post

Posted: Tue Jul 07, 2009 12:23 pm
by Gadget27
That's good. Many Thanks RMcGirr83 ;)

Re: Only Admin Edit Post

Posted: Sat Sep 12, 2009 3:31 pm
by Jarex
Hi. I am trying to find out why it does not work for me. I installed as stated but when testing Moderator's rights can still edit Admin's posts. Does it depend on leaders group settings?

Re: Only Admin Edit Post

Posted: Sat Sep 12, 2009 3:51 pm
by RMcGirr83
No it does not....just if the user editing is an Administrator or not.

Re: Only Admin Edit Post

Posted: Sat Sep 12, 2009 4:04 pm
by Jarex
It means this mod does not aply for Moderators editing Admins posts, am I right?

Re: Only Admin Edit Post

Posted: Sat Sep 12, 2009 4:25 pm
by RMcGirr83
Jarex wrote:It means this mod does not aply for Moderators editing Admins posts, am I right?
It means that only the Admin user that made the post can edit their own post. Moderators can not and other Admins can not edit that Admin's post.

Re: Only Admin Edit Post

Posted: Sat Sep 12, 2009 4:36 pm
by Jarex
Ok, so why It does not work for me? I am an Admin and do not want to have my posts to be edited by Mods. When testing Mods rights still can do that.

Re: Only Admin Edit Post

Posted: Sat Sep 12, 2009 4:45 pm
by RMcGirr83
Jarex wrote:When testing Mods rights still can do that.
I am assuming you are testing by clicking on the link that allows an Admin to assume anothers permissions? I'm not sure how that works but I would sign up another user, change that users permissions to global moderator (make the new user hidden). Then log in as that user and try to edit one of your admin posts.

If it isn't working, then you need to double check the edits the mod has you do as you have installed it incorrectly.

The mod simply disallows anyone but the original Admin user from editing that Admin users post. Once the Admin user loses their permissions as an Admin, then anyone properly authorized to edit posts can edit that users posts.