aboutsummaryrefslogtreecommitdiffstats
path: root/blogthon.cgi
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-12-07 10:35:36 +0100
committerStefan Ritter <xeno@thehappy.de>2009-12-07 10:35:36 +0100
commit6ff2c622be217ba12893dddde1a3a185c9f1dab4 (patch)
treedc384e6bd1907b9edf2d48f365411da8c06c31f6 /blogthon.cgi
parentecd758e7f15916237a0c18cf940e17b7df206c1a (diff)
Fixed send-comment function (now works with apache)
Diffstat (limited to '')
-rwxr-xr-xblogthon.cgi8
1 files changed, 4 insertions, 4 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index 8354aeb..8e1eca8 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -190,9 +190,9 @@ if cname and ctext and ctitle:
content = open(entries_dir + ctitle + '.comments', "w")
content.close()
except:
- errorpage(entries_dir, 'isn\'t writable!')
+ errorpage('"' + entries_dir + '" isn\'t writable!')
try:
- content = open(comments_file[0], "a+")
+ content = open(entries_dir + ctitle + '.comments', "a")
content.write("-." + cname + "\n")
content.write("+." + time.asctime() + "\n")
ctext = ctext.split("\n")
@@ -200,13 +200,13 @@ if cname and ctext and ctitle:
content.write("." + line + "\n")
content.close()
# Send mail?
- if new_comment_mail:
+ if not new_comment_mail == 'False':
msg = 'From: Blogthon\nTo: ' + mail_to + '\nSubject: New comment on ' + blog_title + '\n\nSomeone wrote a comment to this entry: ' + blog_url + '?p=' + ctitle.replace(' ', '-')
smtp = smtplib.SMTP(smtp_host)
smtp.sendmail(blog_title, mail_to, msg)
smtp.quit()
except:
- errorpage(comments_file, 'isn\'t writable!')
+ errorpage('Comment cannot be written!')
# Read entries and store their title and timestamp
entries = []