aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FAQ5
-rw-r--r--TODO11
-rwxr-xr-xblogthon.cgi25
-rw-r--r--configuration11
-rw-r--r--styles/box.css20
5 files changed, 43 insertions, 29 deletions
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
diff --git a/blogthon.cgi b/blogthon.cgi
index 23f1dcc..89594c2 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -10,7 +10,7 @@
# Adrian Vondendriesch <disco-stu@disco-stu.de>
# 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,14 @@ 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=' + 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()
# Read entries and store their title and timestamp
entries = []
diff --git a/configuration b/configuration
index eeae66d..ed1c0d7 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/
@@ -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=
+smtp_pass=
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;