Post Edit Time Limit

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
EsrarliKapi
Registered User
Posts: 29
Joined: Thu Jul 03, 2008 12:16 pm
Location: Ankara
Contact:

Post Edit Time Limit

Post by EsrarliKapi » Sat Aug 23, 2008 10:08 pm

Version of phpBB3: 3.0.1
Was this a fresh install or a(n) update/upgrade/conversion (please be specific)? Conversion from a nukebb port.
Did you use an automated wizard provided by your host to install phpBB? No.
MODs you have installed: Don't have any mods.
Your level of expertise (be honest): Quite experienced in coding, but a newbie in phpBB.

If we come to my problem; In my forum, I have 30 minutes of time limit for editing posts. But as you all know, that's a global setting. What I want is, to give members unlimited post edit time for only one board. Means in just one board, I don't want users to have time limit for editing their posts.

I know that is possible, but I have no idea how can I do that in phpBB.
[Ultimate Simplicity]

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50512
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Post Edit Time Limit

Post by stevemaury » Sat Aug 23, 2008 10:25 pm

Cannot be done without a MOD. Try posting in MOD Requests.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Post Edit Time Limit

Post by mtrs » Sat Aug 23, 2008 10:32 pm

Alternatively you can set unlimited edit time permission, but install Prime Post Revisions mod. Then, if need be, you can track any edited post afterwards, and restore the original unedited post and lock post.
Edit:
stevemaury wrote:Cannot be done without a MOD. Try posting in MOD Requests.
There is already [DEV] Limited Edit Time mod topic, but no download link yet..
I abandoned all of my mods.

User avatar
EsrarliKapi
Registered User
Posts: 29
Joined: Thu Jul 03, 2008 12:16 pm
Location: Ankara
Contact:

Re: Post Edit Time Limit

Post by EsrarliKapi » Sat Aug 23, 2008 10:43 pm

As it was just a one-board stuff, I thought that it could be made with a few changes. Anyway, thanks for the input. I'll bump that topic and try to figure it out myself until the release.
[Ultimate Simplicity]

User avatar
EsrarliKapi
Registered User
Posts: 29
Joined: Thu Jul 03, 2008 12:16 pm
Location: Ankara
Contact:

Re: Post Edit Time Limit

Post by EsrarliKapi » Sat Aug 23, 2008 11:19 pm

Okay, I figured out it myself. To whom it may help:

../viewtopic.php

Find:

Code: Select all

!$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id))
Replace:

Code: Select all

!$config['edit_time'] || $forum_id == 'ID_FORUM')) || $auth->acl_get('m_edit', $forum_id))
../posting.php

Find:

Code: Select all

	if (!($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time']))
Replace:

Code: Select all

	if (!($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'] || $forum_id == 'ID_FORUM'))
Replace 'ID_FORUM' as the ID of the forum that you want to give unlimited edit post time limit.
[Ultimate Simplicity]

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50512
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Post Edit Time Limit

Post by stevemaury » Sat Aug 23, 2008 11:22 pm

Yes, very nice, but as i said, that is a MOD. Glad you could do it yourself.

Also, hardcoding the forum ID may not be the best way to do it, but if it works, great.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
EsrarliKapi
Registered User
Posts: 29
Joined: Thu Jul 03, 2008 12:16 pm
Location: Ankara
Contact:

Re: Post Edit Time Limit

Post by EsrarliKapi » Sat Aug 23, 2008 11:32 pm

I know harcoding is not a good way but as it is specific a use, I don't mind it. That mod will take so long to be released.

Yeah, it works perfect. Also you can use in_array() to do the same for multiple boards. Like:

Code: Select all

in_array($forum_id, array(1,2,3,4,5,6))
I'd have liked to code some fancy mods for phpBB too, but unfrotunately I don't have enough time.

Thanks for the help anyway.
[Ultimate Simplicity]

User avatar
3Di
Former Team Member
Posts: 13792
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Post Edit Time Limit

Post by 3Di » Sun Aug 24, 2008 12:50 am

mtrs wrote:There is already [DEV] Limited Edit Time mod topic, but no download link yet..
Yes, and ofcourse it will be very exhaustive about that..
MOD Desription wrote:Limits the time in minutes (precision though it is seconds) users can edit their posts. Per user basis.

Forums can also have as per default the same kind of time limit while creating new or updating old ones. Per forum basis.

You can use both restrictions, or one of those or none (just set to ZERO the values, they are already set to ZERO though). Restriction doesn't apply to Moderators neither to Admin. The check is done just on Editing, not Submitting posts.

This MOD will work along to the standard Olympus feature, hopefully. (Global 'limit for editing posts')
Regards.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Post Edit Time Limit

Post by mtrs » Fri Oct 03, 2008 8:55 pm

EsrarliKapi wrote:If we come to my problem; In my forum, I have 30 minutes of time limit for editing posts. But as you all know, that's a global setting. What I want is, to give members unlimited post edit time for only one board. Means in just one board, I don't want users to have time limit for editing their posts.
I made a new forum permission mod to override the edit time limit. Say it is 30 minutes, you can give permission to users or groups, thus they can have unlimited edit time limit in those forums.
http://www.phpbb.com/community/viewtopic.php?t=1346435

Edit: Mod validated to Moddb
Last edited by mtrs on Thu Jun 25, 2009 12:57 pm, edited 1 time in total.
I abandoned all of my mods.

dennist
Registered User
Posts: 8
Joined: Tue Nov 11, 2008 6:44 pm

Re: Post Edit Time Limit

Post by dennist » Thu Jun 25, 2009 12:43 pm

EsrarliKapi wrote: Yeah, it works perfect. Also you can use in_array() to do the same for multiple boards. Like:

Code: Select all

in_array($forum_id, array(1,2,3,4,5,6))
I have some problems to use it with multiple boards.

I´m using "in_array($forum_id, array(5,6))" instead of "$forum_id == '5'))"

in viewtopic.php and posting.php but get a php-error.
Can somebody help me?

dennist
Registered User
Posts: 8
Joined: Tue Nov 11, 2008 6:44 pm

Re: Post Edit Time Limit

Post by dennist » Thu Jun 25, 2009 5:52 pm

That is the php-error:

Code: Select all

Parse error: syntax error, unexpected ',' in /www/htdocs/.../viewtopic.php on line 1457

User avatar
EsrarliKapi
Registered User
Posts: 29
Joined: Thu Jul 03, 2008 12:16 pm
Location: Ankara
Contact:

Re: Post Edit Time Limit

Post by EsrarliKapi » Mon Jul 20, 2009 12:31 pm

If codes look like this:

Code: Select all

!$config['edit_time'] || in_array($forum_id, array(5,6)))) || $auth->acl_get('m_edit', $forum_id))
and this:

Code: Select all

if (!($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'] || in_array($forum_id, array(5,6))))
It should work fine.
[Ultimate Simplicity]

Locked

Return to “[3.0.x] Support Forum”