![]() |
Different part of the template in specific forum?
Is there any way to have a different part of a template show depending on the forum?
For example, I'd like to show thumbnails for attached images on most forums, but a specific forum I'd like to show the full attached image. I've already figured out how to do it globally but I'd like to do it per forum. I also know you can use different themes for forums, but I was wondering if it can be done using 1 global theme. Something like, if forum equals #, show this, if else show this... Is this possible to do in the template files? |
<if condition="in_array($foruminfo[forumid], array(xx,yy))">
do stuff only in forumid xx and yy </if> |
Nice! Thanks! How about not to show depending on forum?
And - whats the array for? is that for multiple forums? like <if condition="in_array($foruminfo[forumid], array(12,13))">? So I put nothing as [forumid]? Sorry, I'm a little slow with this... THANKS in advance... |
The array is for multiple forums just as you posted (and your condition is correct for just forums 12 and 13). And yes, leave the $foruminfo[forumid] alone. If you *don't* want it in 12 or 13, then:
HTML Code:
<if condition="!in_array($foruminfo[forumid], array(12,13))"> |
Hey - thanks again....
This is my code for template: postbit_attachmentthumbnail Code:
<if condition="!in_array($foruminfo[forumid], array(103))"> This is the post in the forum with id 103 : http://www.fatboymagazine.com/showthread.php?t=33215 Any idea why its not working? Thanks again! |
If you are doing this in the postbit, I think you may be able to just use the variable $forumid. And you should combine your conditions:
HTML Code:
<if condition="!in_array($forumid, array(103))"> HTML Code:
<if condition="$forumid != 103"> |
Thanks again... but its still not working... i tried both codes, the one for multiple forums and the one for just one forum... none are working....
http://www.fatboymagazine.com/showthread.php?t=33215 here is new code i have in template postbit_attachmentthumbnail Code:
<if condition="$forumid != 103"> --------------- Added [DATE]1221060417[/DATE] at [TIME]1221060417[/TIME] --------------- I've seen and posted on 1 post about conditional templates in the programming forum - should I have posted this there? I figured it was template orientated it fit well here.... Either way, looking forward to your help again Lynne, I know I must seem like a pain in the butt - thanks again! |
If I were doing this, this is what I'd do.
First get your condition to work. Just put "Boo" and "Hello" in there to see what get's spit out. That way you may sure "Boo" shows when you are not in forumid 103 and "Hello" shows only in forumid 103. Then, after I am sure the condition is working, I'd go put the code in there. |
Hey thanks - tried that and the condition doesn't seem to work at all... nothing shows up...
Again, I tried both codes for 1/multiple forums. here is new code i have in template postbit_attachmentthumbnail Code:
<if condition="!in_array($forumid, array(103))"> Thanks again. |
It should show one of those if there is a thumbnail that is supposed to be there. Do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source and make sure the template is even being called. If it is, it should be printing one of those words.
edit: I see a thumbnail attachment in the thread you linked to. Did you just revert it? |
Yeah... I reverted it... will do the option changes now
|
OK, you did that. Now, at the *end of the template* (so your thumbnails still are there while you figure this out) put:
HTML Code:
<if condition="$forumid != 103"> Another thing to try instead of $forumid is $threadinfo[forumid]. |
ok... the words are showing up but the condition itself isn't working...
http://www.fatboymagazine.com/showthread.php?t=32906 It's showing the word testing when it should show the words test - humor..... this is what my code looks like now after your suggestions: Code:
|
Try the condition I posted in post 12.
|
Just did.... still showing the only the word "testing"
My current code.... Code:
<img src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&stc=1&d=$attachment[dateline]" border="0" alt="" style="display:none;"/> |
OK, it's almost like the forumid isn't available there. Put this at the end:
HTML Code:
Testing:<br> |
<a href="http://www.fatboymagazine.com/showthread.php?t=33215" target="_blank">http://www.fatboymagazine.com/showthread.php?t=33215</a> - tried it.... nothing showed up....
|
Sorry I missed your reply somehow.
I saw you posted over at vb.com and got told that perhaps $GLOBALS[forumid] will do the trick. Did it? |
That did it!!!
I didn't even know I got a reply over there until I read your post. lol. You are great for helping me, seriously - thank you. |
Glad you got it to work!
|
All times are GMT. The time now is 09:52 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|