Ok... this question has been asked a couple times, so I figured I would give you at least some sort of solution. If you want to display a block (for example a center block) only on certain boards / subboards, here's a solution for you.
First, whether you have center blocks hidden from forum or not (via TinyPortal Settings page) this will work. You should not display a title or frame for your block, otherwise, an empty block will show up on boards other than those you designate.
- Create a php center block with the code found below.
- Put the board numbers in the array for boards you want the content displayed on as the comment example shows.
- Put your content in the area specified (remember, you need echo statements since it is a php block - replace the example ones with your own)
- Select the option "Do not use title/frame" while editing the block.
- Where it says "Show for this action", in the editbox to the far right put in: board
- Do not select any of the pulldowns in that area!
Here's the block code "template" to use:
global $context;
// what board numbers to display on?
// example: array(3,7,9);
$disp_on_boards = array();
if (in_array($context['current_board'], $disp_on_boards)){
// your content here!
echo "This is only displayed on certain boards!<br />";
echo "Since you see this, you are obviously on one of those boards! ;) <br />";
}
Since it is necessary to not use a title/frame in order to completely hide the block from boards you don't want it displayed on, you may wish to create your own Title/Frame via HTML in your content that is only displayed where you wanted to start with.
Thank you very much! That's exactly what I needed, including not showing either title or frame.