vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Can you use if/then forumhome conditionals in the category descriptions? (https://vborg.vbsupport.ru/showthread.php?t=279965)

rrr 03-12-2012 11:05 PM

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.

kh99 03-12-2012 11:14 PM

The condition you posted should be:

Code:

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

but I don't know if that will solve your problem.

Simon Lloyd 03-13-2012 07:39 AM

To show it everywhere BUT showthread
HTML Code:

<if condition="THIS_SCRIPT != 'showthread'">

rrr 03-13-2012 03:48 PM

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?

Simon Lloyd 03-13-2012 04:27 PM

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

rrr 03-13-2012 04:40 PM

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

Simon Lloyd 03-13-2012 04:43 PM

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

rrr 03-13-2012 09:30 PM

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

Simon Lloyd 03-14-2012 06:55 AM

Glad your sorted :)


All times are GMT. The time now is 10:43 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
  • Page Generation 0.01327 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (5)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete