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.
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.
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.
nice tips.very good post. thanks for sharing
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.