X-Git-Url: https://git.decadent.org.uk/gitweb/?p=memories.git;a=blobdiff_plain;f=Tagtools.pm;fp=Tagtools.pm;h=44c5405ef50a770785eed8b50495fa8fd7eb384e;hp=04e2f63e50e042e9ae6d50a35e6cd206cf03e392;hb=a6ecd221ab7db8df18b1fbcb1ea11353a9437893;hpb=857662436716c74a68a28b32aa55f2a468a0e4d2 diff --git a/Tagtools.pm b/Tagtools.pm index 04e2f63..44c5405 100644 --- a/Tagtools.pm +++ b/Tagtools.pm @@ -1,4 +1,5 @@ package Tagtools; +use warnings; use Lingua::EN::Inflect::Number qw(to_PL); use URI::Escape; use HTML::TagCloud; @@ -36,6 +37,7 @@ sub import { }; *{$whence."::_calendar"} = sub { my $arg = shift; + require Time::Piece; my ($y, $m) = split /-/, ($arg || Time::Piece->new->ymd); my @m = Calendar::Simple::calendar($m, $y); my @month; @@ -76,11 +78,11 @@ sub _setup_tagging { # At this point, the $via_table should now be able to be named as... my $tag_class = $class_for->($tag_table_name); - my $via_table = $tag_table_name."ging"; my $via = $tag_class."ging"; # Set up the class @{$via."::ISA"} = @{$tag_class."::ISA"}; + $via->table($via_table); $via->columns(TEMP => qw/count/); $via->columns(Essential => "id", $tag_table_name, $target_table); # Set up the auxilliary methods