vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   vB4 Template Conditionals List (https://vborg.vbsupport.ru/showthread.php?t=231525)

Bisha 03-28-2011 12:42 PM

Thank you both :)

The second is ok in my case!

The number of post is under 1000 so is ok also on vb4!

:)

BirdOPrey5 03-28-2011 01:42 PM

Quote:

Originally Posted by Lynne (Post 2178215)
Maybe you are just not using commas to format large numbers on your forum? It has definitely been around since vB3 also.

After double checking I see indeed $post[posts] is formatted with commas. I was using $bbuserinfo[posts] which isn't. (but of course contains different data.)

attroll 04-02-2011 12:27 AM

I am trying to find the new conditions for VB4.

Old condistion:
Code:

<if condition="$today_is_wednesday">Test</if>
I have tried this with no luck:
Code:

<vb:if condition="$today_is_wednesday">Test</vb:if>
Any ideas?

BirdOPrey5 04-02-2011 01:56 AM

Try:
Code:

<vb:if condition="gmdate('D') == 'Wed' ">
Test
</vb:if>


attroll 04-02-2011 02:26 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2179953)
Try:
Code:

<vb:if condition="gmdate('D') == 'Wed' ">
Test
</vb:if>



I tried putting the following conditions that you recommended in this code for a widget and even when it is not Wednesday it still displays. Any ideas or help would be appreciated.
Code:

<vb:if condition="gmdate('D') == 'Wed' ">
<b>Tonight is a chat night, Scheduled time is 8 pm.</b><br>
</vb:if>


BirdOPrey5 04-02-2011 01:10 PM

This is the exact code I have working right now on my test forum:
Code:

<vb:if condition="gmdate('D') == 'Sat' ">
TESTING!!!!
</vb:if>

If I change Sat to any other day, it doesn't work. Yesterday it worked with Fri instead.

I have this working in my Navbar template.

I've never used widgets, do template conditionals work in them at all?

I did notice a limitation, gmdate returns Greenwich Mean Time, so it works when it's Wednesday in Greenwich, England.
http://us.php.net/manual/en/function.gmdate.php

Unfortunately vBulletin doesn't seem to allow the regular date() function which returns the local date, so this may not work well for you anyway.

FYI- Your code pasted into my navbar works fine.

karlm 04-14-2011 07:53 AM

is it possible to use a conditional to check whether you're viewing ONLY the very front page (CMS)?

e.g. I'd like to add a link in the footer of just the CMS's front page - but not on any other pages, not show if they're reading an article, not show if they're using forum or blogs, etc. etc. - just the front page and only the front page.

HMBeaty 04-14-2011 07:55 AM

Quote:

Originally Posted by karlm (Post 2184487)
is it possible to use a conditional to check whether you're viewing ONLY the very front page (CMS)?

e.g. I'd like to add a link in the footer of just the CMS's front page - but not on any other pages, not show if they're reading an article, not show if they're using forum or blogs, etc. etc. - just the front page and only the front page.

Try this....
HTML Code:

<vb:if condition="THIS_SCRIPT == 'vbcms'">Show this</vb:if>

karlm 04-14-2011 08:14 AM

Thanks HM, but that shows when reading articles too... I need the code to only show on the front page alone - not articles/comments... If you have any ideas on narrowing it down, that would be most appreciated :)

HMBeaty 04-14-2011 08:20 AM

I'm not sure that's possible since the articles/comments run off of that same script....


All times are GMT. The time now is 06:49 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.01519 seconds
  • Memory Usage 1,743KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete