Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-09-2012, 06:41 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using custom fields on member.php

Hi to everyone, i'm trying to use custom fields variables in member.php, what hook can i use? And what should be the name of each variable?

I mean in postbit you can use $post['fieldx']
To show the field of the user that is viewing you can use $vbulletin->userinfo['fieldx']
What can i use to show the custom field of the user that i'm viewing on member.php?

--------------- Added [DATE]1347303571[/DATE] at [TIME]1347303571[/TIME] ---------------

No one?
Reply With Quote
  #2  
Old 09-11-2012, 04:28 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump
Reply With Quote
  #3  
Old 09-12-2012, 08:10 AM
qpurser qpurser is offline
 
Join Date: Jul 2011
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didn't use a hook but edited the template directly. Don't know if that is any help for you.
Bare with me as I am not a Pro in coding but here is some code I used to show 2 custom fields in the "About Me" tab under "statistics".
I had to edit the "memberinfo_block_statistics" template and used this code:


Code:
<h5 class="subblocksubhead subsubsectionhead">Last 2 Meetings attended:</h5>
<dl class="blockrow stats">
<dt>Meeting 1</dt> <dd>{vb:raw userinfo.field16}</dd>
</dl>
<dl class="blockrow stats">
<dt>Meeting 2</dt> <dd>{vb:raw userinfo.field19}</dd>
</dl>
Look at the attachment to see the result.
Attached Images
File Type: png Screen Shot 2012-09-12 at 11.08.27 AM.png (51.1 KB, 0 views)
Reply With Quote
  #4  
Old 09-12-2012, 08:54 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks very much for your reply qpurser , actually i'm not sure if this can can really help me since i need to see my code (in another computer), just a little question, doesn't {vb:raw userinfo.fielex} supposed to show the field of the user that is viewing the page instead of the field of the user's profile that you're viewing?, are you sure it works? Thank you again
Reply With Quote
  #5  
Old 09-12-2012, 09:31 AM
qpurser qpurser is offline
 
Join Date: Jul 2011
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scanu View Post
just a little question, doesn't {vb:raw userinfo.fielex} supposed to show the field of the user that is viewing the page instead of the field of the user's profile that you're viewing?, are you sure it works? Thank you again
I am confused about this question.
Not sure if I understood you well but let me explain what I did to verify:

Info from the adminCP:
Test User: Meeting 1 = 2012-09-02 and Meeting 2 = 2011-07-01
Test Member: Meeting 1 = 06-18-2012 and Meeting 2 = 05-19-2010

When I am logged in as "test user":
Looking at my own profile the info from those 2 fields is 2012-09-02 and 2011-07-01
Looking at the profile from Test Member the info is 06-18-2012 and 05-19-2010
Looking at the profile from another user who had nothing in those fields nothing shows up in his profile.

Hope that was the info you were looking for
Reply With Quote
  #6  
Old 09-12-2012, 09:42 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes that was, thank you i wi'l try if i can comes up with something using $vbulletin->userinfo['fieldx'] (equivalent of {vb:raw bbuserinfo.fieldx}) as soon as i can

--------------- Added [DATE]1347495350[/DATE] at [TIME]1347495350[/TIME] ---------------

Good news! I figure this out! Thanks anyway for your help i don't know why but it motivates me

Hook: userprofile_create
Variable: $this->userinfo['fieldX'] (and $this->registry->options['ur_option'] to use an option)
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 12:24 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.04150 seconds
  • Memory Usage 2,225KB
  • Queries Executed 12 (?)
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
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete