From 728ee7d2772f457d726a6b4d1dcfde9242187de4 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Tue, 3 Mar 2009 18:43:37 +0100 Subject: [PATCH] Comments: * Commentcounter added for commentlinks: -. at the start of a line means "here is the header" (better for splitting) . at the start of a line means "i am a text" --- blogthon.cgi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/blogthon.cgi b/blogthon.cgi index 1962d77..bc02a02 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -140,14 +140,21 @@ else: # Show regular entry for line in content: print ' ' + line.strip() + '
' if comments == "True": - if not glob.glob(entries_dir + title + '.comments'): + comments_file = glob.glob(entries_dir + title + '.comments') + print str(comments_file) + if not comments_file: print '
' print ' ' print '

' 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 '
' - print ' ' + print ' ' print '

' + comments_content.close() print '

' print '

'