<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">
			<?php if ($wo['config']['user_status'] == 1) { ?>
				<div class="user-status-home">
					<ul class="status-list">
						<li>
							<div class="user-avatar">
								<a href="<?php echo Wo_SeoLink('index.php?link1=create-status'); ?>" data-ajax="?link1=create-status"><img src="<?php echo $wo['user']['avatar'];?>"></a>
							</div>  
							<div class="plus" onclick="window.location.href='<?php echo Wo_SeoLink('index.php?link1=create-status'); ?>'"><i class="fa fa-plus-circle"></i></div>
						</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) {
						?>
							<div class="time pull-right view-more-stories" title="<?php echo $wo['lang']['see_all'] ?>"><a href="<?php echo Wo_SeoLink('index.php?link1=more-status'); ?>"><i class="fa fa-bars"></i></a></div>
							<div class="clear"></div>
						<?php } } ?>
					</ul>
				</div>
			<?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
				} 
				if($wo['loggedin'] == true) {
					echo Wo_LoadPage('story/publisher-box');
				} 
        
				if ($wo['config']['order_posts_by'] == 0) {
			?>
				<div class="order-by"> 
					<div class="dropdown">
						<?php echo $wo['lang']['store_posts_by'] ?>: <a class="dropdown-toggle" type="button" data-toggle="dropdown">
						<span class="order-text"><?php echo ($wo['user']['order_posts_by'] == 0) ? $wo['lang']['all'] : $wo['lang']['people_i_follow']; ?></span>
						<span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li><a href="#" onclick="Wo_StorePosts(0);"><?php echo $wo['lang']['all'] ?></a></li>
							<li><a href="#" onclick="Wo_StorePosts(1);"><?php echo $wo['lang']['people_i_follow'] ?></a></li>
						</ul>
					</div>
				</div>
			<?php } ?>
			<?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="M13,9.5H18V7.5H13V9.5M13,16.5H18V14.5H13V16.5M19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21M6,11H11V6H6V11M7,7H10V10H7V7M6,18H11V13H6V18M7,14H10V17H7V14Z" /></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="M21,6V8H3V6H21M3,18H12V16H3V18M3,13H21V11H3V13Z" /></svg>
					</li>
					<li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('photos');" 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="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" /></svg>
					</li>
					<li class="list-group-item filter-by-li"  onclick="Wo_FilterPostBy('video');" dir="auto" style="color: #2396f3;">
						<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z" /></svg>
					</li>
					<li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('music');" dir="auto" style="color: #cc8317;">
						<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>
					<?php if ($wo['config']['fileSharing'] == 1) { ?>
					<li class="list-group-item filter-by-li" onclick="Wo_FilterPostBy('files');" dir="auto" style="color: #6b376b;">
						<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z" /></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: #c12056;">
						<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,19L9,16.89V5L15,7.11M20.5,3C20.44,3 20.39,3 20.34,3L15,5.1L9,3L3.36,4.9C3.15,4.97 3,5.15 3,5.38V20.5A0.5,0.5 0 0,0 3.5,21C3.55,21 3.61,21 3.66,20.97L9,18.9L15,21L20.64,19.1C20.85,19 21,18.85 21,18.62V3.5A0.5,0.5 0 0,0 20.5,3Z" /></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() {
  $.get(Wo_Ajax_Requests_File() + '?f=load_posts', function(data) {
    document.getElementById('posts-laoded').innerHTML = data;
  	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();
  });
}
  <?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_StorePosts(type) {
  if (type > 1) {
     return false;
  }
  if (type == 0) {
    $('.order-text').text('<?php echo $wo['lang']['all'] ?>');
  } else {
    $('.order-text').text('<?php echo $wo['lang']['people_i_follow'] ?>');
  }
  $('#posts-laoded').html('<div class="wo_loading_post"><div class="wo_loading_post_child"></div></div>');
  $.get(Wo_Ajax_Requests_File() + '?f=update_order_by', {type:type}, function (data) {
    if (data.status == 200) {
      loadposts();
    }
  });
}

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/park.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/desert.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/sea.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>