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

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 »

dellsystem wrote:
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)
I don't think you need all this. kyle just added to the existing MOD (or code present before the MOD).

What he provides does the trick all on its own:
kyle1745 wrote: 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'] )
If it doesn't work for you, it may be another MOD interfering or that makes yours necessary?
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 »

dellsystem,
Thanks I think I was just going to fast and missed the "U". So far I think it is working and am working on some more testing before moving it to production.

tarotamerica,
I am not sure I understand what you say I do not need. I have added the 2 updates that dellsystem requested and missed a letter. I think it is working now. Are you saying that it can be done with less?

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 »

I'm not sure now, but I think I am copying/pasting code that you may have edited as per dell's request. This is a copy of the code from my posting.php & viewtopic.php that works fine:

Code: Select all

 *                               posting.php    
#  
             if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $form_id != 10 )
      {
      $edit_time_expired = ( time() - $post_info['post_time'] < $board_config['post_edit_time_limit'] * 3600 ) ? false : true;
#

Code: Select all

        
 *                               viewtopic.php
#
              if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] && (!$edit_time_expired || $forum_id = 10 )) || $is_auth['auth_mod'] )
# 
What "u" are you guys talking about?
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 »

you have it in your example:
$form_id != 10
the U in forum.

In my case it did not work without adding that.

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 »

Damn my failing eyesight!

Btw, I can see now what dell & you are talking about the forum IDs, 1 || 2 || 3 || etc. Will have to go add it as a failsafe.
Coincidences are God's way of remaining anonymous
—Albert Einstein

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 »

kyle1745 wrote:you have it in your example:
$form_id != 10
the U in forum.

In my case it did not work without adding that.
Odd, I did not have the "u" & it worked anyway...

~tarot
Last edited by tarotamerica on Fri Aug 10, 2007 1:28 pm, edited 2 times in total.
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 may show the button but can you actually click it and edit something?

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 »

kyle1745 wrote:It may show the button but can you actually click it and edit something?
I see now this is to be added for exemptions to Forums in which you do not want the edit button returned... I didn't want exemptions & therefore not looking for them. :oops:
dellsystem wrote:
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 !.
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 »

Ok in testing it is not completely working. It does seem to allow for editing in that section but adds the edit button back to all sections.

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:Ok in testing it is not completely working. It does seem to allow for editing in that section but adds the edit button back to all sections.
Even after 1 hour? Can you paste the related viewtopic.php code here?
Former moderator and website team member | My MODs, and more (GitHub)

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 »

Something comes up that I cannot pinpoint.

When a moderator tries to edit the first post in a topic (in the forum they are moderating) there is a blank information screen that disallows access:

Image

I am unsure what is causing this.
Coincidences are God's way of remaining anonymous
—Albert Einstein

BWOL
Registered User
Posts: 17
Joined: Wed Apr 05, 2006 9:31 pm

Re: Disable Post Editing After X Hours

Post by BWOL »

I used easy mod to load this onto the board. It is working, but I do not see where to change the time limit in the configuration section of the admin panel. I have looked many times.

As set now, it won't allow any editting. Just gives the error without a specifc # of hours.

Please help! Thank you!

napobo3
Registered User
Posts: 14
Joined: Wed Nov 21, 2007 9:51 pm

Re:

Post by napobo3 »

Will it work for phpBB 3.0 ?

thanks!

User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: Re:

Post by dellsystem »

napobo3 wrote:Will it work for phpBB 3.0 ?

thanks!
No.
You can post a request in the 3.0 MOD Requests forum :)
Former moderator and website team member | My MODs, and more (GitHub)

AllenMcB
Registered User
Posts: 20
Joined: Tue Apr 18, 2006 5:37 pm

Re: Disable Post Editing After X Hours

Post by AllenMcB »

Will this mod work on phpbb 2.0.22 (bbtonuke)?

Post Reply

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