Gossamer Forum
Home : Products : DBMan : Customization :

validate mod + relational mod

Quote Reply
validate mod + relational mod
I have the relational mod working pretty much how I want it to (thanks JPDeni!!) however I'm now running into some problems with using the Validate mod on both databases. In the validate mod instructions, it says to use the field "Validated" and it is used throughout several subroutines. My problem is that since the relational mod will not allow me to use "Validated" in both databases, I have to change it to something else. To correspond with my other fields in datbase 2, I just added "comments" to it - so its now "commentsValidated". I went through the validate mod instructions and added the stuff to the 2nd database and changed any occurance of "Validated" to "commentsValidated". There are some parts of the changes to db.cgi and html.pl that cause some problems though. Ie.

if ($db_cols[$i] eq "Validated") {
-- do I just put an "or" statement in there?

This is just one of the fields that need to be fiddled with.

After playing around with the files a bit, I got it to go to the validate page in the 2nd database. However, if I try to validate something, it goes to the success page but does not change the field from "No" to "Yes". Deleting works fine. I have the validate mod working perfectly in my main database, its just the 2nd one that's causing the problems. I have uploaded all the files to the following directory:

http://visit-my-webpage.com/tmp

and my database is accessible here:

http://visit-my-webpage.com/...iews&uid=default

login as: admin/admin

Just go to "list all", click on one of the "brands" and then click "add a review for these...." at the right side of the screen. Clicking this will go to the 2nd database for you to add comments to the original review -- make sure that "validated" is set to "No" in order to get it to work.

I realize that this is a lot of info for one little thing but its kindof hard to explain in a little message.

Thanks in advance for any input!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: validate mod + relational mod In reply to
I probably should have made it a variable rather than hard-coding the name into the subroutines.

You could set up a variable in your .cfg file

$validate_field = 'Validated';

Then wherever it refers to $in{'Validated'} or $rec{'Validated'}, you could use $in{$validate_field} or $rec{$validate_field}.

I'll go look over the mod and see what needs to be changed.


JPD
Quote Reply
Re: validate mod + relational mod In reply to
Jason, I've changed the validate mod to use a variable instead of the hard-coded field name. Take a look at http://www.jpdeni.com/...n/Mods/validate1.txt.

If you use this, you'll also need to add $db_validated_field = 'Validated'; to your "switch_to_*" subroutines for the relational mod. This should do it for you.


JPD
Quote Reply
Re: validate mod + relational mod In reply to
Works like a charm!!! Thanks a million JPDeni!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: validate mod + relational mod In reply to
I'm really glad it worked for you. And I appreciate your bringing up the issue. It will help others who have the same problem.


JPD