Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 09:48 am EST
Geeklog Forums
Adding fields to new user registration
Status: offline
muskrat
Forum User
Chatty
Registered: 10/31/02
Posts: 41
I tried posting this as a comment to another thread about user registration, but nobody answered so I'm trying posting a new topic.I want users to record their name, title and company when the register for my site. I got it so the registration form requested the "fullname" and createuser would set the fullname.I want to also capture the user's company name and job when they sign up. I figure the "about" field in the "userinfo" table should good for this. (Since this is just supposed to be useful info about the person anyway, and that's the info I think I need on this business-to-business site, it should be fine).So changed the language file so that LANG04[7] and LANG04[38] now say "Your job and company" and "Please enter information you want others to see about you".I've changed registrationform.thtml to include the "about" field as well as the fullname field, like this:<tr> <td align="right"><b>Your Full Name:</b></td> <td><input type="text" size="16" maxlength="96" name="fullname"></td></tr><tr> <td align="right"><b>Your job and company:</b></td> <td><textarea name="about" cols="60" rows="6" wrap="virtual">
11
9
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
And your question was...?
FYI, the next version of Geeklog will have "hooks" for an extended user registration. That code is already in CVS, but unfortunately, anonymous CVS doesn't seem to work at the moment ...
bye, Dirk
9
8
Quote
Anonymous
Anonymous
Sorry, my post didn't all make for some reason (probably my error).
My question is, what do I have to do to put some text stored in a variable called $about into the "about" field in the "userinfo" table? I've tried to figure this out by copying and modifying examples from usersettings.php and have tried both DB_save and DB_query but I've got it wrong.
I tried this:
DB_query("INSERT INTO {$_TABLES['userinfo']} SET about='{$about}' WHERE uid={$uid}"
As for your comment that "the next version" will have hooks for extended user registration,
1) GREAT!!!!!
2) is that 2.0 or 1.x? and more to the point, any guess as to how long it will take to see it released as a tarball rather than CVS?
THANKS!
10
10
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
DB_query ("UPDATE {$_TABLES['userinfo']} SET about='{$about}' WHERE uid={$uid}"
The next version I was talking about is Geeklog 1.3.8. But that version is still some time away ...
bye, Dirk
9
7
Quote
Anonymous
Anonymous
Well, thanks again. I put that line in but it's not working yet. I'm sure I've got some minor typo somewhere and I'm trying to debug it. I figured I should make sure the variables were getting passed as I expected. I found this line at the top of users.php
// Uncomment the line below if you need to debug the HTTP variables being passed
// to the script. This will sometimes cause errors but it will allow you to see
// the data being passed in a POST operation
// echo COM_debug($HTTP_POST_VARS);
So I uncommented it. Boy, did it ever cause errors! Now when I click on the "Register now" button, I get a page full of all the text from users.php! I've changed the line back to comment out the COM_debug, but it STILL does that. What's wrong? I've refreshed the browser page to make it reload, I've logged out and back in, but still it just spits out the users.php source code instead of executing it.
-Tom
8
9
Quote
Anonymous
Anonymous
The debug doesn't cause any errors. That one only prints the variables.
When you see source code printing out on the screen, it usually means you're missing <?php and ?> in your file or you closed it out early.
8
8
Quote
Anonymous
Anonymous
Somehow my users.php file got corrupted (probably because I had it open in two editors at once, by mistake). So I replaced it from a backup and got rid of the problem.
As for getting the code to work and update the userinfo table, all I had to do was move the UPDATE statement a little lower in the file. I finally realized that I was trying to UPDATE a record that had not yet been INSERTed.
I bet you're impressed ;-)
Oh well, live and learn. I've got it doing mostly what I want for now, but I'm sure curious about the hooks for enhanced registration in 1.3.8!
9
8
Quote
anonymous
Anonymous
hope so somebody will answer muskrat question exactly like what he want and if possible the experts can explain step by step on how to create new fields and waht should be done in order to make the user registration run smoothly.
I hope so the answers from you all guys..
I hope so the answers from you all guys..
8
8
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The functionality is there - it's called Custom Registration.
A simple example (asking for the user's full name) ships with Geeklog. An extended example (explaining how to add your own fields) is available for download.
bye, Dirk
A simple example (asking for the user's full name) ships with Geeklog. An extended example (explaining how to add your own fields) is available for download.
bye, Dirk
10
7
Quote
anonymous
Anonymous
actually I have read the notes on custom registration but i don't understand this part:
4) Update your theme templates
- See the files under the included "themefiles" directory
what does it means?do we need to copy this file into the current public_html folder that we use now or just replacing it?
4.1) Add a new directory called "custom" to your theme(s) directory
Add the template memberdetail.thtml to this custom folder.
Example: layout/professional/custom/memberdetail.thtml
4.2) Update the User Profile templates to include the custom fields
In the included archive - under themefiles, there is a "users" and "preferences" folder.
They each contain one template that needs to replace the file already in the corresponding
Theme directory. Note: These updated template files don't include the PGP Key field for the
user profile - as it's most likly not wanted anyways. Add it from the existing one if required.
I don't even understand all these..
for someone who understand please help me..!!
4) Update your theme templates
- See the files under the included "themefiles" directory
what does it means?do we need to copy this file into the current public_html folder that we use now or just replacing it?
4.1) Add a new directory called "custom" to your theme(s) directory
Add the template memberdetail.thtml to this custom folder.
Example: layout/professional/custom/memberdetail.thtml
4.2) Update the User Profile templates to include the custom fields
In the included archive - under themefiles, there is a "users" and "preferences" folder.
They each contain one template that needs to replace the file already in the corresponding
Theme directory. Note: These updated template files don't include the PGP Key field for the
user profile - as it's most likly not wanted anyways. Add it from the existing one if required.
I don't even understand all these..
for someone who understand please help me..!!
10
7
Quote
All times are EST. The time is now 09:48 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content