From 6ff2c622be217ba12893dddde1a3a185c9f1dab4 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Mon, 7 Dec 2009 10:35:36 +0100 Subject: Fixed send-comment function (now works with apache) --- blogthon.cgi | 8 ++++---- 1 file 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 = [] -- cgit v1.2.3