Advertisement:

Author Topic: Admin Lock Thread  (Read 32596 times)

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #40 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?
« Last Edit: March 13, 2010, 02:46:09 PM by euroslob »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #41 on: March 13, 2010, 03:21:13 PM »
Admin > Current Theme...
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #42 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!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #43 on: March 15, 2010, 05:34:23 AM »
How about the friendly "Modify Themes" option...
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #44 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"!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #45 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.
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #46 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!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #47 on: March 15, 2010, 07:42:19 AM »
There will be an edit elsewhere relating to $context['can_alock']... was that added?
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #48 on: March 15, 2010, 08:26:58 AM »
Cant find it Arantor, where abouts in the scripting should it be?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #49 on: March 15, 2010, 08:28:22 AM »
Display.php.
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #50 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 !

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #51 on: March 15, 2010, 08:48:37 AM »
That's from Display.template.php is it not?
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #52 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>';

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #53 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.
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #54 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
.


Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Admin Lock Thread
« Reply #55 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.
No good deed goes unpunished
All helpful urges should be circumvented

Offline euroslob

  • Semi-Newbie
  • *
  • Posts: 34
Re: Admin Lock Thread
« Reply #56 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"



Offline Bruno36

  • Full Member
  • ***
  • Posts: 570
  • Gender: Male
    • Scooter Chinois 4T
Re: Admin Lock Thread
« Reply #57 on: July 21, 2010, 09:16:52 AM »
Hello!

an update is scheduled for SMF 2.0 RC3 ????
Bruno36 the French
SMF 2.0.9

Offline KittyGalore

  • Charter Member
  • Semi-Newbie
  • *
  • Posts: 76
Re: Admin Lock Thread
« Reply #58 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.
SMF Curve 2.0x