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 09-29-2004, 07:04 PM
Saphrym's Avatar
Saphrym Saphrym is offline
 
Join Date: Sep 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 09-29-2004, 07:10 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 09-29-2004, 07:34 PM
Saphrym's Avatar
Saphrym Saphrym is offline
 
Join Date: Sep 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
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.
Reply With Quote
  #4  
Old 09-29-2004, 07:39 PM
Saphrym's Avatar
Saphrym Saphrym is offline
 
Join Date: Sep 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well... I should have known that would have been a useless search. No such thing. Argh.
Reply With Quote
  #5  
Old 09-29-2004, 09:05 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<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.
Reply With Quote
  #6  
Old 09-30-2004, 12:16 AM
Saphrym's Avatar
Saphrym Saphrym is offline
 
Join Date: Sep 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 09-30-2004, 12:20 AM
Saphrym's Avatar
Saphrym Saphrym is offline
 
Join Date: Sep 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
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 02:28 AM.


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.13928 seconds
  • Memory Usage 2,225KB
  • 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
  • (5)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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