Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: bananas21ca on December 26, 2007, 06:14:15 PM

Title: Admin Lock Thread
Post by: bananas21ca on December 26, 2007, 06:14:15 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1042)




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:
$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:
'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:
$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
Title: Re: Admin Lock Thread
Post by: CiOooo on December 27, 2007, 08:40:21 AM
tnx for mod. ;)
Title: Re: Admin Lock Thread
Post by: Apllicmz on December 27, 2007, 10:55:32 AM
Nice work man...
i like that mod
Title: Re: Admin Lock Thread
Post by: Shadow03 on December 27, 2007, 05:48:17 PM
Nice job! I'm impressed. This should help prevent staff members from spamming.
Title: Re: Admin Lock Thread
Post by: bananas21ca on December 28, 2007, 12:00:46 AM
The next version im working on will prevent Moderators from Editing, Moving, Merging, deleting or any other feeble attempts to get around the Admin Lock.

Also if anyone wants to come up with a better looking GIF for the Admin Lock feel free to. I'll give you full credit if I use it in the mod. Im not much of an artist myself :P

Anyway,
Thanks for the Support guys, I really appreciate it ;)
Title: Re: Admin Lock Thread
Post by: edi67 on December 28, 2007, 09:36:10 AM
nice one
Title: Re: Admin Lock Thread
Post by: edi67 on December 28, 2007, 01:39:31 PM
everything is ok but why a lot of these errors:

8: Undefined index: is_alocked
File: /home2/crazyzonews/www/Sources/Subs.php
Linea: 3340
Title: Re: Admin Lock Thread
Post by: karlbenson on December 28, 2007, 02:47:50 PM
edi67 try
Open subs.php

FIND
if ($topic_context['is_alocked'])
      $topic_context['class'] = 'alocked';

REPLACE
if (!empty($topic_context['is_alocked']))
      $topic_context['class'] = 'alocked';
Title: Re: Admin Lock Thread
Post by: edi67 on December 28, 2007, 04:25:23 PM
Quote from: karlbenson on December 28, 2007, 02:47:50 PM
edi67 try
Open subs.php

FIND
if ($topic_context['is_alocked'])
      $topic_context['class'] = 'alocked';

REPLACE
if (!empty($topic_context['is_alocked']))
      $topic_context['class'] = 'alocked';

thx for your help Karl i will do
Title: Re: Admin Lock Thread
Post by: bananas21ca on December 28, 2007, 04:50:16 PM
Quote from: edi67 on December 28, 2007, 01:39:31 PM
everything is ok but why a lot of these errors:

8: Undefined index: is_alocked
File: /home2/crazyzonews/www/Sources/Subs.php
Linea: 3340


oops! I'll have to fix that.
Thanks for the fix Karl
Title: Re: Admin Lock Thread
Post by: bananas21ca on December 28, 2007, 05:23:33 PM
I just posted the updated package.
I hope thats all the bugs..... :-\
Title: Re: Admin Lock Thread
Post by: karlbenson on December 28, 2007, 05:34:01 PM
Bananas.

In another topic there was an issue that this mod wouldn't go through a Package Parser because you've structured the mod inside a folder

Package (inside it)
->Folder
- -- > File
- -- > File

Without being inside a folder, it will go through a package parser like
http://sleepycode.com/PackageParser/index.php
making it alot easier for some people to manually install it on other themes and manually as is necessary.
Title: Re: Admin Lock Thread
Post by: ne.miguelito on December 28, 2007, 05:50:36 PM
cannot put an image as this:

(http://maxupload.com/img/E405AA18.jpg)


where that is marked would have an image to say locked
Title: Re: Admin Lock Thread
Post by: bananas21ca on December 28, 2007, 08:20:35 PM
Quote from: karlbenson on December 28, 2007, 05:34:01 PM
Bananas.

In another topic there was an issue that this mod wouldn't go through a Package Parser because you've structured the mod inside a folder

Package (inside it)
->Folder
- -- > File
- -- > File

Without being inside a folder, it will go through a package parser like
http://sleepycode.com/PackageParser/index.php
making it alot easier for some people to manually install it on other themes and manually as is necessary.

The v1.2 package seems to work with the Package Parser. Might have something to do with the fact it was a tar.gz the first time. If it's easier for everyone i'll package it as a .zip on my next release.

Quote from: ne.miguelito on December 28, 2007, 05:50:36 PM
cannot put an image as this:

(http://maxupload.com/img/E405AA18.jpg)


where that is marked would have an image to say locked

That will be included in my next release. Forgot all about it.
In the meantime just regular lock it too, to show the lock symbol.
Title: Re: Admin Lock Thread
Post by: ne.miguelito on December 28, 2007, 08:42:38 PM
Quote
That will be included in my next release. Forgot all about it.
In the meantime just regular lock it too, to show the lock symbol.

but if it is alone locked with the Admin Lock Thread doesn't appear anything...
Title: Re: Admin Lock Thread
Post by: bananas21ca on December 29, 2007, 02:21:08 AM
Quote from: ne.miguelito on December 28, 2007, 08:42:38 PM
Quote
That will be included in my next release. Forgot all about it.
In the meantime just regular lock it too, to show the lock symbol.

but if it is alone locked with the Admin Lock Thread doesn't appear anything...

It won't appear on the board index, but there is a custom "Admin Locked" graphic on the actual thread.
Like I said earlier i'll be putting some sort of lock symbol on the board index in the next version of the mod.
Title: Re: Admin Lock Thread
Post by: ManilaGurL on January 17, 2008, 08:38:38 AM
I dont see Display.template.php. I am using Dilber MC Theme. How do I add this one?

Thanks.
Title: Re: Admin Lock Thread
Post by: Garry1953 on January 17, 2008, 05:58:29 PM
Could prove a handy mod for my forum.
Thanks
Title: Re: Admin Lock Thread
Post by: Chriss Cohn on January 17, 2008, 06:08:40 PM
Cool i'm looking forward to any new release of this mod (with included locking-picture)....

Keep up the good work...
Title: Re: Admin Lock Thread
Post by: bananas21ca on January 23, 2008, 07:52:29 PM
Quote from: ManilaGurL on January 17, 2008, 08:38:38 AM
I dont see Display.template.php. I am using Dilber MC Theme. How do I add this one?

Thanks.

if your theme don't have the Display.template.php file, its using the default themes file which means it should be installed. This may not be true for all themes though, all the ones i've worked with followed the same format.
If you could show me a link to the theme i'll take a look when I have a sec to spare.
Title: Re: Admin Lock Thread
Post by: Pip2andahalf on January 29, 2008, 06:11:29 PM
I don't seem to see the button showing up... I am using the Babylon Theme, and when I switch to the smf default or whatever, I see the button... How can I get this functioning in the Babylon Theme? Also, is there going to be addition of admin lock option in the moderation pulldown menu?

Awesome mod!

Thanks!

Pip
Title: Re: Admin Lock Thread
Post by: bananas21ca on March 03, 2008, 09:06:56 PM
Quote from: Pip2andahalf on January 29, 2008, 06:11:29 PM
I don't seem to see the button showing up... I am using the Babylon Theme, and when I switch to the smf default or whatever, I see the button... How can I get this functioning in the Babylon Theme? Also, is there going to be addition of admin lock option in the moderation pulldown menu?

Awesome mod!

Thanks!

Pip
Quote from: Pip2andahalf on January 29, 2008, 06:11:29 PM
I don't seem to see the button showing up... I am using the Babylon Theme, and when I switch to the smf default or whatever, I see the button... How can I get this functioning in the Babylon Theme? Also, is there going to be addition of admin lock option in the moderation pulldown menu?

Awesome mod!

Thanks!

Pip

Sorry for the long delay in my reply. To add the mod to the Babylon Theme you need to edit the Display.template.php file.

Near the bottom of the file add the following snippet of code:
if ($context['can_alock'])

$moderationButtons[] = '<a href="' . $scripturl . '?action=alock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_lock.gif" alt="' . (empty($context['is_alocked']) ? $txt['smf281'] : $txt['smf282']) . '" border="0" />' : (empty($context['is_alocked']) ? $txt['smf281'] : $txt['smf282'])) . '</a>';


Before:
return implode($context['menu_separator'], $moderationButtons);

The mod will now work. However since I dident make a button for the mod it will use the same one as the Lock Topic button. Minor cosmetic issue, however the mod still works perfect.
Title: Re: Admin Lock Thread
Post by: xyxis_fahim on March 28, 2008, 06:22:52 PM
Ways to make it work on v2.0?
Title: Re: Admin Lock Thread
Post by: Marcus Forsberg on April 27, 2008, 07:05:19 AM
Swedish translation

Admin.swedish.php
$txt['modlog_ac_alocked'] = 'Endast admins kan skriva';

index.swedish.php
$txt['smf281'] = 'Endast admins kan skriva';
$txt['smf282'] = 'Alla kan skriva';

Title: Re: Admin Lock Thread
Post by: neil h on June 17, 2008, 03:14:12 AM
Quote from: bananas21ca on March 03, 2008, 09:06:56 PM
Quote from: Pip2andahalf on January 29, 2008, 06:11:29 PM
I don't seem to see the button showing up... I am using the Babylon Theme, and when I switch to the smf default or whatever, I see the button... How can I get this functioning in the Babylon Theme? Also, is there going to be addition of admin lock option in the moderation pulldown menu?

Awesome mod!

Thanks!

Pip
Quote from: Pip2andahalf on January 29, 2008, 06:11:29 PM
I don't seem to see the button showing up... I am using the Babylon Theme, and when I switch to the smf default or whatever, I see the button... How can I get this functioning in the Babylon Theme? Also, is there going to be addition of admin lock option in the moderation pulldown menu?

Awesome mod!

Thanks!

Pip

Sorry for the long delay in my reply. To add the mod to the Babylon Theme you need to edit the Display.template.php file.

Near the bottom of the file add the following snippet of code:
if ($context['can_alock'])

$moderationButtons[] = '<a href="' . $scripturl . '?action=alock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_lock.gif" alt="' . (empty($context['is_alocked']) ? $txt['smf281'] : $txt['smf282']) . '" border="0" />' : (empty($context['is_alocked']) ? $txt['smf281'] : $txt['smf282'])) . '</a>';


Before:
return implode($context['menu_separator'], $moderationButtons);

The mod will now work. However since I dident make a button for the mod it will use the same one as the Lock Topic button. Minor cosmetic issue, however the mod still works perfect.

Does this info relate to all custom themes or only the Babylon theme?

I have the mod installed and placed a copy of the alocked.gif file in the same folder ( /Themes/theme name/images/topic ) as the default, but I'm still not seeing the 'locked' button in my theme. I'm not even sure it is working.

UPDATE : created a test moderator and the admin lock mod is not working for me.  ???
Title: Re: Admin Lock Thread
Post by: bros on June 24, 2008, 12:24:07 AM
any way to get this to work on SMF 2 Beta 3.1?
Title: Re: Admin Lock Thread
Post by: AlenNS on March 03, 2009, 11:36:46 AM
Does author plans updating this mod for SMF 2.X?

I'm using RC1.
Title: Re: Admin Lock Thread
Post by: AlenNS on October 08, 2009, 07:14:25 AM
Is there any similiar mod for this purpose?
Title: Re: Admin Lock Thread
Post by: KensonPlays on January 11, 2010, 01:45:30 PM
I am using 2.0RC2, and would love this mod, or another one from scratch created for 2.0 RC2!!!
Title: Re: Admin Lock Thread
Post by: KensonPlays on January 13, 2010, 02:11:14 PM
This would be a really nice mod that I would use for announcement topics that need to be locked, among other topics...
Title: Re: Admin Lock Thread
Post by: KensonPlays on January 15, 2010, 09:37:09 AM
*BUMP*
Title: Re: Admin Lock Thread
Post by: Arantor on January 15, 2010, 09:41:50 AM
Seriously, bumping it like this isn't going to get it updated - the mod site listing hasn't been updated in 2 years. I doubt it'll be updated now.
Title: Re: Admin Lock Thread
Post by: euroslob on March 12, 2010, 02:35:00 PM
Currently I have the SMF Core theme installed.  I've download the file from the mod's page to my computer.

In Admin > Packages > Download Packages > used the upload file option at the bottom.

