How can I get one block to show on multiple specific forums? I would rather not have to make a center block for each of the forums.
If anyone knows how or can point me to a hack, it would be appreciated.
This feature is to be added in TP 1.0
For now, there is a hack posted by IchBin. I don't know where exactly it is, so you'll need to search.
I am not having much luck looking for it. Any idea what to search for?
Don't forget when you search you can choose a users posts that you want to search. I don't know where its at either so I would have to search for it as well. But I'll leave that up to you.
I found the post:
http://www.tinyportal.net/index.php?topic=14385.10
But I do not know how to combine the two snippets of code you had posted. I am completely new to PHP so I have no clue what breaks it and how to fix it when it does break.
post your code here you want to use this with and I will try to help
Quote from: Tick� on October 14, 2007, 12:17:33 AM
post your code here you want to use this with and I will try to help
I basically just want to have a centered image in certain forums and child forums.
ok post the code for the image and I will have a go at it. I am not a coder by any means but I will see what I can do with it
Just something simple like this:
<div style="text-align: center;"><img width="134" height="100" src="/forums/tp-images/Image/bleach1.jpg" alt="" /></div>
Thanks a bunch buddy ;D
global $context;
if($context['current_action'] == '')
$current_action = 'home';
//$current_action = 'forum';
if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = 'forum';
if($current_action == 'forum')
{
echo '<div style="text-align: center;"><img width="134" height="100" src="/forums/tp-images/Image/bleach1.jpg" alt="" /></div>';
}
else
{
return;
} Try this
Thanks a bunch, but what parts do I change in that to set it so the block only shows in certain forums?
Well that code is supposed to do that. Is it now working. If not I will check it out
ok i see now. What boards are you wanting it to show up in. I misread what the post said. Get the board numbers that you want it to show up in and I will fix it. To get those go to that board and look in the url and get the board number
25, 29, and 30 are the IDs for the boards.
Try this one
Quoteglobal $context;
if($context['current_board'] == 25,29,30)
{
echo '<div style="text-align: center;"><img width="134" height="100" src="/forums/tp-images/Image/bleach1.jpg" alt="" /></div>';
}
else
{
return;
}
IF not I will try again. hehe ;D
I tried it it did not work. Try it this way.global $context;
if($context['current_board'] == 25)
{
echo '<div style="text-align: center;"><img width="134" height="100" src="/forums/tp-images/Image/bleach1.jpg" alt="" /></div>';
}
elseif($context['current_board'] == 29)
{
echo '<div style="text-align: center;"><img width="134" height="100" src="/forums/tp-images/Image/bleach1.jpg" alt="" /></div>';
}
if($context['current_board'] == 30)
{
echo '<div style="text-align: center;"><img width="134" height="100" src="/forums/tp-images/Image/bleach1.jpg" alt="" /></div>';
}
else
{
return;
}
Ok - that works. But how can I keep it from showing the block's frame on other boards?
Yeah I noticed that. YOu will have to choose the option to not use frame or title. Unless someone else comes along that knows a different way
Thanks for the information though. I should be able to find many uses for it. If anyone knows how to remove the frame, please let me know.
Sure thing. Glad to have helped ya. Tick
Good job Tick. For your info here's how you can use an array to check for multiple boards.
global $context;
$num = array(25,29,30);
if(array_intersect($num, $context['current_board']){
echo 'stuff here for boards 25, 29, and 30';
}
Thanks Ich. I was trying to figure that out. I will file that away in the ole noodle. ;D
IchBinâ,,¢, any idea how to get rid of the table in forums where it shouldn't be?