vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Displaying custom fields (https://vborg.vbsupport.ru/showthread.php?t=162152)

chris1979 11-07-2007 05:04 PM

Displaying custom fields
 
The members of my site are known by their real names instead of their usernames. So on pretty much every page, I want to display the custom fields they put their real name in. (customfield6 and customfield7)

On the postbit page, I can use $post[field6] and $post[field7].

I think I need to edit the code to make that work on other pages. Can anyone give me some clues of what I need to edit?

RedGTiVR6 11-07-2007 06:46 PM

You would go to the Custom Profile Fields in the AdminCP and add in the field you want, taking note of the field number.

On our forum I have it set for vehicle information, it's field5 on our forum.

We use postbit_legacy and this is the code I added:

PHP Code:

<if condition="$post['field5']"><div>$vbphrase[field5_title1]: $post[field5]</div></if> 

I used that under the location field:

PHP Code:

<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if> 

I hope that helps!

I should also note that you will need to create a custom phrase for this to work as well. That's what field5_title1 calls to display on the page. I have field5_title1 mapped to Vehicle. The product should be vBulletin when you set up the phrase.

chris1979 11-07-2007 07:26 PM

Sure, I know the field numbers already - it's fields 6 and 7. And in postbit, it works fine - I just put $post[field6] and $post[field7] into the template and their names show up above their posts.

How do I add that same info on other pages though?

Like on the calendar, for example - I want their real name to appear next to the events they've added to the calendar. I can display their username easily ($eventinfo[musername]) but I don't know how I can add the custom fields.

Any ideas?

chris1979 11-09-2007 05:08 PM

Any tips will be really appreciated.


All times are GMT. The time now is 03:26 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.01023 seconds
  • Memory Usage 1,719KB
  • 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)post_thanks_navbar_search
  • (1)printthread
  • (4)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