Advertisement:

Navigation

SMF Mod Site

Mod Name:
Admin Lock Thread
Created By:
bananas21ca
Type:
Administrative
First Created:
December 23, 2007, 01:48:53 PM
Last Modified:
December 28, 2007, 08:26:38 PM
Latest Version:
1.2
Compatible With:
1.1.4
Total Downloads:
5475

Download this mod

Admin Lock Thread v1.2.zip (4kB) [5407]
Manual Install Instructions for SMF

Description:



Admin Lock Thread v1.1

By Bananas21ca







Description

Locks threads from posting by anyone who is not an admin. This Includes Global Moderators.
Great way to prevent moderators from unlocking topics you don't want reopened.



Installation

Simply install the package to install this modification on the Default theme.


You will have to manually edit if you have a custom theme.


To add this mod to a custom theme, open the Display.template.php file for your theme and search for:
Code: [Select]
$mod_buttons = array(
'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),

'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),

'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),

'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),

'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),

'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start']),

'calendar' => array('test' => 'calendar_post', 'text' => 'calendar37', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),

);

And add:
Code: [Select]
'adminlock' => array('test' => 'can_alock', 'text' => empty($context['is_alocked']) ? 'smf281' : 'smf282', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=alock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
Like so:
Code: [Select]
$mod_buttons = array(
               'adminlock' => array('test' => 'can_alock', 'text' => empty($context['is_alocked']) ? 'smf281' : 'smf282', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=alock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),

                'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),

'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),

'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),

'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),

'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),

'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start']),

'calendar' => array('test' => 'calendar_post', 'text' => 'calendar37', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),

);

How Do I Use This Mod?

After the mod is installed a new button will be available on the Moderator Control Panel at the bottom of every thread.
Simply click "Admin Lock" and the thread will be locked to admins only


Changelog

1.0

o Initial release

1.1

o Embedded Admin Lock function inside LockTopic.php

1.2

o Bug: Fixed "Undefined index: is_alocked" Errors in Subs.php