<?php  
if (!isset($instance['categories'])){
	$instance['categories'] = 0;
}
extract($instance);

$default = array(
	'orderby' => $orderby,
	'order' => $order,
	'number' => $number,
	'status' => 'approve', 
	'post_status' => 'publish'
);

$list = get_comments($default);
//var_dump($list);
if (count($list) > 0){
?>
<div class="ya-comments">
	<?php foreach ($list as $comment){?>
	<div class="ya-comment">
		<div class="comment-author">
			<?php echo get_avatar($comment->user_id, '90');?>
		</div>
		<div class="comment-caption">
			<a href="<?php echo get_comments_link($comment->comment_post_ID);?>"><?php echo self::ya_trim_words($comment->comment_content, $length)?></a>
			<span class="comment-date"><?php echo jdate('d F Y',strtotime($comment->comment_date));?></span>
		</div>
	</div>
	<?php } ?>
</div>
<?php }?>