Hi there,
I used a mod. to show subcats on main-cat page.
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?do=post_view&post=173772
If you take a look at:
http://musiclinks.hebbizz.nl/gsmdir/SMS_Diensten/
you see on the right side only the FIRST of the actual links outside the column??
I used this code. (mod on site_html_templates.pl)
sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#
my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+2) / 2);
# Print Header.
$output = qq|<table align="left" width="95%" border="0" cellspacing="0" cellpadding="5"><tr><td align="left" class="catlist" valign="top">\n|;
foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
# First let's get the name, number of links, and last modified date...
$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];
# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td width="50%" align="left" class="catlist" valign="top">\n|;
}
$i++;
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq||;
$output .= qq|<br><small>| . qq||;
$j=0;
for (@{$subcategories{$subcat}}) {
if (m,^\Q$subcat\E/([^/]+)$,) {
$child = &build_clean($1);
if ($j == $#child) {
$output .= qq|<a href="$build_root_url/$subcat/$child/">$child</a>|;
}
else {
$output .= qq|<a href="$build_root_url/$subcat/$child/">$child</a>, |;
}
}
$j++;
if ($j == $max_subs) {
#$output .= 'and more....';
$output .= qq|<a class="link" href="$url">en meer...</a>|;
last;
$j = 0;
}
}
#chop $output;
$output =~ s/[\s,]+$//;
$output .= qq|</small><br><br>|;
$output .= qq||;
}
# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}
1;
thanx in advance,
Ron.
I used a mod. to show subcats on main-cat page.
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?do=post_view&post=173772
If you take a look at:
http://musiclinks.hebbizz.nl/gsmdir/SMS_Diensten/
you see on the right side only the FIRST of the actual links outside the column??
I used this code. (mod on site_html_templates.pl)
sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#
my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+2) / 2);
# Print Header.
$output = qq|<table align="left" width="95%" border="0" cellspacing="0" cellpadding="5"><tr><td align="left" class="catlist" valign="top">\n|;
foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
# First let's get the name, number of links, and last modified date...
$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];
# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td width="50%" align="left" class="catlist" valign="top">\n|;
}
$i++;
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq||;
$output .= qq|<br><small>| . qq||;
$j=0;
for (@{$subcategories{$subcat}}) {
if (m,^\Q$subcat\E/([^/]+)$,) {
$child = &build_clean($1);
if ($j == $#child) {
$output .= qq|<a href="$build_root_url/$subcat/$child/">$child</a>|;
}
else {
$output .= qq|<a href="$build_root_url/$subcat/$child/">$child</a>, |;
}
}
$j++;
if ($j == $max_subs) {
#$output .= 'and more....';
$output .= qq|<a class="link" href="$url">en meer...</a>|;
last;
$j = 0;
}
}
#chop $output;
$output =~ s/[\s,]+$//;
$output .= qq|</small><br><br>|;
$output .= qq||;
}
# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}
1;
thanx in advance,
Ron.