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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-19-2006, 10:34 PM
WNxWakko's Avatar
WNxWakko WNxWakko is offline
 
Join Date: Apr 2003
Location: Paradise, Texas
Posts: 309
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default If Condition for usergroup

I am trying to have something display in memberinfo but only for certain usergroups. Is there an IF condition that will work for this? If this usergroup then yes else no something similar to that.
Reply With Quote
  #2  
Old 03-19-2006, 11:03 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use this:

Code:
<if condition="is_member_of($bbuserinfo,x, y, z)">
Conditional code bit here...
<else />
Default code bit here...
</if>
Where "x", "y" and "z" are replace them with the Usergroups' IDs.
Reply With Quote
  #3  
Old 03-19-2006, 11:46 PM
WNxWakko's Avatar
WNxWakko WNxWakko is offline
 
Join Date: Apr 2003
Location: Paradise, Texas
Posts: 309
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did try that in the memberinfo and it didnt work.

Here was my test,

Code:
<if condition="is_member_of($bbuserinfo,6, 54, 85)">
yes
<else />
no
</if>
Everyones profile just says Yes no matter what group they were in.
Reply With Quote
  #4  
Old 03-20-2006, 12:52 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm actually using the code for many templates, including Members Info. What are you trying to do so I can try and replicate the problem?
Reply With Quote
  #5  
Old 03-20-2006, 01:10 AM
Stangsta's Avatar
Stangsta Stangsta is offline
 
Join Date: Aug 2004
Location: Virginia
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See if this helps you

https://vborg.vbsupport.ru/showthread.php?t=109279
Reply With Quote
  #6  
Old 03-20-2006, 01:55 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool. That's the exact code I've been using in my templates. Though, I learned it at vB.com.
Reply With Quote
  #7  
Old 03-20-2006, 02:11 AM
WNxWakko's Avatar
WNxWakko WNxWakko is offline
 
Join Date: Apr 2003
Location: Paradise, Texas
Posts: 309
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, Ok I figured out what it is doing, but its still not solving my problem.

That code seems to be showing Yes to me on all profiles because I am usergroup 6 so it says ok I will show you YES. But to other members they see No. This in that simple test that is.

Ok, to explain it simple,

I have Teamspeak and VB integrated together. When a member registers and is approved for an account on my site, it automatically gives them access to teamspeak as the DB is shared. Now I have some settings built in profiles via admincp where I can grant them Server Admin, Channel Admin and many other options. Now my Admin usergroups by default have all this already in Teamspeak, but I can also toggle a checkbox in admincp if I want to grant specific rights to certain members.

So I want a condition that will say, If apart of this usergroup say Yes they have this specific access or if box is checked it will also say yes.

I already know the other conditionals, what I cant get to work is based off usergroup. The answer is based on the usergroup of that members I would be viewing not what usergroup I the view is in.
Reply With Quote
  #8  
Old 03-24-2006, 01:10 AM
yayvb's Avatar
yayvb yayvb is offline
 
Join Date: Feb 2005
Location: CT
Posts: 192
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you may be looking for what I'm looking for. You don't want to limit per usergroup, (ie. yes to admin or no to members) you want to limit if the visitor has the usegroup option set to YES or No depending on your situation. Am I right in thinking this? This way you can go through your usergroups and set which usergroup can access your custom page, etc.
Reply With Quote
  #9  
Old 03-24-2006, 07:42 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm still not sure what you mean but you can try:

User:
Code:
<if condition="$post[userid] == x">
Usergroup:
Code:
<if condition="$post[usergroupid] == y">
Where "x" is replace with UserID and for "y" replace with Usergroup ID.
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 07:56 PM.


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.09396 seconds
  • Memory Usage 2,237KB
  • Queries Executed 13 (?)
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
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete