<div class="page-margin">
    <div class="row">
        <div class="col-md-2 leftcol"><?php echo Wo_LoadPage("sidebar/left-sidebar"); ?></div>
        <div class="col-md-7 middlecol">
            
            <!-- Stories -->
            <?php if ($wo['config']['user_status'] == 1) { ?>
                <div class="user-status-home panel sun_mobi_stories_show">
                    <ul class="status-list" id="sun_status">
                        <li class="create_new">
                            <a href="<?php echo Wo_SeoLink('index.php?link1=create-status'); ?>" data-ajax="?link1=create-status" title="<?php echo $wo['lang']['create_story'] ?>">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>
                                <img src="<?php echo $wo['user']['avatar'];?>" alt="<?php echo $wo['user']['name'];?>">
                            </a>
                        </li>
                        <?php
                            if ($wo['config']['user_status'] == 1) {
                                $get_user_status = Wo_GetFriendsStatus(array('limit' => 8));
                                if (!empty($get_user_status)) {
                        ?>
                        <?php
                            foreach ($get_user_status as $key => $wo['user_status']) {
                                echo Wo_LoadPage('home/user-status');
                            }
                            } 
                            if (Wo_CountStories() > 8) {
                        ?>
                        <li class="view-more-stories">
                            <a href="<?php echo Wo_SeoLink('index.php?link1=more-status'); ?>">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#3D8CFA" d="M19.8521478,10 L21.2077346,10.7531038 C22.2640885,11.339967 22.2640885,12.660033 21.2077346,13.2468962 L19.8521478,14 L21.2077346,14.7531038 C22.2640885,15.339967 22.2640885,16.660033 21.2077346,17.2468962 L13.1565731,21.7197637 C12.484006,22.0934121 11.515994,22.0934121 10.8434269,21.7197637 L2.79226543,17.2468962 C1.73591152,16.660033 1.73591152,15.339967 2.79226543,14.7531038 L4.1478522,14 L2.79226543,13.2468962 C1.73591152,12.660033 1.73591152,11.339967 2.79226543,10.7531038 L4.1478522,10 L2.79226543,9.24689624 C1.73591152,8.66003296 1.73591152,7.33996704 2.79226543,6.75310376 L10.8434269,2.28023626 C11.515994,1.90658791 12.484006,1.90658791 13.1565731,2.28023626 L21.2077346,6.75310376 C22.2640885,7.33996704 22.2640885,8.66003296 21.2077346,9.24689624 L19.8521478,10 Z M17.7930218,11.1439589 L13.1565731,13.7197637 C12.484006,14.0934121 11.515994,14.0934121 10.8434269,13.7197637 L6.20697823,11.1439589 L4.66610426,12 L11.8147128,15.9714492 C11.8832347,16.0095169 12.1167653,16.0095169 12.1852872,15.9714492 L19.3338957,12 L17.7930218,11.1439589 Z M17.7930218,15.1439589 L13.1565731,17.7197637 C12.484006,18.0934121 11.515994,18.0934121 10.8434269,17.7197637 L6.20697823,15.1439589 L4.66610426,16 L11.8147128,19.9714492 C11.8832347,20.0095169 12.1167653,20.0095169 12.1852872,19.9714492 L19.3338957,16 L17.7930218,15.1439589 Z M12.1852872,4.02855081 C12.1167653,3.99048306 11.8832347,3.99048306 11.8147128,4.02855081 L4.66610426,8 L11.8147128,11.9714492 C11.8832347,12.0095169 12.1167653,12.0095169 12.1852872,11.9714492 L19.3338957,8 L12.1852872,4.02855081 Z" /></svg>
                                <?php echo $wo['lang']['see_all'] ?>
                            </a>
                        </li>
                        <div class="clear"></div>
                        <?php } } ?>
                    </ul>
                </div>
            <?php } ?>
            
            <?php 
                if (Wo_IsThereAnnouncement() === true) { 
                $announcement = Wo_GetHomeAnnouncements();
            ?>
            <div class="home-announcement">
                <div class="alert alert-success" style="background-color: white;">
                    <span class="close announcements-option" data-toggle="tooltip" onclick="Wo_ViewAnnouncement(<?php echo $announcement['id']; ?>);" title="<?php echo $wo['lang']['hide'];?>">
                        <i class="fa fa-remove"></i>
                    </span>
                    <?php echo $announcement['text']; ?>
                </div>
            </div>
            <!-- .home-announcement -->
            <?php } ?>
            
            <?php
                if($wo['loggedin'] == true) {
                    echo Wo_LoadPage('story/publisher-box');
                } 
            ?>
            <?php if ($wo['config']['afternoon_system'] == 1) { ?>
            <div class="alert alert-dismissible greetalert hidden" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close" onclick="setCookie('day_status', '1', 3);"><span aria-hidden="true">&times;</span></button>
                <div id="daynightmsg"></div>
            </div>
            <?php } ?>
        
            <?php if ($wo['page'] == 'home') { ?>
                <div id="scroll_filter_click"></div>
                <ul class="list-group filterby" id="filterby-post">
                    <li class="list-group-item hidden" contenteditable="false">Filter by</li>
                    <li class="list-group-item avtive filter-by-li filter_negative_clr" onclick="Wo_FilterPostBy('all');" dir="auto">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4,2H14V4H4V14H2V4C2,2.89 2.89,2 4,2M8,6H18V8H8V18H6V8C6,6.89 6.89,6 8,6M12,10H20C21.11,10 22,10.89 22,12V20C22,21.11 21.11,22 20,22H12C10.89,22 10,21.11 10,20V12C10,10.89 10.89,10 12,10M14,12V20L20,16L14,12Z" /></svg>
                    </li>
                    <li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('text');" dir="auto" style="color: grey;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17.8,20C17.4,21.2 16.3,22 15,22H5C3.3,22 2,20.7 2,19V18H5L14.2,18C14.6,19.2 15.7,20 17,20H17.8M19,2C20.7,2 22,3.3 22,5V6H20V5C20,4.4 19.6,4 19,4C18.4,4 18,4.4 18,5V18H17C16.4,18 16,17.6 16,17V16H5V5C5,3.3 6.3,2 8,2H19M8,6V8H15V6H8M8,10V12H14V10H8Z" /></svg>
                    </li>
                    <li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('photos');" dir="auto" style="color: #53BCE9;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4,5H7L9,3H15L17,5H20A2,2 0 0,1 22,7V19A2,2 0 0,1 20,21H4A2,2 0 0,1 2,19V7A2,2 0 0,1 4,5M13.09,9.45L11.05,12.18L12.6,14.25L11.73,14.91L9.27,11.64L6,16H18L13.09,9.45Z" /></svg>
                    </li>
                    <li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('music');" dir="auto" style="color: #3F51B5;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M21,3V15.5A3.5,3.5 0 0,1 17.5,19A3.5,3.5 0 0,1 14,15.5A3.5,3.5 0 0,1 17.5,12C18.04,12 18.55,12.12 19,12.34V6.47L9,8.6V17.5A3.5,3.5 0 0,1 5.5,21A3.5,3.5 0 0,1 2,17.5A3.5,3.5 0 0,1 5.5,14C6.04,14 6.55,14.12 7,14.34V6L21,3Z" /></svg>
                    </li>
                    <li class="list-group-item filter-by-li"  onclick="Wo_FilterPostBy('video');" dir="auto" style="color: #4caf50;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,2A7,7 0 0,1 19,9A7,7 0 0,1 12,16A7,7 0 0,1 5,9A7,7 0 0,1 12,2M12,4A5,5 0 0,0 7,9A5,5 0 0,0 12,14A5,5 0 0,0 17,9A5,5 0 0,0 12,4M12,6A3,3 0 0,1 15,9A3,3 0 0,1 12,12A3,3 0 0,1 9,9A3,3 0 0,1 12,6M6,22A2,2 0 0,1 4,20C4,19.62 4.1,19.27 4.29,18.97L6.11,15.81C7.69,17.17 9.75,18 12,18C14.25,18 16.31,17.17 17.89,15.81L19.71,18.97C19.9,19.27 20,19.62 20,20A2,2 0 0,1 18,22H6Z" /></svg>
                    </li>
                    <?php if ($wo['config']['fileSharing'] == 1) { ?>
                    <li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('files');" dir="auto" style="color: #7383BF;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z" /></svg>
                    </li>
                    <?php } ?>
                    <?php if ($wo['config']['google_map']) { ?>
                    <li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('maps');" dir="auto" style="color: #EBBA16;">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z" /></svg>
                    </li>
                    <?php } ?>
                </ul>
            <?php } ?>
        
            <div class="btn btn-main btn-active posts-count" onclick="Wo_GetNewPosts();"></div>
            <div class="posts_load">
                <div id="posts-laoded">
                    <div class="wo_loading_post">
                        <div class="wo_loading_post_child"></div>
                    </div>
                </div>
            </div>
            <!-- #posts -->
        </div>
        <!-- .col-md-8 -->
        <?php echo Wo_LoadPage('sidebar/content');?>
    </div>
