Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 06-17-2006, 09:54 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In online.php templates, you can use:
- $bbuserinfo (vB3.0 style, depreciated but still supported in 3.5 and up)
- or $vbulletin->userinfo (vB3.5 & up style)

To use a field from the userinfo use either:
- $bbuserinfo[field]
- $vbulletin->userinfo[field] (PS If you get "Array"-errors, then surround with curly-brackets, ie: {$vbulletin->userinfo[field]} )

To test for usergroup you can use:
HTML Code:
<if condition="is_member_of($bbuserinfo, 15)">
or
HTML Code:
<if condition="is_member_of({$vbulletin->userinfo}, 15)">
Reply With Quote
  #12  
Old 06-17-2006, 10:28 AM
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Location: London
Posts: 516
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doing this hides all the information for everyone else too.

I have a usergroup where, no matter what they enter into their profile, nobody else on the forum can see their contact/messenger details. This is because of an abuse issue.

I don't care what this group can see, I want to stop everyone else from being able to contact them. So far I've sorted everything except for WOL.

Theoretically all the above suggestions should work, they do everywhere else. However something seems to be missing in WOL to prevent it.
Reply With Quote
  #13  
Old 06-17-2006, 11:01 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i now see what you are trying. You want this based on the usergroup if the row of the user being displayed on that line, and not based on the usergroup of the user logged in.

All user information about the current row is stored in $userinfo, so that is what you will need to use.

There is however a problem, not all information about a user is pulled from the database for each row that is displayed on the WOL. Only information that is needed for vBulletin to display that row is retrieved. The usergroupid or the membergroupids are not loaded.

Unfortunatly there is no option to retrieve this information when the table of online users is populated, with a plugin. You could use a plugin, but that would probably mean 1 extra query for each online user, so from performance POV that is not a good option.

The best option would be to us a code edit in online.php.

For vB3.5.4, edit online.php and find the following (line 184)
PHP Code:
$allusers $db->query_read("
    SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo, user.skype, 
And add the following line under the above lines:
PHP Code:
    user.usergroupiduser.membergroupids
For vB 3.6, edit online.php and find the following (line 236)
PHP Code:
$allusers $db->query_read_slave("
    SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo, user.skype, 
And add the following line under the above lines:
PHP Code:
    user.usergroupiduser.membergroupids
Now you can use the is_member_of($userinfo, 15).
Reply With Quote
  #14  
Old 06-17-2006, 01:06 PM
moonclamp's Avatar
moonclamp moonclamp is offline
 
Join Date: May 2004
Location: London
Posts: 516
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fantastic, that worked thank you very much

All except the syntax of the if condition

<if condition="$userinfo[usergroupid] == 15"> worked but <if condition="is_member_of($userinfo,15)"> ) didn't for some reason.
Reply With Quote
  #15  
Old 02-27-2007, 03:42 PM
feldon23's Avatar
feldon23 feldon23 is offline
 
Join Date: Oct 2001
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, the $userinfo is really crippled in Who's Online. We really need $userinfo[usergroup].
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 03:55 PM.


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.03883 seconds
  • Memory Usage 2,210KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_html
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete