<?php if (sizeof($this->comments) > 0) { ?>
<ul class="mainx">
<?php foreach ($this->comments AS $key => $val) { ?>
	<li>
    	<p class="tny-userTime"><span  class="tny-right"><?php if (($val['uid'] == $this->user_id AND !$this->question['lock']) OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']){ ?><a href="javascript:;" onClick="remove_comment($(this).parent(), '<?php echo $val['question_id'] > 0 ? 'question' : 'answer'; ?>', <?php echo $val['id']; ?>);">Delete</a><?php } ?><a href="javascript:;" onClick="$.Q.reply(this,'<?php echo $val['user_name']; ?>', 'save_<?php echo $val['question_id'] > 0 ? 'question' : 'answer'; ?>_comment_<?php echo $val['question_id'] > 0 ? $val['question_id'] : $val['answer_id']; ?>');">Reply</a></span><a href="people/<?php echo $val['url_token']; ?>" data-message="&uid=<?php echo $val['uid']; ?>&card=user" class="umsg"><?php echo $val['user_name']; ?></a> • <?php echo date_friendly($val['time']); ?></p>
        <span class="tny-ctxt"><?php echo nl2br($val['message']); ?></span>
        <a href="people/<?php echo $val['url_token']; ?>" class="suser tny-alpHover"><img src="<?php echo get_avatar_url($val['uid'], 'min'); ?>" title="<?php echo $val['user_name']; ?>" alt="<?php echo $val['user_name']; ?>" data-message="&uid=<?php echo $val['uid']; ?>&card=user" class="umsg"/></a>
    </li>
<?php } ?>
</ul>
<?php } ?>