Disable Post Editing After X Hours

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
7
70%
Very Good
0
No votes
Good
2
20%
Fair
1
10%
Poor
0
No votes
 
Total votes: 10

rantbot
Registered User
Posts: 83
Joined: Sun May 07, 2006 1:37 pm

Re: Disable Post Editing After X Hours

Post by rantbot »

What is this?

#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config VALUES ('post_edit_time_limit', '4');
#
#-----[ OPEN ]-----------------------------------------------------------------

Is it something I have to add to the database?
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: Disable Post Editing After X Hours

Post by dellsystem »

rantbot wrote:What is this?

#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config VALUES ('post_edit_time_limit', '4');
#
#-----[ OPEN ]-----------------------------------------------------------------

Is it something I have to add to the database?
Yes, run that query in PHPMyAdmin or something similar.
Former moderator and website team member | My MODs, and more (GitHub)
rantbot
Registered User
Posts: 83
Joined: Sun May 07, 2006 1:37 pm

Re: Disable Post Editing After X Hours

Post by rantbot »

dellsystem wrote:Yes, run that query in PHPMyAdmin or something similar.
I have phpMyAdmin but haven't the slightest idea how to do this. Is there a discussion of this or a tutorial somewhere? There's a tutorial of sorts in the Mods in Development forum, but it's locked, the images are gone, and the links are dead, so not much help there.
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: Disable Post Editing After X Hours

Post by dellsystem »

rantbot wrote:
dellsystem wrote:Yes, run that query in PHPMyAdmin or something similar.
I have phpMyAdmin but haven't the slightest idea how to do this. Is there a discussion of this or a tutorial somewhere? There's a tutorial of sorts in the Mods in Development forum, but it's locked, the images are gone, and the links are dead, so not much help there.
In PhpMyAdmin click on your database so that you can see its tables, then in the left pane you should see 5 small images near the top of the pane - the middle one is a SQL Query button. Click it, copy and paste the query code into that box, and click run or whatever the button says (should be intuitive) :)
Former moderator and website team member | My MODs, and more (GitHub)
rantbot
Registered User
Posts: 83
Joined: Sun May 07, 2006 1:37 pm

Re: Disable Post Editing After X Hours

Post by rantbot »

I think I have this installed ... two problems though.

1. posters can't edit their posts at all - no edit icon shows up. Admin can edit. The edit and delete icons show up just fine when I'm logged in as the admin.

2. nothing new appeared on the General Admin > Configuration page. I was expecting something to allow me to set the editing time. Where should that be located on the page?

Obviously I did something wrong. Any hints as to which pages I messed up? I have some other mods installed which might be getting in the way. Particularly I have one which won't allow editing if a post has a reply. That was working properly before, and still seems to be working fine now.
User avatar
Tom C
Registered User
Posts: 23
Joined: Sun Jul 08, 2007 3:05 am
Location: Cleveland, OH (USA)

Re: Disable Post Editing After X Hours

Post by Tom C »

This MOD has installed correctly and is working except for my Moderators.

The Members CANNOT edit beyond the time limit (good!),
Admin CAN (good, also!),
but Moderators CANNOT (oops- this is not good!).

Permission in the forum are set at the Member/User level. Suggestions?

____________________________________________________________________________

Update: In order for a Moderator to edit a forum after the time has expired, the Moderator must be assigned to that forum: ACP > Permissions

(I'm also still trying to figure out how to add a Moderator User Level -- not part of this MOD).

Anyhow, two thumbs up for this MOD. Thank you
Image
User avatar
tarotamerica
Registered User
Posts: 230
Joined: Thu Feb 22, 2007 10:30 am
Contact:

Re: Disable Post Editing After X Hours

Post by tarotamerica »

Is there a way to make this work with the "Save Posts as Drafts" MOD?
Coincidences are God's way of remaining anonymous
—Albert Einstein
kyle1745
Registered User
Posts: 173
Joined: Thu Nov 14, 2002 2:21 am

Re: Disable Post Editing After X Hours

Post by kyle1745 »

It would be nice if this mod would offer a selection on which forums it applied to.
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: Disable Post Editing After X Hours

Post by dellsystem »

kyle1745 wrote:It would be nice if this mod would offer a selection on which forums it applied to.
I think that can be done with just a little coding on your part - for example, adding the red part in the line

if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $forum_id != 4 )

so that this MOD only applies to forums that are NOT forum_id = 4. If you want it to work so that it only applies in forum 4, take away the !.

That might be all the coding you have to do - try it out, see if it works :D
Former moderator and website team member | My MODs, and more (GitHub)
kyle1745
Registered User
Posts: 173
Joined: Thu Nov 14, 2002 2:21 am

Re: Disable Post Editing After X Hours

Post by kyle1745 »

Interesting, but what if you wanted to not apply or apply to more than one? For example on my site I would like it to apply to everything but 3 forums.
kyle1745
Registered User
Posts: 173
Joined: Thu Nov 14, 2002 2:21 am

Re: Disable Post Editing After X Hours

Post by kyle1745 »

I tested this on my test site and its not enough. As the user can still not see the "edit" button. I would guess something would also need changed in viewtopic.php.
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: Disable Post Editing After X Hours

Post by dellsystem »

kyle1745 wrote:I tested this on my test site and its not enough. As the user can still not see the "edit" button. I would guess something would also need changed in viewtopic.php.
You're right - try this: (posting.php)

if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $forum_id = 4 || 5 || 6 )

and this: (viewtopic.php)

if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] && ( !$edit_time_expired || $forum_id = 4 || 5 || 6 ) ) || $is_auth['auth_mod'] )

Of course make backups first :D Let me know how it works.
Former moderator and website team member | My MODs, and more (GitHub)
kyle1745
Registered User
Posts: 173
Joined: Thu Nov 14, 2002 2:21 am

Re: Disable Post Editing After X Hours

Post by kyle1745 »

Here is what I tried just for testing sake and was able to get the edit button back, but I get the following message when trying to use it.
Sorry, but you can only edit your posts for 1 hours.

Click Here to return to the topic
posting.php line:

Code: Select all

if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $form_id != 10 )
viewtopic.php line:

Code: Select all

if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] && (!$edit_time_expired || $forum_id = 10 )) || $is_auth['auth_mod'] )
User avatar
tarotamerica
Registered User
Posts: 230
Joined: Thu Feb 22, 2007 10:30 am
Contact:

Re: Disable Post Editing After X Hours

Post by tarotamerica »

This is much better. The boxes looked funny with no edit button.
Coincidences are God's way of remaining anonymous
—Albert Einstein
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: Disable Post Editing After X Hours

Post by dellsystem »

kyle1745 wrote:

Code: Select all

if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $form_id != 10 )
viewtopic.php line:

Code: Select all

if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] && (!$edit_time_expired || $forum_id = 10 )) || $is_auth['auth_mod'] )
You forgot a u in

Code: Select all

if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $form_id != 10 )
- it should say $forum_id != 10 || 11 || 17 (so 10, 11, and 17 are exempt from this)
Former moderator and website team member | My MODs, and more (GitHub)
Post Reply

Return to “[2.0.x] MOD Database Releases”