Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Design and Graphics Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-09-2008, 06:35 PM
nando99 nando99 is offline
 
Join Date: Dec 2005
Location: South Florida
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 09-09-2008, 07:10 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<if condition="in_array($foruminfo[forumid], array(xx,yy))">
do stuff only in forumid xx and yy
</if>
Reply With Quote
  #3  
Old 09-09-2008, 07:29 PM
nando99 nando99 is offline
 
Join Date: Dec 2005
Location: South Florida
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #4  
Old 09-09-2008, 08:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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))">
  stuff in all forums except 12 and 13
</if>
Reply With Quote
  #5  
Old 09-10-2008, 02:12 AM
nando99 nando99 is offline
 
Join Date: Dec 2005
Location: South Florida
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey - thanks again....

This is my code for template: postbit_attachmentthumbnail

Code:
<if condition="!in_array($foruminfo[forumid], array(103))">
<img src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" border="0" alt="" style="display:none;"/>
<div style="float:left; display:block; width:111px; height:111px; text-align:center;">
<table cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle" height="111" width="111" style="margin:0px; padding:0px;">
<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" rel="Lightbox" id="attachment$attachment[attachmentid]"<if condition="$show['newwindow']"> target="_blank"</if>><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1&amp;d=$attachment[thumbnail_dateline]" border="0" alt="Click for a bigger size image." align="middle" style="border: solid 3px #cccccc;"/></a></td></tr></table>
</div>
</if>

<if condition="in_array($foruminfo[forumid], array(103))">
<div align="center"><img src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" border="0" alt=""/>
</div>
</if>
The code for it NOT to show seems to work since it doesn't show the full image in any forum, but it doesn't show the full image in the post located in the forum with ID 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!
Reply With Quote
  #6  
Old 09-10-2008, 02:23 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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))">
 do something
<else />
 else do something else
</if>
And, if it is just one single forum, you may want to just go:
HTML Code:
<if condition="$forumid != 103">
 do something
<else />
 else do something else
</if>
Reply With Quote
  #7  
Old 09-10-2008, 11:47 AM
nando99 nando99 is offline
 
Join Date: Dec 2005
Location: South Florida
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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">

<img src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" border="0" alt="" style="display:none;"/>
<div style="float:left; display:block; width:111px; height:111px; text-align:center;">
<table cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle" height="111" width="111" style="margin:0px; padding:0px;">
<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" rel="Lightbox" id="attachment$attachment[attachmentid]"<if condition="$show['newwindow']"> target="_blank"</if>><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1&amp;d=$attachment[thumbnail_dateline]" border="0" alt="Click for a bigger size image." align="middle" style="border: solid 3px #cccccc;"/></a></td></tr></table>
</div>

<else />

<div align="center"><img src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" border="0" alt=""/>
</div>

</if>
Thanks again - have any other ideas?

--------------- 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!
Reply With Quote
  #8  
Old 09-10-2008, 03:43 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 09-10-2008, 03:56 PM
nando99 nando99 is offline
 
Join Date: Dec 2005
Location: South Florida
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


testing

<else />

test - humor

</if>
It should show the word "testing" in every forum except 103 where it should show "test - humor". It doesn't show anything at all.

Thanks again.
Reply With Quote
  #10  
Old 09-10-2008, 04:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04198 seconds
  • Memory Usage 2,260KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (3)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete