
			<?php

				/* settings */
				$image_dir = 'gallery/big/';       
				$thumb_dir = 'gallery/small/';
				$per_column = 6;
               
				if ($handle = opendir($image_dir)) {
					while (false !== ($file = readdir($handle))) 
					{
						if ($file != '.' && $file != '..') 
						{
						   
							$files[] = $file;
						    
						}
					}
					closedir($handle);
				}
				echo "const gallery=[\n";
				/* step two: loop through, format gallery */
				if(count($files))
				{
					foreach($files as $file)
					{
						$count++;
						// echo '<a rel="prettyPhoto[pp_gal]" href="',$image_dir,$file,'"><img src="',$thumb_dir,$file,'" width="50" height="50" /></a>';
						echo "{ id:$count, file:'$file' },";
						echo "\n";
						/*if($count % $per_column == 0) { echo '<div class="clear"></div>'; }  */
					}
				}
				else
				{
					echo '<p>There are no images in this gallery.</p>';
				}
				echo "]\n";
			?>
	   
	
