<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "/hsphere/local/home/gkornblu/elleschorrphotography.com/cmsAdmin/lib/viewer_functions.php";

list($common_informationRecords, $common_informationMetaData) = getRecords(array(
'tableName' => 'common_information',
'allowSearch'=> false,
'limit' => '1',
));
$common_informationRecord = @$common_informationRecords[0]; // get first record


// load records
list($photo_sharingRecords, $photo_sharingMetaData) = getRecords(array(
'tableName' => 'photo_sharing',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$photo_sharingRecord = @$photo_sharingRecords[0]; // get first record

// load records
  list($google_font_namesRecords, $google_font_namesMetaData) = getRecords(array(
    'tableName'   => 'google_font_names',
  ));
  
?>
 
<!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>
<meta name="robots" content="noindex,nofollow" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/himageMenu2.css.php" />
<link rel="stylesheet" type="text/css" media="screen" href="css/elle.css.php" />
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css.php" />
<script type="text/javascript" src="http://www.elleschorrphotography.com/Scripts/thumbnailviewer2010-1.js"></script>
		<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
		<title>Welcome to Elle Schorr Photography - Sharing - <?php echo $photo_sharingRecord['title'] ?></title>
				<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
				<meta name="robots" content="noindex,nofollow" />

<style type="text/css">
<!--
a {color: #<?php echo $common_informationRecord['link_color'] ?>; text-decoration: none;}
a:hover {color: #<?php echo $common_informationRecord['hover_color'] ?>; text-decoration: underline;}
.copyright {color: #<?php echo $common_informationRecord['text_color'] ?>;; }
.body-text-bold-9 {  border:hidden; color: #<?php echo $common_informationRecord['link_color'] ?> ;}
.body-text-bold-10 { background-color:#000; font-size:1em; border:hidden; color: #<?php echo $common_informationRecord['link_color'] ?> ;}
h3 {color: #<?php echo $common_informationRecord['link_color'] ?> ;}
-->
</style>
<script type="text/javascript">
jQuery(function($){
	$('a[rel=enlargeimage]').click(function(e){
		e.preventDefault();
		var rev = $(this).attr('rev').split(','), link;
		$.each(rev, function(){
			if($.trim(this).indexOf('link') === 0){
				location.href = this.substring(5);
			}
		});
	});
});
</script>

 <link rel="stylesheet" type="text/css" href="css/fonts.css.php" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php 
    $output = ''; 
    foreach ($google_font_namesRecords as $record) { $record['name'] = preg_replace("/[, ]/", "+", $record['name']);
      $output .= $record['name'] . "|"; 
    } 
    $output = rtrim($output,"|"); // remove trailing pipe 
    print $output; 
?>">

 	</head>

<body>
<?php
    function mobile_detection ()
{
	if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))
		return true;
 if (isset ($_SERVER['HTTP_ACCEPT']))
	{
		$accept = strtolower($_SERVER['HTTP_ACCEPT']);
		if (strpos($accept, 'wap') !== false)
			return true;
	}

	if (isset ($_SERVER['HTTP_USER_AGENT']))
	{
		if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false)
			return true;

		if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false)
			return true;
			
	if (strpos ($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false)
			return true;
	
if (strpos ($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false)
			return true;
	}
	
	return false;
}
    ?>
	
<div align="left">


 <?php foreach ($common_informationRecord['photo_sharing_page_masthead'] as $common_info): ?>
  <br />
  <img src="<?php echo $common_info['urlPath'] ?>" alt="<?php $info1 = htmlspecialchars($common_info['info1']); ?>
<?php echo ucwords(strtolower($info1)); ?>" width="<?php echo $common_info['width'] ?>" height="<?php echo $common_info['height'] ?>" border="0" />
  <?php endforeach ?>

</div>
<br />
<table align="center" width="80%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					
		 <td><div align="center"><a class="special"   href="index.php"><span class="navigation_font">Home</span></a></div></td>
          <td><div align="center"><a class="special"  href="galleries.php"><span class="navigation_font">Galleries</span></a></div></td>
    <td><div align="center"><a class="special"   href="exhibitions.php"><span class="navigation_font">Exhibitions</span></a></div></td>
        <td><div align="center"><a class="special"  href="presentations.php"><span class="navigation_font">Presentations</span></a></div></td>
    <!-- <td><div align="center"><a href="../projects.php"><span class="navigation_font">Projects</span></a></div></td> -->
    <td><div align="center"><a class="special"  href="aboutme.php"><span class="navigation_font">About</span></a></div></td>   
         <td><div align="center"><a class="special"  href="contact.php"><span class="navigation_font">Contact</span></a></div></td>
		
                
              </tr><tr><td colspan="7"><hr /></td></tr>
	</table>
	
<table width="975" border="0" align="center" cellpadding="5">
<tr><td><h2 align="center"> <?php echo strtoupper($photo_sharingRecord['title']); ?></h2><?php $recnum = $photo_sharingRecord['num'] ?><br /><div align="left" class="body-text-bold-9"><?php echo $photo_sharingRecord['description'] ?></div></td></tr>
<tr>
<td width="474" valign="top"><div align="center"><span class="body-text-bold-9"><b>Roll over thumbnails for a larger image,<br />clck any thumbnail for a full sized image you can download<?php foreach ($photo_sharingRecord['video_placeholder_image'] as $upload2): ?><?php if ($upload2):?> or to play a video<?php endif ?><?php endforeach ?>.</b></span> <br /><br />
<?php if ($photo_sharingRecord['zip_file']): ?><?php foreach ($photo_sharingRecord['zip_file'] as $upload3): ?> <a href="<?php echo $upload3['urlPath'] ?>"><span class="body-text-bold-9">Click here to download a .zip file containing all the images</span></a><?php endforeach ?><br /><?php endif ?><?php if ($photo_sharingRecord['costco_group_room_url']): ?><a href="<?PHP if (!preg_match("/^http:\/\//i", $photo_sharingRecord['costco_group_room_url'])) {
$photo_sharingRecord['costco_group_room_url'] = "http://" . $photo_sharingRecord['costco_group_room_url']; } ?><?php echo $photo_sharingRecord['costco_group_room_url'] ?>"><span class="body-text-bold-9">Click here to print these images at Costco</span></a><?php endif ?>
</div>
</td></tr></table>

<table width="950" border="0" align="center">
<tr>
<td width="314" align="left" valign="top">
<?php $_SESSION['mobile'] = mobile_detection();  ?><?php if (!isset ($_SESSION['mobile']) OR $_SESSION['mobile'] == true) : ?>

<?php
$photosPerPage =  $common_informationRecord['images_per_page'] ;
 
$photoPage = @$_REQUEST['photoPage'] ? $_REQUEST['photoPage'] - 1 : 0;  
$firstIndex = $photoPage * $photosPerPage; 
$lastIndex = min($firstIndex + $photosPerPage, sizeof($photo_sharingRecord['images'])) - 1;  
?>     

<?php if ((ceil(sizeof($photo_sharingRecord['images']) / $photosPerPage)) > 1): ?><form action="?num=<?php echo $photo_sharingRecord['num'] ?>" method="post"> 
<?php if ($firstIndex > 0): ?>  
<a href="?photoPage=<?php echo $photoPage; ?>&=<?php echo $photo_sharingRecord['num'] ?>"><span class="body-text-bold-9"><b><?php echo $common_informationRecord['previous_message_tablet'] ?><br /></b></span></a>  
<?php endif ?>

<span class="body-text-bold-9">Page </span><input type="text" name="photoPage" value="<?php echo($photoPage + 1); ?>" class="body-text-bold-10"  style="width: 15px;" /> of <?php echo(ceil(sizeof($photo_sharingRecord['images']) / $photosPerPage)); ?>

<?php if ($lastIndex < sizeof($photo_sharingRecord['images']) - 1): ?> 
<a href="?photoPage=<?php echo $photoPage+2; ?>&=<?php echo $photo_sharingRecord['num'] ?>"><span class="body-text-bold-9"><b><br /><?php echo $common_informationRecord['next_message_tablet'] ?></b></span></a><br /><br />  
<?php endif ?> 
</form> 
<?php endif ?> 

<?php else :?>  

<?php
$photosPerPage =  $common_informationRecord['images_per_page'] ;
 
$photoPage = @$_REQUEST['photoPage'] ? $_REQUEST['photoPage'] - 1 : 0;  
$firstIndex = $photoPage * $photosPerPage; 
$lastIndex = min($firstIndex + $photosPerPage, sizeof($photo_sharingRecord['images'])) - 1;  
?>     

<?php if ((ceil(sizeof($photo_sharingRecord['images']) / $photosPerPage)) > 1): ?><form action="?num=<?php echo $photo_sharingRecord['num'] ?>" method="post"> 
<?php if ($firstIndex > 0): ?>  
<a href="?photoPage=<?php echo $photoPage; ?>&=<?php echo $photo_sharingRecord['num'] ?>"><span class="body-text-bold-9"><b><?php echo $common_informationRecord['previous_message_computer'] ?><br /></b></span></a>  
<?php endif ?>

<span class="body-text-bold-9">Page </span><input type="text" name="photoPage" value="<?php echo($photoPage + 1); ?>" class="body-text-bold-10"  style="width: 15px;" /> of <?php echo(ceil(sizeof($photo_sharingRecord['images']) / $photosPerPage)); ?>

<?php if ($lastIndex < sizeof($photo_sharingRecord['images']) - 1): ?> 
<a href="?photoPage=<?php echo $photoPage+2; ?>&=<?php echo $photo_sharingRecord['num'] ?>"><span class="body-text-bold-9"><b><br /><?php echo $common_informationRecord['next_message_computer'] ?></b></span></a><br /><br />  
<?php endif ?> 
</form> 
<?php endif ?> 

 
<?php endif ?>
<table border="0" cellspacing="3" cellpadding="3">
<tr >

<?php

if ($firstIndex > sizeof($photo_sharingRecord['images'])-1 || $firstIndex < 0) { $firstIndex = 0; $photoPage = 0; }

foreach (range($firstIndex, $lastIndex) as $photoIndex):
@$upload = $photo_sharingRecord['images'][$photoIndex];
//Set the upload num value to an interger
$uploadNum = $upload['num'];
?>


<td  align="center" valign="middle">

<a title="<span class=&quot;body-text-bold-9&quot;><?PHP @$upload['info1'] = preg_replace("[\"]", "''", @$upload['info1'] ); ?><?php $info1 = htmlspecialchars(@$upload['info1']); ?><?php echo strtoupper($info1); ?><?php // is this a video file?
if ($upload['extension'] == 'mp4'): ?><?php $vid = 'Y' ; ?><?php else :?><?php $vid = 'N' ; ?><?php endif; ?><br /><?PHP @$upload['info2'] = preg_replace("[\"]", "''", @$upload['info2'] ); ?><?php echo $upload['info2'] ?></span><br />" href="<?php //if this is a video file show a horizontal placeholder image.
if ($vid == 'Y'):?><?php foreach ($photo_sharingRecords as $record): ?><?php foreach ($record['video_placeholder_image'] as $upload): ?><?php echo $upload['thumbUrlPath3'] ?><?php endforeach ?><?php endforeach ?><?php // If not video, show larger vertical or horizontal thumbnail 
else :?><?php if (@$upload['info3'] == "V"): ?><?php echo $upload['thumbUrlPath3'] ?><?php else: ?><?php echo $upload['thumbUrlPath2'] ?><?php endif; ?><?php endif; ?>"

rel="enlargeimage"

/*
* Below I have set the unique num value for the image record to the uploadNum variable in the URL.
*/
rev="targetdiv:loadarea,link:<?php if ($vid == 'Y'):?>photosharingdetailv5.php?uploadNum=<?php echo $uploadNum;?>&num=<?php echo $recnum ?><?php else:?><?php echo $upload['urlPath'] ?><?php endif; ?>" ><?php //If this is a vide file link to video page
 if ($vid == 'Y'):?><?php foreach ($photo_sharingRecords as $record): ?><?php foreach ($record['video_placeholder_image'] as $upload): ?><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><?php endforeach ?><?php endforeach ?><?php //If not show thumbnail
  else:?><img  src="<?php echo $upload['thumbUrlPath'] ?>" alt=""  width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight']?>" border="0" style="margin-bottom: 5px" /><?php endif; ?></a>

</td>
<?php $maxCols=4; if (@++$count % $maxCols == 0): ?></tr><tr ><?php endif; ?>
<?php endforeach ?>
</tr>
</table>

<p></td>
<td width="626"><table width="25%" border="0" align="center" cellpadding="5" cellspacing="0">

<tr>
<td align="left" valign="top" ><div align="left">


<div align="center" id="loadarea" style="width: 400px; height: 500px;">

<?php $upload = @$photo_sharingRecord['images'][$firstIndex] ?>

<span class="body-text-bold-9"><?PHP @$upload['info1'] = preg_replace("[\"]", "''", @$upload['info1'] ); ?><?php $info1 = htmlspecialchars(@$upload['info1']); ?><?php echo strtoupper($info1); ?><br /><?PHP @$upload['info2'] = preg_replace("[\"]", "''", @$upload['info2'] ); ?><?php echo @$upload['info2'] ?></span><br /><br /><a href="<?php echo $upload['urlPath'] ?>"><img src="<?php if ($upload['info3'] == "V"): ?><?php echo $upload['thumbUrlPath3'] ?><?php else: ?><?php echo $upload['thumbUrlPath2'] ?><?php endif; ?>" alt="" border="0" /></a> <br /> <br />


</div> </td>

</tr>
</table></td>
</tr>
</table>
</body>
</html>
