Simple Machines Community Forum

SMF Support => Language Specific Support => Português (Portuguese) => Topic started by: tonnybarros on April 27, 2009, 08:03:34 AM

Title: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on April 27, 2009, 08:03:34 AM
Pessoal, meu forum é de pedidos de ajuda na área de eletronica, http://tectonny.com

Eu preciso que todos que fossem pedir ajuda seguisse uma regra, tipo, sempre colocar modelo, marca, tipo de aparelho.

A pergunta é, tem como cobrar isso, de forma que a pessoa fosse obrigado a preencher isso? Tipo criar um mini formulário com os requesitos obrigatório, se não preenchido a mensagem não é enviada.

E se possivel (acredito que não), só em determinadas categorias.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on April 29, 2009, 11:01:17 AM
http://custom.simplemachines.org/mods/index.php?mod=1279

;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on April 29, 2009, 11:45:03 AM
Bruno tem outro? Esse deu erro:

Ao instalar este pacote, serão efectuadas as seguintes acções:
   Tipo    Acção    Descrição
1.    Executar código    install.php    
2.    Executar modificação    ./index.php    Sucesso
3.    Executar modificação    ./Sources/ModSettings.php    Falha
4.    Extrair Arquivo    ./Sources/CustomForm.php    
5.    Extrair Arquivo    ./Themes/default/CustomForm.template.php    
6.    Executar modificação    ./Themes/default/languages/Modifications.english.php    Sucesso
7.    Executar modificação    ./Themes/default/languages/Help.english.php    Sucesso
8.    Executar modificação    ./Themes/default/languages/Modifications.english-utf8.php    Ignorar o arquivo
9.    Executar modificação    ./Themes/default/languages/Help.english-utf8.php    Ignorar o arquivo
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on April 30, 2009, 05:13:24 AM
Não há outro, pelo menos que eu conheça.

Tens de tentar seguir as instruções de instalação manual, e ver se consegues perceber onde é que está a falha no ModSettings.php.

Boa sorte ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on April 30, 2009, 07:40:32 AM
Será que se continuar a instalação e modificar o ModSettings.php manualmente da certo?
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on April 30, 2009, 10:42:42 AM
Sim.

Mas convém verificar se consegues alterar o ModSettings.php ANTES de ir instalar o MOD :P
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on April 30, 2009, 10:43:34 AM
Consegui instalar
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on April 30, 2009, 10:45:58 AM
Boa ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 02, 2009, 06:44:34 PM
Bruno teria como em apenas uma categoria redirecionar o botão NOVO TOPICO para o formulário. Ou mim indica alguma idéia para isso.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 04, 2009, 10:24:33 AM
Sim, creio que sim...

Manda aí o teu Display.template.php
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 04, 2009, 11:32:03 AM
Em anexo Bruno.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 04, 2009, 11:36:11 AM
Desculpa, enganei-me :P

Era o MessageIndex.template.php :P
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 04, 2009, 11:39:59 AM
ehheheheheh, em anexo:

Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 04, 2009, 12:45:42 PM
Bem, não tenho bem a certeza, mas cá vai :P

Encontras:

// Are they allowed to post new topics?
if ($context['can_post_new'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['smf258'] . '</a>';


E substituis por:

// Are they allowed to post new topics?
if ($context['can_post_new'])
{
if ($context['current_board'] != xx)
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['smf258'] . '</a>';
else
$buttonArray[] = '<a href="' . $scripturl . '?action=ACCAO_DO_FORM">' . $txt['smf258'] . '</a>';
}

Em que substituis o "xx" pelo ID do quadro em questão, e o "ACCAO_DO_FORM" pela acção que está criada com o formulário.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 04, 2009, 03:16:47 PM
Mas Bruno isso só terá efeito no forum que eu quero? No caso o 21.0.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 04, 2009, 06:03:42 PM
É essa a ideia. Experimenta lá ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 04, 2009, 06:23:52 PM
Heheeheh, não mudou nada, abre um novvo topico normal.

Veja como ficou:

// Are they allowed to post new topics?
   if ($context['can_post_new'])
   {
      if ($context['current_board'] != 21)
         $buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['smf258'] . '</a>';
      else
         $buttonArray[] = '<a href="' . $scripturl . '?action=form;id=1">' . $txt['smf258'] . '</a>';
   }
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 04, 2009, 07:20:59 PM
Oh chatice :)

Depois experimento melhor...
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 04, 2009, 07:23:32 PM
Hehehehhe, fiquei doido para ver funcionando. O que faço? Coloco o codigo original de novo?
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 04, 2009, 07:29:21 PM
Sim, coloca. Isso eu posso testar facilmente. Amanhã não tou por cá, mas depois já testo (se não me esquecer :P )
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 05, 2009, 05:36:05 PM
Brunoi não esquece desse tópico, valeuuuuuuuuuu
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 08, 2009, 05:56:52 AM
Já consegui :)

Encontras:

// Create the button set...
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);


E substituis por:

// Create the button set...
if ($context['current_board'] != 82)
{
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
}
else
{
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=1'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
}
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on May 08, 2009, 08:58:12 PM
Grande Bruno, parabens, deu certo mas vc esqueceu de mudar no código o ID, no primeiro teste nada aconteceu, mas olhando o codigo eu vi que estava com ID 82, foi só mudar para o meu e pronto ficou ok.


Agora como eu faço para colocar varios IDs de forum para diferentes IDs de formulário?

Valeu estou aprendendo muito contigo.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on May 11, 2009, 05:02:32 AM
O problema aí é que eu não consigo partir a construção do array, mexendo só na linha do "new_topic" que é a que interessa. Por isso é que tenho de agrupar todo o array, e o código fica muita grande. Mas o que queres fazer é fácil, tem é muito código por causa disto...


   if (($context['current_board'] != 11) && ($context['current_board'] != 12) && ($context['current_board'] != 13))


E depois:

   else
   {
      if ($context['current_board']==11)
      {
         $normal_buttons = array(
         .........
      }
      if ($context['current_board']==12)
      {
         $normal_buttons = array(
         .........
      }
      if ($context['current_board']==13)
      {
         $normal_buttons = array(
         .........
      }
   }


Tás a perceber?
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on August 31, 2009, 12:16:42 PM
Isto vai dar-me um jeitão, mas testei e não acontece nada de diferente.
Alterei o if ($context['current_board'] != 82) para if ($context['current_board'] != 9) (o quadro onde quero que o formulário crie o tópico) e mudei o action=form;id=1 para action=form;id=5 o formulário que eu quero utilizar.

Estou a fazer alguma coisa mal? :P

PS: fiz isto apenas no MessageIndextemplate do meu tema custom.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on August 31, 2009, 12:32:14 PM
Rapaz o meu funcionou beleza no 1.1.X mas agora estou no 2.0 e o Bruno acha que não funciona....
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on August 31, 2009, 02:12:32 PM
Mas eu uso o 1.1.10... :(
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on August 31, 2009, 02:22:52 PM
Xuta aí o teu MessageIndex.template.php.

Não sei se posso já mexer nisto, mas vai-me lembrando :P
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on August 31, 2009, 07:01:57 PM
Ok, aqui vai então.
Obrigado.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 01, 2009, 04:46:58 AM
Esse não, o alterado ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on September 01, 2009, 01:20:43 PM
Oops...  O:)
Cá vai ele.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 02, 2009, 05:26:17 AM
Parece-me tudo bem...

* Quando carregas no botão "Novo tópico" o que é que acontece?
* Se fizeres www.O_TEU_FORUM.com/index.php?action=form;id=5 o formulário é mostrado?
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on September 02, 2009, 11:09:20 AM
Bem... não faço a mínima ideia do que se terá passado... mas agora está a funcionar.  :o :o

Bem isto é de uma ajuda tremenda, fazia-me imensa falta.

Importas-te que partilhe o teu código no tópico do mod?

Muito obrigado (uma vez mais)  ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 02, 2009, 01:44:10 PM
Obviamente que não ;) Força aí
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 02, 2009, 08:58:34 AM
Já agora, para o 2.0, deve ser mais fácil ainda...

Note-se que não posso testar...

MessageIndex.template.php
Encontrar:
// Are they allowed to post new topics?
if ($context['can_post_new'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['new_topic'] . '</a>';


E substituir com um muito semelhante ao anterior:

// Are they allowed to post new topics?
if ($context['can_post_new'])
{
if ($context['current_board'] != 82)
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['new_topic'] . '</a>';
else
$buttonArray[] = '<a href="' . $scripturl . '?action=form;id=1">' . $txt['new_topic'] . '</a>';
}


Muito menos bagunçado no 2.0 ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on September 02, 2009, 06:26:13 PM
Obrigado, vai certamente ser útil quando eu mudar para versão 2.0 quando ela sair 8)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: Costa on September 02, 2009, 01:49:42 PM
a versão 2.0 já saiu :P só ainda é RC :P
Tou usando, aconselho o upgrade
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on September 02, 2009, 07:03:25 PM
Pois, mas eu vou esperar pela versão final, porque o meu fórum está todo kitado e tenho medo, tenho muito medo :D :D
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: Costa on September 02, 2009, 07:04:03 PM
atão, os backups existem para quê? :P
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: FragaCampos on September 02, 2009, 07:08:50 PM
Além disso, o TinyPortal não suporta a versão 2 do SMF :o
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 03, 2009, 09:11:19 AM
Eita agora que eu vi, opção para o 2.0, to louco atrás desse código, mas Brunos vc não falou que não dava?
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 03, 2009, 10:55:35 AM
Não disse que não dava!

Disse que o código anterior que fiz não dava no 2.0 :P Claro que seria só uma questão de descobrir como fazê-lo dar ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 03, 2009, 10:59:15 AM
Ok, vou testar e ver se funciona igual ao 1.1.10!!!!!!
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 03, 2009, 07:08:33 PM
Não funcionou o código do 2.0, e eu coloquei o ID certo, mas não funcionou...
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 03, 2009, 09:05:53 PM
Consegui fazer funcionar com este código:


// Create the button set...
   if ($context['current_board'] != 21)
   {
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
   }
   else
   {
    $normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=1'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
  }
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 03, 2009, 09:10:53 PM
Bruno tem como explicar melhor como colocar para outras categorias....
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 04, 2009, 05:55:57 AM
Esse código é para o 1.1.x, a construção do array é bastante diferente no 2.0!

Manda-me o teu MessageIndex.template.php, sff.
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 04, 2009, 07:55:55 AM
Na verdade o código acima foi feito em cima do código do 2.0 e não do 1.1.0 e assim funcionou...
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 04, 2009, 09:19:14 AM
Esse ficheiro é bastante diferente do que o que eu aqui tinha. OK, se tá a funcionar, porreiro ;)

É MUITO bom que a malta parta a carola e descubra por si ;)

Qual era a tua duvida com as outras categorias?
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 04, 2009, 09:23:42 AM
Sim tá beleza e funcionando, mas agora eu quero colocar o redirecionamento de outro ID para outro form?
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tonnybarros on September 08, 2009, 02:46:43 PM
Bruno tem como colocar para vários IDs???????????
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: margarett on September 08, 2009, 04:53:19 PM
Tal e qual como com 1.1.x, a adaptação é "trigo limpo, farinha amparo" ;)


   if ($context['current_board'] != 21)
   {
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
   }
   else
   {
    $normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=1'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
  }


Passa a (com a natural adaptação dos "current_boards" e dos IDs dos forms):

   if (($context['current_board'] != 21) && ($context['current_board'] != 22) && ($context['current_board'] != 23))
   {
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
   }
   else
   {
if ($context['current_board'] != 21)
{
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=1'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
}
if ($context['current_board'] != 22)
{
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=2'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
}
if ($context['current_board'] != 23)
{
$normal_buttons = array(
'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=3'),
'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
);
}
   }


E isto pode crescer até quereres ;)
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tectonny on February 25, 2011, 11:28:49 AM
Código atualizado para versão 2.0 RC5

   if (($context['current_board'] != 21) && ($context['current_board'] != 47))
   {
   $normal_buttons = array(
  'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
      'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
   );
   }
   else
   {
   if ($context['current_board'] != 21)
   {
      $normal_buttons = array(
      'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=5', 'active' => true),
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
      'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
   );
   }
   if ($context['current_board'] != 47)
   {
      $normal_buttons = array(
      'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;id=1', 'active' => true),
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
      'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
   );
   }
   }
Title: Re: Edição do fundo dos post (quando for criar a mensagem).
Post by: tectonny on June 16, 2011, 05:00:34 PM
Atualizado para a versão 2.0:

   if (($context['current_board'] != 21) && ($context['current_board'] != 47))
   {
   $normal_buttons = array(
  'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
      'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
   );
   }
   else
   {
   if ($context['current_board'] != 21)
   {
      $normal_buttons = array(
      'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=5', 'active' => true),
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
      'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
   );
   }
   if ($context['current_board'] != 47)
   {
      $normal_buttons = array(
      'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=form;n=1', 'active' => true),
      'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
      'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
      'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
   );
   }
   }



Lembrando que tem que comentar o seguinte código para funcionar:
// Create the button set...
// $normal_buttons = array(
// 'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
// 'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
// 'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
// 'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
// );