Advertisement:

Author Topic: [TIP/TRICK] Unlimited Edit Time For A Single Group  (Read 17781 times)

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
[TIP/TRICK] Unlimited Edit Time For A Single Group
« on: August 23, 2008, 12:23:53 PM »
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:

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

Code: [Select]
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:

Code: [Select]
'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:

Code: [Select]
'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:

Code: [Select]
global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments;
Replace:

Code: [Select]
global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $user_info;
Change the 'ID_GROUP' in the code as the ID of the group.
« Last Edit: August 25, 2008, 12:03:41 PM by [SiNaN] »
Former SMF Core Developer | My Mods | SimplePortal

Offline SpyDie

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
    • The LandzDown Forum
Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
« Reply #1 on: August 24, 2008, 10:18:33 AM »
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.'

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
« Reply #2 on: August 25, 2008, 12:03:26 PM »
Seems like I missed the global.

Display.php

Find:

Code: [Select]
   global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $board;
Replace:

Code: [Select]
   global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $user_info;
Fixed the first post too.
Former SMF Core Developer | My Mods | SimplePortal

Offline mushroom-eater

  • Newbie
  • *
  • Posts: 3
Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
« Reply #3 on: November 22, 2008, 07:48:08 AM »
nice tips.very good post. thanks for sharing

Offline RML

  • Semi-Newbie
  • *
  • Posts: 37
Re: [TIP/TRICK] Unlimited Edit Time For A Single Group
« Reply #4 on: March 18, 2010, 02:48:07 PM »
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.