projects
/
catcam.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1d13f68
)
fix basename
master
author
Don Armstrong
<don@donarmstrong.com>
Sun, 11 Dec 2016 20:21:39 +0000
(12:21 -0800)
committer
Don Armstrong
<don@donarmstrong.com>
Sun, 11 Dec 2016 20:21:39 +0000
(12:21 -0800)
index.cgi
patch
|
blob
|
history
diff --git
a/index.cgi
b/index.cgi
index 7035f479689e200ac1a7840aba600d8c12f41d5f..d357012630ee6cefc5e69e8beaadb36454d39a2b 100755
(executable)
--- a/
index.cgi
+++ b/
index.cgi
@@
-6,10
+6,12
@@
use strict;
use CGI::Simple;
use File::Find;
use File::stat;
use CGI::Simple;
use File::Find;
use File::stat;
+use File::Basename qw(dirname);
+use POSIX;
my $q = CGI::Simple->new({num=>100});
my $q = CGI::Simple->new({num=>100});
-my $cat_dir =
'/home/don/debian/.cat/'
;
+my $cat_dir =
dirname($ENV{SCRIPT_FILENAME})
;
my %pics;
my %pics;
@@
-37,10
+39,10
@@
EOF
my $num = 0;
my $previous_date = '';
for my $pic (sort {$pics{$b}->ctime <=> $pics{$a}->ctime} keys %pics) {
my $num = 0;
my $previous_date = '';
for my $pic (sort {$pics{$b}->ctime <=> $pics{$a}->ctime} keys %pics) {
- my $this_date = POSIX::strftime('%Y-%m-%d',
time($pics{$pic}->ctime
));
+ my $this_date = POSIX::strftime('%Y-%m-%d',
localtime($pics{$pic}->ctime()
));
if ($previous_date ne $this_date){
print "<p>$this_date</p>\n";
if ($previous_date ne $this_date){
print "<p>$this_date</p>\n";
- $
this_date = $previou
s_date;
+ $
previous_date = $thi
s_date;
}
my $basename = $pic;
$basename =~ s/\.html//;
}
my $basename = $pic;
$basename =~ s/\.html//;