I have not tested the following codes...but if they work, cool! If not, then may be someone can provide some tweaks that will work....
1) Add the following codes as global variables in the
my (); codes in the
sub main routine:
Code:
$categories, $categoryid 2) Then add the following codes:
Code:
($in->param('categoryid') =~ /^(\d+)$/) ? ($categoryid = $1) : (u
ndef $categoryid); AFTER the following codes:
Code:
($in->param('order') =~ /^(score|category)$/i) ? ($order = uc $1) : ($or
der = 'CATEGORY'); 3) Then add the following codes:
Code:
# Search Category Codes
if ($categoryid) {
$categories = $categoryid;
my $sth = $linkdb->prepare (" SELECT SubCategoryID FROM Category
Heiarchy WHERE CategoryID = $categoryid ");
$sth->execute();
while (my $cat = ($sth->fetchrow_array)[0]) {
$categories .= ",$cat";
}
}[
AFTER the following codes:
Code:
# Now let's search the links table, but first figure out any filters.
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Links.
def"; 4) Then add the following codes in the hash codes for the
&site_search_results:
Code:
categoryid => $categoryid 5) Then add the following codes in your
category.html file:
Code:
<input type="radio" name="categoryid" value="<%categoryid%>"><%category_name%></option>
<input type="radio" name="categoryid" value=""> Whole Site</option> Again...I do not know if this will work...I have not built my site yet...so, the
CategoryHierarchy table has not been built.
Regards,
Eliot Lee