 					<?php 
 						$ww_root=$this->webroot;
              
                                $wallcommentLike = ClassRegistry::init('Profileslatecommentlike');
                                $conut='';
                             
                                        if($wallcommentLike->checkme($comment['Profileslatecomment']['id'],$loggedUser['id'])){
                                                $lun = 'Liked';
                                                $fun_n = 'unlike_by_wall_id2';
                                        }else{
                                                $lun = 'Like';
                                                $fun_n = 'like_by_wall_id2';
                                        }
                                        if($comment['Profileslatecomment']['user_id'] == $loggedUser['id'] || $wall['Profileslate']['user_id'] == $loggedUser['id']):
                                                $del = "<i class='fa fa-times'></i>";
                                        else:
                                                $del = '';
                                        endif;
                                       // pr($profileInfo2);
                                        ?>
                                
                            <li class="row-fluid cbox" id="data_<?php echo $comment['Profileslatecomment']['id'];?>" >
                                                <div class="span11 offset1">
                                                        <div class="shdw brd pd5 mrb5" >
                                                                <div class="row-fluid">
                                                                        <div class="" style="max-height: 50px; max-width: 50px; width: 7%; float: left;">
										                                        <?php if ($comment['Profileslatecomment']['parent_id']==0){?>
										                                        	<?php if (!empty($profileInfolink[$comment['Profileslatecomment']['user_id']])){?>
										                                        	<img src="<?php echo $profileInfolink[$comment['Profileslatecomment']['user_id']];?>" width="50px" height="50px">
										                                        	<?php }else {
										                                        		echo $this->Html->image('profile.jpg',array('style'=>'width="50px" height="50px"'));
										                                        	}?>
										                                        	
                                        										<?php }else {
                                                                                        echo $this->Html->image('profile.jpg',array('style'=>'width="50px" height="50px"'));
                                                                                }?>	
                                                                        </div>
                                                                        <div class=" prelative" style="width: 93%; float: right; padding-left: 1%;">
                                                                                <span class="topright"><a onclick="ddp('<?php echo $ww_root?>profileslatecomments','delete','<?php echo $comment['Profileslatecomment']['id']; ?>');"><?php echo $del;?></a></span>
                                                                                <div class="w97p fnt80">
                                                                                        <span class="profile-name">
																						<?php 
																							if (!empty($profileInfo[$comment['Profileslatecomment']['user_id']])){
																								echo $profileInfo[$comment['Profileslatecomment']['user_id']];
																							}else {
																								echo 'Annoymous';
																							}
																							?>: 
																						</span>
                                                                                        <?php echo $comment['Profileslatecomment']['comment']?>
                                                                                </div>
                                                                                <div class="divline"></div>

                                                                                <span class="fl fnt80 cash">
                                                                                <?php 
                                                                                        echo timeAgo($comment['Profileslatecomment']['created']);
                                                                                        $tot = $wallcommentLike->countwallcommentlikes($comment['Profileslatecomment']['id']); 
                                                                                ?>
                                                                                </span>
                                                                                <div class="tar fnt80" onclick="<?php echo $fun_n?> &nbsp;('<?php echo $ww_root?>profileslatecommentlikes','<?php echo $comment['Profileslatecomment']['id']; ?>',<?php echo $tot;?>)"id="<?php echo 'lkunl'.$comment['Profileslatecomment']['id'] ?>"> <?php echo $lun; ?>(<?php echo $tot; ?>)</div>
                                                                        </div>
                                                                </div>
                                                        </div>
                                                </div>
                                        </li>
                                        
                       
                                        <?php 
                                        
                                        function timeAgo($time_ago)
{
    $time_ago = strtotime($time_ago);
    $cur_time   = time();
    $time_elapsed   = $cur_time - $time_ago;
    $seconds    = $time_elapsed ;
    $minutes    = round($time_elapsed / 60 );
    $hours      = round($time_elapsed / 3600);
    $days       = round($time_elapsed / 86400 );
   
	
    // Seconds
    if($seconds <= 60){
 
    	if($seconds<=10){
            return "just now";
        }
        else{
            return "$seconds seconds ago";
        }
    }
    //Minutes
    else if($minutes <=60){
        if($minutes==1){
            return "one minute ago";
        }
        else{
            return "$minutes minutes ago";
        }
    }
    //Hours
    else if($hours <=24){
        if($hours==1){
            return "an hour ago";
        }else{
            return "$hours hrs ago";
        }
    }
    //Days
	
	
    else if($days <= 7){
        if($days==1){
            return "Yesterday";
        }else{
            return date('M-j-Y, h:i:s a',$time_ago);
        }
		
    }
    //Weeks
    //Years
    else{
         return date('M-j-Y, h:i:s a',$time_ago);
    }
}
                                        
                                        
                                        ?>