Selected Install Mod, but it won't install what I have done wrong?  :-[
Title: Re: Admin Lock Thread
Post by: KensonPlays on March 12, 2010, 02:38:00 PM
:( It's just this would be a awesome mod/feature!!
Title: Re: Admin Lock Thread
Post by: euroslob on March 12, 2010, 02:45:58 PM
Hi Arantor. Tried what you advised but no luck mate! Any clues what I've done wrong?

Rgds E.S
Title: Re: Admin Lock Thread
Post by: Arantor on March 12, 2010, 06:23:33 PM
euroslob; Please don't bump, I note it didn't work.

Did you get an error? Warning? Blank screen? Something else?
Title: Re: Admin Lock Thread
Post by: euroslob on March 13, 2010, 02:08:27 PM
Hi Arantor, Many thanks for your reply

God I've been pulling my hair out as to why this mod won't configure!

This what I did:  Admin>  Packages>  Download Packages>  Upload A Package> Browse>  Selected file on my PC>  Uploaded>  Apply Mod>  Install Now.

A message box then appears "Extracting Manager" saying: The package was installed successfully. You should now be able to use whatever functionality it adds or changes; or not be able to use functionality it removes.

Is there anything else I should do?

Rgds E.S
Title: Re: Admin Lock Thread
Post by: Arantor on March 13, 2010, 02:13:45 PM
So.. SMF version, mod package used?
Title: Re: Admin Lock Thread
Post by: euroslob on March 13, 2010, 02:21:40 PM
At present I'm using  "SMF Default Theme -Core" 

If I try to lock a topic now Arantor I get this message appear on a white screen:

Fatal error: Cannot redeclare adminlocktopic() (previously declared in /home/essexvw1/public_html/forum/Sources/LockTopic.php:106) in /home/essexvw1/public_html/forum/Sources/LockTopic.php on line 224
Title: Re: Admin Lock Thread
Post by: Arantor on March 13, 2010, 02:25:00 PM
It's been installed twice somehow. You'll need to look at the code on http://custom.simplemachines.org/mods/index.php?action=parse;mod=1042;attach=45325;smf_version=1.1.11 and see where it's been added twice - and remove one of them.
Title: Re: Admin Lock Thread
Post by: euroslob on March 13, 2010, 02:35:32 PM
Arantor, how do I get to the option to open the Display.template.php on the current installed theme?
Title: Re: Admin Lock Thread
Post by: Arantor on March 13, 2010, 03:21:13 PM
Admin > Current Theme...
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 05:28:11 AM
Hi Arantor, sorry for my absence. OK so far Ive selected:  Admin> Current Theme.. where do I get in to edit the files?

For what its worth I loaded up a new forum on a sub domain so I could reload the "Admin Lock Thread" I tried again using the "Core" theme and still no luck!
Title: Re: Admin Lock Thread
Post by: Arantor on March 15, 2010, 05:34:23 AM
How about the friendly "Modify Themes" option...
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 05:57:32 AM
Yep been in there Arantor but because I'm using the "Default Core Theme" there is only two listed: "Classic YaBB SE Theme" and "Babylon Theme"

Which is why I am a bit confused here trying to edit "Core"!
Title: Re: Admin Lock Thread
Post by: Arantor on March 15, 2010, 06:19:43 AM
Oh, I forgot it doesn't actually let you edit the default theme. Only way to edit it then is with FTP.
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 07:39:57 AM
I thought that this maybe the case Arantor.
I've just carried out a before and after, this is before uploading the Admin Lock file:

$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 this is after uploading Admin Lock Thread:

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

I've carried out the checks in FTP file manager which shows the upload was a success. BUT! no red button is appearing at the bottom of a thread!
Title: Re: Admin Lock Thread
Post by: Arantor on March 15, 2010, 07:42:19 AM
There will be an edit elsewhere relating to $context['can_alock']... was that added?
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 08:26:58 AM
Cant find it Arantor, where abouts in the scripting should it be?
Title: Re: Admin Lock Thread
Post by: Arantor on March 15, 2010, 08:28:22 AM
Display.php.
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 08:46:47 AM
I understand that Arantor, but what I meant is where abouts in the script of Display.php will $context['can_alock'] be listed?

Personally I would have assumed it should have been in the red script I posted !
Title: Re: Admin Lock Thread
Post by: Arantor on March 15, 2010, 08:48:37 AM
That's from Display.template.php is it not?
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 09:01:16 AM
I'm using Just Host File Manager, here's my path Themes>  Default> DisplayTemplate.php> Show File

The copied file below is the section I thought covered the Admin Lock Button:

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

   if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
      $mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();');

   echo '
   <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 1ex;">
      <tr>
         ', template_button_strip($mod_buttons, 'bottom') , '
      </tr>
   </table>';

   if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
      echo '
   <input type="hidden" name="sc" value="', $context['session_id'], '" />';

   if (empty($settings['use_tabs']))
      echo '
   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      document.getElementById("quickmodSubmit").style.display = "none";
   // ]]></script>';

   echo '
</form>';
Title: Re: Admin Lock Thread
Post by: Arantor on March 15, 2010, 09:03:02 AM
There's part of it in Sources/Display.php too, relating to $context['can_alock']

You may want to check the mod's parse instructions to see exactly what it should have added.
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 09:10:48 AM
This is what is really confusing me as it implied it was a simple install to the theme I have currently installed! There should not have been the need to modify the scripting!  ???

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.

Title: Re: Admin Lock Thread
Post by: Arantor on March 15, 2010, 09:13:46 AM
The mod will install in the source - which is common to every theme, then you only need to make the changes to custom themes manually.
Title: Re: Admin Lock Thread
Post by: euroslob on March 15, 2010, 09:45:06 AM
Arantor I have purposely created a new forum on a sub domain for testing out mods in order not to break the one I have in regular use at present. I have successfully tried all kinds of other mods such as themes, smileys etc.

I have tried deleting the test forum and re installing it, then uploading the Admin Lock file. But time after time no luck!

I really cannot see where I have gone wrong,  I have followed the installation guide and the fact that I am using the standard forum theme this mod should have installed with no problems.

There really should not have been the need to start looking at scripting as the mod author states "  You will have to manually edit if you have a custom theme"


Title: Re: Admin Lock Thread
Post by: Bruno36 on July 21, 2010, 09:16:52 AM
Hello!

an update is scheduled for SMF 2.0 RC3 ????
Title: Re: Admin Lock Thread
Post by: KittyGalore on January 02, 2020, 03:40:39 PM
Like the idea of this mod but haven't seen the original owner of this mod online since 2008 as it would be nice to get it updated.