Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: [SiNaN] on August 23, 2008, 12:16:43 PM

Title: [TIP/TRICK] Unlimited Edit Time For A Single Board
Post by: [SiNaN] on August 23, 2008, 12:16:43 PM
Question: How can I set an unlimited edit time for a single board?
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() && $board != 'ID_BOARD')

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']) || $board == 'ID_BOARD' || $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, $board;

Change the 'ID_BOARD' in the code as the ID of the board.