From 648817f7b2957819f2854e7ee223ea9f7ed32619 Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 26 May 2003 04:01:40 +0000 Subject: for XHTML git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@902 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- blog/blog.pl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'blog/blog.pl') diff --git a/blog/blog.pl b/blog/blog.pl index 135bf63d..69e039b1 100755 --- a/blog/blog.pl +++ b/blog/blog.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: blog.pl,v 1.7 2003/05/26 03:31:28 in2 Exp $ +# $Id: blog.pl,v 1.8 2003/05/26 04:01:40 in2 Exp $ use CGI qw/:standard/; use LocalVars; use DB_File; @@ -125,8 +125,7 @@ sub main # Counter ---------------------------------------------------------------- if( $attr{"$fn.loadCounter"} ){ - my($c); - $c = dodbi(sub { + $th{counter} = dodbi(sub { my($dbh) = @_; my($sth, $t); $dbh->do("update counter set v = v + 1 where k = '$brdname'"); @@ -139,13 +138,12 @@ sub main "values ('$brdname', 1)"); return 1; }); - $th{counter} = $c; } # Calendar --------------------------------------------------------------- if( $attr{"$fn.loadCalendar"} ){ # 沒有合適的 module , 自己寫一個 |||b - my($c, $week, $day, $t, $link); + my($c, $week, $day, $t, $link, $newtr); $c = ("\n". "\n". "\n"); @@ -168,6 +166,8 @@ sub main foreach( 1..$week ); } foreach( 1..31 ){ + last if( !check_date($y, $m, $_) ); + $c .= "\n" if( $newtr ); $c .= "\n"; if( ++$week == 7 ){ - $c .= "\n\n\n"; + $c .= "\n\n"; $week = 0; + $newtr = 1; + } + else{ + $newtr = 0; } } - $c .= "\n
$emonth[$m] $y
"; $t = packdate($y, $m, $_); @@ -182,12 +182,17 @@ sub main $c .= "
\n"; + $c .= "\n" if( !$newtr ); + $c .= "\n"; $th{calendar} = $c; #my $cal = HTML::Calendar::Simple->new({month => $m, year => $y}); #$th{calendar} = $cal->calendar_month; -- cgit v1.2.3