I have a problem with this mod because I installed 3 Level of New Graphics mod. The subcategories are shoing up but the problem is not in the right place. Here is the code for
sub site_html_print_cat {
my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
$columns = 1;
$output = qq|<table width="100%" border="0" cellspacing="0" cellpadding="0">\n|;
$output .= qq|<tr>\n|;
foreach $subcat (sort @subcat) {
my $mod = $stats{"$subcat"}[3];
my $new_add = $stats{"$subcat"}[4];
($description) = @{$category{$subcat}}[2];
($subcatstyle) = @{$category{$subcat}}[9];
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) {
$category_name = &build_clean($1);
}
else {
$category_name = &build_clean($subcat);
}
$numlinks = $stats{"$subcat"}[0];
# $mod = $stats{"$subcat"}[1];
if ($i == $columns) {
$output .= qq|</tr>\n<tr>|;
$i = 0;
}
$output .= qq|<td vAlign="top">\n|;
$output .= qq|<a href="$url">$category_name</a>\n|;
$output .= qq|<i>($numlinks)</i> \n|;
if ($new_add eq "Yes") {
$days_old = &days_old($stats{"$subcat"}[2]);
if ($days_old <= 2) { $output .= qq| $new_1|; }
elsif ($days_old <= 7) { $output .= qq| $new_3|; }
elsif ($days_old <= 14) { $output .= qq| $new_7|; }
}
if ($mod eq "Yes") { $output .= qq~ $updated~; }
$output .= qq|
|;
$output .= qq|$description\n| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</td>\n|;
$i++;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~ ~ if ($style eq "1");
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR>~;
}
else { }}
$output .= "</tr>\n</table>\n";
return $output;
}
1;
I don"t know what it"s doing but when I tried this for Business section at http://searchat.virtualave.net, instead of the subcategories being printed below Business, it printed directly above the whole categories.
Please help in correcting this.
SearchAt!- Directory of Services
http://webbusinessservices.hypermart.net
sub site_html_print_cat {
my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
$columns = 1;
$output = qq|<table width="100%" border="0" cellspacing="0" cellpadding="0">\n|;
$output .= qq|<tr>\n|;
foreach $subcat (sort @subcat) {
my $mod = $stats{"$subcat"}[3];
my $new_add = $stats{"$subcat"}[4];
($description) = @{$category{$subcat}}[2];
($subcatstyle) = @{$category{$subcat}}[9];
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) {
$category_name = &build_clean($1);
}
else {
$category_name = &build_clean($subcat);
}
$numlinks = $stats{"$subcat"}[0];
# $mod = $stats{"$subcat"}[1];
if ($i == $columns) {
$output .= qq|</tr>\n<tr>|;
$i = 0;
}
$output .= qq|<td vAlign="top">\n|;
$output .= qq|<a href="$url">$category_name</a>\n|;
$output .= qq|<i>($numlinks)</i> \n|;
if ($new_add eq "Yes") {
$days_old = &days_old($stats{"$subcat"}[2]);
if ($days_old <= 2) { $output .= qq| $new_1|; }
elsif ($days_old <= 7) { $output .= qq| $new_3|; }
elsif ($days_old <= 14) { $output .= qq| $new_7|; }
}
if ($mod eq "Yes") { $output .= qq~ $updated~; }
$output .= qq|
|;
$output .= qq|$description\n| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</td>\n|;
$i++;
if ($subcatstyle =~ m,^\(([^\)]+)\)(\d)$, && $#{$subcategories{$subcat}} >= 0) {
($subcatstyle, $style) = ($1, $2);
$s = 0;
@subcatsub = split (/\|/, $subcatstyle);
$output .= qq~ ~ if ($style eq "1");
foreach $category_name (@subcatsub) {
foreach (sort @{$subcategories{$subcat}}) {
($subcatstyle eq "ALL" && $#subcatsub == 0) ?
($_ =~ m,.*/([^/]+)$, and $category_name = &build_clean($1)) :
($_ eq "$subcat/$category_name" or next);
if ($style eq "1") {
$length += length($category_name);
($length > $subcat_length) and last;
}
if ($s > 0) {
$output .= qq~, ~ and $length += 2 if ($style eq "1");
$output .= qq~ ~ if ($style eq "2");
}
$url = "$build_root_url/" . &urlencode($_) . "/";
$output .= qq~<LI>~ if ($style eq "2");
$output .= qq~<a class="subcat" href="$url">$category_name</a>~;
$s++;
last if ($subcatstyle ne "ALL" && $#subcatsub > 0);
}
}
undef $length;
if ($s < $#{$subcategories{$subcat}}) {
$output .= qq~...~ if ($style eq "1");
}
$output .= qq~<BR>~;
}
else { }}
$output .= "</tr>\n</table>\n";
return $output;
}
1;
I don"t know what it"s doing but when I tried this for Business section at http://searchat.virtualave.net, instead of the subcategories being printed below Business, it printed directly above the whole categories.
Please help in correcting this.
SearchAt!- Directory of Services
http://webbusinessservices.hypermart.net