News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

CmdModeration

Started by [SiNaN], November 06, 2008, 08:52:47 AM

Previous topic - Next topic

[SiNaN]

Link to Mod

CmdModeration

This mod allows you to (un)lock or (un)sticky topics by just using commands in your posts. Commands are listed below:

Format: [!cmd: command]
Options: sticky, unsticky, lock, unlock.
Example: [!cmd: unsticky]

Note: This will override the options selected at the post form and will not work with the quick (AJAX) edit.
Former SMF Core Developer | My Mods | SimplePortal

Sakae

Great mod, thank you. Where can I change the !cmd text?

Suggestion: It could be already [!sticky] or [!unlock], couldn't?
http://www.tigrelog.com.br
l: simple p: machines

aldo

AWESOME! Lol. I was thinking about something like this, glad someone made it :)

Its like IRC almost

bisbebri

i had to remove

if ($return_config)
return $config_vars;

$context['settings_insert_below'] = '
<script language="JavaScript" type="text/javascript"><!-- // --><![', 'CDATA', '[
document.getElementById("cmd_lock_replace_text").disabled = !document.getElementById("cmd_lock_replace_enable").checked;
document.getElementById("cmd_unlock_replace_text").disabled = !document.getElementById("cmd_unlock_replace_enable").checked;
document.getElementById("cmd_sticky_replace_text").disabled = !document.getElementById("cmd_sticky_replace_enable").checked;
document.getElementById("cmd_unsticky_replace_text").disabled = !document.getElementById("cmd_unsticky_replace_enable").checked;
// ', ']', ']></script>';

As it caused parse errors because of line:
<script language="JavaScript" type="text/javascript"><!-- // --><![', 'CDATA', '[

Harvester

LOve this! This works great in conjunction with teh welcome topic for 1.1.x


I have one question though...

When a post is locked or stickies... your mod adds a string of text to the post that says "This Topic is locked"

What file is that text set in?? I cant find it.

I have looked in Modifications.Engling.php and its not in there.

Harvester

nevermind. I hadnt realized it installed a panel in the admin area... WOOPS ;) lol

Harvester

well.. I thought this would be great to use with the AutoWelcome mod... I imagined i could just insert the cmd! in the post and it would lock...

doesnt work though... for whatever reason it will only lock the post if a person makes the post..  it doesnt work with autogenerated posts...

any idea why?

paulshepherd

I get this error whenever I try to access any of the Configuration settings. Gone once I uninstall the mod. 2.0 RC1-1

Parse error: syntax error, unexpected ',' in /home/shepherd/public_html/forums/Sources/ManageSettings.php on line 2002


Any ideas?


ethankcvds

#8
Find this:
<script language="JavaScript" type="text/javascript"><!-- // --><![', 'CDATA', '[

Replace with this:
<script language="JavaScript" type="text/javascript"><!-- // --><![[

also find:
// ', ']', ']></script>';

Replace with this:
// ]]></script>';
No Pm's for support please!

paulshepherd

Worked like a charm, thanks a lot! =]

candidosa2

thank you
when Update dont forget Portuguese and brazilian

