vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   If Condition for usergroup (https://vborg.vbsupport.ru/showthread.php?t=110838)

WNxWakko 03-19-2006 10:34 PM

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.

Freesteyelz 03-19-2006 11:03 PM

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.

WNxWakko 03-19-2006 11:46 PM

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.

Freesteyelz 03-20-2006 12:52 AM

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?

Stangsta 03-20-2006 01:10 AM

See if this helps you

https://vborg.vbsupport.ru/showthread.php?t=109279

Freesteyelz 03-20-2006 01:55 AM

Cool. That's the exact code I've been using in my templates. Though, I learned it at vB.com. :)

WNxWakko 03-20-2006 02:11 AM

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.

yayvb 03-24-2006 01:10 AM

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.

Freesteyelz 03-24-2006 07:42 AM

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.


All times are GMT. The time now is 10:52 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.00992 seconds
  • Memory Usage 1,727KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete