![]() |
include($_SERVER['DOCUMENT_ROOT'].'/static/swimwear07/inc/nav_top.inc.php'); ?> | ![]() |
//gets girl's name for gallery
$girl = ereg_replace(".php","",end(explode("/",$_SERVER['SCRIPT_NAME'])));
/*
if($_SESSION['old_girl'] != $girl){
$_SESSION['gnum'] = 1;
}
$_SESSION['old_girl'] = $girl;
//creates filenames
$filename = $girl.'_'.$_SESSION['gnum'].'.jpg';
//creates file paths
$filepath_hires = 'images/gallery/'.$girl.'/highRes/';
$filepath = 'images/gallery/'.$girl.'/';
//gets image count
$i_count = 0;
if ($handle = opendir($_SERVER['DOCUMENT_ROOT'].'/static/swimwear07/'.$filepath_hires)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
//echo $file.'
';
$i_count++;
}
}
closedir($handle);
}
if(isset($_GET['dl'])){
header("Content-Disposition: attachment; filename=$filename");
readfile($_SERVER['DOCUMENT_ROOT'].'/static/swimwear07/'.$filepath_hires.$filename);
exit;
}
if(isset($_SESSION['gnum'])){
if((isset($_GET['next'])) and ($i_count > $_SESSION['gnum'])){
$_SESSION['gnum']++;
}
if((isset($_GET['prev'])) and ($_SESSION['gnum'] > 1)){
$_SESSION['gnum'] = $_SESSION['gnum'] - 1;
}
}else{
$_SESSION['gnum'] = 1;
}
$filename = $girl.'_'.$_SESSION['gnum'].'.jpg';
$showing = $_SESSION['gnum'].' of '.$i_count;
$dl_href = '/static/swimwear07/'.$filepath_hires.$filename;
*/
$gallery_images = array();
if($handle = opendir($_SERVER['DOCUMENT_ROOT'].'/static/swimwear07/images/gallery/'.$girl)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
//pr($file);
$check = explode('.',$file);
//print_r($check);
if(isset($check[1])) {
if(($check[1] == 'jpg') || ($check[1] == 'gif')) {
array_push($gallery_images,$file);
}
}
}
}
closedir($handle);
}
sort($gallery_images);
//print_r($gallery_images);
$totol = count($gallery_images);
if(isset($_GET['id'])){
if($totol > $_GET['id']){
$_GET['id']++;
}
if($_GET['id'] > 0){
$_GET['id'] = $_GET['id'] - 1;
}
}else{
$_GET['id'] = 0;
}
$filename = $gallery_images[$_GET['id']];;
$filepath_hires = 'images/gallery/'.$girl.'/highRes/';
if(isset($_GET['dl'])){
header("Content-Disposition: attachment; filename=$filename");
readfile($_SERVER['DOCUMENT_ROOT'].'/static/swimwear07/'.$filepath_hires.$filename);
exit;
}
$dl_href = '/static/swimwear07/'.$filepath_hires.$filename;
$showing = ($_GET['id']+1).' of '.$totol;
?>