vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to do an "if" on a usergroup (https://vborg.vbsupport.ru/showthread.php?t=139593)

itrends 02-16-2007 06:30 PM

How to do an "if" on a usergroup
 
How do i get an image to show in the postbit of a user dependant on if they are associated with a usergroup?

Meaning

If user is in usergroup 1 = dont show image
if user is in usergroup 2 = do show image

?

Cheers :)

kall 02-16-2007 06:38 PM

PHP Code:

<if condition $bbuserinfo[usergroup] == x>do this</if> 

That's your basic one.

itrends 02-16-2007 06:44 PM

perfic, thank you :)

Doesnt work :(

I used <if condition = $bbuserinfo[usergroup] == 10>I Donated!</if>

but it shows on everyone when used in the postbit :(

I should point out that I am checking if they are a member of a SECONDARY usergroup

Meaning, their primary usergroup is registered users and their secondary is 10.

Any help please? :)

kall 02-16-2007 08:51 PM

Oops. :)

$bbuserinfo is for the VIEWER.

You probably want to use $post instead of $bbuserinfo, in the example i gave.

itrends 02-16-2007 09:01 PM

Didn't work either. Just prints the text on the postbit of every single user.

I just want it to print the text If they are in usergroup id 10

Any ideas?

Adrian Schneider 02-16-2007 09:21 PM

Code:

<if condition="$post['usergroupid'] == X">Display This</if>

itrends 02-16-2007 09:29 PM

Thanks. Still doesn't work.

I put

<if condition="$post['usergroupid'] == 10">I Donated</if>

In my postbit_legacy and it does not show for anyone, not even the users that are in usergroup 2 and also associated with usergroup 10.

:(

Kirk Y 02-16-2007 09:52 PM

Try this:

Code:

<if condition="is_member_of($post,10)">I Donated</if>

itrends 02-16-2007 10:01 PM

Thank you so much. That one worked :)


All times are GMT. The time now is 09:55 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.01046 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_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