vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Height and weight custom user field (https://vborg.vbsupport.ru/showthread.php?t=319007)

SPEEDKILLZ 06-09-2015 06:16 PM

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.

kh99 06-09-2015 06:28 PM

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.

MarkFL 06-09-2015 06:31 PM

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. :D

SPEEDKILLZ 06-09-2015 08:40 PM

Quote:

Originally Posted by kh99 (Post 2547482)
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 (Post 2547484)
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. :D

Sounds great sir.

kh99 06-09-2015 08:43 PM

Quote:

Originally Posted by SPEEDKILLZ (Post 2547491)
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.

SPEEDKILLZ 06-09-2015 08:51 PM

Quote:

Originally Posted by kh99 (Post 2547493)
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:


All times are GMT. The time now is 09:52 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.01041 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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