Merge branch 'master' of git@fucktheforce.de:blogthon
This commit is contained in:
commit
38ce719e5a
33
blogthon.cgi
33
blogthon.cgi
@ -189,21 +189,24 @@ if cname and ctext and ctitle:
|
||||
except:
|
||||
errorpage('not writable entries_dir')
|
||||
comments_file = glob.glob(entries_dir + ctitle + '.comments')
|
||||
content = open(comments_file[0], "a+")
|
||||
content.write("-." + cname + "\n")
|
||||
content.write("+." + time.asctime() + "\n")
|
||||
ctext = ctext.split("\n")
|
||||
for line in ctext:
|
||||
content.write("." + line + "\n")
|
||||
content.close()
|
||||
# Send mail?
|
||||
if new_comment_mail:
|
||||
msg = 'From: Blogthon\nSubject: New comment on ' + blog_title + '\n\nSomeone wrote a comment to this entry: ' + blog_url + '?p=' + re.sub(' ', '-', ctitle)
|
||||
smtp = smtplib.SMTP(smtp_host)
|
||||
if smtp_user != '' and smtp_pass != '':
|
||||
smtp.login(smtp_user, smtp_pass)
|
||||
smtp.sendmail(blog_title, mail_to, msg)
|
||||
smtp.quit()
|
||||
try:
|
||||
content = open(comments_file[0], "a+")
|
||||
content.write("-." + cname + "\n")
|
||||
content.write("+." + time.asctime() + "\n")
|
||||
ctext = ctext.split("\n")
|
||||
for line in ctext:
|
||||
content.write("." + line + "\n")
|
||||
content.close()
|
||||
# Send mail?
|
||||
if new_comment_mail:
|
||||
msg = 'From: Blogthon\nSubject: New comment on ' + blog_title + '\n\nSomeone wrote a comment to this entry: ' + blog_url + '?p=' + re.sub(' ', '-', ctitle)
|
||||
smtp = smtplib.SMTP(smtp_host)
|
||||
if smtp_user != '' and smtp_pass != '':
|
||||
smtp.login(smtp_user, smtp_pass)
|
||||
smtp.sendmail(blog_title, mail_to, msg)
|
||||
smtp.quit()
|
||||
except:
|
||||
errorpage('commentsfile seems not to be writable!')
|
||||
|
||||
# Read entries and store their title and timestamp
|
||||
entries = []
|
||||
|
Loading…
Reference in New Issue
Block a user