<li id="comment-<?php echo $comment['comment_id']; ?> " class="<?php echo $comment['comment_id']; ?> "> <img src="/images/avatars/<?php echo $comment['user_id']; ?> _headshot.png" width="64" height="64" alt="" class="avatar_thumb" /> <a href="<?php echo site_url('user/' . urlencode($comment['username'])); ?> " style="color:<?php echo user_color($comment['user_level']); ?> ; font-weight:bold;" ><?php echo $comment['username']; ?> </a> said: <br /> <p> <?php echo stripslashes(nl2br($comment['comment_text'])); ?> <small>(<?php echo _datadate($comment['comment_time']); ?> )</small> </p> <?php
function user_style($user_rank = 'user') { return 'color:' . user_color($user_rank) . '; font-weight:' . ($user_rank != 'user' ? 'bold' : 'normal'); }
/** * New function * * Description of new function * * @access public * @param none * @return output */ public function load_more_comments($user_id = 0, $messages_loaded = 0) { // if( ! $this->input->if_ajax()) die("Error: AJAX REQUEST MISSING"); if (!isset($this->system->userdata['user_id'])) { $this->system->userdata['user_id'] = 0; $this->system->userdata['user_level'] = 'user'; } $profile_comments = $this->db->select('profile_comments.*, users.username, users.user_id, users.user_level')->select('IF(profile_comments.comment_author = ' . $this->system->userdata['user_id'] . ', 1, 0) as modify', FALSE)->join('users', 'users.user_id = profile_comments.comment_author')->limit(6, $messages_loaded)->order_by('profile_comments.comment_id', 'DESC')->get_where('profile_comments', array('comment_profile' => $user_id))->result_array(); if ($this->system->userdata['user_level'] != 'user') { foreach ($profile_comments as $key => $comment) { $profile_comments[$key]['modify'] = 1; } } foreach ($profile_comments as $comment) { ?> <li id="comment-<?php echo $comment['comment_id']; ?> " class="<?php echo $comment['comment_id']; ?> "> <img src="/images/avatars/<?php echo $comment['user_id']; ?> _headshot.png" width="64" height="64" alt="" class="avatar_thumb" /> <a href="<?php echo site_url('profile/view/' . urlencode($comment['username'])); ?> " style="color:<?php echo user_color($comment['user_level']); ?> ; font-weight:bold;" ><?php echo $comment['username']; ?> </a> said: <br /> <p> <?php echo stripslashes(nl2br($comment['comment_text'])); ?> <small>(<?php echo _datadate($comment['comment_time']); ?> )</small> </p> <?php if ($comment['modify']) { ?> <a href="/profile/comment/delete/<?php echo $comment['comment_id']; ?> " style="color:#ff7c7c" class="delete small"> (Delete)</a> <?php } ?> </li> <?php } }