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)

Lynne 06-08-2011 02:36 PM

Quote:

Originally Posted by baghdad4ever (Post 2205038)
hi

how to display Google ads to the guest and in home page only?

Assuming your "home page" is the forum.php page....
Code:

<vb:if condition="$show['guest'] AND THIS_SCRIPT == 'index'">
ad
</vb:if>


baghdad4ever 06-08-2011 06:10 PM

Quote:

Originally Posted by Lynne (Post 2205060)
Assuming your "home page" is the forum.php page....
Code:

<vb:if condition="$show['guest'] AND THIS_SCRIPT = 'index'">
ad
</vb:if>



thanks lynne

but this will occur


Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3416

The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish

BirdOPrey5 06-08-2011 09:03 PM

Change the = to == and try again. :)

ChromeDome 06-11-2011 02:02 PM

How can I create a condition based on "Social Groups" (no user groups)? I tried this but it didn't work:

Code:

<vb:if condition="($bbuserinfo['groupid'] <> 2) ">

CONTENTS GO HERE

</vb:if>


BirdOPrey5 06-11-2011 02:30 PM

Where are you trying to use this conditional?

ChromeDome 06-11-2011 03:09 PM

I want to use it in the footer template.

My site uses a floating tool bar. For members that want to hide the tool bar all together, I want to allow them to add themselves to the social group, "Hide Tool Bar". I then want to use the conditional to hide the tool bar code if the user is a member of this social group.

BirdOPrey5 06-11-2011 04:29 PM

Quote:

Originally Posted by ChromeDome (Post 2206251)
I want to use it in the footer template.

My site uses a floating tool bar. For members that want to hide the tool bar all together, I want to allow them to add themselves to the social group, "Hide Tool Bar". I then want to use the conditional to hide the tool bar code if the user is a member of this social group.

Ahh... OK, well that will never work with social groups.

Luckily however vBulletin has a built in feature, publicly joinable usergroups that should work exactly as you describe.

In your Usergroup manager in Admin CP, make a new usergroup based off of registered users. Set the option to make it a publicly joinable usergroup. Call it "Hidden Toolbar" or whatever.

Members can join it via the User CP -> Group Memberships

And then you can use the standard condition:

Code:

<vb:if condition="is_member_of($bbuserinfo, X)">
Where X is the usergroup you made.


OR... now that I've typed that out... The "right" way of doing this would be using a Custom Profile Field.

In Admin CP make a New Custom Profile Field... Basically a "Yes/No" option to turn on/off the toolbar...

Then you would use a condition like:

Code:

<vb:if condition="$bbuserinfo['fieldX'] == 'Yes' ">
Where X is the field # assigned by vBulletin.

I can give you more details on this if you think it will work for your needs.

ChromeDome 06-11-2011 05:37 PM

I used the custom profile field solution. Thank you so much!!!!

kether1 06-12-2011 05:58 PM

Is there a conditional to use if one would like to show something only to the member who posted the post?

For example:
I created a custom field that I would like for the member to enter information into that s/he and the admin can see when posted, but no other members can see. (A secure field - if you will).

Thanks,
Kether

BirdOPrey5 06-12-2011 06:11 PM

You could do a condition to show code only to the user who posted it...

Code:

<vb:if condition="$bbuserinfo['userid'] == $post['userid']">
(will work in the postbit)


But you'd still need to make the extra field to hold the data and everything else needed to process it. The conditional is the easy part.


All times are GMT. The time now is 02:40 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.02829 seconds
  • Memory Usage 1,745KB
  • 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
  • (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