<a href="<?php echo site_url('irclog/' . $start . '/' . $results); ?> ">View with normal width</a> <?php } ?> <div id="log"> <div id="user-list"> <span class="headline">Users <span class="users-count right">(<?php echo count((array) $start_users); ?> )</span></span> <ul> <li class="title"><?php echo dt_tm($log[count($log) - 1]->timestamp); ?> </li> <?php $start_users = (array) $start_users; krsort($start_users); arsort($start_users); foreach ($start_users as $u => $s) { ?> <li class="default"><?php echo $s . $u; ?> </li> <?php } ?>
function display_comments($comments, $module, $user, $is_answer = false, $offset) { if (isset($_GET['answer']) && isint($_GET['answer'])) { $answer = $_GET['answer']; } else { $answer = 0; } foreach ($comments as $c) { ?> <div class="comment<?php echo $is_answer ? ' answer' : ''; ?> " id="comment-<?php echo $c->id; ?> "> <?php echo $is_answer ? '<a href="#comment-' . $c->id . '" class="fa fa-caret-right expander"></a>' : ''; ?> <div class="comment-text"> <a href="<?php echo site_url('user/' . $c->creator->id); ?> "><?php echo showname($c->creator); ?> </a> <span class="text"><?php echo htmlentities($c->comment); ?> </span> </div> <div class="comment-actions"> <?php echo dt_tm($c->date); ?> <?php if ($answer != $c->id) { ?> <a href="?answer=<?php echo $c->id; ?> #comment-<?php echo $c->id; ?> " data-comment-answer="<?php echo $c->id; ?> ">Answer</a> <?php } ?> <?php if (!isset($c->answers) && $c->count_answers > 0) { ?> <a href="?answers=<?php echo $c->id; ?> #comment-<?php echo $c->id; ?> " data-comment-answers="true" data-comment-reference="<?php echo $c->id; ?> " data-comment-action="next">Show answers (<?php echo $c->count_answers; ?> )</a> <?php } ?> <?php echo $c->ratings->display_small('comment-' . $c->id); ?> </div> <a class="user-image" href="<?php echo site_url('user/' . $c->creator->id); ?> "><img src="<?php echo avatar_image($c->creator->id); ?> " class="avatar" /></a> <?php echo ''; ?> <?php if (isset($c->answers)) { $is_this_answer_post = isset($_GET['answers']) && $_GET['answers'] == $c->id; if ($is_this_answer_post && $offset > 0) { ?> <a class="show-answers-button" data-comment-reference="<?php echo $c->id; ?> " data-comment-action="previous" href="?answers=<?php echo $c->id; ?> &end=<?php echo $_GET['end'] > 30 ? $_GET['end'] - 30 : 0; ?> ">Show <?php echo $offset > 30 ? 30 : $offset; ?> previous answers.</a> <?php } display_comments($c->answers, $module, $user, true, $offset); $remaining_answers = $c->count_answers - count($c->answers); if ($is_this_answer_post) { $remaining_answers -= $offset; } if ($remaining_answers > 0) { $next_answers = isset($_GET['end']) && $is_this_answer_post && isint($_GET['end']) ? $_GET['end'] + 30 : 30; ?> <a class="show-answers-button" data-comment-reference="<?php echo end($c->answers)->id; ?> " data-comment-action="next" href="?answers=<?php echo $c->id; ?> &end=<?php echo $next_answers; ?> ">Show <?php echo $remaining_answers > 30 ? 30 : $remaining_answers; ?> more answers.</a> <?php } } ?> <?php if ($answer == $c->id) { ?> <?php echo form_open(uri_string() . '?answers=' . $c->id . '#comment-' . $c->id, array('class' => 'create-answer')); ?> <?php echo form_hidden('duplicate-preventer', uniqid()); ?> <?php echo form_hidden('comment-answer-to', $c->id); ?> <div class="comments-wrapper"> <textarea name="comment" placeholder="<?php echo $user ? 'Your comment...' : 'You have to log in or create an account to comment.'; ?> "<?php echo $user ? 'autofocus' : ' disabled="disabled"'; ?> ></textarea> </div> <?php $submit_data = array('type' => 'submit', 'name' => 'comments-submit', 'value' => 'Submit comment'); if (!$user) { $submit_data['disabled'] = 'disabled'; } ?> <?php echo form_input($submit_data); ?> <?php echo form_close(); ?> <?php } ?> </div> <?php } }