vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Template conditional question (https://vborg.vbsupport.ru/showthread.php?t=207581)

JamesAB 03-07-2009 05:22 AM

Template conditional question
 
I'm editing the memberinfo_block_contactinfo template.

I wanted to add a conditional based on the usergroupid of the member whose profile is being viewed, not the usergroupid of the person viewing the profile page.

Is the usergroupid already available here? Or do I need to make a plugin to get it?

Thanks,
James

TigerC10 03-07-2009 08:05 AM

It's already there, the $userinfo variable contains all of the data for the user you're currently viewing the memberinfo profile for. So access the userid of the person you want like so: $userinfo['usergroupid']

This is NOT the same person as $vbulletin->userinfo['usergroupid'] (well, I suppose that it can be the same person if someone is viewing their own profile).

JamesAB 03-07-2009 05:58 PM

Thanks TigerC10. I don't feel so badly about getting confused on that one now.

This worked for me in the template:
Code:

<if condition="is_member_of($userinfo['usergroupid'], 5, 6, 9, 11, 13, 15, 17, 21, 22, 23)">
However it didn't work when I tried to use the expression !is_member_of instead. :confused:

Thanks,
James


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