vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   IF Statement Question (https://vborg.vbsupport.ru/showthread.php?t=274786)

Cledus James 11-29-2011 12:06 AM

IF Statement Question
 
Ok basically I'm trying to display an image in postbit depending on whether or not the posting user is in X usergroup. Wondering if anyone can help me out with a simple IF statement.

Code:

<if condition="$post['usergroupid'] == X"></if>
This doesn't work because it's basically going to display the image based on whether or not the reader is in X usergroup. I need one that determines whether the poster is in X usergroup.

kh99 11-29-2011 12:22 AM

That should work. $post['usergroupid'] will be the usergroupid of the poster.

Cledus James 11-29-2011 12:27 AM

It's not. Not sure why it isn't then. Maybe it's because the usergroup Im basing it on is a custom group and not a default one? No idea. The group id is 80 so I added this code within my postbit template:

Code:

<if condition="$post['usergroupid'] == 80">hello</if>
It would not print the "hello". Any ideas for me?

Thanks for all the help.

kh99 11-29-2011 12:51 AM

Is it a secondary (additional) user group? If so (and even if it's not, really), you should use

Code:

<if condition="is_member_of($post, 80)">hello</if>

Cledus James 11-29-2011 02:20 AM

That worked, thanks for your help.


All times are GMT. The time now is 05:42 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.00991 seconds
  • Memory Usage 1,710KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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