<?php /* Template Name: Author Posts */ ?>
<?php get_header();?>
<?php  global $smof_data;?>
            <div id="main" class="container">
            	<div id="fullContent">
                
					<div class="singlePost">
                    	
                   
                        	<div class="hentry">
                          
                    
                        <?php if(isset($_GET['result'])) : ?>

			<?php if($_GET['result'] == 'success') : ?>

				<!-- .client_success BEGIN -->
				<div class="client_success">

					<span class="success"><?php _e("Successfully Added","lioit"); ?><span class="cross"><a href="#">X</a></span></span>

				</div><!-- .client_success END -->

			<?php endif; ?>

		<?php endif; ?>
        <script>
		// ajaxLoop.js
jQuery(function($){
    var page = 1;
    var loading = true;
    var $window = jQuery(window);
    var $content = jQuery("#ajaxContent");
    var load_posts = function(){
            $.ajax({
                type       : "GET",
                data       : {numPosts : 1, pageNumber: page},
                dataType   : "html",
                url        : "<?php echo Lioit_URI; ?>/loopHandler.php",
                beforeSend : function(){
                    if(page != 1){
                        $content.append('<div id="temp_load" style="text-align:center">\
                            <img src="<?php echo Lioit_URI; ?>/images/ajax-loader.gif" />\
                            </div>');
                    }
                },
                success    : function(data){
                    $smof_data = jQuery(data);
                    if($smof_data.length){
                        $smof_data.hide();
                        $content.append($smof_data);
                        $smof_data.fadeIn(500, function(){
                            jQuery("#temp_load").remove();
                            loading = false;
                        });
                    } else {
                        jQuery("#temp_load").remove();
                    }
                },
                error     : function(jqXHR, textStatus, errorThrown) {
                    jQuery("#temp_load").remove();
                    alert(jqXHR + " :: " + textStatus + " :: " + errorThrown);
                }
        });
    }
    $window.scroll(function() {
        var content_offset = $content.offset();
        console.log(content_offset.top);
        if(!loading && ($window.scrollTop() +
            $window.height()) > ($content.scrollTop() + $content.height() + content_offset.top)) {
                loading = true;
                page++;
                load_posts();
        }
    });
    load_posts();
});

	
		
	</script>
    	<div class="titleTop">
    <div class="titleTopTitle">
      <h2> <i class="icon-th-list"></i><?php _e("Posts","lioit"); ?></h2>
      <span class="titleBorder bigTitleBorder"></span>
       </div>
    <!--End Latest PostsTitle--> 
    </div>
	 									<div class="lioLatestPost lioLatestPostColumns">
              								<div class="row">
                                            <div class="span1">
                                                <div class="postListColumns postListColumnsTitle" style="text-align:left;padding-left:10px;">
                                                    <span><?php _e("Thumb","lioit"); ?></span>
                                                </div>
                                            </div>
                                        <div class="span5">
                                        	<div class="postListColumns postListColumnsTitle" style="text-align:left;padding-left:10px;">
                                  				<span><?php _e("Title","lioit"); ?></span>
                                            </div>
                                        </div>
                                        <div class="span2">
                                        	<div class="postListColumns postListColumnsTitle">
                                            	<i class="icon-calendar"></i>
                                  				<span><?php _e("Date","lioit"); ?></span>
                                            </div>
                                        </div>
                                        <div class="span2">
                                        	<div class="postListColumns postListColumnsTitle">
                                            	<i class="icon-user"></i>
                                 				<span><?php _e("Author","lioit"); ?></span>
                                            </div>
                                        </div>
                                        <div class="span2">
                                        	<div class="postListColumns postListColumnsTitle">
                                            	<i class="icon-folder-open"></i>
                                    			<span><?php _e("Categories","lioit"); ?></span>
                                            </div>
                                        </div>
                                        
                                        
                                        </div> </div>
                               
		<div id="ajaxContent" role="main"></div>
        

		
                       </div>
                     
                    </div><!--End ContentBox-->
                    
                </div><!--End Main Content-->
            </div><!--End Main-->
        </div><!--End Content-->

<?php get_footer();?>
