News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Edição do fundo dos post (quando for criar a mensagem).

Started by tonnybarros, April 27, 2009, 08:03:34 AM

Previous topic - Next topic

tonnybarros


margarett

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'),
);
}
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

tonnybarros

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.

margarett

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?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

FragaCampos

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.

tonnybarros

Rapaz o meu funcionou beleza no 1.1.X mas agora estou no 2.0 e o Bruno acha que não funciona....

FragaCampos


margarett

Xuta aí o teu MessageIndex.template.php.

Não sei se posso já mexer nisto, mas vai-me lembrando :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

FragaCampos


margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

FragaCampos


margarett

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?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

FragaCampos

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

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

margarett

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 ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

FragaCampos

Obrigado, vai certamente ser útil quando eu mudar para versão 2.0 quando ela sair 8)

Costa

a versão 2.0 já saiu :P só ainda é RC :P
Tou usando, aconselho o upgrade
Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

FragaCampos

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

Costa

Hugo "Costa" Fernandes - PT SMF
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

FragaCampos

Além disso, o TinyPortal não suporta a versão 2 do SMF :o

Advertisement: