i figured out how to do it in 1.11.. but it's not that great...
add to my list at top..
add this..
Code:
($in->param('category') =~ /^(\d+)$/) and ($cat = $1);
under
Code:
($in->param('order') =~ /^(score|category)$/i) ? ($order = uc $1) : ($order = 'CATEGORY');
add..
Code:
# Build a hash of the category and subcategories.
my (%categories);
if ($cat) {
$categories{$cat}++;
my $sth = $catdb->prepare ("SELECT SubCategoryID FROM CategoryHierarchy WHERE CategoryID = $cat");
$sth->execute() or die $DBI::errstr;
while (my ($id) = $sth->fetchrow_array) { $categories{$id}++; }
}
under..
Code:
# Return if we don't have any matches.
unless ($link_count or $cat_count) {
&log_query ($in->param('query'), 0);
&site_html_search_failure ({ error => "No matching links.", ignored => $ignored, %in }, $dynamic);
return;
}
under..
Code:
$hit = $catdb->array_to_hash($hit);
add
Code:
if ($cat && !$categories{$hit->{ID}}) { $cat_count--; next; }
under
Code:
$hit = $linkdb->array_to_hash ($hit);
add
Code:
if ($cat && !$categories{$hit->{CategoryID}}) { $link_count--; next; }
------------------
Jerry Su Links SQL User
------------------