function showCellComments($evidence_id, $hypothesis_id, $thread_id) { global $base_URL; global $reply_depth; $comments = array(); $comments = getCellComments($evidence_id, $hypothesis_id, $thread_id); $to_return = FALSE; if (count($comments) > 0) { $to_return = TRUE; foreach ($comments as $comment_id) { $this_comment = new Comment(); $this_comment->populateFromId($comment_id); $commenter = new User(); $commenter->populateFromId($this_comment->user_id); ?> <div class="comment" style="margin-left: <?php echo $reply_depth * 50; ?> "> <p class="by"><a href="<?php echo $base_URL; ?> profile/<?php echo $commenter->username; ?> "><?php echo $commenter->name; ?> </a> <?php if ($thread_id == 0) { ?> writes<?php } else { ?> replies<?php } ?> :</p> <p class="comment"><?php echo nl2br($this_comment->comment); ?> </p> <p class="time"><b>Time:</b> <?php echo $this_comment->created; ?> </p> <p class="classification"><b>Classification:</b> <?php echo $this_comment->classification; ?> </p> <p class="caveat"><b>Caveat:</b> <?php echo $this_comment->caveat; ?> </p> <?php $reply_id = rand(0, 10000000000); ?> <p class="replyTo"><a style="cursor: pointer;" onclick="new Effect.BlindDown(reply<?php echo $reply_id; ?> );">Reply</a></p> <div class="replyToThis" id="reply<?php echo $reply_id; ?> " style="display: none;"> <form method="post" class="edit" action="add_comment_action.php"> <input type="hidden" name="this_url" value="<?php echo $_SERVER['REQUEST_URI']; ?> " /> <input type="hidden" name="user_id" value="<?php echo $active_user->id; ?> " /> <input type="hidden" name="evidence_id" value="<?php echo $evidence_id; ?> " /> <input type="hidden" name="hypothesis_id" value="<?php echo $hypothesis_id; ?> " /> <input type="hidden" name="reply_to_id" value="<?php echo $this_comment->id; ?> " /> <p><textarea rows="8" name="comment" cols="60"></textarea></p> <p><b>Classification</b> <select name="classification"> <option value="U">Unclassified</option> <option value="C">Confidential</option> <option value="S">Secret</option> <option value="TS">Top Secret</option> </select> <b style="padding-left: 15px;">Caveat</b> <select name="caveat"> <option value="">(No caveat)</option> <option value="FOUO">FOUO/AIUO</option> <option value="SI">SI</option> <option value="TK">TK</option> <option value="HCS">HCS</option> <option value="G">G</option> </select></p> <p class="submit"><input class="button" type="submit" value="Add Reply" /></p> </form> </div> </div> <?php $reply_depth++; showCellComments($evidence_id, $hypothesis_id, $this_comment->id); $reply_depth--; } } return $to_return; }
} else { echo "<br /><small>StDev: N/A; no ratings yet.</small>"; } ?> <h3 class="comments">Discuss this Cell</h3> <?php $reply_depth = 0; if (showCellComments($active_evidence->id, $active_hypothesis->id, 0)) { } else { echo '<p><i>No comments.</i></p>'; } ?> <form method="post" class="edit" action="add_comment_action.php"> <input type="hidden" name="this_url" value="<?php echo $_SERVER['REQUEST_URI']; ?> " /> <input type="hidden" name="user_id" value="<?php