aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-10-31 00:33:19 +0100
committerStefan Ritter <xeno@thehappy.de>2009-10-31 00:33:19 +0100
commit50f6f862f68aa8ac661327745c0291b162824f64 (patch)
tree73923820e84c63410436367017ac42e73a7edd2b
parenta8f13c725ecfac7fe06d0d05b0154bb88db4ac0a (diff)
Don't show comment form when comments are disabled
Diffstat (limited to '')
-rwxr-xr-xblogthon.cgi32
1 files changed, 17 insertions, 15 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index 9eb2ab6..f34b889 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -485,21 +485,23 @@ else:
print ' <div class="comments">'
# 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 class="submit_comment_name_input" type="text" id="cname" name="cname" />'
- print ' <br /><label class="submit_comment_text">text:</label><textarea class="submit_comment_textarea" id="ctext" name="ctext"></textarea>'
- print ' <br /><label class="submit_comment_quiz">' + str(random_int_a) + '+' + str(random_int_b) + '=</label><input class="submit_comment_quiz_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_border_bottom"></div>'
- print ''
+ if comments == "True":
+ 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 class="submit_comment_name_input" type="text" id="cname" name="cname" />'
+ print ' <br /><label class="submit_comment_text">text:</label><textarea class="submit_comment_textarea" id="ctext" name="ctext"></textarea>'
+ print ' <br /><label class="submit_comment_quiz">' + str(random_int_a) + '+' + str(random_int_b) + '=</label><input class="submit_comment_quiz_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>'
+ else:
+ print ' <div class="submit_border_bottom"></div>'
+ print ''
if comments == "True":
comments_file = glob.glob(entries_dir + title + '.comments')