aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xblogthon.cgi20
-rw-r--r--entries/Demo.comments8
-rw-r--r--styles/blogthon.css4
3 files changed, 26 insertions, 6 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index dc34572..bc02a02 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -140,10 +140,22 @@ else: # Show regular entry
for line in content:
print ' ' + line.strip() + '<br />'
if comments == "True":
- print ' <div class="comment">'
- print ' <ul><li><a href=? class="comment">comments</a></li></ul>'
- print ' </div><br />'
-
+ comments_file = glob.glob(entries_dir + title + '.comments')
+ print str(comments_file)
+ if not comments_file:
+ print ' <div class="comment">'
+ print ' <ul><li><a href=? class="comment">no comments</a></li></ul>'
+ print ' </div><br />'
+ else:
+ comments_content = open(comments_file[0], "r")
+ comments_counter = 0
+ for line in comments_content:
+ if line.split(".", 1)[0] == "-": comments_counter += 1
+ print ' <div class="comment">'
+ print ' <ul><li><a href=? class="comment">comments (' + str(comments_counter) + ')</a></li></ul>'
+ print ' </div><br />'
+ comments_content.close()
+
print ' </p></div>'
print ' <br /><br />'
content.close()
diff --git a/entries/Demo.comments b/entries/Demo.comments
new file mode 100644
index 0000000..b6d9d98
--- /dev/null
+++ b/entries/Demo.comments
@@ -0,0 +1,8 @@
+-. xeno Sun Mar 1 12:00:00 2009
+.Hi,
+.
+.I hope you like my software. To delete this entry, just delete the file
+.entries/Demo.comments.
+.
+.Best regards,
+.xeno
diff --git a/styles/blogthon.css b/styles/blogthon.css
index 3808f1a..280536a 100644
--- a/styles/blogthon.css
+++ b/styles/blogthon.css
@@ -73,8 +73,8 @@ a.entrytitle:link, a.entrytitle:hover, a.entrytitle:visited, a.entrytitle:active
}
a.comment:link, a.comment:hover, a.comment:active, a.comment:visited {
- font-family: Arial;
- font-size: 8px;
+ font-family: Helvetica;
+ font-size: 10px;
}
# vim: set tw=0 ts=4: