Merge branch 'master' of git@fucktheforce.de:blogthon

This commit is contained in:
Adrian Vondendriesch 2009-07-24 16:12:03 +02:00
commit 88b4922344
5 changed files with 43 additions and 29 deletions

5
FAQ
View File

@ -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'.

11
TODO
View File

@ -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

View File

@ -10,7 +10,7 @@
# Adrian Vondendriesch <disco-stu@disco-stu.de> # Adrian Vondendriesch <disco-stu@disco-stu.de>
# Description: A simple blogging software # 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 import ConfigParser
def generate_uuid(string): def generate_uuid(string):
@ -120,6 +120,21 @@ except: errorpage("comments")
try: newest_first = configuration.get('look', 'newest_first') try: newest_first = configuration.get('look', 'newest_first')
except: errorpage("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 # Read POST Variables
action = cgi.FieldStorage() action = cgi.FieldStorage()
month_display = action.getvalue('m') month_display = action.getvalue('m')
@ -181,6 +196,14 @@ if cname and ctext and ctitle:
for line in ctext: for line in ctext:
content.write("." + line + "\n") content.write("." + line + "\n")
content.close() 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 # Read entries and store their title and timestamp
entries = [] entries = []

View File

@ -1,6 +1,6 @@
[personal] [personal]
blog_title: A BlogThon Blog blog_title: Blogthon
blog_subtitle: Subtitle blog_subtitle: makes blogging easier
blog_url: http://www.thehappy.de/ blog_url: http://www.thehappy.de/
keywords: please,change,me keywords: please,change,me
entries_dir: entries/ entries_dir: entries/
@ -16,3 +16,10 @@ linklist: True
permalinks: True permalinks: True
comments: True comments: True
newest_first: True newest_first: True
[smtp]
new_comment_mail= False
mail_to= please@change.me!!!
smtp_host= localhost
smtp_user=
smtp_pass=

View File

@ -5,11 +5,11 @@
body { body {
background: #444444; background: #444444;
background-image: url("box_img/background.png"); background-image: url("box_img/background.png");
font-family: Monospace; font-family: Fixed;
font-size: 9px; font-size: .7em;
color: #CCCCCC; color: #CCCCCC;
margin: auto; margin: auto;
margin-top: 12px; margin-top: 14px;
margin-bottom: 10px; margin-bottom: 10px;
padding-bottom: 25px; padding-bottom: 25px;
width: 600px; width: 600px;
@ -27,7 +27,7 @@ a {
/* HEADER */ /* HEADER */
div.header { div.header {
height: 24px; height: 30px;
width: 600px; width: 600px;
margin: auto; margin: auto;
text-align: center; text-align: center;
@ -60,7 +60,7 @@ a.rss_link {
div.atom { div.atom {
position: absolute; position: absolute;
top: 1px; top: 1px;
padding-left: 559px; padding-left: 553px;
} }
a.atom_link { a.atom_link {
@ -71,9 +71,9 @@ a.atom_link {
div.pages { div.pages {
position: absolute; position: absolute;
top: 39px; top: 47px;
width: 600px; width: 600px;
height: 13px; height: 16px;
margin: auto; margin: auto;
background: #222222; background: #222222;
border-top: 1px solid #333333; border-top: 1px solid #333333;
@ -157,7 +157,7 @@ div.entries {
div.entry { div.entry {
margin-top: 6px; margin-top: 6px;
background: #444444; background: #444444;
border: 1px dotted #000000; border: 1px solid #000000;
} }
div.entry_title { div.entry_title {
@ -206,7 +206,7 @@ div.comments {
} }
div.comment { div.comment {
border: 1px dotted #000000; border: 1px solid #000000;
background: #414141; background: #414141;
width: 560px; width: 560px;
margin-bottom: 10px; margin-bottom: 10px;
@ -232,7 +232,7 @@ div.comment_content {
} }
div.submit_comment { div.submit_comment {
border: 1px dotted #000000; border: 1px solid #000000;
background: #444444; background: #444444;
width: 555px; width: 555px;
padding-left: 5px; padding-left: 5px;