vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   User Profile Field Question (https://vborg.vbsupport.ru/showthread.php?t=155093)

sunilvarma 08-13-2007 09:57 AM

User Profile Field Question
 
I created a user profile field and want to use it in the FORUMHOME template.

To show it in the postbit I used $post[field6] and it works. But if I use this in the FORUMHOME template, it doesn't work.

I know I'm missing something here. Can someone help me with this?

nico_swd 08-13-2007 10:41 AM

Try
PHP Code:

$vbulletin->userinfo['field6']; 


sunilvarma 08-13-2007 10:58 AM

nope, that didn't work.

Opserty 08-13-2007 11:15 AM

<font face="Courier New">$bbuserinfo['field6']</font>

sunilvarma 08-13-2007 11:22 AM

this shows only the info for the logged in user. but i want to work i a slightly different way.

in the who's online list i want to show the field6 of each loggedin user against their username.

sunilvarma 08-15-2007 11:42 AM

anyone?

Opserty 08-15-2007 11:46 AM

You'd have to write a plugin then since I don't think userfields are fetched in the "Whats Going On" but. If you know the PHP side of vBulletin then you'd need to find the correct hook location (the one inside the user display loop) and use $userinfo = fetch_userinfo($userid) to fetch the info for the specified user. Then use $userinfo['field6'] to access the data.

sunilvarma 08-15-2007 02:46 PM

well, unfortunately i am not that good at PHP. so could you elaborate further?

Thanks

Opserty 08-15-2007 03:12 PM

Add a new plugin

With hook location forumhome_loggedinuser

PHP Code:

$online_userinfo fetch_userinfo($loggedin['userid']); 

The in Style Manger Go to Edit Templates -> Forum Home Templates -> forumhome_loggeninuser

Add $online_userinfo[field6] to the end of it.

Don't know if that is the most efficient way to do it, but it works. Hopefully :)

sunilvarma 08-15-2007 04:11 PM

thanks a lot Opserty. it worked.


All times are GMT. The time now is 10:27 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.01488 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete