vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Conditionals (https://vborg.vbsupport.ru/showthread.php?t=258566)

Wunderlust 02-08-2011 10:07 PM

Conditionals
 
Hi,

i have searched but cannot find the conditional to do the following:-

Show an ad after the last post AND also only if there is more than one reply to the thread. Could anyone help me with this?

Thanks

TIm

Lynne 02-09-2011 12:08 AM

What template are you putting the condition in? If the postbit/_legacy, then I think the variables are $post['postid'] (you want that to not be 1) and $post['islastshown']. So, something like:

HTML Code:

<vb:if condition="$post['islastshown'] AND $post['postcount'] != 1">stuff</vb:if>
I've not tested it, but I think it's something like that.

Wunderlust 02-09-2011 10:29 AM

Thx Lynne, I did try that but alas it does not seem to have an affect! I also tried maxposts but to no avail :-(

Lynne 02-09-2011 02:35 PM

I tried it on my site and it worked just fine. Exactly where are you putting it and can we have a link to a page where it should show up.

Wunderlust 02-09-2011 10:01 PM

Hi Lynne, I am putting the code right at the bottom of the postbit legacy template.

An example of a thread with no posts is here.. http://www.tacklebox.com.au/forums/f...ir-travel.html

I also have another conditional to show the ads after the first post which uses the following:

PHP Code:

<vb:if condition="$post[postcount] % $vboptions[maxposts] == 1">
Google Code
</vb:if> 

This is just before the conditional that I want to only show one ad if no posts made.

Lynne 02-09-2011 10:04 PM

Whoops, I'm sorry. I had first written $post['postid'] before doing it on my site and figuring out it was actually $post['postcount']

HTML Code:

<vb:if condition="$post['islastshown'] AND $post['postcount'] != 1">stuff</vb:if>

Wunderlust 02-09-2011 10:22 PM

Wonderful Lynne - you rock! Now to start annew thread on my second problem!


All times are GMT. The time now is 11:48 AM.

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.01098 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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