Quote<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
      <operation>
         <search position="end" />
         <add><![CDATA[
$txt['cmd_settings_label'] = 'Cmd Modera&ccedil;&atilde;o';
$txt['cmd_settings_title'] = 'Cmd Modera&ccedil;&atilde;o Defini&ccedil;ões';

$txt['cmd_on_post'] = 'Activar para criar postes';
$txt['cmd_on_modify'] = 'Activar para editar poste';

$txt['cmd_lock_switch'] = 'Activar Trancar cmd';
$txt['cmd_lock_command'] = 'Comando Trancado';
$txt['cmd_unlock_command'] = 'Destrancar o Comando';
$txt['cmd_lock_replace_enable'] = 'Substituir comando para trancar';
$txt['cmd_lock_replace_text'] = 'Substituir texto para bloquear';
$txt['cmd_unlock_replace_enable'] = 'Substituir comando para desbloquear ';
$txt['cmd_unlock_replace_text'] = 'Substituir comando de desbloquear';

$txt['cmd_sticky_switch'] = 'Activar cmd Inamov&iacute;vel';
$txt['cmd_sticky_command'] = 'Comando Inamov&iacute;vel';
$txt['cmd_unsticky_command'] = 'command mov&iacute;vel';
$txt['cmd_sticky_replace_enable'] = 'Substituir o comando Inamov&iacute;vel';
$txt['cmd_sticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';
$txt['cmd_unsticky_replace_enable'] = 'Substituir comando Inamov&iacute;vel';
$txt['cmd_unsticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';]]></add>
      </operation>
   </file>
   <file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
      <operation>
         <search position="end" />
         <add><![CDATA[
$txt['cmd_settings_label'] = 'Cmd Modera&ccedil;&atilde;o';
$txt['cmd_settings_title'] = 'Cmd Modera&ccedil;&atilde;o Defini&ccedil;ões';

$txt['cmd_on_post'] = 'Activar para criar postes';
$txt['cmd_on_modify'] = 'Activar para editar poste';

$txt['cmd_lock_switch'] = 'Activar Trancar cmd';
$txt['cmd_lock_command'] = 'Comando Trancado';
$txt['cmd_unlock_command'] = 'Destrancar o Comando';
$txt['cmd_lock_replace_enable'] = 'Substituir comando para trancar';
$txt['cmd_lock_replace_text'] = 'Substituir texto para bloquear';
$txt['cmd_unlock_replace_enable'] = 'Substituir comando para desbloquear ';
$txt['cmd_unlock_replace_text'] = 'Substituir comando de desbloquear';

$txt['cmd_sticky_switch'] = 'Activar cmd Inamov&iacute;vel';
$txt['cmd_sticky_command'] = 'Comando Inamov&iacute;vel';
$txt['cmd_unsticky_command'] = 'command mov&iacute;vel';
$txt['cmd_sticky_replace_enable'] = 'Substituir o comando Inamov&iacute;vel';
$txt['cmd_sticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';
$txt['cmd_unsticky_replace_enable'] = 'Substituir comando Inamov&iacute;vel';
$txt['cmd_unsticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';]]></add>
      </operation>
   </file>
   <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
      <operation>
         <search position="end" />
         <add><![CDATA[
$txt['cmd_settings_label'] = 'Cmd Modera&ccedil;&atilde;o';
$txt['cmd_settings_title'] = 'Cmd Modera&ccedil;&atilde;o Defini&ccedil;ões';

$txt['cmd_on_post'] = 'Activar para criar postes';
$txt['cmd_on_modify'] = 'Activar para editar poste';

$txt['cmd_lock_switch'] = 'Activar Trancar cmd';
$txt['cmd_lock_command'] = 'Comando Trancado';
$txt['cmd_unlock_command'] = 'Destrancar o Comando';
$txt['cmd_lock_replace_enable'] = 'Substituir comando para trancar';
$txt['cmd_lock_replace_text'] = 'Substituir texto para bloquear';
$txt['cmd_unlock_replace_enable'] = 'Substituir comando para desbloquear ';
$txt['cmd_unlock_replace_text'] = 'Substituir comando de desbloquear';

$txt['cmd_sticky_switch'] = 'Activar cmd Inamov&iacute;vel';
$txt['cmd_sticky_command'] = 'Comando Inamov&iacute;vel';
$txt['cmd_unsticky_command'] = 'command mov&iacute;vel';
$txt['cmd_sticky_replace_enable'] = 'Substituir o comando Inamov&iacute;vel';
$txt['cmd_sticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';
$txt['cmd_unsticky_replace_enable'] = 'Substituir comando Inamov&iacute;vel';
$txt['cmd_unsticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';]]></add>
      </operation>
   </file>
   <file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
      <operation>
         <search position="end" />
         <add><![CDATA[
$txt['cmd_settings_label'] = 'Cmd Modera&ccedil;&atilde;o';
$txt['cmd_settings_title'] = 'Cmd Modera&ccedil;&atilde;o Defini&ccedil;ões';

$txt['cmd_on_post'] = 'Activar para criar postes';
$txt['cmd_on_modify'] = 'Activar para editar poste';

$txt['cmd_lock_switch'] = 'Activar Trancar cmd';
$txt['cmd_lock_command'] = 'Comando Trancado';
$txt['cmd_unlock_command'] = 'Destrancar o Comando';
$txt['cmd_lock_replace_enable'] = 'Substituir comando para trancar';
$txt['cmd_lock_replace_text'] = 'Substituir texto para bloquear';
$txt['cmd_unlock_replace_enable'] = 'Substituir comando para desbloquear ';
$txt['cmd_unlock_replace_text'] = 'Substituir comando de desbloquear';

$txt['cmd_sticky_switch'] = 'Activar cmd Inamov&iacute;vel';
$txt['cmd_sticky_command'] = 'Comando Inamov&iacute;vel';
$txt['cmd_unsticky_command'] = 'command mov&iacute;vel';
$txt['cmd_sticky_replace_enable'] = 'Substituir o comando Inamov&iacute;vel';
$txt['cmd_sticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';
$txt['cmd_unsticky_replace_enable'] = 'Substituir comando Inamov&iacute;vel';
$txt['cmd_unsticky_replace_text'] = 'Substituir texto para Inamov&iacute;vel';]]></add>
      </operation>
   </file>

Advertisement: