PDA

View Full Version : Add a select field to the profile


Mutt
07-02-2001, 10:00 PM
Hey there

I'm still trying to learn all of this and damn this is cool ****. Anyway, I installed the gender hack and was going to use it to install another profile select box. Then I saw the very cool CP tool for adding a field to the profile. It currently only allows you to add a input box. I decieded to modify it so I could add my select box from there. It wasn't very hard and the hack is pretty short.


Here it is in a nutshell
I added a textarea field to the add/edit profile field
if you want the new field to be a dropdown, you enter the dropdown values. each line represents a new option tag.

Ex. you want a new field called "sex" that is a drop down with
the choices male,female, and other.

Make the new field as usual.
Set Field Length. (1 would be a standard dropdown)
Set Maximum Input (I'd leave it at 250)
In the Select Box Items text area type

Male
Female
Other

each on it's own line.


UPDATED for v224 with vbHacker
Click thru for the updated version (https://vborg.vbsupport.ru/showthread.php?postid=236601#post236601)

Mutt
07-04-2001, 03:05 PM
would anyone want the ability to add radio yes/no fields as well? I don't need em right now, but I gotta beileve I will sooner or later

Big Up to the VB guys for making it possible to add profile fields from the Admin CP. I dig it!

Jonathan@Refresh
07-04-2001, 03:13 PM
This looks an excellent hack!

Radio buttons would also be very useful.

Has anyone installed it?

Ruth
07-06-2001, 02:23 AM
great hack, radio buttons anyone?

RobAC
07-06-2001, 12:40 PM
Radio buttons would be great!

BradC
07-06-2001, 01:24 PM
If no one gets around to making radio buttons I will for ya :)

Not much of a change of code really...

but I can't do it off the top of my head at work lol..

I usually on use drop downs.. cause they work for some of the stuff I have been doing lately :)

RobAC... pm if you want me to change the custom hack to radio buttons instead of drop downs :)

Ruth
07-06-2001, 05:52 PM
BreadC, we need both drop down and radio buttons :D

thanks

Mutt
07-10-2001, 02:43 AM
I updated the directions to add radio buttons over the weekend, but couldn't get on the site to post em. I'll post it after work tomorrow. I orgiginally just made then standard Yes No radio buttons, but started to change it so they could have any value and you could have more than 2. will post it asap.

Ruth
07-13-2001, 04:55 PM
Mutt please post them as soon as you can....can't wait longer :D

thanks

Mutt
07-15-2001, 04:02 PM
I'll try and finish it up today. I though of a nicer way to do it and would like to make it clean before posting. busy working on the vb code buttons today but I'm sure I'll get to it

Ruth
07-17-2001, 11:47 AM
Mutt...are you still working on it?

wilth
07-18-2001, 04:38 PM
great work mutt

snyx
07-18-2001, 06:33 PM
damnit mutt! ya did a good job! like a charm!

snyx

LOL, mutt . . . .

JWS
07-20-2001, 02:20 PM
I'm interested in this as well....

debsync
07-23-2001, 05:44 AM
I installed this and it works great outside of the control panel (when a user wants to change a profile field in his own user cp the drop down menu appears as it should).. But in the admin CP, when I go to 'add users', the custom field that I added does not show the drop down options.. It only shows an empty field just like the other profile fields there.. Any suggestions?

Mutt
07-23-2001, 10:08 PM
opps, I didn't change the cp. I'll get to it.

here's the newest file. I thought I had uploaded this already. sorry for the delay

NEW - add selections just like the last one, but now you can choose between input box, select box, or radio button.

Ruth
07-23-2001, 10:16 PM
great work Mutt :)

Thanks

Ruth
07-23-2001, 11:30 PM
Mutt, i'm not sure but the drop down menu is not working in register.php

when i enter the values
-
X
Y
Z

i get -XYZ in the register.php

Did i do something wrong?

Thanks :)

debsync
07-24-2001, 01:29 AM
works great for me! this is one of the coolest hacks! but it will be even better when the dropdown lists and radio buttons appear in the admin cp under 'users --> add/find' ;)) I wish I knew how to add that feature myself, but I'm not too good with php yet ;)

anyway keep up the good work Mutt! ;)

VirtueTech
07-31-2001, 03:23 PM
I have a queston:

I got this error in my Admin CP when I edited a non-select or 'mutt' field in my custom profile fields editor.

Warning: Unlink failed (No such file or directory) in /web/pbc2/forums/admin/profilefield.php on line 107

The directory exists and I am able to create select fields....and there are even "X.file" files in the /admin/profile directory....but there are no "X.files" for the other custom profile fields....so the script gives me that error above.

I know...or I think and hope....this error is not a big deal. But I wanted to point it out.

caislander
07-31-2001, 07:15 PM
Mutt,

Very cool hack, now if someone would just make it so these fields are searchable ;)

Later

ldydvr
08-01-2001, 12:02 PM
Is what is happening to VirtueTech happening to everyone using this?

Ruth
08-02-2001, 11:01 AM
did anyone try this with 2.0.3 ?

Mutt
08-03-2001, 03:39 AM
works in 2.03

updated to include modifications to user.php
(now works when editing profiles from the cp)

enjoy
Mutt

please post any bugs you find or let me know any ideas for additions


VirtueTech - fixed your problem :)

VirtueTech
08-03-2001, 03:42 AM
Mutt you rule :)

Mutt
08-03-2001, 03:46 AM
VirtueTech

I just changed the download above to include a fix for your error. you better redownload you were just too fast for me

Ruth
08-03-2001, 03:48 AM
You are great Mutt :D

i wonder if you can add a feature like when someone choose OTHER from a drop down menu, they must fill in a near by box.

just a suggestion,

Thanks again :)

dxb
08-04-2001, 01:15 PM
man your great mutt thanks for the hack and the fast update for it :)

and another thing can you explain the country flag addition again because I couldnt understad what exactly I should do it the other thread

thanks anyway :)

debsync
08-06-2001, 02:42 PM
oops nm I got it ;)

illogicalx
08-07-2001, 02:27 AM
waoooow

Mutt nice , it's a great hack :)

i used it for gender in 2.0.3

it's work gooooood


only i was haveing one problim when i made a field with drop down menu and i made that field a required field in registertion template .

it wasn't work but when i changed it to optional field it's work great :)

one more thing if i want to use an image instead of a text for exp:

if gender = Male >>>> then i'll have in the member list a male image instead of a text MALE .

how can i do that :) .


that is all .....

thanks

LuBi
08-26-2001, 04:45 PM
Thanks, worked great on my site. Just what I was looking for!

tamarian
09-07-2001, 01:29 AM
Hi Mutt,

For some reason, the hack only works for the modify profile. On the registration part, is quite buggy. It displays a text field if the field is required. If the field is not required, it displays the radio buttons for all custom fields, if the ones created the usual way before the hack. I unistalled, reinstalled (on a test server) and the behavior is re-producable.

LuBi
09-07-2001, 01:44 AM
Sorry to hear, works good on my server take a look.

Suprascene.com Forums (http://forums.suprascene.com)

tamarian
09-07-2001, 02:01 AM
Hi Lubi,

Can you test and see what happens if you make automobile a mandatory field?

LuBi
09-14-2001, 11:37 PM
Originally posted by tamarian
Hi Lubi,

Can you test and see what happens if you make automobile a mandatory field?

Don't know how, but I would like to move some up to the mandatory ones. If you haven't figures out how to fix your problem please inform me and i'll do what I can.

Mutt
09-17-2001, 02:02 AM
I'll have to update my directions. I've changed this hack. the version I'm using now adds 2 fields to to the profile table. now you can pick, input text, radio, select, or textarea. you can set allow, vbcode, images, smiles, html. I also made sure it works with required fields, and handled some cp stuff that I missed before. Like I said, I don't have directions ready. it's a bit more work. I'll try and get to it next weekend

ethank
09-17-2001, 04:14 AM
Originally posted by Mutt
I'll have to update my directions. I've changed this hack. the version I'm using now adds 2 fields to to the profile table. now you can pick, input text, radio, select, or textarea. you can set allow, vbcode, images, smiles, html. I also made sure it works with required fields, and handled some cp stuff that I missed before. Like I said, I don't have directions ready. it's a bit more work. I'll try and get to it next weekend

Well....damn :) Just put this on my site.

I changed it a bit to have an option for a "hidden" field, which the profile editor uses to make category like dividers in the profile. This let me group profile fields together and have instructions on how to fill them in using "hidden" profile fields. Check the registration thing on murmurs.com for an example (the Feaks Map).

Ethan

numerodix
09-17-2001, 05:03 PM
This may come off as a silly question but how do you put in the custom fields where you want to in the user profile. That is normally they all come one after the other, how do you put each one where you want them to be. Ie first the name, then the gender, then the # posts, then the rest of the custom fields below that again. How do you manipulate them as you would the normal fields?

BradC
09-17-2001, 11:10 PM
if you are talking about the actual user's profile..

go into your admin cp..

then go to edit templates,

show all.

then go down to this template: getinfo

in that template is the profile template, so you can take that... open it up in your favorite program.. or in notepad, and change it around to be like you want it too... but bare in mind if you do it to one you might as well do it to all of them.. so you don't have double of one field.

also... to find the field info.. to know what it is..

go to your custom fields in the admin cp, figure out what number it is (i.e. field5, field4) and then add it into the database like

$userinfo[field5]

I think that is how you do it..

Soul Lord XL
09-18-2001, 01:24 AM
Ack! When I go to do anything heres what the error message says:

Parse error: parse error in /usr/home/s/h/shenlong/public_html/vbb/member.php on line 1236

Here is my line 1263 on Member.PHP:

FilePath="admin/profile/$profilefield[profilefieldid].file";

what is wrong with that?

By the way, i am a little unclear on this, is this right, its my register_customfields:

<tr>
<td bgcolor="$bgcolor"><normalfont><b>$profilefield[title]:</b></normalfont><br>
<smallfont>$profilefield[description]</smallfont></td>
<td bgcolor="$bgcolor"><normalfont> $TheField normalfont></td>
</tr>


thanks

BradC
09-21-2001, 02:56 PM
FilePath="admin/profile/$profilefield[profilefieldid].file";




Did you forget to copy it completly.. I say this because it should be

$FilePath="admin/profile/$profilefield[profilefieldid].file";

instead of

FilePath="admin/profile/$profilefield[profilefieldid].file";

Justice
10-14-2001, 04:33 AM
it would have been nice to have some updated instructions for the hack. I just installed it and most of my fields are required (and they don't show up in the registration page). The edit profile page works great though.

Are new instructions coming soon or should I uninstall and wait?

Mr. X
10-14-2001, 07:54 AM
Can someone please post a screenshot of this hack in action? Thanks!

Baines
10-14-2001, 10:29 AM
Hi,

Regarding un-installation of this hack.

Is there something more you have to do than:
*changing back the four PHP-files to their original state
*changing back the template
*delete the "profile"-directory
*delete any custom profile-fields

to un-install this hack?

:)

Thanks in advance,
Baines

Justice
10-14-2001, 02:11 PM
Originally posted by Baines
Is there something more you have to do than:
*changing back the four PHP-files to their original state
*changing back the template
*delete the "profile"-directory
*delete any custom profile-fields

to un-install this hack?

I sure hope not. This is what I did last night and everything seems to be back to normal. I look forward to a more secure version of this hack though

troubadour
10-16-2001, 12:09 AM
Mutt,

Thanks for the great hack. I've installed it and it's working well. However, I too am having the problem regarding required fields. You mentioned that you corrected this problem but haven't had time to update your instructions. Do you have an estimate as to when you may update them.

:) Thanks a lot for a very useful hack.

-T

alkatraz
10-16-2001, 12:18 AM
I can't wait for the next release of this great hack! I really need the textarea profiles added!!
Please keep us updated Mutt =)

thx!

Ed FvC
10-17-2001, 06:11 PM
I've tried adding this hack twice on v2.0.3, but each time, it shows the form fields up on the top of the UserCP->Edit Profile page, and they're all mangled (the drop-down menu is on the left with only the input boxes for Biography, Location, etc. lined up horizontally). I didn't get a chance to screencap it before I removed it, unfortunately.

My experience with PHP is quite limited, so I can't really see where I'm messing up. I've done exactly what the instructions say. Any chance in this being installed in the next release of vB?

treszoks
10-20-2001, 02:19 AM
I've added select fields to my board and will share directions if anyone would like them. It requires adding two templates for each select field plus a couple of lines in register.php and member.php.

alkatraz
10-20-2001, 06:10 PM
[QUOTE]Originally posted by treszoks
I've added select fields to my board and will share directions if anyone would like them. It requires adding two templates for each select field plus a couple of lines in register.php and member.php.

boutwell
11-05-2001, 11:01 PM
I use (And love) this hack...was just wondering if there was a revision that addressed the required fields bug (if you make a required field, they don't show up on registration :( )

Thanks for all the great work :)

Brad

troubadour
11-07-2001, 10:30 PM
on an update to this hack? I'm plugging away with the PHP books, but it's going to be a while till I'm up to speed to do anything productive code wise or I'd do it myself.

So, any news on an update?

Thanks

Ruth
02-04-2002, 03:30 AM
did anyone try this hack with 2.2.1?

x28
02-04-2002, 03:52 AM
also looking for 2.2.2?

x28
02-06-2002, 03:02 AM
installed on 2.2.2

AOK

Only thing is if you edit or back to Text input values will show in cp again after you clear them save and re-enter.

Not a problem just an aggravation.

TheComputerGuy
02-07-2002, 12:55 AM
I do not follow, only thing is if you edit or back to text input values will show in cp again after you clear them save and renter...

I dont follow what are you referring to

Mutt
02-09-2002, 01:22 PM
I was just thinking about this hack today. the problems have already been fixed and I added feaures. I need to upgrade to 2.2.2 then I'll write some directions.

while I'm at it, i'll update it to write a template instead of writing a file. I'm a little bit more vb savy these days :)

x28
02-18-2002, 12:03 AM
Mut,

any word on a release date.

-=dm=-
02-23-2002, 02:33 PM
Im using vB 2.2.1
and I got this error forums/admin/profilefield.php on line 187
when I click "User Profile Fields" add or modify .(in admin)
can u please help me?

thanx

nafae
02-23-2002, 03:39 PM
yes mutt any word on a release date??

matrixclub
04-03-2002, 03:39 PM
i has change it can use input,select,radio,checkbox field and also it can be searchable..

work aok on 2.2.2 2.2.3 2.24 everything is ok...

http://ezbbs.vserver.com.tw/forum/register.php?action=signup

tamarian
04-03-2002, 04:53 PM
Originally posted by matrixclub
i has change it can use input,select,radio,checkbox field and also it can be searchable..

work aok on 2.2.2 2.2.3 2.24 everything is ok...

http://ezbbs.vserver.com.tw/forum/register.php?action=signup

Can you share your hack changes?

Mutt
04-04-2002, 09:29 PM
with hack directions so simple now that we hack vbhacker, I updated the directions for this guy. running on v224. if you have a previous installation you'll have to remove it first. this new version doesn't write files to store you custom field info. instead it stores them to the DB.

I cleaned it up a lot and there shouldn't be any problems with required fields.

This hack adds the ability to add custom custom fileds to the profile. these would be field other than standard text input boxes. Dropdown Select Boxes and Radio Boxes are currently supported. Some of the code for Text areas is in, but for the sake of simplicity I removed textarea support.

add a new field as usual. fill out all fields. (Note field length is used for select boxes as well. 1 is standard)
choose the field type. (standard text input, select box, radio buttons)
Under "Multiple Choice Options" enter the values for your selections seperated by commas. the first one is the default selection. put a comma at the begining of the list to have an empty filed be the default.

Hope ya like it, let me know if the vbhacker file works.

It should edit 3 files, 1 template, and add a couple rows to the proflefield table.

Dark_Wizard
05-25-2002, 11:49 PM
Hey Jeff...I installed this on 2.2.5 and it works great...one question though, why didn't you update the admin/user.php file to reflect the same?

x28
05-27-2002, 07:17 PM
How do you add Drop down boxes to this hack?

geniuscrew
06-02-2002, 02:21 PM
Hi,

I'm getting errors with this hack on 2.2.5

I get this error when I click on Edit Profile:

Warning: Failed opening '/home/--------/forums/member.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0

Erwin
06-03-2002, 08:08 AM
This is one of the best hacks around - I am using this with great effect, combining this with other hacks to make this a powerful addition to vB. Thanks!!!

The only possible complaint is that each time I go to modify a custom profile, if it was a dropdown menu the textarea is empty, and I have to enter the data again. A small issue, which is easily overcome with a text file that I use as a backup.

Thanks for your great work!

RazorSharpe
06-06-2002, 08:06 AM
How does one install the customcustomfields.hack.php hack??

any pointers would be very appreciated.

mashby
06-10-2002, 12:16 AM
So, Erivin, I assume that it's working for you on 2.2.6?

JoshFink
06-11-2002, 04:08 PM
Is there a non vbHacker version? I really haven't delved into that and would love to just do it by hand.

Thanks

Josh

geniuscrew
06-11-2002, 04:13 PM
To get the non-vbhacker version you still need to do it using vbHacker - but when you come to actually modifying it, select "Generate text file" instead.

Also just a word of warning -
I got my error above because I chmodded member.php to 777 so that it could be writable, but forgot to chmod it back to 755.

Hope that helped!

JoshFink
06-11-2002, 04:14 PM
Thanks.. I appreciate the help.

Josh

Birdie501
06-11-2002, 10:34 PM
hi,

i installed with vbhacker and the installation went well.
But if i change the value in my profile it is not saved?
If i edit a user in admin cp there is no dropdown field, only textarea?

Nothing works for me and i am using vb 2.2.5?

Any solutions?

mayja
06-13-2002, 01:03 AM
Works fine for me with 2.26. Thanks!

Can anyone help with the code to add checkboxes as well?

mashby
06-24-2002, 05:39 AM
Ok, I must be doing something wrong. I've tried adding this to my board both by hand and then (after removing it) with VBHacker and I can't seem to get it to work.

Everything runs with no errors apparent. The only problem is that NONE of my custom fields are visible now. So, you can't see the field for "Biography," etc.

You can see for yourself at this URL: http://www.npug.org/forum/register.php?styleid=2

Any thoughts on what I'm doing wrong?

Birdie501
07-01-2002, 12:41 PM
ok,
i installed it again. Now it works but still have some problems.
If i want to modify a custom field, the configuration for that field is not saved. If i click modify the fields Field Type and
Multiple Choice Options are empty, so i have to enter the value again every time i want to change something.

Is there also the possibility to have a dropdown field?
btw i am running 2.2.5.

any help is very appreciated. Thanks!

Mutt
07-02-2002, 02:32 AM
i guess i should drop by more often.

I didn't modify the admin/user.php file but I guess I forgot to add those directions to the file. I'll dig it up and add it when I get home

roxics
07-02-2002, 09:12 AM
Yeah how do you install customcustomfields.hack.php?

Is it an addition to the selectprofilefield.txt you offered on page 2 of this thread? If so do you just throw this php file in with the others?

This looks like a great hack. Also are these fields searchable? As in does it work with FireFly's "Search Members by custom profile fields hack" found here:

http://www.vbulletin.org/hacks/index.php?s=&action=showhack&hackid=177

Thanks

roxics
07-04-2002, 06:41 AM
Okay nevermind I figured it out. I had to discover what VBhacker was first. :)

This hack doesn't work with FireFly's hack I mentioned above. The fields show up in the search as standard text fields. The search will work finding what people listed from say a drop down box or choose with a radio button, but someone has to type in one of the options listed in the drop down box or the radio button. It would be great if the radio buttons and the drop down boxes appeared in the search area.

It would also be great if the box allowed people to choose more then one option by holding down the 'Ctrl" button on the keyboard. :)

mayja
07-04-2002, 11:28 PM
Originally posted by Birdie501
If i want to modify a custom field, the configuration for that field is not saved. If i click modify the fields Field Type and
Multiple Choice Options are empty, so i have to enter the value again every time i want to change something.

The "type" and "option" fields hadn't been added to the "edit" query in profilefield.php. So to fix this glitch...

Find in profilefield.php :

// ###################### Start edit #######################
if ($action=="edit") {

$profilefield=$DB_site->query_first("SELECT title,description,required,hidden,maxlength,size,d isplayorder,editable
FROM profilefield
WHERE profilefieldid=$profilefieldid");


and change to:

// ###################### Start edit #######################
if ($action=="edit") {

$profilefield=$DB_site->query_first("SELECT title,description,required,hidden,maxlength,size,d isplayorder,editable,type,options
FROM profilefield
WHERE profilefieldid=$profilefieldid");

Birdie501
07-05-2002, 05:26 AM
Thanks! Now i am still waiting for a new release supporting drop down fields :)

Ryangel
07-18-2002, 03:56 PM
Brilliant Hack ! :)

*installs* ... opps time to sleep ...

Ryangel
07-18-2002, 03:58 PM
Originally posted by Birdie501
Thanks! Now i am still waiting for a new release supporting drop down fields :)

hmm drop down fields? I believe if you want a single drop down box you just change the "field length" to "1" .

Maybe I'm misunderstanding the question ... hmm.

Vivi Ornitier
08-11-2002, 05:54 PM
I'm not sure if anyone else is having this probelm but when i installed this hack and added all the custom fields. When a user goes into their profile and edits something, it's all good. But when they go and edit again, they have to re-enter everything over again and all the saved fields before are totally gone. Any suggestions?

Vivi Ornitier
08-11-2002, 06:09 PM
and instead of telling us how to generate a text file from vbhacker, can someone just generate the text file and post it?

Sion
11-21-2002, 02:30 PM
Warning: fopen("profile/5.file", "w") - No such file or directory in /home/amateur/public_html/uwc/admin/adminfunctions.php on line 156

Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/amateur/public_html/uwc/admin/adminfunctions.php on line 158

Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/amateur/public_html/uwc/admin/adminfunctions.php on line 160

I get these errors, please help!

Sion
11-21-2002, 02:49 PM
I can't seem to get vBhacker working properly, any1 mind posting the txt file of the latest one, please!

BigJohnson
01-26-2003, 09:50 AM
so when are u going to fix this so it shows up correctly in the admin user file like u said u were. U didint add the user modifications to this for the new vbhacker version u releleased. Please help.

TheComputerGuy
01-26-2003, 01:07 PM
Here is a TXT file

Personally, I am going to uninstall this file.

geniuscrew
02-05-2003, 07:01 PM
Originally posted by Ryangel


hmm drop down fields? I believe if you want a single drop down box you just change the "field length" to "1" .

Maybe I'm misunderstanding the question ... hmm.


Nope - you're right :)

Changing the "field length" to 1, makes it a drop down box :)

Working brilliantly on 2.2.9!

Nomb
02-24-2003, 09:00 PM
I have this hack installed and it's working great!! I have the code for the admin cp but not in front of me right now. I?ll post a new text file with the corrections. :D

EDIT Erwin helped me solve my form issues, unrealted to this hack.

Nomb
02-27-2003, 06:12 PM
I got my form problems worked out thanks to Erwin in the php forum. :D

Anyway, if you want your newly created fields to show up in the admin cp correctly, aka, dropdowns and radios actually come up that way instead of plain old text boxes I've got the code.

See my attachment below. I updated Mutt's second revision to the hack. The one that stores everything in the database, the way it should be done. The new text file shows how to alter your admin/user.php file to reflect your new fields.

Also, I made the small addition that mayja pointed out so the fields are saved. It was a minor query error.

I think you can call it final now, no more bugs. Course, I'm working on adding checkboxes. :banana:

BTW, all this is working for me on 2.2.8

Nomb
02-28-2003, 06:41 AM
I found one more small bug that wasn't displaying the type dropdown correctly when editting a field in the admin cp. It's fixed and the attachment in the above post has been updated.

Doing these checkboxes isn't easy! I'm close though.

I wonder if they're including this in vB3. Hope so!

boutwell
02-28-2003, 06:29 PM
Hmmm....I just (re)installed this on version 2.3.0 and everythign is working fine except for none of the cutom fields are showing up in the user's control panel where they edit their profiles. They are showing up on the registration pages and in the admin CP...anyone know what may be the problem?

Would that be an error in member.php or a template of some sort?

TheComputerGuy
02-28-2003, 11:14 PM
Look in the "modifyprofile" edit "$customfields" with $customfield I believe...not tested yet...

Nomb
03-03-2003, 01:01 AM
Originally posted by boutwell
Hmmm....I just (re)installed this on version 2.3.0 and everythign is working fine except for none of the cutom fields are showing up in the user's control panel where they edit their profiles. They are showing up on the registration pages and in the admin CP...anyone know what may be the problem?

Would that be an error in member.php or a template of some sort?

That would be an error in member.php, not sure what though.

This could all be part of a small change they made in 2.3.0, not sure because I'm using 2.2.8. Post what you edited and then also post the query that updates the mysql with the custom fields.

007
03-17-2003, 08:49 PM
Hey Nomb did you get the checkboxes code working yet?

danglick
03-24-2003, 04:24 PM
The user.php code has a couple of errors. In both the 'add user' and the 'edit user' code, the fields are pre-filled with the values of the administrator's profile fields, rather than the user's (or blank in the case of a new record).

Nomb, I'm sure you can figure out how to fix it; but if you'd like me to send you the corrected code I'm using on my site, let me know.

DigitalDesktops
03-25-2003, 02:18 AM
i'm still having problems with this. The custom field options won't show up in the User CP. I'm using 2.3.0. The Only thing that was different in the readme was this:

User.php

In my User.php(Line 295) :

maketableheader("Custom Profile Fields");
$userfield=$DB_site->query_first("SELECT * FROM userfield WHERE userid=$userid");

$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$varname="field$profilefield[profilefieldid]";
makeinputcode($profilefield[title],"field".$profilefield[profilefieldid],$userfield[$varname]);
}

doformfooter("Save Changes");

}

// ###################### Start do update #######################

In customfileds.txt posted by Nomb it says to replace this code:
maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
makeinputcode($profilefield[title],"field".$profilefield[profilefieldid]);
}
with this code
// new options

maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT *
FROM profilefield
WHERE editable = 1
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$profilefieldname="field$profilefield[profilefieldid]";
if ($bgcolor=="#13486D") {
$bgcolor="#1C5780";
} else {
$bgcolor="#13486D";
}
// new options
$TheField="";
$optionlines = explode(',', $profilefield[options]);
$option_bit=$optionlines[0];
if ($profilefield[type]==1) {
// radio
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $bbuserinfo[$profilefieldname]) { $LocOn = "checked"; } else { $LocOn = ""; }
$TheField .= "<input type=\"radio\" name=\"$profilefieldname\" value=\"$option_bit\" $LocOn> $option_bit ";
$option_bit=next($optionlines);
}
} elseif ($profilefield[type]==2) {
// select
$TheField = "<select size=\"$profilefield[size]\" name=\"$profilefieldname\">";
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $bbuserinfo[$profilefieldname]) { $LocOn = "selected"; } else { $LocOn = ""; }
$TheField .= "<option value=\"$option_bit\" $LocOn>$option_bit</option>";
$option_bit=next($optionlines);
}
$TheField .= "</select>";
} elseif ($profilefield[type]==3) {
// textarea
$bbuserinfo[$profilefieldname]=htmlspecialchars($bbuserinfo[$profilefieldname] );
$TheField = "<textarea name=\"$profilefieldname\" rows=\"6\" cols=\"40\" wrap=\"physical\">$bbuserinfo[$profilefieldname]</textarea>";
} else {
$TheField="<input type=\"text\" class=\"bginput\" name=\"$profilefieldname\" value=\"$bbuserinfo[$profilefieldname]\" size=\"$profilefield[size]\" maxlength=\"$profilefield[maxlength]\">";
}
makelabelcode($profilefield[title],$TheField);
}

// new options

Can anyone help me with this?

TMM
04-08-2003, 12:24 PM
Looks very interesting :)

Has anyone tried Nomb's latest in 2.2.9? Danglick, maybe you could post the corrected code here...?

Also, could this be made to work with Firefly's lite registration hack?

Thanks,

TMM

lange
04-25-2003, 04:07 AM
Version 2.3.0.

I'm using the Nomb's attachment (customfields.txt).

I have the same problen than DigitalDesktops. In user.php, the code is not the same than in 2.2.8.

lange
04-25-2003, 06:33 PM
Anyone got it in 2.30 ?

geniuscrew
04-28-2003, 11:15 PM
I'm getting errors with 2.3.0 also :/

DigitalDesktops
04-28-2003, 11:21 PM
I got it working on 2.3.0. :)
Run the hack on VBhacker, then Insert the missing steps into the files, and it should work. :D

Keyser S?ze
05-04-2003, 09:15 PM
i guess most everyone is having the same problem i am with 2.3.0 and this hack :(


if anyone knows how to fix it a updated install txt would be great :)

Falkware
05-05-2003, 07:36 PM
using this hack on 2.3.0 and it seems to work fine with the exception of one problem.

If I have a custom field and check it to be a Required field it will not show up in User CP under Edit Profile for whatever reason.

Can somebody give me any pointers on how to get required custom fields to show up in User CP/Edit Profile on v2.3.0?

Thanks.

OmaniMan
05-11-2003, 07:50 AM
What A Wonderful Hack :rambo:

Keyser S?ze
05-13-2003, 01:00 AM
i got this working in 2.3.0 with so far no errors


i dont use vbhacker, try this, in admin/profilefeild

it says find this
$DB_site->query("INSERT INTO profilefield (profilefieldid,title,description,required,hidden, maxlength,size,displayorder,editable) VALUES (NULL,'".addslashes($title)."','".addslashes($description)."',$required,$hidden,'$maxlength','$size','$display order','$editable')");

but its not there, search for this instead $DB_site->query("INSERT INTO profilefield

i think its about line 40, copy the entire line, and replace it with this

$DB_site->query("INSERT INTO profilefield (profilefieldid,title,description,required,hidden, maxlength,size,displayorder,editable,type,options) VALUES (NULL,'".addslashes($title)."','".addslashes($description)."',$required,$hidden,'$maxlength','$size','$display order', '$editable',$type,'".addslashes($options)."')");


further down we have another thats like this in the same php file, it ask u to find this
$DB_site->query("UPDATE profilefield SET title='".addslashes($title)."',description='".addslashes($description)."',required=$required,hidden=$hidden,maxlength='$ma xlength',size='$size',displayorder='$displayorder' ,editable='$editable' WHERE profilefieldid=$profilefieldid");

but again it is not there, so instead search for this
$DB_site->query("UPDATE profilefield SET

copy the entire line, (close to line 100)

and replace it with this

$DB_site->query("UPDATE profilefield SET title='".addslashes($title)."',description='".addslashes($description)."',required=$required,hidden=$hidden,maxlength='$ma xlength',size='$size',displayorder='$displayorder' ,editable='$editable',type=$type,options='".addslashes($options)."' WHERE profilefieldid=$profilefieldid");

besides that use Nombs attachment and this should work fine in 2.3.0

if anyone gets the checkboxes working id love it!

Hamma
05-22-2003, 01:26 AM
I've got 2.3.0 what is the most updated file i should install?

Keyser S?ze
05-22-2003, 01:48 AM
this attached instructions will work in vb 2.3.0 perfectly :)

just a little update is all


dont use this for any other version other than 2.3.0, use the others

use this for 2.2.8 and i think 2.2.9 https://vborg.vbsupport.ru/showthread.php?s=&threadid=21833&perpage=15&display=&pagenumber=7

Hamma
05-22-2003, 02:23 AM
Thanks :D I did the original code on the first page and it worked. I will make the tweaks from your file as well ;)

edit: i forgot im running 2.2.7 lol

Falkware
06-04-2003, 04:54 PM
I've got this working fine on v2.3.0 using the files attached here and the recent fixes. Thanks all!

However, I have the same problem as danglick. When an Admin goes to edit a user's profile within Admin CP the custom fields are pre-filled with the values of the administrator's custom profile fields, rather than the user's values (or blank in the case of a new record).

Is there any way to stop it from doing this, and show the user's value instead?

Nomb
06-04-2003, 07:42 PM
Today at 11:54 AM Falkware said this in Post #112 (https://vborg.vbsupport.ru/showthread.php?postid=404390#post404390)
I've got this working fine on v2.3.0 using the files attached here and the recent fixes. Thanks all!

However, I have the same problem as danglick. When an Admin goes to edit a user's profile within Admin CP the custom fields are pre-filled with the values of the administrator's custom profile fields, rather than the user's values (or blank in the case of a new record).

Is there any way to stop it from doing this, and show the user's value instead?

If you're using my hack for admin/user.php ... there is an error as described above.

In admin/user.php

Find This (The Code from my txt file):

// new options

maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT *
FROM profilefield
WHERE editable = 1
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$profilefieldname="field$profilefield[profilefieldid]";
if ($bgcolor=="{firstaltcolor}") {
$bgcolor="{secondaltcolor}";
} else {
$bgcolor="{firstaltcolor}";
}
// new options
$TheField="";
$optionlines = explode(',', $profilefield[options]);
$option_bit=$optionlines[0];
if ($profilefield[type]==1) {
// radio
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $bbuserinfo[$profilefieldname]) { $LocOn = "checked"; } else { $LocOn = ""; }
$TheField .= "<input type=\"radio\" name=\"$profilefieldname\" value=\"$option_bit\" $LocOn> $option_bit ";
$option_bit=next($optionlines);
}
} elseif ($profilefield[type]==2) {
// select
$TheField = "<select size=\"$profilefield[size]\" name=\"$profilefieldname\">";
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $bbuserinfo[$profilefieldname]) { $LocOn = "selected"; } else { $LocOn = ""; }
$TheField .= "<option value=\"$option_bit\" $LocOn>$option_bit</option>";
$option_bit=next($optionlines);
}
$TheField .= "</select>";
} elseif ($profilefield[type]==3) {
// textarea
$bbuserinfo[$profilefieldname]=htmlspecialchars($bbuserinfo[$profilefieldname] );
$TheField = "<textarea name=\"$profilefieldname\" rows=\"6\" cols=\"40\" wrap=\"physical\">$bbuserinfo[$profilefieldname]</textarea>";
} else {
$TheField="<input type=\"text\" class=\"bginput\" name=\"$profilefieldname\" value=\"$bbuserinfo[$profilefieldname]\" size=\"$profilefield[size]\" maxlength=\"$profilefield[maxlength]\">";
}
makelabelcode($profilefield[title],$TheField);
}

// new options


Replace it with this:


// new options

maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT *
FROM profilefield
WHERE editable = 1
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$profilefieldname="field$profilefield[profilefieldid]";
if ($bgcolor=="{firstaltcolor}") {
$bgcolor="{secondaltcolor}";
} else {
$bgcolor="{firstaltcolor}";
}
// new options
$TheField="";
$optionlines = explode(',', $profilefield[options]);
$option_bit=$optionlines[0];
if ($profilefield[type]==1) {
// radio
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $userfield[$profilefieldname]) { $LocOn = "checked"; } else { $LocOn = ""; }
$TheField .= "<input type=\"radio\" name=\"$profilefieldname\" value=\"$option_bit\" $LocOn> $option_bit ";
$option_bit=next($optionlines);
}
} elseif ($profilefield[type]==2) {
// select
$TheField = "<select size=\"$profilefield[size]\" name=\"$profilefieldname\">";
while ($option_bit) {
$option_bit=trim($option_bit);
if ($option_bit == $userfield[$profilefieldname]) { $LocOn = "selected"; } else { $LocOn = ""; }
$TheField .= "<option value=\"$option_bit\" $LocOn>$option_bit</option>";
$option_bit=next($optionlines);
}
$TheField .= "</select>";
} elseif ($profilefield[type]==3) {
// textarea
$userfield[$profilefieldname]=htmlspecialchars($userfield[$profilefieldname] );
$TheField = "<textarea name=\"$profilefieldname\" rows=\"6\" cols=\"40\" wrap=\"physical\">$userfield[$profilefieldname]</textarea>";
} else {
$TheField="<input type=\"text\" class=\"bginput\" name=\"$profilefieldname\" value=\"$userfield[$profilefieldname]\" size=\"$profilefield[size]\" maxlength=\"$profilefield[maxlength]\">";
}
makelabelcode($profilefield[title],$TheField);
}

// new options


Basically, all the instances of $bbuserinfo have been changed to $userfield which is from the query above this block of code in user.php.

Remember to replace this twice.

tomjinx1
06-11-2003, 06:24 PM
Two quickies Mutt...

This is a really good hack and I will definitely use it. However, I am having a couple of problems that will be the deciding factor.

First off is this. After saving a custom profile field with Select Box and then going back into it, the text that was entered into the textarea is gone and it has to be typed in again... Is there a way to fix this?

The last thing is a TextArea box selection. I use some boxes where the user must fill one of these out and unfortunately a straight line doesn't cut it. Is it possible to add one of these as a type where it uses height as rows and width as column?

Thanks in advance...

Tommy

tomjinx1
06-13-2003, 01:01 PM
Nomb and IceMalee - you guys solve my first problem....

Now for the textarea box, I have finally coded it in and it seems to be working for me. If anyone wants the coding, please let me know and I will post it here...

Tom

tomjinx1
06-13-2003, 05:50 PM
File deleted due to it having some major bugs...

If someone could make it to where we could choose textarea boxes I would really appreciate it...

Thanks

Falkware
06-14-2003, 03:24 PM
Nomb, thanks for the update man. I applied it to my files and it removed the issue where it replaced the users value with my own when editing a profile in admin when a user has a select field.

However...

Instead of showing the users value now it shows the first value on the list instead.

Is there any way to make the select box retain the users chosen value even when an admin is in their profile through Admin CP?

tomjinx1
06-14-2003, 06:57 PM
I had a dream last night and in that dream I was updating the coding for this stupid (not really) hack.

I am now within a few more minutes of coding before we have Radio Buttons, Select Boxes (dropdowns), Standard Text Lines, and my contribution TEXTAREA boxes.

It's been a pain, especially since I no nothing about PHP. But I'm learning fast.

The problem before was that I had the text area boxes for registration but everything else was blank..

I have however fixed that problem and I just have to recode a little on the user.php file...

If you interested in this I will have it posted in just a little bit...

Tom

tomjinx1
06-14-2003, 10:55 PM
Ok, I'm very close but I need a little help on one thing.

Right now I have it where it creates the textarea by the size and maxlength entries. Everything works fine. The Standard Text, Radio Buttons, and Select Boxes hold their information however the textarea box doesn't....

Anybody wanna help me out here?

tomjinx1
06-18-2003, 01:11 AM
Everything is going smoothly however I don't think anyone cares.

I need help from someone here. I have everything working great with the script above and a few modifications to the profilefield.php file. However, I need help on 2 things. The members.php file and the user.php file.

When you go to a users profile in AdminCP or if you go to Edit Profile under the UserCP, if you have a field selected as not editable by user, then it completely hides that field, from the User AND the Admin.

Can someone tell me how to get it to where the Admin can see it?

Tom

Keyser S?ze
07-02-2003, 03:12 AM
[QUOTE]06-04-03 at 04:42 PM Nomb said this in Post #113 (https://vborg.vbsupport.ru/showthread.php?postid=404455#post404455)
CODE
[/php]

Basically, all the instances of $bbuserinfo have been changed to $userfield which is from the query above this block of code in user.php.

Remember to replace this twice. [/B]

themonarch
08-24-2003, 08:26 PM
I can't get this to work on 2.3.2. It just shows static text boxes.

I tried everything I could figure out on this thread to no avail. I got confused on which instructions to use but I tried both and with all the fixes and no go. Boo hoo for me. :disappointed:

themonarch
08-26-2003, 04:20 AM
Wow! I can't believe it! I used phpMyAdmin and changed the field TYPE (all caps) to type in the profilefield table and voila - it works! Damn case sensitive server/database!

Also, I set the default value (again with phpMyAdmin) of this field to 1, as in textbox.

And another tweek, I used the vBulletin Admin Control Panel to change the field size to 1 and now it's a dropdown box.

Oh, and I edited this post with the most recent copy and edits of the install instructions text file, hopefully to help the next person out.

This is working on my vBulletin 2.3.2

Have fun and vBulletin forever! :banana:

Tae-Hwan
09-02-2003, 03:39 AM
07-02-03 at 05:12 AM IceMalee said this in Post #121 (https://vborg.vbsupport.ru/showthread.php?postid=414610#post414610)
i was/am having this problem, i did like u said and it halfway fixed it, now it doesnt put mine in, but just makes the users custom info blank completely

any help?


I first installed this hack without looking at all the replies afterwards, so I ended up having to plug all the holes with my own fixes.. =( seems like this is the only one that hasn't been plugged by you guys yet.

Here's my fix to this problem, I don't know if it's the most efficient, but it works:

Find in user.php, under the "edit" subroutine:
// new options

maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT *
FROM profilefield
WHERE editable = 1
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$profilefieldname="field$profilefield[profilefieldid]";

and just stick this lil bit under the // new options so it looks like:

// new options

$userfields=$DB_site->query("SELECT * from userfield where userid=$userid");
$userfield=$DB_site->fetch_array($userfields);

maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT *
FROM profilefield
WHERE editable = 1
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$profilefieldname="field$profilefield[profilefieldid]";

Tae-Hwan
09-02-2003, 03:40 AM
^ oh yea, and this is in conjunction with nomb's "replace $bbuserinfo w/ $userfield" fix.

TheComputerGuy
09-19-2003, 03:05 PM
Monarch...do you think you could possibly fix that txt without all those Blocks and stuff, it is very hard to read. :(

Liz
09-27-2003, 11:53 PM
I second that. Themonarch - could you please fix?

Falkware
10-03-2003, 04:30 PM
Following all these instructions I've yet been able to pull up a user's choice as default choice when editing a profile. It still show's whatever field is default, in my case "None" rather than whatever the user has selected.

This means every time I have to edit a profile to flag them for whatever feature we have I have to double check their profile for what that field is suppose to be.

Has anybody been able to make the system show the user's selection rather than default when editing user profile through admin?

DiscussAnything
09-15-2004, 12:12 AM
I know it's late in the game, but I have a request. Hopefully someone still cares and can tell me how to do this.

I installed this with all the fixes and it works fine on 2.34. What I'd like though is to have check boxes instead of a single selection. I would like people to be able to make multiple selections. I added checkboxes and that works, only it doesnt save all selected fields, just the last one. I can't figure it out, can anyone help me out here?

Thanks!

The Markus
12-07-2004, 04:25 PM
does this work on the latest version?

imageconstrux
02-13-2005, 12:41 AM
This is a great hack, I've had it installed on my board since the beginning. I'm hoping to tweak it, though. I have drop-down boxes for required fields, and the default is the first field in the list. If a user doesn't actively select a different option from each drop-down, the default is what ends up as part of their profile. I'd like to avoid this issue, forcing new registrants to actually select an option. I would imagine this would involve adding an extra field for each drop down that says "Make a selection" - that part is easy.

What I'm wondering how to do is, how do I get the system to return an error if they do not make a selection?