Gossamer Forum
Home : Products : DBMan : Customization :

user information at signup

(Page 1 of 3)
> >
Quote Reply
user information at signup
I did a bunch of searches for adding fields to the signup form but I couldn't find anything.

I'd like to create a database containing user information for people who have userid's in my databases. All of my databases use the same .pass file. Basically what I'd want to do is add a bunch of fields to the signup form - stuff like location, date signed up, rider style etc. (I have a biking website)

I'd set up a relation between the userid of the main databases and the user database. Main database has a "posted by" field that clicks into the user database.

Only 1 problem though, currently creating a new account uses this submit code:

<input type="SUBMIT" name="signup" value="Create">

And adding to the database is this:

<INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add Record">

How would I combine the two together so when the person signs up, they are added to both the .pass file and the user database?

Basically, I'd allow users to search through the user database for people in their area to go biking with. Of course there'd be an option for not making the user info visible to the public.

Is this too ambitious?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Try checking out my "Limit Number of Records per User" mods. The index for the mods is at http://www.jpdeni.com/...ds/limitrecords.html. There are options for a user to add a record at the time of signup, with and without the password lookup mod and with and without the "user-friendly" html.pl file.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I'm starting to think that this isn't really going to work right. I'm going to have several main databases - bike reviews, trail reviews, crash stories and classified ads. If the user clicks "sign in" on any of those db's they will be leaving the current database to sign up. Once they've signed up, they'd have to go back to the db that they came from. (people might get confused about where they are) Would it be possible to add data to the user database from within the main db's? Like use a "switch" in the main db's to pull the add record stuff from the user db?

limitrecords4.txt looks like it would do the trick for the user db. Then I'd just have the userid field as the key/common field from the user db to all the others.

I realize this is all confusing 'cuz of all the db's that I'm using and stuff --- I really appreciate all of your input!

Thanks.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
It's possible (though a real pain in the patootey) to have a value "follow" the user when he goes from one place to another. I use it in my bookstore db if people want to write a review, but haven't logged on yet. They go to log on -- or even sign up for an account -- and when they're done they're taken straight to the add form to add a review for the book they wanted to.

Is this what you want to do?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
To add a review to my main db, the mod that you used in your bookstore wouldn't really do the trick... but if someone were to add a comment to a review in the related database - it would. If its a real pain in the butt, I'm not sure if its totally neccessary.

Basically, what I'd like to do is if a user clicks the "sign up" button (from any of my 4 db's), they make a username and add a brief bio about themselves that may or may not be viewable by others depending on if they click "public" or "private" (radio field). In a bike review for example, there is a field - "Name", I'd like to be able to click that name and that users bio will show up. Bio's will be searchable to allow people to find possible bike riding partners. Once the user has entered their bio and their username, they are brought back to the database that they linked in from. This way, the person wouldn't have to re-enter the database that they were just in - this would avoid confusion.

Another little problem is that I imported about 500 db entries from another database that I'm using and not all of them have userid's that go along with the record -- I just plugged my userid in there. So I guess I'd have to put a switch with an IF statement to see if there is a corresponding profile entry to a userid and remove the link if there isn't.

If you need any more spec info, let me know.

Thanks again for your input!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I think I need a map. Smile Or a new brain or something. Or maybe it's that I've answered all the easy questions already. Now the really challenging ones are coming up. Or maybe it's my biorhythm.

Whatever it is, I'm just not seeing this at all.

Maybe we could take it one step at a time. Pick one of your databases. Any one at random. On what page(s) in that database would it be likely that a user would need to sign in?


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry this is so confusing...

Okay, I'm working on the bike review database so lets use that one. If $db_userid is "" or "default", navigation has these links:

what's new, search, list all, login, sign up.

If the user logs in from any one of those pages, navigation changes to this:

what's new, search, list all, add, modify, delete, change password, log off.

There are some extra options for admin access too if ($db_userid eq "admin")

So if a person hasn't signed in or doesn't have an account, they can only login or signup from the 1st set of links mentioned above.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Okay. Now I think I can handle it.

Let's assume that the person is going to sign up for a username and fill out the bio thing.

In your link for "sign up" add &old_setup=$db_setup.

In sub html_signup and sub html_signup success add a hidden field:

<input type="hidden" name="old_setup" value="$in{'old_setup'}">

At the beginning of sub html_home for the "user" database, add

Code:

if ($in{'old_setup'}) {
print "Location: $db_script_url?db=$in{'old_setup'}&uid=$db_uid\n\n";
return;
}
That should cause the user to go back to the bike reviews home page after he signs up and logs in. ("Should" being the operative word. Wink)


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Added what you said to the db's.

Couple questions/problems:

Tried to install limitrecords4.txt on my "user" database and I noticed that it doesn't mention putting a "userid" in the html_record_form, just a password.

I added a userid field to it and when it tried to sign up, it gave me the following error:

Invalid userid: jason. Must only contain only letters and be less than 12 and greater than 3 characters.

email address already exists.email address already exists.

(only had email problem on offline version for some reason)

I added the stuff from your limitrecords mod to the cfg.

$db_email_field = 'Email';
Email => [3, 'alpha', 20, 50, 1, '', ''],

$auth_user_field = 14;
Userid => [14, 'alpha', -2, 15, 0, '', '']

Bike reviews is accessible here:
http://www.visit-my-webpage.com/...ews&login_form=1 -- just click "login" in the left menubar.

Setup files are here: http://www.visit-my-webpage.com/tmp/

Thank you for your help!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
In Reply To:
Tried to install limitrecords4.txt on my "user" database and I noticed that it doesn't mention putting a "userid" in the html_record_form, just a password.
That's because it is assumed that you would already have a userid field in your database. You don't want two fields that are the same.

