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

Reply
 
Thread Tools Display Modes
  #1  
Old 06-09-2015, 06:16 PM
SPEEDKILLZ SPEEDKILLZ is offline
 
Join Date: Feb 2011
Location: USA
Posts: 641
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Height and weight custom user field

Im trying to figure out how i would go about adding a custom user field "height and weight" where members can choose their stats, in the postbit it would read; Stats: 5'5", 135 lbs any help or guidance would be great.
Reply With Quote
  #2  
Old 06-09-2015, 06:28 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's pretty easy, if I understand what you're asking for. Just go to User Profile Fields in the admincp and create your fields. If you want the user to choose them you'd want Single-Selection Menu.

Then in the postbit (or postbit_legacy) template you just insert something like
Code:
Height: {vb:raw post.fieldX}<br/>
Weight: {vb:raw post.fieldY}
where the X and Y are the actual numbers for the height and weight fields you create (which you can see on the Profile Field Manager display).

This can also be done with a plugin to avoid editing the templates if you'd prefer that, you just need to add to one of the template hooks that are in the postbit. If you wanted the user to enter their data as text then check or format it, you'd need a plugin of course.
Reply With Quote
Благодарность от:
SPEEDKILLZ
  #3  
Old 06-09-2015, 06:31 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will be visiting your site tonight to finish what I began before, and I can take care of this too while I'm at it if you want.
Reply With Quote
Благодарность от:
SPEEDKILLZ
  #4  
Old 06-09-2015, 08:40 PM
SPEEDKILLZ SPEEDKILLZ is offline
 
Join Date: Feb 2011
Location: USA
Posts: 641
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
It's pretty easy, if I understand what you're asking for. Just go to User Profile Fields in the admincp and create your fields. If you want the user to choose them you'd want Single-Selection Menu.

Then in the postbit (or postbit_legacy) template you just insert something like
Code:
Height: {vb:raw post.fieldX}<br/>
Weight: {vb:raw post.fieldY}
where the X and Y are the actual numbers for the height and weight fields you create (which you can see on the Profile Field Manager display).

This can also be done with a plugin to avoid editing the templates if you'd prefer that, you just need to add to one of the template hooks that are in the postbit. If you wanted the user to enter their data as text then check or format it, you'd need a plugin of course.
Great thank you buddy. So if i want them to be able to type in the weight and height i need a plugin? But if i want then to select a height and weight then that is in the user field? Do you know what pugin? Thank you.

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

Quote:
Originally Posted by MarkFL View Post
I will be visiting your site tonight to finish what I began before, and I can take care of this too while I'm at it if you want.
Sounds great sir.
Reply With Quote
  #5  
Old 06-09-2015, 08:43 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SPEEDKILLZ View Post
Great thank you buddy. So if i want them to be able to type in the weight and height i need a plugin? But if i want then to select a height and weight then that is in the user field? Do you know what pugin? Thank you.
Well, if you want the users to enter text instead of choose from a menu, then you still create one or two profile fields. And if you just want to display whatever they type in then you don't need a plugin. But if you want to check or reformat what they enter, then you'd need a plugin (which someone would have to write using php).

But I know MarkFL will get you fixed up.
Reply With Quote
  #6  
Old 06-09-2015, 08:51 PM
SPEEDKILLZ SPEEDKILLZ is offline
 
Join Date: Feb 2011
Location: USA
Posts: 641
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Well, if you want the users to enter text instead of choose from a menu, then you still create one or two profile fields. And if you just want to display whatever they type in then you don't need a plugin. But if you want to check or reformat what they enter, then you'd need a plugin (which someone would have to write using php).

But I know MarkFL will get you fixed up.
Ok thanks buddy. Yes MarkFL is awesome and a huge help. I am just trying to get a concept on how it works for future use. Thank you again. :up:
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 05:25 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.04024 seconds
  • Memory Usage 2,221KB
  • Queries Executed 13 (?)
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_code
  • (4)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
  • (2)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete