News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[TIP/TRICK] Unlimited Edit Time For A Single Group

Started by [SiNaN], August 23, 2008, 12:23:53 PM

Previous topic - Next topic

[SiNaN]

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.
Former SMF Core Developer | My Mods | SimplePortal

SpyDie

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.
Beta. Software undergoes beta testing shortly before it's released. Beta is Latin for 'still doesn't work.'

[SiNaN]

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.
Former SMF Core Developer | My Mods | SimplePortal

mushroom-eater


RML

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.

Advertisement: