Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: [SiNaN] in August 23, 2008, 12:23:53 NACHMITTAGS

Titel: [TIP/TRICK] Unlimited Edit Time For A Single Group
Beitrag von: [SiNaN] in August 23, 2008, 12:23:53 NACHMITTAGS
Question: How can I set an unlimited edit time for a single membergroup?
Original Topic: http://www.simplemachines.org/community/index.php?topic=244332.0

Post.php

We have 3.

Find:

if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time())
Replace:

if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time() && !in_array('ID_GROUP', $user_info['groups']))

Display.php

Find:

'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time()))),

Replace:

'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || in_array('ID_GROUP', $user_info['groups']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time()))),

Find:

global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments;

Replace:

global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $user_info;

Change the 'ID_GROUP' in the code as the ID of the group.
Titel: Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
Beitrag von: SpyDie in August 24, 2008, 10:18:33 VORMITTAG
Has it worked for you, on a test board?

Tried here with both my test board (local) and my live website, it doesn't work.

ID_GROUP is 12, so all I changed was entering 12 into the code.
Titel: Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
Beitrag von: [SiNaN] in August 25, 2008, 12:03:26 NACHMITTAGS
Seems like I missed the global.

Display.php

Find:

   global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $board;

Replace:

   global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $user_info;

Fixed the first post too.
Titel: Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
Beitrag von: mushroom-eater in November 22, 2008, 07:48:08 VORMITTAG
nice tips.very good post. thanks for sharing
Titel: Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
Beitrag von: RML in März 18, 2010, 02:48:07 NACHMITTAGS
Hello SiNaN,

It would be a very useful for my board. Could you please make it work with the latest version (2.0 RC3) of SMF?

Thanks in advance.