vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Adding Custom Select Field To Profile (https://vborg.vbsupport.ru/showthread.php?t=30925)

treszoks 10-20-2001 10:00 PM

Someone asked for this and here it is. Hopefully the documentation is clear enough and I didn't miss anything. Post here with any problems and/or comments.

This hack adds a select field (dropdown menu) to the profile. *Make sure to backup everything first!*

alkatraz 10-22-2001 06:51 PM

can you add form Textarea support plz!!

thank you!

treszoks 10-22-2001 09:38 PM

Here you go. Untested, but should work.

snyx 10-22-2001 11:38 PM

What is the difference between this and the other hack like it created by mutt (I think thats what his name was)

cooldude 10-23-2001 01:37 AM

thankx m8

treszoks 10-23-2001 01:43 AM

Mine only requires adding two templates and modifying a couple of lines in register.php and member.php and doesn't use text files that must be opened and read from.

alkatraz 10-25-2001 12:17 AM

thx a ton doode!

your the best ! =)

alkatraz 10-25-2001 01:06 AM

doh!

it works great, except for one thing:

when its displaying the custom textarea field in the Getinfo template (to view a members profile), the text thats entered in the textarea box doesnt have any linebreaks, so its displayed in one long line.


I know about a php function called "nl2br()" that is supposed to display multiline text with <br>'s instead of hidden carriege returns, BUT when I add it to getinfo_customfields, it doesnt do anything..

This is the code that I need to modify to display line breaks:
Code:

<tr>
        <td bgcolor="$backcolor"><normalfont><b>$profilefield[title]</b></normalfont></td>
        <td bgcolor="$backcolor"><normalfont>$profilefield[value]&nbsp;</normalfont></td>
</tr>

if you can help me at all, id really appreciate!
thx
-Colin

treszoks 10-25-2001 01:53 AM

Assuming the linebreaks were added to the db:

In member.php find this in the "getinfo" action segment (should be around line 1200):

$profilefield[value]=$userinfo[$profilefieldname];

Change it to this:

if ($profilefieldname == "fieldX") //where X is the field number
{
$profilefield[value]=nl2br($userinfo[$profilefieldname]);
}
else
{
$profilefield[value]=$userinfo[$profilefieldname];
}

alkatraz 10-25-2001 08:58 PM

sweet thank you!

I just noticed one more little issue,
the max input for custom fields is 250 characters so if a user types more then that it cuts it off.. I've changed the max input value in the Admin CP to 1000 chars but it still cuts it off at 250, I guess vbb has an internal max of 250.

admin cp:
Quote:

Maximum Input
- how many characters may a user enter into this field?
- maximum 250

Thank you very much for all of your help, I really appreciate it Treszoks.


All times are GMT. The time now is 12:35 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.01258 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete