Location: PHPKode > scripts > EGallery > index.php
<?php
//////////////////////////////////////////////////////
///////////////// EGallery Index File ////////////////
//////////////////////////////////////////////////////
//      Place this file in the image directory      //
//////////////////////////////////////////////////////

// Customize this next line if you changed the location of egallery.
include_once "egallery/functions.php";

// Find your domain
if ( $domain == "" ) {
	$domain = 'http://'.$_SERVER['HTTP_HOST'];
}
// Find the subdirectory
if ( $subdirectory == "" ) {
	$subdir = $_SERVER["REQUEST_URI"];
	$subdirectory = str_replace("/index.php", "", $subdir);
}
// Fix for index.php directory. Alternatively you could write a htaccess redirect to root.
$onindex = str_replace($subdirectory, "", $subdir);
if ( $onindex == "/index.php" ){
	$directory = str_replace("\/", "", $directory);
} 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<?php
			// Get directory name for use in the <title>
			$curdir = getcwd();
			$shortname = basename(trim($curdir, '/'));
			$titlename = ucwords($shortname);
		?>
		<title><?php if ($page_title != ""){ echo $page_title; } else { echo $titlename; } ?></title>
		<link rel="stylesheet" href="<?php echo $domain.$subdirectory.$directory; ?>/style.css" />
		<style type="text/css">
			.box{
			  width: <?php echo $image_width; ?>px;
			}
		</style>
	</head>
<body>

<?php if ( $zip_download == "yes" ) { ?>
<div class="download-set">
	<div class="download-button-wrapper"><a href="<?php echo $domain.$subdirectory.$directory; ?>/download.php?zip=1" class="download-button"><?php echo $zip_download_text; ?></a></div>
</div>
<?php } ?>

<div class="masonry" id="container">
	<?php
	// Get the images
	$images = getImages($shortname);
	foreach($images as $img) {
		echo "<div class=\"box\">";
		echo "<a href=\"".$domain.$subdirectory.$directory."/download.php?image=".basename($img['file'])."\"><img class=\"photo\" src=\"".$domain.$subdirectory.$directory."/thumb.php?src={$img['file']}&w=".$image_width."\" alt=\"\"></a>";
		if ($show_info == "yes") {
			if (function_exists('exif_read_data')) {
				echo '<br /><div class="file-details"><table width="200"><tr><td width="50%">';
				// Next line supresses errors for images that have odd EXIF data
				$info = @exif_read_data($domain.$img['file']);
				echo $info['FileName'].'</td><td width="50%" style="text-align:right;">';
				print ByteSize($info['FileSize']); 
				echo "</td></tr></table></div>";
			}
		}
		echo "</div>\n";
	} 
	?>
</div>

<div class="credits"><a href="http://ericheikkinen.com/egallery-automatic-php-image-galleries/" target="_blank">EGallery - PHP Image Gallery</a></div>

<!-- Jquery Masonry -->
<script src="<?php echo $domain.$subdirectory.$directory; ?>/js/jquery-1.4.2.min.js"></script>
<script src="<?php echo $domain.$subdirectory.$directory; ?>/js/jquery.masonry.min.js"></script>
<script>
  $(function(){

	var $container = $('#container');
  
	$container.imagesLoaded( function(){
	  $container.masonry({
		itemSelector : '.box'
	  });
	});
  
  });
</script>

</body>
</html>
Return current item: EGallery