News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Admin Lock Thread

Started by bananas21ca, December 26, 2007, 06:14:15 PM

Previous topic - Next topic

euroslob

#40
Arantor, how do I get to the option to open the Display.template.php on the current installed theme?

Arantor

Admin > Current Theme...

euroslob

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!

Arantor

How about the friendly "Modify Themes" option...

euroslob

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"!

Arantor

Oh, I forgot it doesn't actually let you edit the default theme. Only way to edit it then is with FTP.

euroslob

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!

Arantor

There will be an edit elsewhere relating to $context['can_alock']... was that added?

euroslob

Cant find it Arantor, where abouts in the scripting should it be?

Arantor


euroslob

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 !

Arantor

That's from Display.template.php is it not?

euroslob

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>';

Arantor

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.

euroslob

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
.


Arantor

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.

euroslob

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"



Bruno36

Hello!

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

KittyGalore

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

IP_Board_Rules

Is there a 2.0 version of this mod?

Advertisement: