Not display baner in one board

Started by mirkodzo, August 23, 2015, 05:08:40 AM

Previous topic - Next topic

mirkodzo

Within the first post I put a banner, but I do not want it to display in one child boards. How to do it??
Help please!

margarett

How did you add that banner?
If you used a MOD, you need to address that question to its specific support topic ;)
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

mirkodzo

I not use MOD.
I edited display.template.php with
                 if ($message['id'] == $context['first_message'])
      echo '
                        <div style="float:right;">
                        [b]baner[/b]</div>';


but I do not want it to display in one child boards. How to do it??


Kindred

what mod did you use?   

From that code, it would seem that you are going to have to add additional settings to the individual board settings to determine if you want it displayed or not...       not just a simple conditional at that location.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mirkodzo

I did not use a single mode

Quoteit would seem that you are going to have to add additional settings to the individual board settings to determine if you want it displayed or not...

Yes, yes...  but I do not know how to write program code, just for it??

margarett

I'm on the phone now but you should have a variable $board or $context['board']. Use that on your "if" so that it only outputs stuff if board is different from what you're excluding ;)
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

mirkodzo

if ($message['id'] == $context['first_message'] && $context['board'] ==  )

thank you, when you can, please write me the whole program code  ::)


Kindred

well, see, that's what I mean.

You can HARDCODE the boardIDs...  but that is a poor choice and would require code edits every time you added a new board that you want to exclude

the PROPER way to do it would be to add the conditional check on a variable... and then control that variable from the board settings.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

But that's wayyy more difficult to implement ;)
Not debating if it's better, or course it is ;) But a lot harder and, for a single case, hard-coding might very well be a good-enough solution.
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

riou

If it is just 1 board and context board contains current active ones id you could just do

$context['board'] != 'board id to skip here'


as Kindred says you'd have to manually add each board if you want new ones to also be excluded

margarett

For either one or several boards, an array is IMO the best approach

$excluded = array(1,2,3);
if ($message['id'] == $context['first_message'] && !in_array($context['current_board'], $excluded))
echo '
<div style="float:right;">
[b]baner[/b]</div>';
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

mirkodzo


Advertisement: