<?php
foreach (PageContext::$response->Comments AS $comments) {
    
    // if($comments->community_type == 'PUBLIC' || $comments->community_created_by == PageContext::$response->sess_user_id || PageContext::$response->sess_user_id == $comments->user_id){
    ?>
    <div class="col-md-12 btm-mrg pad10p" id="jdivComment_<?php echo $comments->news_feed_comments_id; ?>">
        <div class="row">
            <div class="col-md-1">
                <?php if($comments->user_image_name != '') {?>
                <span class="mediapost_pic">
                    <img class="ryt-mrg" src="<?php echo PageContext::$response->userImagePath; ?>medium/<?php echo $comments->user_image_name; ?>">
                </span>
                <?php  }else {?>
                    <span class="mediapost_pic">
                        <img class="ryt-mrg" src="<?php echo PageContext::$response->userImagePath?>medium/member_noimg.jpg">
                    </span>
                <?php } ?>
                <?php // if($comments->file_path){?>
              <!--<img class="image_zoom" src="<?php echo PageContext::$response->userImagePath; ?>medium/<?php echo $comments->file_path; ?>">-->
            <?php // } ?>
            </div>
            <div class="col-md-11">
                <span class="name"><?php echo $comments->Username; ?> </span><?php echo $comments->news_feed_comment_content; ?>
                <br>
                <span class="new-text">
                    <?php echo $comments->news_feed_comment_date; ?></span> 
                <div class="commentimg_box">
                    <?php if($comments->file_path != ''){ ?>
                      <img  src="<?php echo PageContext::$response->userImagePath;?>medium/<?php echo $comments->file_path;?>">
                    <?php } ?>
                </div>
                <div class="mediapost_user-side1">
                    <span class="mediapost_links" id="jcountfeedcommentlike_<?php echo $comments->news_feed_comments_id; ?>"><?php if($comments->num_comment_likes>0){ echo $comments->num_comment_likes."Likes"; }?></span>
                    <input type="hidden" id="reply_<?php echo $comments->news_feed_comments_id; ?>" value="<?php echo $comments->num_replies;?>">
                    <span class="mediapost_links " cid="<?php echo $comments->news_feed_comments_id; ?>" ><a href="#" class="jShowFeedReply" id="<?php echo $comments->news_feed_comments_id; ?>"><span id="jcountreply_<?php echo $comments->news_feed_comments_id; ?>"><?php if($comments->num_replies>0){ echo $comments->num_replies." Replies";} ?>Replies</span></a></span>
                    <div class="clear"></div>
                </div>
                  <div class="comment_sharelike_sec">
                    <?php if($comments->user_id == PageContext::$response->sess_user_id || $comments->community_created_by == PageContext::$response->sess_user_id){ ?>
                     <a href="#" class="jFeedCommentDelete" aid="<?php echo $comments->announcement_id; ?>" id="<?php echo $comments->announcement_comment_id; ?>">Delete</a>
                    <?php } ?>
                     <a href="#" class="jFeedCommentReply marg10right" cid="<?php echo $comments->news_feed_comments_id; ?>" aid="<?php echo $comments->news_feed_id; ?>" id="<?php echo $comments->news_feed_comments_id; ?>"><i class="fa fa-reply"></i> Reply</a>
                     <a href="#" class="jNewsFeedCommentLike <?php if ($comments->LIKE_ID > 0) { ?> liked <?php } ?> " id="jlikeComment_<?php echo $comments->news_feed_comments_id; ?>" cid="<?php echo $comments->news_feed_comments_id; ?>" aid="<?php echo $comments->news_feed_id; ?>" >
                     <i class="fa fa-thumbs-o-up icn-fnt-size"></i> 
                     <span id="jlikedisplaycomment_<?php echo $comments->news_feed_id; ?>">Like </span></a> 
                 </div>
                <div class="loader" id="imagereply_loader_<?php echo $comments->news_feed_comments_id;?>">
                    <img src="<?php echo PageContext::$response->userImagePath;?>default/loader.gif" />
                </div>
                
            </div>
        </div> 
    </div>
     <?php// } ?>
           <input type="hidden" id="reply_comment_id" value="<?php echo PageContext::$response->replyid;?>">
           <input type="hidden" id="announceid" value="<?php echo $comments->news_feed_comments_id; ?>">
      
<div id="jdivReply_<?php echo $comments->news_feed_comments_id; ?>" class="jDisplayReply" style="display:none;">
                                                                        <p class="lead emoji-picker-container">
                                                                        <textarea data-emojiable="true" placeholder="Write your reply here..."  class="form-control textarea-control" style="height:35px;" id="watermark_<?php echo $comments->news_feed_id; ?>_<?php echo $comments->news_feed_comments_id; ?>" class="watermark" name="watermark"  ></textarea>                                                                         
                                                                        <a class="upload_cambtn" id="<?php echo $comments->news_feed_id; ?>">
                                             <label for="imagereply_file"><i class="fa fa-camera"></i></label></a>
                                                  <input type="file" id="imagereply_file_<?php echo $comments->news_feed_comments_id; ?>" class="jfeedimagereply_file" cid="<?php echo $comments->news_feed_comments_id; ?>" style="display:none;"/></a>
                                                                        
                                                                        </p>
                                                                        <!--<a id="shareButton" cid="{$feedlist['community_id']}" aid="{$feedlist['community_announcement_id']}"  class="btn yellow_btn fontupper pull-right jshareCommentButton"> Post</a>-->
                                                                        <a id="shareButton" cid="<?php echo $comments->community_id; ?>" cmid="<?php echo $comments->news_feed_comments_id; ?>" aid="<?php echo $comments->news_feed_id; ?>"  class="btn yellow_btn fontupper pull-right jPostNewsfeedCommentButton"> Post</a>
                                                                    </div>
            <div id="jDivReplyImagePreview_<?php echo $comments->news_feed_comments_id;?>"></div>
                 <div id="postingReply_<?php echo $comments->news_feed_comments_id;?>"></div>
                                                                    <!--<div id="postingReply_<?php echo $comments->news_feed_comments_id; ?>"></div>-->



<?php }
if (PageContext::$response->TotalPage != PageContext::$response->CurrentPage) {
    ?>
    <div id="jDisplayMoreComments_<?php echo $comments->news_feed_id; ?>"><a href="#" id="jMorecommentsButton" pid="PageContext::$response->CurrentPage" aid="<?php echo $comments->news_feed_id; ?>">Load more comments</a></div>
    <?php }
?>
 
