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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2006, 02:35 PM
mihai11 mihai11 is offline
 
Join Date: Dec 2005
Location: Sibiu - Romania
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default All Vb <if> conditions

Hi,

I would like to learn more about the conditions that I can use in VB templates. For example, I am aware of the following tests:

<if condition="$show['guest']">You're a guest!</if>

<if condition="$show['member']">You're a member, not a guest</if>

How can I find out what other tests I can perform with the variable "$show" ?
For example, can I use it to find out if the user browsing the page is an administrator ?

If the answer is "yes", then how did you knew how to build the test condition ?

Regards,
Razvan
Reply With Quote
  #2  
Old 11-20-2006, 04:12 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<if condition="is_member_of($vbulletin->userinfo, 6)">This will show to admins</if>
You can replace the 6 with any usergroupid, or check for a few at a time (5, 6, 7) to see if they are in any of them. It's parsed as PHP code so the possible conditions are nearly infinite.
Reply With Quote
  #3  
Old 11-20-2006, 09:19 PM
mihai11 mihai11 is offline
 
Join Date: Dec 2005
Location: Sibiu - Romania
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where are these functions defined ? (show, is_member_of)

Can I get a list of these built-in functions ?

Regards,
Razvan
Reply With Quote
  #4  
Old 11-20-2006, 09:36 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$show is a variable, and is_member_of() is a function.

Here is a list of some common conditions you can use,
http://www.vbulletinzone.com/t44
Reply With Quote
  #5  
Old 11-22-2006, 04:36 PM
mihai11 mihai11 is offline
 
Join Date: Dec 2005
Location: Sibiu - Romania
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is great resource !!! Thanks !!!

What about the variables, like $show ? Is there some VB documentation about what variables are available and where (in which templates) ?
Reply With Quote
  #6  
Old 12-15-2010, 01:14 AM
gbechtel gbechtel is offline
 
Join Date: Aug 2005
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want to be able to block ads by IP or a block of IP's. I don't want to move members into groups because some of the users I don't want to show ads to are not even members. The problem I am having is with users clicking on Google Ads that are on the same network, I don't want any issues with Google so I am trying to take care of the issue before I get the warning from them.

Is their a condition that does this, does anyone have a starting point that I could play around with and test?

Thanks.
Reply With Quote
  #7  
Old 12-15-2010, 01:21 AM
JacquiiDesigns's Avatar
JacquiiDesigns JacquiiDesigns is offline
 
Join Date: Dec 2008
Location: Tennessee
Posts: 687
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gbechtel View Post
I want to be able to block ads by IP or a block of IP's. I don't want to move members into groups because some of the users I don't want to show ads to are not even members. The problem I am having is with users clicking on Google Ads that are on the same network, I don't want any issues with Google so I am trying to take care of the issue before I get the warning from them.

Is their a condition that does this, does anyone have a starting point that I could play around with and test?

Thanks.
You bumped a thread from 2006 o.O -- You may get a better response if you post your own thread. Also - what version of vBulletin are you using?

At anyrate - No - There is no condition for blocking IP address. A list of conditionals for vB 3.x can be found at http://tech6.com/f51/vbulletin-templ...als-list-t112/ -- I'm not familiar with vB4 conditionals - you might be able to find a list here or at http://vbulletin.com - use search

HTH,

Jacquii.
Reply With Quote
  #8  
Old 08-17-2011, 04:38 PM
s.sami s.sami is offline
 
Join Date: Mar 2011
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<if condition="is_member_of($vbulletin->bf_ugp_forumpermissions['canview'])"> is this possible ?
Reply With Quote
  #9  
Old 08-17-2011, 04:45 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by s.sami View Post
<if condition="is_member_of($vbulletin->bf_ugp_forumpermissions['canview'])"> is this possible ?
What you have there won't work. What are you trying to do?
Reply With Quote
  #10  
Old 08-17-2011, 04:52 PM
s.sami s.sami is offline
 
Join Date: Mar 2011
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i try if the user have permisson view category can see lastpost title on the forum statics but if No have permission (see you dont have permission)

i use this

Code:
 <if condition="!in_array($bbuserinfo[usergroupid], array(5,6,9))">
<if condition="in_array($latestpost[forumid], array(43, 44, 45, 160, 161, 36, 37, 95, 146, 153, 38, 39, 40, 41, 94, 104))"> 

<a href="showthread.php?p=$latestpost[lastpostid]" class="text3"><b><font color="red">you dont have permisson view this title!</font><b></span>

<else />
<a href="showthread.php?p=$latestpost[lastpostid]" class="hak">$latestpost[title]</span>

</if>
bu as you know this is not useful..
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 04:03 AM.


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.04386 seconds
  • Memory Usage 2,256KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete