vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   membergroupids Conditional (https://vborg.vbsupport.ru/showthread.php?t=69993)

Saphrym 09-29-2004 07:04 PM

membergroupids Conditional
 
I know the syntax for doing a conditional that checks equality for a groupid.

I'm trying to find out if there's a way to do a template conditional that returns true if a certain ID is in membergroupids WITHOUT being equal to it.

I.E. I want an image to be posted to the left of the poster name on the postbit IF they are a member of a certain group OR a secondary member of a group.

Revan 09-29-2004 07:10 PM

I do not know if the following will work for both primary and secondary usergroups, but anyways:
Code:

if condition="is_member_of($id_of_group)"> html here <else> other html here </if>
Note that most of my "from memory" coding doesnt work right away, so please dont flame me if this turns out to become soup :p

Saphrym 09-29-2004 07:34 PM

Quote:

Originally Posted by Revan
I do not know if the following will work for both primary and secondary usergroups, but anyways:
Code:

if condition="is_member_of($id_of_group)"> html here <else> other html here </if>
Note that most of my "from memory" coding doesnt work right away, so please dont flame me if this turns out to become soup :p

Hmmm... No... that doesn't seem to work. Let me see if I can find the boolean syntax for if an item is contained in an array. If there is such a thing.

Saphrym 09-29-2004 07:39 PM

Well... I should have known that would have been a useless search. No such thing. Argh.

Zachery 09-29-2004 09:05 PM

<if condition="is_member_of($var, X)"> user is part of X <else /> user is not part of x</if>

$var should contain membergroupids in it, such examples are $bbuserinfo and $post

X should be the group you want to check for.

Saphrym 09-30-2004 12:16 AM

Quote:

Originally Posted by Zachery
<if condition="is_member_of($var, X)"> user is part of X <else /> user is not part of x</if>

$var should contain membergroupids in it, such examples are $bbuserinfo and $post

X should be the group you want to check for.

Ok I tried this:

Code:

is_member_of($bbuserinfo['membergroupids'], 9)
It resulted in true for everyone on my forums... even the people who were NOT members of group 9. Did I do something wrong?

Saphrym 09-30-2004 12:20 AM

Quote:

Originally Posted by Saphrym
Ok I tried this:

Code:

is_member_of($bbuserinfo['membergroupids'], 9)
It resulted in true for everyone on my forums... even the people who were NOT members of group 9. Did I do something wrong?

Nevermind.

This worked:

Code:

<if condition="is_member_of($post, 9)">
Thanks!


All times are GMT. The time now is 01:44 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.00976 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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