Gossamer Forum
Home : Products : DBMan : Customization :

user information at signup

(Page 2 of 3)
> > > >
Quote Reply
Re: user information at signup In reply to
I know why it isn't working. (Duh! Blush)

Code:

&switch_to_users;
%rec3 = &get_record($rec{'Userid'});
&switch_to_bikereviews;
if ($rec3{'Userid'}) {
print qq|link to the user|;
}
I was trying to be more "generic" with the code, but what I had won't work!

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Awesome!! Works great. I'm gonna mess around with the display here and there and I'll post a message once its done so you can have a look at your mastery.

Thanks sooo much for your help!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Cool! I can't wait to see it.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Looks like I just ran into my first little problem.

You mentioned that I have to have a field "Userid" in both the bikereviews and users db's to get it all working. In my comments db (which relates to the bikereviews), I'm using "commentsUserid". If I change it to Userid, there would be 2 fields that are common with bikereviews instead of 1. BikeID is currently the common field.

Here's what my final db's are going to be:

bikereviews - related to commentsbikereviews, users
trailreviews - related to commentstrails, users
classifids - related to users
bestcrashes - related to users

I might be added a store review db at a later date. So with all of these db's relating to users, things might get a bit messy.

What I'm aiming to do is the following:
User has to sign up in the users db. When they go to add to any of the db's, their name, email, etc. is taken from the users db and plugged into the html_record_form.

So now, the users db is not only a searchable library of users, it sortof acts like a cookie.
Quote Reply
Re: user information at signup In reply to
I'm really not sure what you're asking, Jason. (I think my brain is going away again. Smile)

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry its so confusing... I just have too many related db's on the go.

To sum it up, I can't get the relation between my comments db and the users db working.

This is gonna get weird.

"commentsbikereviews" is related to bikereviews -- "users" is related to both of them.

commentsbikereivews' userid field is called "commentsUserid" because it has to be different from the bikereviews userid. Since the "users" db uses is userid and not commentsUserid, it doesn't relate to "commentsUserid".

Basically, all of my db's are going to have to relate to the users db.

Does that clear anything up?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Conceptually, it's extremely confusing. Smile But in practical terms, what are you wanting to do?

I got an idea, but I'm not sure if this is what you're doing or not.

The top of the page is the bike review. There is a link to the bio of the author of the review.

Below that there are comments about the bike review. In each one there is a link to the bio of the author of the comment.

Are you trying to work out how to get the link to the bio of the author of the comment?

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

In Reply To:
Are you trying to work out how to get the link to the bio of the author of the comment?
Yes. The link to the bio from the review works perfectly, putting it on the comment and getting other data from the users db is the problem.

In all of my "review" db forms (trailreviews, bikereviews etc.), there are a couple fields that I'd like to fill with data from the "users" db. For instance, "if" a person has a bio and they fill out a review, the state/country fields for example are automatically filled by taking the info from the users db. -- like a cookie.

Does this clear anything up?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
You've got two very different things in your last post. You are talking about a link in the search results and you are talking about filling in forms. One thing at a time, please. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry.... guess I'm just ansy to get things working.

Getting the bio link into all of my db's is more important to autofilling the forms.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm sorry. I'm just not with it these days.

You can basically use the same code:

Code:

&switch_to_users;
%rec3 = &get_record($rec{'name of userid field in the database you're currently working with'});
&switch_to_name of current database;
if ($rec3{'Userid'}) {
print qq|link to the user|;
}
If your bike review comments record info is in a hash called %rec2, then use

%rec3 = &get_record($rec2{'name of userid field in the database you're currently working with'});


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry I took so long to reply and for this whole thing dragging out for as long as it has....

Anyways, I just plugged that into the comments db and it works fine. However, if I try to put it in sub html_record in the reviews db, something weird happens. For some reason, $long_url is getting messed up if this is in there:

%rec3 = &get_record($rec{'Userid'});

For some reason, $long_url stays the same for about 5-10 links then "nh=" jumps and does the same thing. So clicking the links will give an invalid result. If I comment out the #rec3 statement, it works again.

I uploaded all of the files to the server so you can see what I mean. Its weird.

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

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

Also, for some strange reason, all of the comments that are added to the reviews show up for each record.... not just the one with the corresponding BikeID. I went through the steps that you gave me to set it up and it all looks fine. I don't even think that I touched anything in that part of the html.pl.

Thank you for your ongoing envolvement in my project!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm getting really overwhelmed with this. This is so complicated. I don't even know where to begin.

I did notice that, when I looked at a review, there were two comments. One of them said ID:22 and the other said ID: Yes. This tells me that your bike comments reviews database is messed up. You didn't add or delete any fields in the .cfg file after adding records, did you?




JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I've ovewhelmed the dbman goddess!!?!? Uh oh, that's not good.

Sorry, there was some remnants of old entries in the comments.db on the server -- just updated it.

Even when I emptied the comments db and readded stuff, the error occurs. I removed 2 fields in the comments cfg and I changed the $auth_user_field accordingly and the switch sub in db.cgi. Would that cause the problem?

To make things even more baffling, comments only show up when you do a list all.... if you do a search on any field, the results don't have a comment in them (even if they are supposed to).

With my luck, its most likely the stupidest little problem... finding it is the trouble. I'd determined though.


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'll tell you what. I will give you my Sunday. Hubby will be spending the day taking his mother out to dinner, so I will have the whole day. And there's usually not a lot of traffic on the forum on Sundays.

Put all of your files into your directory -- including the .db files -- with .txt extensions and I'll pick them up and install them on my own server so I can see what's going on. Deal? Smile


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Wow... the royal treatment! I can't tell you how appreciative I am right now!!!! If I had tons of cash, I can tell you right now, I'd be sending some your way!

Sounds like a plan. I'll put all of the stuff into the directories that I mentioned in a bunch of messages in this thread. I'll put the working version online as well -- just so its running on my temp server.

I should be around Sunday so if you want to send me email instead of posting to the board, that's may be easier. Its up to you.

Thanks again!!!!!!!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I should have asked this before, but I guess better late than never.

In bikereviews_html.pl, sub html_record, you say

In Reply To:
## problem here. If %rec3 is commented out, List all works correctly. If its left, $long_url gets messed up
#%rec3 = &get_record($rec{'Userid'});
What do you mean "messed up"? Can I get an example of the $long_url both with the line and without it?

I know you explained it earlier, but I really need a specific example.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I just saw something that can be a major problem.

In users.cfg, you have

ID => [0, 'numer', 5, 8, 1, '', ''],

and

Userid => [16, 'alpha', -2, 15, 1, '', '']

and

# The column name for the database key. Can be any column, but it must be unique!
# You can't have two records with the same key value!
$db_key = 'Userid';
# Track the key? Should DBMan keep a counter of the next key to use? This isn't
# neccessary if you can guarantee that your entry in the key field will be unique
# (i.e. a userid).
$db_key_track = 1;


Not good.

I don't know why you have the ID field, but you definitely should not have $db_key_track=1 if your key field is the userid field.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
What do you mean "messed up"? Can I get an example of the $long_url both with the line and without it?
When %rec3 is commented out, long_url is correctly incremented. Ifs its left in, long_url loses proper incrementation.

In Reply To:
I don't know why you have the ID field, but you definitely should not have $db_key_track=1 if your key field is the userid field.
In users.cfg, ID is just the record number - that could just be changed to Usercount or something like that. I'd like to have a user counter just so I know how many accounts there are. I need to keep Userid -- it relates to all of the datbases.

How would I remedy this problem?

Thanks for looking at my files!


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
There are other ways to keep track of the number of registered users. The only way that the ID field is incremented is if it is the $db_key field.

I would eliminate the ID field from users.cfg.

Regarding the other problem -- I really need to see the URL that is generated when the line is active and when it isn't. That's the only way I can tell what the problem is.

What I'm doing right now is setting up a simplified version of your databases on my home computer -- one database at a time. No fancy page formatting or anything. Just the basic database structure. I'll let you worry about making it pretty. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
I would eliminate the ID field from users.cfg.
Sounds fine to me.

In Reply To:
Regarding the other problem -- I really need to see the URL that is generated when the line is active and when it isn't. That's the only way I can tell what the problem is.
Okay, right now, the version that I have online doesn't have %rec3 commented out. Log into
http://visit-my-webpage.com/...iews&uid=default as admin/admin and do a "list all". Mouseover the fields listed under "brand" or "model". Notice in your browser's status bar that nh= does not increment correctly when you move down the list. If you click on one of the reviews, it has the wrong data or its not there at all. When %rec3 is commented out, everything works okay with nh= however the link to the users db under "posted by" no longer appears.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I think I got it. It's a conflict with variable names.

Try adding $i to the "my" line at the beginning of sub get_record:

my ($key, $found, $line, @data, $field, $restricted, $i);

I'm sorry I've been so dense.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
Try adding $i to the "my" line at the beginning of sub get_record:

I'm sorry I've been so dense.
No worries... Anyways, I added the $i but unfortunately it didn't work.


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Okay. Let's try something else then.

In sub html_view_success, change

$i = 1; to $rec_count=1;

++$i; to ++$rec_count;

In sub html_record, change

$record_number = ((($nh - 1) * $db_max_hits) + $i); to
$record_number = ((($nh - 1) * $db_max_hits) + $rec_count);

I know that somewhere there is a conflict with the $i variable which is causing this. So now we change the $i variable to something else.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Worked like a charm! DBMan goddess strikes again!

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