summaryrefslogtreecommitdiff
path: root/index.cgi
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-09-08 17:54:56 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-09-08 17:54:56 +0000
commit04efea1833c5f2ae910e85d2616119f102c01e35 (patch)
tree4436c47cbf779d8a1cdc15ad3307b10ecd662999 /index.cgi
parent7a9969cbc7694763f06b2a2c91cf154bbfbda9d5 (diff)
fix time format and commentar submission mail notification
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi19
1 files changed, 12 insertions, 7 deletions
diff --git a/index.cgi b/index.cgi
index 28a0737..d4569aa 100755
--- a/index.cgi
+++ b/index.cgi
@@ -138,7 +138,7 @@ sub output_rss {
description => $item->{'body'},
author => $item->{'author'},
comments => "${link}#comments",
- pubDate => POSIX::strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime($item->{'epoch'})),
+ pubDate => POSIX::strftime("%a, %d %b %Y %H:%M:%S %z (%Z)", gmtime($item->{'epoch'})),
category => @{[split(/, */, $item->{'tags'})]},
);
} else {
@@ -149,7 +149,7 @@ sub output_rss {
dc => {
subject => $blog_title,
creator => $item->{'author'},
- date => POSIX::strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime($item->{'epoch'})),
+ date => POSIX::strftime("%a, %d %b %Y %H:%M:%S %z (%Z)", gmtime($item->{'epoch'})),
},
);
}
@@ -354,16 +354,21 @@ sub read_comment {
# send email notification
my $smtp = Net::SMTP->new($smtp_server);
+ my $date = POSIX::strftime("%a, %d %b %Y %H:%M:%S %z (%Z)", localtime);
$smtp->mail($ENV{USER});
$smtp->to("$blog_owner\n");
$smtp->data();
$smtp->datasend("From: $smtp_sender\n");
$smtp->datasend("To: $blog_owner\n");
- $smtp->datasend("Subject: $blog_title comment submission\n\n");
- $smtp->datasend("You have received a new comment submission.\n\n");
- $smtp->datasend(sprintf("From: %s\n", $comment_name));
- $smtp->datasend(sprintf("Date: %s\n", scalar(localtime)));
- $smtp->datasend(sprintf("Comment:\n\"%s\"\n\n", $comment_body));
+ $smtp->datasend("Date: $date\n");
+ $smtp->datasend("Subject: $blog_title comment submission\n");
+ $smtp->datasend("\n");
+ $smtp->datasend("You have received a new comment submission.\n");
+ $smtp->datasend("\n");
+ $smtp->datasend("From: $comment_name\n");
+ $smtp->datasend("Date: $date\n");
+ $smtp->datasend("Comment: \"$comment_body\"\n");
+ $smtp->datasend("\n");
$smtp->datasend("Moderate comments at ${blog_url}admin.cgi?view=moderate\n");
$smtp->dataend();
$smtp->quit;