<?php global $gp_settings; ?>

<?php if($gp_settings['title'] == "Show") { ?>	
<h1 class="page-title">
<?php if(is_search()) { ?>
	<?php echo $wp_query->found_posts; ?> <?php _e('search results for', 'gp_lang'); ?> "<?php echo esc_html($s); ?>"
<?php } elseif(is_category()) { ?>
	<?php if(get_category_parents) { $catstr = get_category_parents($cat, false, ' / '); echo substr($catstr, 0, strlen($catstr) -3 ); } else { single_cat_title(); } ?>
<?php } elseif(is_tag()) { ?>
	<?php single_tag_title(); ?>
<?php } elseif(is_author()) { ?>
	<?php wp_title(''); ?><?php _e('\'s Posts'); ?>
<?php } elseif(is_archive()) { ?>
	<?php _e('Archives', 'gp_lang'); ?> <?php wp_title(' / '); ?>
<?php } ?>
</h1>
<?php } ?>

<?php $post_status = 'publish'; ?>
<?php 
    $args = $GLOBALS['wp_query']->query; 
    $args['ignore_sticky_posts'] = 1;
    $args['orderby'] = $orderby;
    $args['order'] = $order;
    $args['gdsr_sort'] = $gdsr_sort;
    $args['gdsr_order'] = $gdsr_order;
    $args['paged'] = $paged;
    $args['post_status'] = $post_status;
    $args['posts_per_page'] = $gp_settings['posts_per_page'];
?>

<?php query_posts($args); ?>
		
<div id="content <?php echo (is_search()) ? "fullwidth" : ""; ?>"<?php if($gp_settings['dropdown_filter'] == "0") { ?> class="shift-down"<?php } ?>>
		
	<?php if (have_posts()) : while (have_posts()) : the_post(); include('loop-data.php'); ?>
	
		<div <?php post_class('post-loop'); ?>>
		
			<!--Begin Image-->
			<?php if(has_post_thumbnail()) { ?>					
				<div class="post-thumbnail<?php if($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
					<?php if($gp_settings['post_type'] == "Video") { ?><span class="video-icon"></span><?php } ?>
					<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
						<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
						<img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['url']; ?>" alt="<?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?>" />		
					</a>				
				</div>					
			<?php } ?>
			<!--End Image-->
			
			<!--Begin Post Text-->
			<div class="post-text<?php if($gp_settings['post_type'] == "Review" && ($gp_settings['score_type'] == "No Scores" OR ($gp_settings['gp_gdsr']->review <= 0 && $gp_settings['user_voting'] == "Users cannot vote"))) { ?> hidden<?php } ?>" style="width: <?php echo $gp_settings['post_text_width']; ?>px;">
			
				<div class="left" style="width: <?php echo $gp_settings['post_left_width']; ?>px;">
				
					<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
					
					<?php if($gp_settings['content_display'] == "1") { ?>	
						<?php the_content(); ?>
					<?php } else { ?>
						<?php if($gp_settings['excerpt_length'] != "0") { ?><p><?php echo excerpt($gp_settings['excerpt_length']); ?><?php if($gp_settings['read_more'] == "0") { ?> <a href="<?php the_permalink(); ?>" class="read-more" title="<?php the_title(); ?>"><?php _e('Read More', 'gp_lang'); ?> &raquo;</a><?php } ?></p><?php } ?>
					<?php } ?>

					<?php /*require('post-meta.php');*/ ?>
					
				</div>
				
				<?php if($gp_settings['post_type'] == "Review") { require('review-meta.php'); } ?>
				
			</div>
			<!--End Post Text-->
		
		</div>
	
	<?php endwhile; ?>
	
		<?php gp_pagination(); ?>

		<?php if($gp_settings['dropdown_filter'] == "0") { require_once('dropdown-filter.php'); } ?>
	
	<?php else : ?>	

		<h4><?php _e('Try searching for a different term.', 'gp_lang'); ?></h4>
		
	<?php endif; wp_reset_query(); ?>	
	
</div>
<?php if(!is_search()) : ?>
    <?php get_sidebar(); ?>
<?php endif; ?>