If you added the userid field to sub html_signup, take it out.

And please don't try adding the code I gave you earlier in this thread until you have worked out the limit records thing. Remember, one thing at a time.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
That's because it is assumed that you would already have a userid field in your database. You don't want two fields that are the same.

If you added the userid field to sub html_signup, take it out.
Sorry, I removed the userid stuff.

How would the person get a userid though? When the person clicks "signup" (from any db), it goes to the users db with the assumption that they do not have a userid or password.


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
You have a userid field in your users .cfg file, right? There should be a field on the add form for the userid. They enter it into that field.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Yes, "Userid" is in the cfg file.
Userid => [14, 'alpha', -2, 15, 0, '', '']

<input type="TEXT" name="userid" value="$in{'userid'}">

I put the input line in the html_record form however I'm still getting a couple errors when I try to add a record with a username/password.

I doesn't seem to like any userid... whatever I type, it errors out with - "Invalid userid: jdulberg. Must only contain only letters and be less than 12 and greater than 3 characters."

Thanks for your patience!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm going to need to look at your html.pl and .cfg files. I'm getting really confused.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
No prob. The links to the online version and the files are in a message a few posts up - 23-Jun-00 05:54 PM

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
There's a problem with the mod. Sorry.

In sub signup, change

unless ((length($in{$db_cols[$auth_user_field]}) >= 3) and (length($in{$db_cols[$auth_user_field]}) <= 12) and ($in{$db_cols[$auth_user_field]} =~ /^[a-zA-Z0-9]+$/)) {

Sorry 'bout that.

(I really do think there's something with my brain these days. Maybe it's too much sun. Cool)


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
You've been spending too much time working on dbman and stuff... people like me causing all kinds of trouble.

I changed sub signup to what you said but unfortunately I'm still getting the invalid userid error.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Do you have the $auth_user_field set correctly? Are you having them sign up to the correct database?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Your gonna kill me... Looks like I had "userid" instead of "Userid" in the html.pl. I changed some stuff around in the cfg and html.pl to get rid of a few required fields and it looks like its working now.

Once the record is added, I'm automatically logged in and it goes to the add_success page. Guess now its a matter of getting it to go back to the db that the person came from and getting the relation to work for making the username clickable if the user has a bio.

Thanks for putting up with me for so long!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
It happens. Smile

I've sorta lost my train of thought here. Do you have the hidden field

<input type="hidden" name="old_setup" value="$in{'old_setup'}">

in sub html_signup_form? (I forgot that you were using the "add a record at time of signup" thing. You won't need it in sub html_signup_success.)

If you have that field, check the source code for your signup form to make sure it's actually there and that the correct database name (the one you came from) has been entered.

If it has been, you have two choices. You can either have a link on your "add success" page to go back to where they were or you can just have it send them back without getting a success page.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Yep, its filled:
<input type="hidden" name="old_setup" value="bikereviews">

Is it possible to have it send them to the main page of the database that they came from with a little signup success message? If I have a link, some [dense] people might get confused about where they are.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Sure.

In sub signup, change

&html_signup_success;

to

print "Location: $db_script_url?db=$in{'old_setup'}&uid=$db_uid&new_user=1\n\n";

In db.cgi, sub main, change

Code:

elsif ((keys(%in) <= 2) ||
($in{'login'})) { &html_home; }
to

Code:

elsif ((keys(%in) <= 2) ||
($in{'login'}) || $in{'new_user'}) { &html_home; }
At the beginning of sub html_home, where you want to print out the confirmation message, add

Code:

if ($in{'new_user'}) {
print qq|Thank you for registering with $html_title.|;
}
or whatever you want it to say.

I think this will work. Smile It's a little different than what I'm using, but I think it will be necessary to do it this way.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Works like a charm! JPDeni, the DB Master strikes again.

Now, onto the final leg of this crazy modification.

I need to set up a relation between users and my other db's. For example, someone does a search in Bikereviews and they find a review by "fred". I'm pretty sure I know how to link to Fred's information but is it possible to have it so if the person doesn't have any user information, the link will not appear? I have about 1000 old entries in my db that don't have any user information so there would be nothing to link to.

If its too much of a pain to do, is there a way to add another view_failure so if the user has no info, it'll go to a page that says so instead of going to the normal view_failure? I'd like to keep the original view_failure for normal searches.

Thanks again for your ongoing support!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Cool! I think I'm gettin' the hang of this!! Wink

You could do a search for the user when the record prints out. It would be something like:

Code:

&switch_to_user;
%rec2 = &get_record($rec{$db_cols[$auth_user_field]});
&switch_to_whatever the current database is;
if ($rec2{$db_cols[$auth_user_field]}) {
print qq|link to the user|;
}
If you're already using %rec2 for something, you can change the hash name to anything you want it to be.

This does assume that your userid field has exactly the same name between databases and that the $db_key field for the user database is the userid field.

This is really a lot easier than making a different "view failure" page. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Okay, I added that and ran throught he relational setup but nothing appears -- looks like I'm gonna need a hand setting up the relation between users and my other db's.

I set the db_key in the users db to Userid like you said and Userid also exists in all of the other db's. So Userid is key/common in the users db.

I'm using %rec2 for my bikereview/comments db's so I guess I'd just change it to %rec3.

Updated all the files on the temp server if you want to see them. http://www.visit-my-webpage.com/tmp/

Maybe's I'll take the cake for one of the most modded dbman's? Once all the setup is done... I'm gonna be running 7 db's.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
> >