Okay I've been thinking about why the category link HTML was never template-ized and couldn't think of any reason why it couldn't work. This only took about an hour to come up with and it worked after a couple partially successful attempts. Hope it works for you guys.
Open site_html_templates.pl and go to sub_site_html_print_cat.
Find:
$output .= qq|<dl><dt><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|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;Replace with:
numlinks => $numlinks,
category_name => $category_name,
description => $description,
new => $new
);
if (&days_old($mod) < $db_new_cutoff) {$cat_rec{'new'} = 1}
if ($cat_rec{'description'} !~ /^[\s\n]*$/) {delete: $cat_rec{'description'}}
$output .= &site_html_category_link;Add this new subroutine:
# --------------------------------------------------------
# This routine is used to display what a category link should
# look like.
return &load_template ('category_link.html', {
%cat_rec,
%globals
});
}Now create a new template named 'category_link.html', like the following, and place it in your templates directory:
<i>(<%numlinks%>)</i>
<%if new%>
<i><sup>new</sup></i>
<%endif%>
<%if description%>
<%description%>
<%endif%>Change Log:
9-15-00 : BUG - 'my %cat_rec;' declaration at top of subroutine. Works correctly once removed.
--Drew
Open site_html_templates.pl and go to sub_site_html_print_cat.
Find:
Code:
# Then we print out the name linked, new if it's new, and popular if its popular. $output .= qq|<dl><dt><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|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
Code:
%cat_rec = (url => $url, numlinks => $numlinks,
category_name => $category_name,
description => $description,
new => $new
);
if (&days_old($mod) < $db_new_cutoff) {$cat_rec{'new'} = 1}
if ($cat_rec{'description'} !~ /^[\s\n]*$/) {delete: $cat_rec{'description'}}
$output .= &site_html_category_link;
Code:
sub site_html_category_link { # --------------------------------------------------------
# This routine is used to display what a category link should
# look like.
return &load_template ('category_link.html', {
%cat_rec,
%globals
});
}
Code:
<a href="<%url%>"><%category_name%></a> <i>(<%numlinks%>)</i>
<%if new%>
<i><sup>new</sup></i>
<%endif%>
<%if description%>
<%description%>
<%endif%>
9-15-00 : BUG - 'my %cat_rec;' declaration at top of subroutine. Works correctly once removed.
--Drew