Edit the commens section in blogthon.cgi

This commit is contained in:
Adrian Vondendriesch 2009-06-04 16:49:49 +02:00
parent 8224638f1d
commit 40349e0713
1 changed files with 16 additions and 15 deletions

View File

@ -384,38 +384,39 @@ else:
print ' </div>'
print ''
print ' <div class="comments">'
print ' <div>'
for line in comments_content:
if line.split(".", 1)[0] == "-":
print ' </div>'
print ' <div class="comment">'
print ' <div class="comment_author">' + line.split(".", 1)[1].strip() + '</div>'
elif line.split(".", 1)[0] == "+":
print ' <div class="comment_date">' + line.split(".", 1)[1].strip() + '</div>'
#print ' <div class="comment_content">'
else:
line = line.split(".", 1)[1]
print ' <div class="comment_content">'
print ' ' + line.strip() + '<br />'
print ' </div>'
print ' </div>'
print ''
print ' </div>'
comments_content.close()
else:
print ' </div>'
print ''
print ' </div>'
print ' </div>'
# 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 ' <div class="submit_comment">'
print ' <form action="" method="post">'
print ' <input type="hidden" name="ctitle" value="' + title + '" />'
print ' <input type="hidden" name="cquizv" value="' + str(cquizv) + '" />'
print ' <label class="submit_comment_name">name:</label><input type="text" id="cname" name="cname" />'
print ' <br /><label class="submit_comment_text">text:</label><textarea class="submit_comment_textarea" rows="5" cols="80" id="ctext" name="ctext"></textarea>'
print ' <br /><label class="submit_comment_quiz">' + str(random_int_a) + '+' + str(random_int_b) + '=</label><input type="text" id="cquiz" name="cquiz" />'
print ' <br /><input class="submit_comment_button" type="submit" id="submit" value="post comment" />'
print ' </form>'
print ' </div>'
print ' <div class="submit_comment">'
print ' <form action="" method="post">'
print ' <input type="hidden" name="ctitle" value="' + title + '" />'
print ' <input type="hidden" name="cquizv" value="' + str(cquizv) + '" />'
print ' <label class="submit_comment_name">name:</label><input type="text" id="cname" name="cname" />'
print ' <br /><label class="submit_comment_text">text:</label><textarea class="submit_comment_textarea" rows="5" cols="80" id="ctext" name="ctext"></textarea>'
print ' <br /><label class="submit_comment_quiz">' + str(random_int_a) + '+' + str(random_int_b) + '=</label><input type="text" id="cquiz" name="cquiz" />'
print ' <br /><input class="submit_comment_button" type="submit" id="submit" value="post comment" />'
print ' </form>'
print ' </div>'
print ''
if comments == "True":