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

Re: search options

Quote Reply
Re: search options In reply to
Finally we found the easy mod to search for any col:
Replace:
# Now let's search the links table, but first figure out any filters.
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Links.def";
my %filter = ();
foreach my $col (@{$linkdb->{db_cols}}) {
if ($in->param($col)) {
$filter{$col} = $in->param($col);
}
}
$link_hits = $linkdb->query ( { query => $query, mh => $mh, nh => $nh, filter => \%filter, ww => $ww } );
$link_count = $linkdb->hits || 0;
$link_errors = $linkdb->query_errors;

with:
# Now let's search the links table, but first figure out
# any filters.
my $idsinfo;
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Links.def";
my %filter = ();
foreach my $col (@{$linkdb->{db_cols}}) {
if ($in->param($col)) {
$filter{$col} = $in->param($col);
}
}

if ($in->param('IDS'))
{
$idsinfo = $in->param('IDS');
}
else
{
$idsinfo = 'query';
}
$link_hits = $linkdb->query ( { $idsinfo => $query, mh => $mh, nh => $nh, filter => \%filter, ww => $ww } );
$link_count = $linkdb->hits || 0;
$link_errors = $linkdb->query_errors;

Now you can enter a query like:
http://www.yourdomain.com/cgi-bin/search.cgi?query=15&IDS=ID
to display the Link with ID 15

Cheers

Niko


http://www.master-productions.com
Subject Author Views Date
Thread search options el noe 4669 Jun 17, 2000, 5:36 AM
Thread Re: search options
pugdog 4570 Jun 17, 2000, 8:18 AM
Thread Re: search options
el noe 4617 Jun 17, 2000, 8:47 AM
Thread Re: search options
pugdog 4604 Jun 17, 2000, 10:31 AM
Thread Re: search options
el noe 4571 Jun 17, 2000, 10:39 AM
Post Re: search options
pugdog 4580 Jun 17, 2000, 2:13 PM
Post Re: search options
pugdog 4560 Jun 17, 2000, 2:15 PM
Post Re: search options
el noe 4560 Jun 18, 2000, 3:19 AM
Thread Re: search options
el noe 4563 Jun 18, 2000, 6:03 AM
Post Re: search options
startpoint 4512 Jul 13, 2000, 4:09 PM