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

search options

Quote Reply
search options
Hi,
I just wanted to ask if there is a search term like in links 2.0 where I can search only for the link ID.
e.g. search.cgi?ID=16?

Cheers
Niko

http://www.master-productions.com
Quote Reply
Re: search options In reply to
You'd have to code that. Or, you could just feed the ID into the jump.cgi program. If the ID exists, you get taken there (or to the detail page -- see the mod) and if it doesn't you get the standard error "ID doesn't exist".



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: search options In reply to
O.K. how about defining the ID - field as searchable and search for the "ID" or ID or ID* - it does not work. Do you have any suggestions?

Thanks

Niko

http://www.master-productions.com
Quote Reply
Re: search options In reply to
I think the problem has to do with how the search is set up. Numeric searches are handled differently.

The thing is _WHY_ not just link to the jump.cgi?? If you are searching for an ID, you'll only have one match anyway, so you might as well just link to it if it exists. It's a lot simpler, and has the same effect.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: search options In reply to
Hi,
we are using Links SQL as a shopping cart and want to give our affiliates the possibility to link to one single product. There are no Links to jump to, only Link information. To see what I mean go to :
http://www.master-productions.com/...?query=16&IDS=ID
Thanks for your help

Niko

http://www.master-productions.com
Quote Reply
Re: search options In reply to
Again, just change it to

http://www.master-productions.com/cgi-bin/jump.cgi?ID=16

If you use the jump.cgi mod I posted to count hits to detail pages, you'd make it:

http://www.master-productions.com/cgi-bin/jump.cgi?ID=16.html

and it would display the detail page, which is what I think you want to do.

It actually has a _lot_ less overhead than using search.cgi for a simple lookup.





http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: search options In reply to
BTW... if you are linking to the detail pages, why not just let them link to the detail page directly? It won't change, and it will be updated on each rebuild. It will use less server resources as well, and stands a chance of being indexed because it's not a .cgi page.

http://www.master-productions.com/links/pages/Detailed/16.html



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: search options In reply to
O.K. you are probably right. I have just the problem that I want to store the information about the refferer in a cookie via shop.cgi. But this is not really a problem since I can call page.cgi via shop.cgi and count the refferals and store the cookie before - so this is not really a problem any more. Anyway I still did not get the point about page.cgi.
When I go to
http://www.master-productions.com/...?g=/Detailed/16.html for example I only get Links to the Category IBM for example via page.cgi again. If I link to the url in the detailed there is - obviously no page because I did not build detailed pages and I donīt want to because they are more than 17000 and they are growing. By the way - the bdsql - mini guide was very helpful either I did not see it before. I now have something to update the product list with modified prices, new products and delete old ones and there would have been the possibility to link to single IDīs via search.cgi - which I donīt need any more with the page.cgi. Anyway would be nice if you had a hint which line to change to get a regular link to the html - page with a page viewed with page.cgi.

Thanks

Niko

http://www.master-productions.com
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
Quote Reply
Re: search options In reply to
Nice work done my friend. So we can search on all fields great, just what i needed!

Question: If i want to search on all links added from 1 may 2000 till 31 may 2000 how to do that ?

Regards,

Startpoint