+ my ($threads, $locked);
+ unless ($locked = lock_file($mainfile) and $threads = get_all_threads($mainfile, KILL_DELETED)) {
+ print ${$template->scrap(
+ $assign->{'errorLocking'}
+ )};
+ return;
+ }
+ unlock_file($mainfile);
+
+ my $tmplparam = {
+ $assign->{'year'} => $param->{'year'},
+ $assign->{'month'} => $param->{'month'},
+ $assign->{'monthName'} => month($param->{'month'})
+ };
+
+ #
+ # monthDocStart
+ #
+ print ${$template->scrap(
+ $assign->{'monthDocStart'},
+ $tmplparam
+ )};
+
+ #
+ # thread overview
+ #
+ for (sort keys %$threads) {
+ print ${$template->scrap(
+ $assign->{'monthThreadEntry'},
+ {
+ $assign->{'threadID'} => $_,
+ $assign->{'threadCategory'} => $threads->{$_}->[0]->{'cat'},
+ $assign->{'threadTitle'} => $threads->{$_}->[0]->{'subject'},
+ $assign->{'threadTime'} => short_hr_time($threads->{$_}->[0]->{'time'}),
+ $assign->{'threadDate'} => very_short_hr_time($threads->{$_}->[0]->{'time'}),
+ $assign->{'year'} => $param->{'year'},
+ $assign->{'month'} => $param->{'month'}
+ }
+ )};
+ }
+
+ #
+ # monthDocEnd
+ #
+ print ${$template->scrap(
+ $assign->{'monthDocEnd'},
+ $tmplparam
+ )};
+