From 25749d70b01c4a810af9cab1aae0fdf6d5c7ef45 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Wed, 22 Jul 2009 13:56:39 +0200 Subject: Deleted FAQ and TODO --- FAQ | 5 ----- TODO | 11 ----------- 2 files changed, 16 deletions(-) delete mode 100644 FAQ delete mode 100644 TODO diff --git a/FAQ b/FAQ deleted file mode 100644 index 8042ee7..0000000 --- a/FAQ +++ /dev/null @@ -1,5 +0,0 @@ -1) I edited an entry, now it is listed first on the page... wtf? - - Unix don't know a creation time for a file, so i had to use the last - changed time for entries. You can use 'touch' to edit the timestamp. - Syntax is 'touch foo.txt -t YYMMDDhhmm'. diff --git a/TODO b/TODO deleted file mode 100644 index 5799ff5..0000000 --- a/TODO +++ /dev/null @@ -1,11 +0,0 @@ -box.css: - - * Das Elternelement des Kommentarformular (pos. rel) ist ein Kommentar. - Wenn ein Kommentar vorhanden ist, dann positioniert sich das Formular - also korrekt. Ist jedoch keiner vorhanden, dann wird als - Elternelement der Eintrag genommen, und das Formular sitzt nicht mehr - richtig. - -blogthon.cgi: - - * RSS fertigstellen -- cgit v1.2.3 From 1a151afc1e2901953ea5d0e84b690b1944328e65 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Wed, 22 Jul 2009 14:00:00 +0200 Subject: Some changes in default configuration --- configuration | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration b/configuration index eeae66d..9aa2c35 100644 --- a/configuration +++ b/configuration @@ -1,6 +1,6 @@ [personal] -blog_title: A BlogThon Blog -blog_subtitle: Subtitle +blog_title: Blogthon +blog_subtitle: makes blogging easier blog_url: http://www.thehappy.de/ keywords: please,change,me entries_dir: entries/ -- cgit v1.2.3 From 873b9127c9bfb1054d4b0f0aaca1e1c98d3920ef Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Thu, 23 Jul 2009 10:36:37 +0200 Subject: Raised the font in box.css --- styles/box.css | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/styles/box.css b/styles/box.css index 0a93c77..f8003c9 100644 --- a/styles/box.css +++ b/styles/box.css @@ -5,11 +5,11 @@ body { background: #444444; background-image: url("box_img/background.png"); - font-family: Monospace; - font-size: 9px; + font-family: Fixed; + font-size: .7em; color: #CCCCCC; margin: auto; - margin-top: 12px; + margin-top: 14px; margin-bottom: 10px; padding-bottom: 25px; width: 600px; @@ -27,7 +27,7 @@ a { /* HEADER */ div.header { - height: 24px; + height: 30px; width: 600px; margin: auto; text-align: center; @@ -60,7 +60,7 @@ a.rss_link { div.atom { position: absolute; top: 1px; - padding-left: 559px; + padding-left: 553px; } a.atom_link { @@ -71,9 +71,9 @@ a.atom_link { div.pages { position: absolute; - top: 39px; + top: 47px; width: 600px; - height: 13px; + height: 16px; margin: auto; background: #222222; border-top: 1px solid #333333; @@ -157,7 +157,7 @@ div.entries { div.entry { margin-top: 6px; background: #444444; - border: 1px dotted #000000; + border: 1px solid #000000; } div.entry_title { @@ -206,7 +206,7 @@ div.comments { } div.comment { - border: 1px dotted #000000; + border: 1px solid #000000; background: #414141; width: 560px; margin-bottom: 10px; @@ -232,7 +232,7 @@ div.comment_content { } div.submit_comment { - border: 1px dotted #000000; + border: 1px solid #000000; background: #444444; width: 555px; padding-left: 5px; -- cgit v1.2.3 From 57b8c5aacae395f16af7cf56bc44d4239cbc1b3a Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Fri, 24 Jul 2009 11:53:09 +0200 Subject: Added SMTP code for sending a mail when new comments arrive --- blogthon.cgi | 23 ++++++++++++++++++++++- configuration | 7 +++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/blogthon.cgi b/blogthon.cgi index 8fa1c7d..bbb0131 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -10,7 +10,7 @@ # Adrian Vondendriesch # Description: A simple blogging software -import cgi, os, time, glob, re, md5, sys, random +import cgi, os, time, glob, re, md5, sys, random, smtplib import ConfigParser def generate_uuid(string): @@ -120,6 +120,21 @@ except: errorpage("comments") try: newest_first = configuration.get('look', 'newest_first') except: errorpage("newest_first") +try: new_comment_mail = configuration.get('smtp', 'new_comment_mail') +except: errorpage("new_comment_mail") + +try: mail_to = configuration.get('smtp', 'mail_to') +except: errorpage("mail_to") + +try: smtp_host = configuration.get('smtp', 'smtp_host') +except: errorpage("smtp_host") + +try: smtp_user = configuration.get('smtp', 'smtp_user') +except: errorpage("smtp_user") + +try: smtp_pass = configuration.get('smtp', 'smtp_pass') +except: errorpage("smtp_pass") + # Read POST Variables action = cgi.FieldStorage() month_display = action.getvalue('m') @@ -181,6 +196,12 @@ if cname and ctext and ctitle: 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=' + ctitle + smtp = smtplib.SMTP(smtp_host) + smtp.sendmail(blog_title, mail_to, msg) + smtp.quit() # Read entries and store their title and timestamp entries = [] diff --git a/configuration b/configuration index 9aa2c35..481a79e 100644 --- a/configuration +++ b/configuration @@ -16,3 +16,10 @@ linklist: True permalinks: True comments: True newest_first: True + +[smtp] +new_comment_mail= False +mail_to= please@change.me!!! +smtp_host= localhost +smtp_user= changeme +smtp_pass= changeme -- cgit v1.2.3 From 8d77719ceec40ca02b45a571f6286ce7c65c77e5 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Fri, 24 Jul 2009 14:33:21 +0200 Subject: Link to entry in new-comment-mail parsed through re.sub --- blogthon.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blogthon.cgi b/blogthon.cgi index bbb0131..6e32476 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -198,7 +198,7 @@ if cname and ctext and ctitle: 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=' + ctitle + 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) smtp.sendmail(blog_title, mail_to, msg) smtp.quit() -- cgit v1.2.3 From 743cb0f08b5dae7dce197a075d550f857a1c478c Mon Sep 17 00:00:00 2001 From: Maximilian Gass Date: Fri, 24 Jul 2009 14:58:38 +0200 Subject: Made SMTP Auth actually functional --- blogthon.cgi | 2 ++ configuration | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blogthon.cgi b/blogthon.cgi index 6e32476..8318fdd 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -200,6 +200,8 @@ if cname and ctext and ctitle: 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 stmp_pass != '': + smtp.login(smtp_user, smtp_pass) smtp.sendmail(blog_title, mail_to, msg) smtp.quit() diff --git a/configuration b/configuration index 481a79e..ed1c0d7 100644 --- a/configuration +++ b/configuration @@ -21,5 +21,5 @@ newest_first: True new_comment_mail= False mail_to= please@change.me!!! smtp_host= localhost -smtp_user= changeme -smtp_pass= changeme +smtp_user= +smtp_pass= -- cgit v1.2.3 From a328abe745ae99435bdc400938eaa62414d601df Mon Sep 17 00:00:00 2001 From: Maximilian Gass Date: Fri, 24 Jul 2009 15:01:50 +0200 Subject: Fixed typo (stmp -> smtp) --- blogthon.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blogthon.cgi b/blogthon.cgi index 8318fdd..8d6dc50 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -200,7 +200,7 @@ if cname and ctext and ctitle: 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 stmp_pass != '': + if smtp_user != '' and smtp_pass != '': smtp.login(smtp_user, smtp_pass) smtp.sendmail(blog_title, mail_to, msg) smtp.quit() -- cgit v1.2.3