<?php
/*
Template Name: Blog
*/
get_header();

global $gp_settings;

?>

<?php if($gp_settings['title'] == "Show") { ?><h1 class="page-title"><?php the_title(); ?></h1><?php } ?>

<!--Begin Blog Page Content-->
<?php if($post->post_content) { ?>
	<?php the_content(); ?>
	<div class="sc-divider"></div>
<?php } ?>
<!--End Blog Page Content-->

<?php 
query_posts("cat=".$gp_settings['cats']."&caller_get_posts=1&orderby=$orderby&order=$order&gdsr_sort=$gdsr_sort&gdsr_order=$gdsr_order&paged=$paged&posts_per_page=".$gp_settings['posts_per_page']); ?>
	
<div id="content"<?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(); ?>">
						<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
						<img 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 && $user_voting == "Users cannot vote"))) { ?> hidden<?php } ?>" style="width: <?php echo $post_text_width; ?>px;">
			
				<div class="left" style="width: <?php echo $post_left_width; ?>px;">
				
					<h2><a href="<?php the_permalink(); ?>"><?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 get_sidebar(); ?>
				
<?php get_footer(); ?>