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)

Hawk7173 03-23-2011 09:15 PM

It was posted in forumdisplay

Thanks

Footman 03-24-2011 11:45 AM

Hello all. Firstly thanks for the list. It 'should' help me with what I'd like to do... but I need to ask for a bit of help here.

I'm trying to show the "Style Chooser" in the footer to ONLY certain user groups. I just can't figure where to place the code in the footer. Below is the portion of the footer code I think I should be working with:
Code:

<vb:if condition="$show['quickchooser']">
                <select name="styleid" onchange="switch_id(this, 'style')">
                        <optgroup label="{vb:rawphrase quick_style_chooser}">
                                {vb:raw quickchooserbits}
                        </optgroup>
                </select>
</vb:if>

I was using this bit of supplied code from the OP:
Code:

<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</vb:if>
Any ideas where to place the code?

Thanx

BirdOPrey5 03-24-2011 12:21 PM

Since there's already a conditional, you should just add it to the existing conditional using an "AND" :

Code:

<vb:if condition="$show['quickchooser'] AND is_member_of($bbuserinfo, 1,2,3)">
                <select name="styleid" onchange="switch_id(this, 'style')">
                        <optgroup label="{vb:rawphrase quick_style_chooser}">
                                {vb:raw quickchooserbits}
                        </optgroup>
                </select>
</vb:if>

Where 1, 2, and 3 are the usergroups you want to show the chooser to.

You understand however any user could still change their style via their User CP options whether or not the quick-chooser is actually shown on every page.

Footman 03-25-2011 07:48 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2176948)
...You understand however any user could still change their style via their User CP options whether or not the quick-chooser is actually shown on every page.

Hmmmmm Didn't think of that.

I did however figure another way around this. I set the option to change styles to yes, but only have the main theme I want the members to see selected in the "Style Manager." Seems I, as the admin, can see the other themes, but the regular members cannot.

BirdOPrey5 03-25-2011 09:49 PM

That's true, the way to keep users from selecting styles is to uncheck them in the style manager. Only admins will have access to all styles (including unchecked styles.

Bisha 03-27-2011 08:24 PM

What is Conditional tag for post count!

If (post count XXX)
do this 1
else
this 2?

BirdOPrey5 03-27-2011 09:31 PM

Quote:

Originally Posted by Bisha (Post 2178096)
What is Conditional tag for post count!

If (post count XXX)
do this 1
else
this 2?

If you are in the postbit and you want the post count of the person who made the post:

Code:

<vb:if condition="$post['posts'] >= XXX">
do this
<vb:else />
this
</vb:else>

If you want the post count of the current user logged in use:

Code:

<vb:if condition="$bbuserinfo['posts'] >= XXX">
do this
<vb:else />
this
</vb:else>


Lynne 03-27-2011 09:36 PM

actually, that usually will not work if the post count is over 1000 since it is a formatted number, ie. 1,000

BirdOPrey5 03-27-2011 09:50 PM

Quote:

Originally Posted by Lynne (Post 2178116)
actually, that usually will not work if the post count is over 1000 since it is a formatted number, ie. 1,000

Is that new in VB4? I saw mention of this yesterday and tested it in my VB3.8 forum and my 22,000+ post count had no commas (22000) in VB 3.8. :confused:

On the plus side, usually when you're testing for post counts is some minimal number, 5, or 10, or even 100 which shouldn't be affected.

Lynne 03-28-2011 04:03 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2178121)
Is that new in VB4? I saw mention of this yesterday and tested it in my VB3.8 forum and my 22,000+ post count had no commas (22000) in VB 3.8. :confused:

On the plus side, usually when you're testing for post counts is some minimal number, 5, or 10, or even 100 which shouldn't be affected.

Maybe you are just not using commas to format large numbers on your forum? It has definitely been around since vB3 also.


All times are GMT. The time now is 11:26 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.03390 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
  • (5)bbcode_code_printable
  • (4)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