Gossamer Forum
Home : Products : Links 2.0 : Customization :

Search subcategories

Quote Reply
Search subcategories
Hello

I was looking for a mod to search subcategories and i found one in the resources section of this site. ( http://josereffoios.virtualave.net/links/search_subc.txt )

the code replaces

--------------------------------------------------
# If we have a hit, add it in!
if (($or_match && $match) or $andmatch) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++; # We have a match!
}
---------------------------------------------------

in search.cgi with

####################################################

# Split Categories and sub Categories into two different variables
($subcat1,$subcat2) = split(/\//, $values[$db_category]);

# do the same for the form's hidden value (category or subcateg name)
($subcat3,$subcat4) = split(/\//, $in{'thiscat'});

# check what type of category is and define what the search criteria will be
if ($subcat4) {$subcat1 = $values[$db_category];}

if ($in{'thiscat'})
{
if ($subcat1 eq $in{'thiscat'})
{
# If we have a hit, add it in!
if (($or_match && $match) or $andmatch) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++; # We have a match!
}
}
}

else
{
# If we have a hit, add it in!
if (($or_match && $match) or $andmatch) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++; # We have a match!
}
}

############################################

The problem is this mod only searchs down 2 levels, how can i modify this mod to search all subcategories?

Thanks bye


Quote Reply
Re: Search subcategories In reply to
Hi,
Did anyone come up with any solution for this?

Thank you.

Regards,
Pagla

Quote Reply
Re: Search subcategories In reply to
Nope...doesn't look like it...You could try using the Language Links subcategory search Mod, but I found that it did not work well at all with the vanilla installation of Links 2.0.

Regards,

Eliot Lee