</div>
<!-- .page-margin -->
<style>
.post-youtube iframe {height: 277px !important;}
</style>
<?php 
if ($wo['user']['social_login'] == 1) { 
  echo Wo_LoadPage('modals/create-password');
} 
?>
<script type="text/javascript">
$(function() {
    loadposts();
});
// $(document).on('click', '.story-image-wrapper', function(event) {
//   event.preventDefault();
//   $value = $(this).parents(".story-container").attr('data-status-id');
//   $.post(Wo_Ajax_Requests_File() + '?f=story_view', {id: $value}, function(data, textStatus, xhr) {
        
//   });
// });
/* Standard syntax */
document.addEventListener("fullscreenchange", function() {
  $('video').toggleClass('active-player');
});
/* Firefox */
document.addEventListener("mozfullscreenchange", function() {
  $('video').toggleClass('active-player');
});
/* Chrome, Safari and Opera */
document.addEventListener("webkitfullscreenchange", function() {
  $('video').toggleClass('active-player');
});
/* IE / Edge */
document.addEventListener("msfullscreenchange", function() {
  $('video').toggleClass('active-player');
});
function loadposts() {

    $("#posts-laoded").load(Wo_Ajax_Requests_File() + '?f=load_posts', function enter() {
        Wo_FinishBar();
        $('.video-js').each(function(index, el) {
            fluidPlayer($(this).attr('id'), {
                layoutControls: {
                    primaryColor:           "<?php echo $wo['config']['btn_background_color'];?>",
                    fillToContainer: true,
                    playbackRateEnabled: true,
                }
            });
        });
        $(".post-description p, .product-description").each(function(index, el) {
            $(this).readmore({
              speed: 75,
              moreLink: '<a href="#" class="hash"><?php echo $wo["lang"]["read_more"];?></a>',
              lessLink: '<a href="#" class="hash"><?php echo $wo["lang"]["read_less"];?></a>'
            });
        });
        $(".post-commet-textarea .textarea").triggeredAutocomplete({
           hidden: '#hidden_inputbox_comment',
           source: Wo_Ajax_Requests_File() + "?f=mention",
           trigger: "@" 
        });
        $(".comment-reply textarea").triggeredAutocomplete({
           hidden: '#hidden_inputbox_comment_reply',
           source: Wo_Ajax_Requests_File() + "?f=mention",
           trigger: "@"
        });
        $('#load-more-posts').show();
        $('.sun_comm_addmore .dropdown-toggle').on('click', function (event) {
            $(this).parent().toggleClass('open');
        });
        $(document).ready(function(){
          $('.sun_comm_addmore > .dropdown-menu .dropdown-toggle').on("click", function(e){
            $(this).next('ul').toggle();
            e.stopPropagation();
            e.preventDefault();
          });
        });
    });
}
  <?php if ($wo['user']['social_login'] == 1) { ?>
  $(window).on("load", function (e) {
       $('#create-password').modal('show');
    });
  $(function() {
    var create_password_container = $('#create-password');
    $('form.create-password').ajaxForm({
      url: Wo_Ajax_Requests_File() + '?f=update_new_logged_user_details',
      beforeSend: function() {
        Wo_progressIconLoader($('form.create-password').find('button'));
      },
      success: function(data) {
        if (data.status == 200) {
          create_password_container.find('.error-container').html("<div class='alert alert-success'>" + data.message + "</div>");
           $('#update-username').attr('href', data.url);
           setTimeout(function() {
            $('#create-password').modal('hide');
           }, 1500);
        } else {
          var errors = data.errors.join("<br>");
          create_password_container.find('.error-container').html("<div class='alert alert-danger'>" + errors + "</div>");
        }
        Wo_progressIconLoader($('form.create-password').find('button'));
      }
    });
  });
<?php } ?>
function Wo_ViewAnnouncement(id) {
    var announcement_container = $('.home-announcement');
    $.get(Wo_Ajax_Requests_File() + '?f=update_announcement_views', {id:id}, function (data) {
      if (data.status == 200) {
          announcement_container.slideUp(200, function () {
            $(this).remove();
          });
      }
    });
}
function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays*60*60*1000));
    var expires = "expires="+ d;
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookieValue(a) {
    var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)');
    return b ? b.pop() : '';
}
$(function () {
    var is_day_enabled = getCookieValue('day_status');
    var myDate = new Date();
    var hrs = myDate.getHours();
    var greet;
    var color;
    var quote;
    if (hrs < 12) {
        greet = '<?php echo $wo['lang']['good_morning']?>, <?php echo $wo['user']['name']?> <img src="<?php echo $wo['config']['theme_url'];?>/img/sunrise.png"/>';
        color = '#7FC583';
        quote = '<?php echo $wo['lang']['good_morning_quote']?>';
    } else if (hrs >= 12 && hrs <= 18) {
        greet = '<?php echo $wo['lang']['good_afternoon']?>, <?php echo $wo['user']['name']?> <img src="<?php echo $wo['config']['theme_url'];?>/img/sun.png"/>';
        color = '#ffc107';
        quote = '<?php echo $wo['lang']['good_afternoon_quote']?>';
    } else if (hrs >= 18 && hrs <= 24) {
        greet = '<?php echo $wo['lang']['good_evening']?>, <?php echo $wo['user']['name']?> <img src="<?php echo $wo['config']['theme_url'];?>/img/sunset.png"/>';
        color = '#FF4F70';
        quote = '<?php echo $wo['lang']['good_evening_quote']?>';
    }
    if (is_day_enabled != 1) {
      setTimeout(function () {
        $('.greetalert').css('border-left', '2.5px solid ' + color );
        $('#daynightmsg').html('<div class="small-texts">' + greet + '</div><p>' + quote + '</p>');
        $('.greetalert').removeClass('hidden');
      }, 100);
    }
});
</script>