Problem.
See this code:
sub site_html_print_cat {
# --------------------------------------------------------
# This routine prints out a list of categories.
#
my $subcat = shift;
my ($output, $category_name, $category_url, $i, $cat, $cat_r, @subnames);
my $parent_cat = shift @$subcat;
my $breakpoint = int (($#{$subcat}+1) / $CFG->{build_category_columns}) + ( (($#{$subcat}+1) % $CFG->{build_category_columns}) ? 1 : 0);
# Print Header.
my $table_head = $CFG->{build_category_table} || '';
my $width = int (100 / $CFG->{build_category_columns});
if ($CFG->{build_category_columns}) {
$output = qq|<div class="margin"><table $table_head><tr><td class="catlist" width="$width%" valign="top">\n|;
}
$i = 0;
my $cat_db = $DB->table('Category');
foreach $cat_r (@$subcat) {
# Get the URL and the Category name.
$category_url = $CFG->{build_root_url} . "/" . $cat_db->as_url ($cat_r->{Full_Name}) . "/" . $CFG->{build_index};
($cat_r->{Name} =~ m,.*/([^/]+)$,) ? ($category_name = $1) : ($category_name = $cat_r->{Name});
$cat_r->{Short_Name} = $category_name;
$cat_r->{URL} = $category_url;
# ------------------------ Category Days_Old Routine --------------------------
# Calculate the number of days old.
if ($cat_r->{'Has_New_Links'}) {
$cat_r->{'Days_Old'} = >::Date::date_diff (>::Date::date_get(), $cat_r->{'Newest_Link'});
}
else { $cat_r->{'Days_Old'} = ''; }
# ----------------------------------------------------------------------------
See the Days_Old routine, is there a hook here anywhere I can use? I don't think I can port this part into the plugin because the $cat_r variable originates in the foreach loop.
Anyone have any input?
Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
See this code:
sub site_html_print_cat {
# --------------------------------------------------------
# This routine prints out a list of categories.
#
my $subcat = shift;
my ($output, $category_name, $category_url, $i, $cat, $cat_r, @subnames);
my $parent_cat = shift @$subcat;
my $breakpoint = int (($#{$subcat}+1) / $CFG->{build_category_columns}) + ( (($#{$subcat}+1) % $CFG->{build_category_columns}) ? 1 : 0);
# Print Header.
my $table_head = $CFG->{build_category_table} || '';
my $width = int (100 / $CFG->{build_category_columns});
if ($CFG->{build_category_columns}) {
$output = qq|<div class="margin"><table $table_head><tr><td class="catlist" width="$width%" valign="top">\n|;
}
$i = 0;
my $cat_db = $DB->table('Category');
foreach $cat_r (@$subcat) {
# Get the URL and the Category name.
$category_url = $CFG->{build_root_url} . "/" . $cat_db->as_url ($cat_r->{Full_Name}) . "/" . $CFG->{build_index};
($cat_r->{Name} =~ m,.*/([^/]+)$,) ? ($category_name = $1) : ($category_name = $cat_r->{Name});
$cat_r->{Short_Name} = $category_name;
$cat_r->{URL} = $category_url;
# ------------------------ Category Days_Old Routine --------------------------
# Calculate the number of days old.
if ($cat_r->{'Has_New_Links'}) {
$cat_r->{'Days_Old'} = >::Date::date_diff (>::Date::date_get(), $cat_r->{'Newest_Link'});
}
else { $cat_r->{'Days_Old'} = ''; }
# ----------------------------------------------------------------------------
See the Days_Old routine, is there a hook here anywhere I can use? I don't think I can port this part into the plugin because the $cat_r variable originates in the foreach loop.
Anyone have any input?
Robert Blackstone
Webmaster of Scato Search
http://www.scato.com