Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: Days_Old tag.

Quote Reply
Re: Days_Old tag. In reply to
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
Subject Author Views Date
Thread Days_Old tag. lparry 5655 Feb 3, 2001, 8:21 PM
Thread Re: Days_Old tag.
Dan_O 5498 Feb 4, 2001, 12:34 PM
Thread Re: Days_Old tag.
lparry 5472 Feb 5, 2001, 1:19 PM
Thread Re: Days_Old tag.
Robert_B 5490 Feb 5, 2001, 3:04 PM
Thread Re: Days_Old tag.
lparry 5481 Feb 5, 2001, 4:05 PM
Thread Re: Days_Old tag.
Robert_B 5467 Feb 5, 2001, 5:11 PM
Thread Re: Days_Old tag.
Robert_B 5458 Feb 5, 2001, 5:38 PM
Thread Re: Days_Old tag.
pugdog 5491 Feb 5, 2001, 10:57 PM
Thread Re: Days_Old tag.
Robert_B 5431 Feb 6, 2001, 6:14 AM
Thread Re: Days_Old tag.
Alex 5419 Feb 6, 2001, 11:03 AM
Thread Re: Days_Old tag.
Robert_B 5407 Feb 6, 2001, 1:57 PM
Thread Re: Days_Old tag.
Robert_B 5407 Feb 6, 2001, 6:36 PM
Thread Re: Days_Old tag.
Alex 5435 Feb 6, 2001, 7:45 PM
Post Re: Days_Old tag.
Robert_B 5412 Feb 7, 2001, 6:25 AM