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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2008, 12:36 AM
djxcee djxcee is offline
 
Join Date: Mar 2008
Location: SoCal
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Break in custom profile field?

I created a custom textfield and it doesn't break.

Here is my custom field, $userinfo[field3]. Is there anyway to add nl2br to it?
Reply With Quote
  #2  
Old 11-27-2008, 03:36 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to run profile fields through a vBulletin function that handles this: fetch_profilefield_display().
Reply With Quote
  #3  
Old 11-27-2008, 07:21 AM
djxcee djxcee is offline
 
Join Date: Mar 2008
Location: SoCal
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
You need to run profile fields through a vBulletin function that handles this: fetch_profilefield_display().
Ah ok. Sorry (still learning PHP), but I have to ask; how will I proceed in doing this?
Reply With Quote
  #4  
Old 11-27-2008, 07:37 AM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AdminCP > User Profile Fields > User Profile Field Manager > (The profile field you are interested in) > Edit > Profile Field Type > Multiple-Line Text Box

vBulletin automatically converts linebreak to <br/> when the profile field value is displayed in profile pages (About Me).
Reply With Quote
  #5  
Old 11-27-2008, 07:41 AM
djxcee djxcee is offline
 
Join Date: Mar 2008
Location: SoCal
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do have Multiple-Line Text Box but vBulletin automatically doesn't convert the linebreak.
Reply With Quote
  #6  
Old 11-27-2008, 07:46 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to run the function yourself (via a plugin), vBulletin only runs it in certain pages.
Reply With Quote
  #7  
Old 11-27-2008, 09:49 AM
djxcee djxcee is offline
 
Join Date: Mar 2008
Location: SoCal
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried adding
PHP Code:
fetch_profilefield_display() 
to member_build_blocks_start and getting this error
PHP Code:
Parse errorsyntax errorunexpected $end in /var/www/vhosts/domain.com/subdomains/test/httpdocs/member.php(454) : eval()'d code on line 8 
Reply With Quote
  #8  
Old 11-27-2008, 11:41 AM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Err you forgot half of your colon .... your semicolon!

You might as well paint your semicolon key on your keyboard with bright yellow before doing any coding in C, C++, Java, Javascript, PHP etc ..
Reply With Quote
  #9  
Old 11-27-2008, 05:18 PM
djxcee djxcee is offline
 
Join Date: Mar 2008
Location: SoCal
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whoops forgot about that .
Now getting a different error:
PHP Code:
WarningMissing argument 1 for fetch_profilefield_display(), called in /var/www/vhosts/wincinteractive.com/subdomains/test/httpdocs/carz/member.php(454) : eval()'d code on line 7 and defined in /var/www/vhosts/wincinteractive.com/subdomains/test/httpdocs/carz/includes/functions.php on line 1400

Warning: Missing argument 2 for fetch_profilefield_display(), called in /var/www/vhosts/wincinteractive.com/subdomains/test/httpdocs/carz/member.php(454) : eval()'
d code on line 7 and defined in /var/www/vhosts/wincinteractive.com/subdomains/test/httpdocs/carz/includes/functions.php on line 1400 
Reply With Quote
  #10  
Old 11-28-2008, 02:15 AM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The error means that fetch_profilefield_display() is expecting some arguments yet you didn't supply any.

Refer to vB API for the function at http://members.vbulletin.com/api/vBu...efield_display that states that the function fetch_profilefield_display() expects two arguments.
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 02:44 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.04114 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete