PDA

View Full Version : Custom User Fields Suggestions / Questions


Nutcase
Thu 22nd Mar '01, 12:28am
Hey there...

I was looking at integrating my sites user system w/ the vb2.0 user system using custom user fields, and thought of a few things that would make it better, if anyone has the time to implement it.

First off, there should be fields that are added to the profile, but not visible to anything but the php scripts, like Super-hidden fields. This will allow me to store backend information w/ the user profile, without accidentally changing it by hand (as it isnt meant to be hand edited)

I also noticed that there seems to be a php file you can use to grab user details from.. thats a great idea, as soon as i figure out how it works. Does it require that i preserve the sessionid across the whole site, or just the cookie? If it requires preservation of the session id, can that be changed?

Finally, is there any sort of documentation on this? I mainly need to create three large fields that are only used in the code. not the profiles.

Thanks!

Nutcase
Sat 24th Mar '01, 8:55pm
*bump*

No one knows anything about the custom fields? Please help out if you can... i really want to get this integration going. :)

Thanks!

tamarian
Sun 25th Mar '01, 12:56am
I know a bit about userfields and use them a lot, and I'm sure many here know a lot more than I do. But I don't get your questions. What's the difference between hidden, and super hidden?

Tell us what you want to do with them, and maybe we can come up with something.

Nutcase
Sun 25th Mar '01, 1:36pm
Well, I guess my questions are half question/ half suggestion. I want to create a few large fields to hold serialized arrays of info about the user. They would be super-hidden, in that they are part of the system, and are creatable through the admin interface, but no one views them in the profile, including admins and mods. They would just be usable via php. I know i can do that by adding direct fields to the db and stuff, but i wanted to integrate it into the vB user system... so i am not sure if that would work.

So hidden is the normal hidden where the moderator can edit it, but the user cant. Do they show up in the profile view for mods or users?

Super hidden is just never shown, but used all the time.

So my question is how can i do this... my suggestion is to make it easier to do. :)

As far as the other two parts:

How do i use the vB user data in other parts of my site? Is there a simple way to grab it as an array? Is their an abstraction layer in the vB code i can use, or do i have to grab it directly from the db?

And is there any documentation on this?

tubedogg
Sun 25th Mar '01, 4:28pm
There's not really any documentation, but you could pull everything for a particular user with
$userinfo = mysql_query("SELECT * FROM user WHERE userid='X'");
and then, for example, $userinfo[username] would be the username, etc.

JamesUS
Sun 25th Mar '01, 4:51pm
Well actually the custom fields are stored in another table so you would need that as well. I believe it is called userfield.

tubedogg
Sun 25th Mar '01, 4:55pm
Right. So
$userinfo = mysql_query("SELECT * FROM user,userfield WHERE user.userid='X' AND userfield.userid='X'");

Nutcase
Sun 25th Mar '01, 9:15pm
groovy. Maybe i will make a small php include file that grabs all the user details into an array, based on the cookies. Sorta a vB user integration kit. If so, i will let everyone here know. Then again, it could be so simple that it isnt needed.

In any case, I will play around with this and see what I come up with.

Thanks for your help! :)