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)

fitnesshealth 07-26-2010 11:49 PM

I have a piece of code added to the end of footer template but I want this piece of code to be visible only when i'm reading a thread (any thread).

May I ask if there's any conditional for this?

BirdOPrey5 07-27-2010 01:05 AM

Quote:

Originally Posted by fitnesshealth (Post 2075012)
I have a piece of code added to the end of footer template but I want this piece of code to be visible only when i'm reading a thread (any thread).

May I ask if there's any conditional for this?

try this:

Code:

<vb:if condition="THIS_SCRIPT == 'showthread'">
Show this only in a thread
</vb:if>


fitnesshealth 07-27-2010 06:41 AM

Thanks, works great!

encryption 07-31-2010 08:11 PM

I would really benefit from a similar list of conditionals from php code, rather than conditionals. I can do nearly anything I want in a template thanks to this list, but trying to determine if a user is a member of a usergroup via php code is still foreign to me. Does anybody know of a list of these, or is anybody willing to translate this list to a php counterpart list? :)

ICannt.org 08-07-2010 06:40 AM

Quote:

Originally Posted by ICannt.org (Post 2060895)
Hello all,

How would I be able to make a mix of this? ie: Show in all forums except for 40, 41, and 42?

Cheers

Any idea on this?
Cheers

adom7 08-07-2010 10:54 AM

Can anyone assist me how to show a few texts on a certain time?
Let me explain,
I want my users see some texts displaying on site in the morning, however in the evening they will see another text on site.

Is there a conditional for that?

Lynne 08-07-2010 02:24 PM

Quote:

Originally Posted by ICannt.org (Post 2080415)
Any idea on this?
Cheers

HTML Code:

<vb:if condition="!in_array($forum['forumid'], array(40, 41, 42))">Show if not in forumids 40, 41, or 42
</vb:if>

Quote:

Originally Posted by adom7 (Post 2080470)
Can anyone assist me how to show a few texts on a certain time?
Let me explain,
I want my users see some texts displaying on site in the morning, however in the evening they will see another text on site.

Is there a conditional for that?

I think you are going to require more than a condition. You'll have to write plugin that takes TIMENOW (the current time in unix time) and converts it to the users time (don't forget that there are timezones to consider here) and then use the result there in your condition. You can look in the API here - http://members.vbulletin.com/api/ - for vbdate and that should help.

adom7 08-07-2010 05:09 PM

Quote:

Originally Posted by Lynne (Post 2080525)

Quote:

Can anyone assist me how to show a few texts on a certain time?
Let me explain,
I want my users see some texts displaying on site in the morning, however in the evening they will see another text on site.

Is there a conditional for that?
I think you are going to require more than a condition. You'll have to write plugin that takes TIMENOW (the current time in unix time) and converts it to the users time (don't forget that there are timezones to consider here) and then use the result there in your condition. You can look in the API here - http://members.vbulletin.com/api/ - for vbdate and that should help.

Thank you, Lynne
But I can't do that by myself. I hope someone handle it :erm:
I would like to use it for adsense.

Come2Daddy 08-11-2010 05:47 PM

Beautiful :)

XLCR GODFATHER 08-13-2010 08:02 PM

Please Help.
I am unable to duplicate results in other Templates

I have been able to set linked images to show in the postbit_legacy template for custom profile fields with no problem using

Code:

<vb:if condition="$post['fieldx']">
my link and image information
</vb:if>

I tried
Code:

<vb:if condition="$bbuserinfo['fieldx']">
my link and image information
</vb:if>

But this shows the user who is viewing the informations link (if set) as apposed to the member who's profile they are viewing

So what I am asking is, is there an alternative conditional for?
Code:

<vb:if condition="$post['fieldx']">
or is there something I am missing else where?

Thank you in advance for any help....


All times are GMT. The time now is 01:39 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.01518 seconds
  • Memory Usage 1,744KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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