From b1fc650b1bf60425fc801c5c2af4e61a1ed58b3f Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Mon, 18 May 2009 17:27:03 +0200 Subject: Rewrite session Part 2 --- blogthon.cgi | 94 ++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 37 deletions(-) (limited to 'blogthon.cgi') diff --git a/blogthon.cgi b/blogthon.cgi index 4cd53aa..6cdea07 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -285,17 +285,27 @@ else: print ' ' print '' - print '
' - - if static_display != "": # Show Staticpage + # Staticpage + if static_display != "": content = open(staticpages_dir + static_display, "r") - print '
' + re.sub('\d+?-', '', static_display) + '
' - print '

' + print '

' + print '
' + re.sub('\d+?-', '', static_display) + '
' + print '
' + print '

' for line in content: print ' ' + line.strip() + '
' - print '

' + print '

' + print '
' + print ' ' + print '
' + print '
' + print '
' + print '
' + print '
' + print '
' content.close() - else: # Show regular entry + # Entry + else: entry_counter = 0 for entry in entries: date = time.strftime("%c", entry[0]) @@ -308,72 +318,82 @@ else: if post_display == title or not post_display: if allentries_display == "1" or entry_counter < entries_per_page: content = open(entry, "r") + print '
' if permalinks: - print ' ' + print '
' + title + '
' else: - print '
' + title + ' (' + date + ')
' - print '
' + print '
' + title + '
' + print '
' for line in content: print ' ' + line.strip() + '
' - - # Comments are shown when post_display and comments_file + print '
' + print ' ' + print '
' + print '
' + print '
' + print '
' + print '
' + print '
' + print '' + + # Comments... + # ... are shown when post_display and comments_file isn't false comments_file = glob.glob(entries_dir + title + '.comments') if post_display: if comments_file: - print '

' comments_file = glob.glob(entries_dir + title + '.comments') comments_content = open(comments_file[0], "r") + print '
' for line in comments_content: if line.split(".", 1)[0] == "-": - print '
' - print ' ' + line.split(".", 1)[1].strip() + ' wrote at ' + print '
' + line.split(".", 1)[1].strip() + '
' elif line.split(".", 1)[0] == "+": - print ' ' + line.split(".", 1)[1].strip() + ':

' + print '
' + line.split(".", 1)[1].strip() + '
' else: line = line.split(".", 1)[1] - print '   ' + line.strip() + '
' + print '
' + print ' ' + line.strip() + '
' + print '
' + print '
' + print '' comments_content.close() # Form for adding comments random_int_a = random.randint(1,9) random_int_b = random.randint(1,9) cquizv = random_int_a + random_int_b - - print '


' - print '
' - print ' ' - print ' ' - print ' ' - print '
' - print '
' - print '
' - print '
' + print '
' + print ' ' + print ' ' + print ' ' + print '
' + print '
' + print '
' + print '
' if comments == "True": comments_file = glob.glob(entries_dir + title + '.comments') if not comments_file and not post_display: - print '
' - print ' ' - print '
' + print '
' + print ' no comments' + print '
' elif comments_file and not post_display: 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 ' comments (' + str(comments_counter) + ')' + print '
' comments_content.close() - - print '
' - print '

' + content.close() entry_counter += 1 if not month_display and not post_display and not allentries_display and entry_counter == entries_per_page: # Display pagelist print '
View all entries...
' - print '
' + print '' print ' ' print '' -- cgit v1.2.3