Gossamer Forum
Home : Products : DBMan : Customization :

Limit Number of Records per User

Quote Reply
Limit Number of Records per User
Question - In the Limit Number of Records per User mod (Easy Way), if I want to change change the error message from "duplicate key error" to "Click your back button, then click [Modify] to update your existing report." I found 3 instances of "duplicate key error" in the script but am unsure what needs to be changed.

Thanks,
Will

Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: Limit Number of Records per User In reply to
Before

&html_add_failure($status);

add

Code:

if ($status eq "duplicate key error") {
$status = "Click your back button, then click [Modify] to update your existing report";
}
The only thing is that the duplicate key error would not come up when a record was being modified, only when it is being added.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Limit Number of Records per User In reply to
That's perfect. Some of the guides that contribute fishing reports can't read too well. Instead of updating their current report, they add a new report each time and that causes problems.

Another quick question. This is an existing database and $db_key = 'ID';. Will anything be harmed if I change it to $db_key = 'Userid';?

Thanks for your help.

Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: Limit Number of Records per User In reply to
I made the changes to db.cgi and my reports.cfg. It broke displaying the image from the file upload mod.

Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: Limit Number of Records per User In reply to
I don't see how the two could be related. Displaying the image is in sub html_record. The change is in sub add_record.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Limit Number of Records per User In reply to
I don't see how either. I can guess though. I think it must be related to changing $db_key in the .cfg. After I made the change, I tested it and it did not keep me from adding a second fishing report using one of the old UserIDs. The same old dummies would be mucking up my database.

Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: Limit Number of Records per User In reply to
You changed the $db_key field? From what to what?

(I gotta tell you that your graphic is very distracting. I'm about to turn off graphics just because of yours.)


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Limit Number of Records per User In reply to
From above
In Reply To:
This is an existing database and $db_key = 'ID';. Will anything be harmed if I change it to $db_key = 'Userid';?
Carol, what graphic?


Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: Limit Number of Records per User In reply to
In Reply To:
Carol, what graphic?
Go to the top of the page and click "Edit Profile." Click "Basic Profile." Go to the bottom of the page. There is a field labeled --

Your Picture (Entire URL - Picture size is 65x75 pixels)

In that field will be the following

http://www.fishhoo.com/goofy.gif

That's the graphic I'm talking about. It is very distracting. However, I have just changed my settings so I won't see it any more.

If you have changed the key field of your database, the uploaded files will no longer be associated with their records, since they were keyed to the key field.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Limit Number of Records per User In reply to
Thanks for reminding me of the graphic. I had the display option turned off and didn't realize how bad it really was. I have dumped the graphic.

I guess the answer to my above question,
In Reply To:
Another quick question. This is an existing database and $db_key = 'ID';. Will anything be harmed if I change it to $db_key = 'Userid';?
should have been yes.



Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/
Quote Reply
Re: Limit Number of Records per User In reply to
Obviously I had missed the question when you asked it before.

The answer would be "No," unless you already have records in the database. If you already have records in the database, the answer is "Possibly."

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Limit Number of Records per User In reply to
Smile Yeah, I had to retreat from that one.

Thanks just the same.

Will
Webmaster
FishHoo! Search Index for Fishermen
http://www.fishhoo.com/