Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-12-2012, 11:05 PM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Can you use if/then forumhome conditionals in the category descriptions?

I'm trying to make a banner show in each forum category on the forumhome homepage, but not on the thread view pages or showthread pages.

I tried using
HTML Code:
<if condition="THIS_SCRIPT = index">
But that didn't seem to stop it from showing on showthread (didn't seem to take any effect).

Is there a type of conditional that can work within the category descriptions that for sure accept HTML? That's where I'm putting my banner code.
Reply With Quote
  #2  
Old 03-12-2012, 11:14 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The condition you posted should be:

Code:
<if condition="THIS_SCRIPT == 'index'">

but I don't know if that will solve your problem.
Reply With Quote
Благодарность от:
rrr
  #3  
Old 03-13-2012, 07:39 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To show it everywhere BUT showthread
HTML Code:
<if condition="THIS_SCRIPT != 'showthread'">
Reply With Quote
  #4  
Old 03-13-2012, 03:48 PM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks @kh99 and @simon lloyd

I think the problem may be that conditionals aren't parsed in the "description" area of forums. It seems like you can put HTML there, but the conditionals don't seem to be doing anything.

Are conditionals supposed to work in that area?
Reply With Quote
  #5  
Old 03-13-2012, 04:27 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would then need to edit the forumbit templates, search for "Description" and you'll see something like
HTML Code:
<if condition="$show['forumdescription']">
<div class="smallfont">$forum[description]</div>
</if>
and you want to surrond that with your condition like
HTML Code:
<if condition="THIS_SCRIPT != 'showthread' AND $show['forumdescription']">
<div class="smallfont">$forum[description] <img src="/images/misc/MYADBANNER.gif" /></div>
</if>
<else />
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div>
</if>
</if>
Or something like that. you can use html in the description as i just added a picture to one of mine, when i have time i'll see what else we can use for a condition
Reply With Quote
  #6  
Old 03-13-2012, 04:40 PM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you!

That seems like it could work for one image, but what I'm trying to do is show a category sponsor banner on the homepage category listing, but not show that banner on the showthread or forumdisplay pages.

I *do* want to show the forum description on the forum display, showthread and forumhome, but *only* show the sponsor banner on forumhome.

The code above looks like it would add the same banner to all the forum categories.

When I'm looking at the forumbit templates, they don't seem to have a forumid in them.

I probably should've put all this info in my original post, but I didn't want to overload it with words
Reply With Quote
  #7  
Old 03-13-2012, 04:43 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to look harder in forumhome_forumbit_level1_nopost i found
HTML Code:
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
I haven't checked the others but you can build conditionals in to there to show a different image for each forumid
Reply With Quote
Благодарность от:
rrr
  #8  
Old 03-13-2012, 09:30 PM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks again. I think I've almost wrapped my head around it.

So I edit the forumbit template where the $description variable is and add the banner code after that.

I just need to figure out how to write the conditional to show a different image for each forumid.

I tried:
Code:
<if condition="$forum[forumid] = '17'">
But that still showed the banner after every forum description instead of next to just forumid 17's forum description.

--------------- Added [DATE]1331687984[/DATE] at [TIME]1331687984[/TIME] ---------------

Hmmm, from the looks of this post from Lynne
https://vborg.vbsupport.ru/showpost....1&postcount=15

It doesn't look like a forumid conditional won't work on forumhome?

--------------- Added [DATE]1331689441[/DATE] at [TIME]1331689441[/TIME] ---------------

My bad, I found my error. I thought != meant "does not equal" and = meant "equal".

Turns out it should have been == which actually means "equal"

Code:
<if condition="$forum[forumid] == '17'">
That works on forumhome for only showing a banner on a specific forum category

Thanks again @Simon
Reply With Quote
  #9  
Old 03-14-2012, 06:55 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad your sorted
Reply With Quote
Reply


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 08:44 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.05835 seconds
  • Memory Usage 2,256KB
  • 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
  • (5)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (2)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete