<?php
/*
  Photo Nexus Theme
*/

get_header();

// Get the user choices for the theme.
global $options;
foreach ($options as $value) {
	if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}

/* get number of maximum Photos limited by the number you assign to the variable */

$categoryvariable=$cat; // assign the variable as current category
$numberof_posts_to_show = $phonx_max_photos; // Increase this if you have more than 200 Pictures in any one library. :)
query_posts('cat='. $categoryvariable . '&showposts='. $numberof_posts_to_show); 

$autoplay_gallery="true";
if ($phonx_autoplay_gallery=="Off") {$autoplay_gallery="false";}

$image_quality="72"; //HIGH QUALITY IMAGE SETTING
if ($phonx_image_quality=="Maximum Quality") {$image_quality="100";} 

?>

		<script type="text/javascript">
			<!--
			$(document).ready(
				function (){
					$("#pikame").PikaChoose({
						<?php print ("buttons_text: { play: \"". $phonx_play_button . "\", stop: \"". $phonx_stop_button . "\", previous: \"". $phonx_prev_button . "\", next: \"". $phonx_next_button . "\" },"); ?>
						auto_play: <?php echo $autoplay_gallery; ?>,
						thumb_width: <?php echo $phonx_width_thumbnail; ?>,
						thumb_height: <?php echo $phonx_height_thumbnail; ?>
					});
				});
			-->
		</script>

<?php
$key="image";
?>
<div id="content">
	<div id="columns">
	<div id="gallerycol">
	
		<?php if (have_posts()) : ?>
		<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
	 	<?php /* If this is a category archive */ if (is_category()) { ?>
		<?php //single_cat_title(); ?>
	 	<?php } ?>

		<div class="gallerywrap">
			<ul id="pikame">
				<?php while (have_posts()) : the_post(); ?>

					<?php $image=get_post_meta($post->ID, $key, true); ?>
					<?php if ($image!=="") {?>
					<?php //h=height w=width zc=how you want it cropped q=quality ?>
					<li><img src="<?php bloginfo('stylesheet_directory'); ?>/phpThumb.php?src=<?php echo $image; ?>&amp;h=550&amp;w=730&amp;zc=0&amp;q=<?php echo $image_quality; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /><span><?php the_title(); ?></span></li>
					
					<?php } ?>

				<?php endwhile; ?>
			</ul>
		</div>

		<?php endif; ?>

	</div>
	</div>
</div>

<?php get_footer(); ?>
