<?php defined('SYSPATH') OR die('No direct access to this file is allowed.');
show_header();
show_content();
$story = get_story();
if ($story == null) {
echo '<p>That story does not exist.</p>';
} else {
show_story($story, null, 'single');
?>
<?php if ($story['description'] != '') { ?><div id="storybody"><?php show_body($story); ?></div><?php } ?>
<?php
if (has_right('submitComment')) {
show_submission_form('comment');
} elseif ($ns->user['uid'] == null) {
?><p class="notice"><em>You must be <a href="/login">logged in</a> to leave a comment.</em></p><?php
} else {
?><p class="notice"><em>You are not allowed to leave a comment.</em></p><?php
}
$comments = get_comments($story['lft'], $story['rgt']);
//print_r($comments);
for ($i = 0, $c = count($comments); $i < $c; $i++) {
if ($comments[$i]['uid'] != '') {
show_comment($comments[$i], 'comment');
}
}
}
show_footer();