Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Pending to a table instead of deleting

Quote Reply
Pending to a table instead of deleting
Hi All,

Is it possible to have the option of sending a record to a duplicate links table so that it can be recalled at a later date, a bit like putting the record "ON HOLD"?

Regards

MDJ1
http://www.isee-multimedia.co.uk
Quote Reply
Re: Pending to a table instead of deleting In reply to
Couple suggestions....

1) Copy the Validate.def file and call it Hold.def.

2) Create another table called Hold that should look like the Validate.def file.

3) You could use some conditional statements in the process_form routine that will call the particular database based on a trigger parameter like onhold.

Example:

Code:

$hold = = new Links::DBSQL $LINKS{admin_root_path} . "/defs/Hold.def";


AFTER the following codes:

Code:

$val = new Links::DBSQL $LINKS{admin_root_path} . "/defs/Validate.def";


You could also add a query statement to make sure that the link is not already in the Validate and Hold tables with the following codes:

Code:

$hold-> query ( { URL => $in->param('URL'), ww => 1 } );


Then edit the following codes:

Code:

$id = $val->add_record ( $rec, $in );


to the following:

Code:

if ($in->param('hold') eq 'Yes') {
$id = $hold->add_record ( $rec, $in );
}
else {
$id = $val->add_record ( $rec, $in );
}


5) Then add the following field in your add forms in the add.html and add_error.html template files:

Code:

<input type="checkbox" name="hold" value="Yes"> Put on Hold


These codes may have to be tweaked a bit and you would have to tweak the validate routines in the Admin_HTML.pl file to pull data from the Hold table into the Links table. But this will give you some idea of what you need to do.

Hope this helps.

Regards,

Eliot Lee

Quote Reply
Re: Pending to a table instead of deleting In reply to
Thanks eliot,

I will have a play with this ASAP.

It amazes me how you role this off the "top of your head"!

Looking forward to the new Links SQL should be any time now, Alex did say a couple of days 4 days ago!!!



Regards

MDJ1
http://www.isee-multimedia.co.uk
Quote Reply
Re: Pending to a table instead of deleting In reply to
You're welcome...

Thanks for the compliment...I am actually learning more and more SQL and also CF (Cold Fusion) at my new job, which will expand my programming skills...but I will still be maintaining my site with Perl, CGI, and SQL. Wink

BTW: I am also looking forward to the new version...it will be nice to see if the new version enhances the build process. I just tested the build process last night and it took three times as long to build only 10% of directory before timing out. Alex has mentioned that the category structure is improved in the next version and having an enhanced SQL engine will be nice, too.

Wink

Regards,

Eliot Lee