Comments:
* Comments are now shown under the entry when you click the permalink or the comments link
This commit is contained in:
parent
622aec5bad
commit
de59842011
30
blogthon.cgi
30
blogthon.cgi
@ -132,26 +132,44 @@ else: # Show regular entry
|
||||
if post_display == title or not post_display:
|
||||
if allentries_display == "1" or entry_counter < entries_per_page:
|
||||
content = open(entry, "r")
|
||||
if permalinks:
|
||||
if permalinks: # Title as permalink...
|
||||
print ' <div class="entrytitle"><a href="?p=' + title + '" class="entrytitle">' + title + ' <small>(' + date + ')</small></a></div>'
|
||||
else:
|
||||
else: # ... or not
|
||||
print ' <div class="entrytitle">' + title + ' <small>(' + date + ')</small></div>'
|
||||
print ' <div class="entry"><p>'
|
||||
for line in content:
|
||||
print ' ' + line.strip() + '<br />'
|
||||
|
||||
# Comments are shown when post_display and comments_file
|
||||
comments_file = glob.glob(entries_dir + title + '.comments')
|
||||
if comments_file and post_display:
|
||||
print ' <br><hr>'
|
||||
comments_file = glob.glob(entries_dir + title + '.comments')
|
||||
comments_content = open(comments_file[0], "r")
|
||||
for line in comments_content:
|
||||
if line.split(".", 1)[0] == "-":
|
||||
print ' <br />'
|
||||
print ' <i>' + line.split(".", 1)[1] + '</i><small> wrote at '
|
||||
elif line.split(".", 1)[0] == "+":
|
||||
print ' ' + line.split(".", 1)[1] + ':</small><br />'
|
||||
else:
|
||||
line = line.split(".", 1)[1]
|
||||
print ' ' + line.strip() + '<br />'
|
||||
comments_content.close()
|
||||
|
||||
if comments == "True":
|
||||
comments_file = glob.glob(entries_dir + title + '.comments')
|
||||
if not comments_file:
|
||||
if not comments_file and not post_display:
|
||||
print ' <div class="comment">'
|
||||
print ' <ul><li><a href=? class="comment">no comments</a></li></ul>'
|
||||
print ' <ul><li><a href="?p=' + title + '" class="comment">no comments</a></li></ul>'
|
||||
print ' </div><br />'
|
||||
else:
|
||||
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 ' <div class="comment">'
|
||||
print ' <ul><li><a href=? class="comment">comments (' + str(comments_counter) + ')</a></li></ul>'
|
||||
print ' <ul><li><a href="?p=' + title + '" class="comment">comments (' + str(comments_counter) + ')</a></li></ul>'
|
||||
print ' </div><br />'
|
||||
comments_content.close()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user