View Full Version : Break in custom profile field?
djxcee
11-27-2008, 12:36 AM
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?
Dismounted
11-27-2008, 03:36 AM
You need to run profile fields through a vBulletin function that handles this: fetch_profilefield_display().
djxcee
11-27-2008, 07:21 AM
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?
ReCom
11-27-2008, 07:37 AM
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).
djxcee
11-27-2008, 07:41 AM
I do have Multiple-Line Text Box but vBulletin automatically doesn't convert the linebreak.
Dismounted
11-27-2008, 07:46 AM
You need to run the function yourself (via a plugin), vBulletin only runs it in certain pages.
djxcee
11-27-2008, 09:49 AM
I tried adding fetch_profilefield_display() to member_build_blocks_start and getting this error Parse error: syntax error, unexpected $end in /var/www/vhosts/domain.com/subdomains/test/httpdocs/member.php(454) : eval()'d code on line 8
ReCom
11-27-2008, 11:41 AM
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 .. ;);););););)
djxcee
11-27-2008, 05:18 PM
Whoops forgot about that :o.
Now getting a different error:
Warning: Missing 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
ReCom
11-28-2008, 02:15 AM
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/vBulletin/_includes---functions.php.html#functionfetch_profilefield_disp lay that states that the function fetch_profilefield_display() expects two arguments.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.