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

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28162
Joined: Sat Aug 16, 2003 7:36 am

Disable Post Editing After X Hours

Post by Extensions Robot »

MOD Name: Disable Post Editing After X Hours
Author: Throckmorton
MOD Description: Allows you to set a time limit for how long users may edit their posts.
Configurable in General Admin -> Configuration
Administrators and moderators can still edit all posts.


MOD Version: 1.1.1 (Updated 08/04/06)

Download File: Disable Post Editing After X Hours v1.1.1.zip
mods overview page: View
File Size: 3673 Bytes

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:29 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
webmacster87
Former Team Member
Posts: 3758
Joined: Fri Jun 11, 2004 2:30 am
Location: San Mateo, CA
Name: Douglas Bell
Contact:

Post by webmacster87 »

MOD Validated/Released

Notes:
As stated above, lets an admin set a maximum amount of time a user has to edit their post. After that time is up, the user may no longer edit their post.

Tudorius
Registered User
Posts: 7
Joined: Fri Jun 16, 2006 1:06 pm

Post by Tudorius »

Great mod, but i have one problem: it won't work. Installed it on a (upgraded, with only the changed files) 2.021 version of phpbb2 and users can still edit posts after four hours.

Do i also have to edit the tpl files for each template i use? (i did, but ask it anyway)
Do it work well with other mods? I installed this Mods: reg ip 1.0.0 (works great), Easy BotStopper (working fine) and I edited/modded emailer.php because the board had some problems with sending notifications, had something to do with Godaddy.com. So everything works fine: except this mod. I followed every step (by hand) in the mod file, no errors etc.

How many control options for this mod are there in cp, cause i only see one. Is that correct? Cause from the moment of the virgin install of phpbb2 (2.0.19) i was allready missing some discription lines in cp (probably something to do with the template/language files, i'm working on that) so now i'm not sure about how many control options this mod has. Maybe one is missing, like the others. (Hope you understand what i'm trying to explain. My English is not that good.)

Is there somebody out there who installed this mod and actually get it working? (Or not) It would be nice to know.

Greetz,

Tudorius.

edit: the template the board uses is a (bit modded) version of lifecod.

wvccboy
Registered User
Posts: 33
Joined: Tue Feb 21, 2006 3:40 pm
Location: Narnia
Contact:

Post by wvccboy »

Looks like the TPL files also have to be edited, if we aren't using SubSilver then?
JourneyToNarnia.com Founder
http://www.acneforums.net

Tudorius
Registered User
Posts: 7
Joined: Fri Jun 16, 2006 1:06 pm

Post by Tudorius »

Dunno, thats why i asked it. Subsilver is in the correct dir and i edited it just like the mod said. But I also edited the tpl's from the template the bord uses now, in stead of subsilver, and my question now is: was i right by doing that or was it a unnesecerry thing to do? How come the mod won't work?

Greetz,

Tudorius.

User avatar
Saeru
Registered User
Posts: 622
Joined: Sun Feb 19, 2006 5:44 am
Location: Under a pile of PHP code.
Contact:

Post by Saeru »

when template (.tpl) files are involved, even though it says subSilver in the mod, thats just to lead you to what template files you edit.
You do the changes to -all- templates your forum is running, just as you did subSilver.

You also don't need to keep subSilver on your board to make it work (if you don't use it). so long as one template is installed.. it's all fine.
"Naku ga yousuru ichidanto tsuyosa kyaku ga icchuu wo yusuru."[/size]

Tudorius
Registered User
Posts: 7
Joined: Fri Jun 16, 2006 1:06 pm

Post by Tudorius »

Ok, thanks Saeru. I thought subsilver was still needed if one uses another template. But still have the prob that this mod simply wont work. And i did everything i should do, just like the mod file said. So what can be the problem?

Anyone?

Greetz,

Tudorius.

ps:
I wrote: How many control options for this mod are there in cp, cause i only see one. Is that correct?

No need to answer this part of my question no more. I forgot that I can figure that one out by simply looking at the sourcecode. But thanx anyway.

Throckmorton
Registered User
Posts: 364
Joined: Tue Oct 07, 2003 7:07 pm
Location: Naperville, IL

Post by Throckmorton »

If you have added the database field 'post_edit_time_limit' correctly and made the edit to viewtopic.php, the mod will work. The other three file edits, admin_board.php, lang_admin.php and board_config_body.tpl are what gives you the ability to change the time, but aren't strictly necessary for the edit-time-out feature to work.

When you go to your ACP now, do you see the default value set to "4"?
-Lance

Come visit The Illuminati-R-Us Forums for all your debunking needs.

I was touched by His Noodly Appendage

Tudorius
Registered User
Posts: 7
Joined: Fri Jun 16, 2006 1:06 pm

Post by Tudorius »

You may slap me in the face if you want: i forgot to upload viewtopic.php. There was no backup in the dir so it must slipped my mind. :oops:

So uploaded it, and now it works! Thanx for your help. :)

Throckmorton
Registered User
Posts: 364
Joined: Tue Oct 07, 2003 7:07 pm
Location: Naperville, IL

Post by Throckmorton »

Yeah, that would do it. Glad you got it working.
-Lance

Come visit The Illuminati-R-Us Forums for all your debunking needs.

I was touched by His Noodly Appendage

User avatar
irene_haydon
Registered User
Posts: 210
Joined: Sat Apr 15, 2006 3:37 pm

Post by irene_haydon »

Can this be used selectively, I mean Time limit "on" for some part of the forum and "off" for other parts of the forum?

Thanks,
Irene

Throckmorton
Registered User
Posts: 364
Joined: Tue Oct 07, 2003 7:07 pm
Location: Naperville, IL

Post by Throckmorton »

irene_haydon wrote: Can this be used selectively, I mean Time limit "on" for some part of the forum and "off" for other parts of the forum?

Thanks,
Irene

No, it can't. Sorry.

Moderators and administrators can still edit anyone's post though.
-Lance

Come visit The Illuminati-R-Us Forums for all your debunking needs.

I was touched by His Noodly Appendage

Caution50
Registered User
Posts: 2
Joined: Wed Jun 07, 2006 1:01 pm

Post by Caution50 »

There is a problem with this mod:
Users can't see the edit button if the time is over...
But if they manipulate the variables in the URL they are still able to edit their posts...

Throckmorton
Registered User
Posts: 364
Joined: Tue Oct 07, 2003 7:07 pm
Location: Naperville, IL

Post by Throckmorton »

Caution50 wrote: There is a problem with this mod:
Users can't see the edit button if the time is over...
But if they manipulate the variables in the URL they are still able to edit their posts...

Did you actually have a user do this, or did you just find it on your own?

Here is an upgrade to v1.1.1, which resolves the problem:

Code: Select all

############################################################################### 
## MOD Title: Disable Post Editing After X Hours
## MOD Author: Throckmorton < n/a > (n/a) n/a
## MOD Description: Allows you to set a time limit for how long users may edit their posts.
##                  Configurable in General Admin -> Configuration
##                  Administrators and moderators can still edit all posts.
##
## MOD Version: 1.1.1
##
## Installation Level: Easy
## Installation Time: 3 Minutes
##
## Files To Edit: posting.php
##                language/lang_english/lang_main.php
##
## Included Files: n/a
##                 
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
###############################################################################
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/ 
###############################################################################
## Author Notes: This mod is compatible with EasyMOD.
##
##               This is the update to v1.1.1 only.  It requires v1.0.0 already
##               installed.
##
##############################################################################
## MOD History:
##               
## 2006-07-10 - Version 1.1.1
##            - Fixed bug that prevented admins and moderators from editing posts
##              introduced in v1.1.0
##
## 2006-07-09 - Version 1.1.0
##            - Added check in posting.php to prevent users from editing posts
##              by manipulating URLs
##
## 2006-05-22 - Version 1.0.0
##            - Initial Release 
##
###############################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
###############################################################################
#
#-----[ OPEN ]-----------------------------------------------------------------
# 
posting.php
# 
#-----[ FIND ]-----------------------------------------------------------------
#
		$sql = "SELECT f.*, t.topic_id, t.topic_status, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, t.topic_vote, p.post_id, p.poster_id
# 
#-----[ IN-LINE FIND ]-----------------------------------------------------------------
# 
, p.poster_id
# 
#-----[ IN-LINE AFTER, ADD ]-----------------------------------------------------------------
# 
, p.post_time
# 
#-----[ FIND ]-----------------------------------------------------------------
#
	if ( $mode == 'editpost' || $mode == 'delete' || $mode == 'poll_delete' )
# 
#-----[ BEFORE, ADD ]-----------------------------------------------------------------
#
	if ( $mode == 'editpost' && !$is_auth['auth_mod'] )
	{
		$edit_time_expired = ( time() - $post_info['post_time'] < $board_config['post_edit_time_limit'] * 3600 ) ? false : true;
		$edit_time_expired = ( $board_config['post_edit_time_limit'] == -1 ) ? false : $edit_time_expired;		

		if ( $edit_time_expired ) 
		{ 
			$topic_id = $post_info['topic_id'];
			$message = sprintf($lang['Edit_own_posts_expired'], $board_config['post_edit_time_limit'] );
			$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');

			message_die(GENERAL_MESSAGE, $message);
		}
	}

#
#-----[ OPEN ]-----------------------------------------------------------------
# 
language/lang_english/lang_main.php
#
#-----[ FIND ]-----------------------------------------------------------------
# 
$lang['Edit_own_posts'] = 'Sorry, but you can only edit your own posts.';
# 
#-----[ AFTER, ADD ]-----------------------------------------------------------------
#
$lang['Edit_own_posts_expired'] = 'Sorry, but you can only edit your posts for %s hours.';
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------------ 
# 
# EoM
-Lance

Come visit The Illuminati-R-Us Forums for all your debunking needs.

I was touched by His Noodly Appendage

Caution50
Registered User
Posts: 2
Joined: Wed Jun 07, 2006 1:01 pm

Post by Caution50 »

I found it on my own...
thanks for the fix... :)

Post Reply

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