$user) $valid_users[$key]=md5($user); // Check if cookie data is available and valid if (isset($_COOKIE['epa'])) { $cookie_data=explode('@',$_COOKIE['epa']); if (count($cookie_data)==3) { if (in_array($cookie_data[0],$valid_users)) { $user_index=array_search($cookie_data[0],$valid_users); if ($valid_users[$user_index+1]!=$cookie_data[1]) require_login(); else if (md5($_SERVER['HTTP_USER_AGENT'])!=$cookie_data[2]) require_login(); } else { require_login(); } } else { require_login(); } // Check if form data is submitted and valid } else if (isset($_REQUEST['new_user']) && isset($_REQUEST['new_password'])) { if (in_array(md5($_REQUEST['new_user']),$valid_users)) { $user_index=array_search(md5($_REQUEST['new_user']),$valid_users); if ($valid_users[$user_index+1]!=md5($_REQUEST['new_password'])) { require_login(); } else { $_SESSION['user']=md5($_REQUEST['new_user']); $_SESSION['passw']=md5($_REQUEST['new_password']); $_SESSION['agent']=md5($_SERVER['HTTP_USER_AGENT']); setcookie('epa',$_SESSION['user'] . '@' . $_SESSION['passw'] . '@' . $_SESSION['agent'],time()+3600); } } else { require_login(); } // Check if current session is valid } else if (isset($_SESSION['passw']) && isset($_SESSION['user']) && isset($_SESSION['agent'])) { if ($_SESSION['agent']!=md5($_SERVER['HTTP_USER_AGENT'])) require_login(); if (in_array($_SESSION['user'],$valid_users)) { $user_index=array_search($_SESSION['user'],$valid_users); if ($valid_users[$user_index+1]!=$_SESSION['passw']) require_login(); } else { require_login(); } // Session data and form data is invalid } else { require_login(); } } if (isset($_REQUEST['poweredby'])) { header("Content-type: image/png"); imagepng(poweredby_image()); exit; } // Create and output image in specified size if (isset($_REQUEST['image'])) { $image=$_REQUEST['image']; $image=str_replace(chr(92),chr(47),getcwd()).'/'.$image; if (file_exists($image)) { $size=@GetImageSize($image); if ($size[2]==1) { if (imagetypes() & IMG_GIF) { $im=@imagecreatefromgif($image); } else { header("Content-type: image/png"); imagepng(invalid_image('No GIF support')); exit; } } if ($size[2]==2) { if (imagetypes() & IMG_JPG) { $im=@imagecreatefromjpeg($image); } else { header("Content-type: image/png"); imagepng(invalid_image('No JPG support')); exit; } } if ($size[2]==3) $im=@imagecreatefrompng($image); if ($size[2]!=1 && $size[2]!=2 && $size[2]!=3) { $thumb=invalid_image('Invalid Image'); } else { if ($thumb_size<30) $thumb_size=30; if (isset($_REQUEST['resize'])) { if ($image_resizeto==0 && isset($_REQUEST['screenwidth'])) $image_resizeto=floor($_REQUEST['screenwidth']/1.6); if (!$image_inflate) { if ($image_resizeto>$size[0] && $image_resizeto>$size[1]) $image_resizeto=max($size[0],$size[1]); } $thumb_size=$image_resizeto; $show_number=false; $show_binder=false; $border_width=0; $show_bordershadow=false; } if ($show_binder) $border_offset=3; else $border_offset=2; if ($gd2) { if ($size[0]>$size[1]) $thumb=imagecreatetruecolor($border_width*$border_offset+$thumb_size,$border_width*2+ceil($size[1]/($size[0]/$thumb_size))); else $thumb=imagecreatetruecolor($border_width*$border_offset+ceil($size[0]/($size[1]/$thumb_size)),$border_width*2+$thumb_size); } else { if ($size[0]>$size[1]) $thumb=imagecreate($border_width*$border_offset+$thumb_size,$border_width*2+ceil($size[1]/($size[0]/$thumb_size))); else $thumb=imagecreate($border_width*$bortider_offset+ceil($size[0]/($size[1]/$thumb_size)),$border_width*2+$thumb_size); } $black=imagecolorallocate($thumb,0,0,0); $white=imagecolorallocate($thumb,255,255,255); $gray=imagecolorallocate($thumb,192,192,192); $middlegray=imagecolorallocate($thumb,158,158,158); $darkgray=imagecolorallocate($thumb,128,128,128); imagefill($thumb,0,0,imagecolorallocate($thumb,hexdec(substr($border_color,1,2)),hexdec(substr($border_color,3,2)),hexdec(substr($border_color,5,2)))); if ($show_binder) $bind_offset=4; else $bind_offset=0; if ($show_bordershadow) { imagerectangle($thumb,$bind_offset,0,imagesx($thumb)-4,imagesy($thumb)-4,$gray); imageline($thumb,$bind_offset+2,imagesy($thumb)-3,imagesx($thumb),imagesy($thumb)-3,$darkgray); imageline($thumb,imagesx($thumb)-3,2,imagesx($thumb)-3,imagesy($thumb),$darkgray); imageline($thumb,$bind_offset+2,imagesy($thumb)-2,imagesx($thumb),imagesy($thumb)-2,$middlegray); imageline($thumb,imagesx($thumb)-2,2,imagesx($thumb)-2,imagesy($thumb),$middlegray); imageline($thumb,$bind_offset+2,imagesy($thumb)-1,imagesx($thumb),imagesy($thumb)-1,$gray); imageline($thumb,imagesx($thumb)-1,2,imagesx($thumb)-1,imagesy($thumb),$gray); } if ($gd2) imagecopyresampled($thumb,$im,$border_width*($border_offset-1),$border_width,0,0,imagesx($thumb)-($border_offset*$border_width),imagesy($thumb)-2*$border_width,imagesx($im),imagesy($im)); else imagecopyresized($thumb,$im,$border_width*($border_offset-1),$border_width,0,0,imagesx($thumb)-($border_offset*$border_width),imagesy($thumb)-2*$border_width,imagesx($im),imagesy($im)); if ($show_number && isset($_REQUEST['number']) && isset($_REQUEST['total'])) { // Sample some pixels to determine text color $colors=array(); for ($i=5;$i<25;$i++) { $indexis=ImageColorAt($thumb,$i,4+ceil($i/5)); $rgbarray=ImageColorsForIndex($thumb,$indexis); array_push($colors,$rgbarray['red'],$rgbarray['green'],$rgbarray['blue']); } if (array_sum($colors)/count($colors)>180) $textcolor=imagecolorallocate($thumb,0,0,0); else $textcolor=imagecolorallocate($thumb,255,255,255); if ($show_binder) $number_offset=$border_width*2; else $number_offset=$border_width; if ($border_width==0) $number_offset=1; imagestring($thumb,1,$number_offset,1,($_REQUEST['number']+1) . '/' . $_REQUEST['total'],$textcolor); } if ($show_binder) { $spacing=floor(imagesy($thumb)/$binder_spacing)-2; $offset=floor((imagesy($thumb)-($spacing*$binder_spacing))/2); for ($i=$offset;$i<=$offset+$spacing*$binder_spacing;$i+=$binder_spacing) { imagefilledrectangle($thumb,8,$i-2,10,$i+2,$black); imageline($thumb,11,$i-1,11,$i+1,$darkgray); imageline($thumb,8,$i-2,10,$i-2,$darkgray); imageline($thumb,8,$i+2,10,$i+2,$darkgray); imagefilledrectangle($thumb,0,$i-1,8,$i+1,$gray); imageline($thumb,0,$i,8,$i,$white); imageline($thumb,0,$i-1,0,$i+1,$gray); imagesetpixel($thumb,0,$i,$darkgray); } } if (isset($_REQUEST['resize']) && $copyright!='') { $colors=array(); for ($i=5;$i180) $textcolor=imagecolorallocate($thumb,0,0,0); else $textcolor=imagecolorallocate($thumb,255,255,255); if ($show_binder) $number_offset=$border_width*2; else $number_offset=$border_width; imagestring($thumb,1,$number_offset,imagesy($thumb)-10,' ' . $copyright,$textcolor); } } if (isset($_REQUEST['indexalbum'])) $main_page=$_REQUEST['indexalbum']; else $main_page=0; if ($size[2]==1) { if ($createcache && $main_page>0) @imagegif($thumb,substr($image,0,strpos($image,'.')) . '_thumbindex' . '.gif'); else if ($createcache) @imagegif($thumb,substr($image,0,strpos($image,'.')) . '_thumb' . '.gif'); header("Content-type: image/gif"); imagegif($thumb); } else if ($size[2]==2) { if ($createcache && $main_page>0) @imagejpeg($thumb,substr($image,0,strpos($image,'.')) . '_thumbindex' . '.jpg',90); else if ($createcache) @imagejpeg($thumb,substr($image,0,strpos($image,'.')) . '_thumb' . '.jpg',90); header("Content-type: image/jpeg"); imagejpeg($thumb,'',90); } else if ($size[2]==3) { if ($createcache && $main_page>0) @imagepng($thumb,substr($image,0,strpos($image,'.')) . '_thumbindex' . '.png'); else if ($createcache) @imagepng($thumb,substr($image,0,strpos($image,'.')) . '_thumb' . '.png'); header("Content-type: image/png"); imagepng($thumb); } else { header("Content-type: image/png"); imagepng(invalid_image('Invalid Image')); } } else { header("Content-type: image/png"); imagepng(invalid_image('File not found')); } imagedestroy($im); imagedestroy($thumb); exit; } // Resize images permanently if ($resizeimages) { $images=get_images(getcwd()); if ($images && $resizeto>30) { foreach ($images as $image) { $size=@GetImageSize($image); if ($size[0]>$size[1]) { $width=$resizeto; $height=ceil($size[1]/($size[0]/$width)); } else { $width=ceil($size[0]/($size[1]/$resizeto)); $height=$resizeto; } if ($size[2]==1) $im=@imagecreatefromgif($image); if ($size[2]==2) $im=@imagecreatefromjpeg($image); if ($size[2]==3) $im=@imagecreatefrompng($image); if ($size[2]==2 || $size[2]==3) { if ($gd2) { if ($size[0]>$size[1]) $thumb=imagecreatetruecolor($width,ceil($size[1]/($size[0]/$width))); else $thumb=imagecreatetruecolor(ceil($size[0]/($size[1]/$height)),$height); } else { if ($size[0]>$size[1]) $thumb=imagecreate($width,ceil($size[1]/($size[0]/$width))); else $thumb=imagecreate(ceil($size[0]/($size[1]/$height)),$height); } if ($gd2) imagecopyresampled($thumb,$im,0,0,0,0,imagesx($thumb),imagesy($thumb),imagesx($im),imagesy($im)); else imagecopyresized($thumb,$im,0,0,0,0,imagesx($thumb),imagesy($thumb),imagesx($im),imagesy($im)); if ($size[2]==1) @imagegif($thumb,str_replace(chr(92),chr(47),getcwd()).'/'.$image) or die('Please enable write access to this directory'); if ($size[2]==2) @imagejpeg($thumb,str_replace(chr(92),chr(47),getcwd()).'/'.$image,90) or die('Please enable write access to this directory'); if ($size[2]==3) @imagepng($thumb,str_replace(chr(92),chr(47),getcwd()).'/'.$image) or die('Please enable write access to this directory'); } } imagedestroy($im); imagedestroy($thumb); } } // Detect sub directories - if present; current index.php file is home - otherwise detect directories one level higher $dir_names=array(); $file_names=array(); $album_show=false; $total_amount_images=0; if ($dir=@opendir(getcwd())) { while ($file=readdir($dir)) { if (($file!='.') && ($file!='..') && is_dir($file) && file_exists($file.'/index.php')) { $images=get_images($file); if (count($images)!=0) { array_push($dir_names,$file); array_push($file_names,$file . '/' . $images[0]); $album_show=true; $total_amount_images=$total_amount_images+count($images); } } } } sort($dir_names); sort($file_names); $total_amount_albums=count($dir_names); if (count($dir_names)==0) { $dir_names=array(); if ($dir=@opendir('../')) { while ($file=readdir($dir)) { if (($file!='.') && ($file!='..') && is_dir('../'.$file) && file_exists('../'.$file.'/index.php') && $file!=substr(getcwd(),-strlen($file))) { $images=get_images('../' . $file); if (count($images)!=0) array_push($dir_names,'../' . $file); } } } sort($dir_names); $file_names=array(); $file_names=get_images('./'); sort($file_names); } // Page title if ($title=='') { $title=str_replace(chr(92),chr(47),getcwd()); $title=str_replace('_',' ',$title); $title=substr($title,strrpos($title,chr(47))+1); if (ereg("([0-9]{3})",substr($title,0,3))) $title=trim(substr($title,3)); } // Evaluate which thumbnails to show on current page $max_files=count($file_names); if (isset($_REQUEST['page'])) $page=abs((int) $_REQUEST['page']); else $page=0; $albumpage=ceil($page/$images_per_page)+1; $show_files=$page+$images_per_page; if ($show_files>$max_files) $show_files=$max_files; if ($page==$show_files) $page-=$images_per_page; // Create HTML page echo "$title\n"; echo "\n"; echo "\n"; // Insert CSS Styles html_css(); // Javascript for pop-up window echo "
\n"; echo "\n"; echo "

$title
AMCIS 2005 - A Conference on a Human Scale

 
"; if (file_exists("text.txt")) { echo "
"; include ("text.txt"); echo "
"; } echo "
"; echo "
\n"; if (isset($_REQUEST['showimage']) && isset($_REQUEST['screenwidth'])) { // Display single photo on page $showimage=$_REQUEST['showimage']; $showimageurl=rawurlencode($showimage); $screenwidth=$_REQUEST['screenwidth']; $file_size=floor(filesize($showimage)/800); $file_date=date('Y-m-d H:i',filemtime($showimage)); $file_name=substr($showimage,0,strpos($showimage,'.')); if (ereg("([0-9]{3})",substr($file_name,0,3))) $file_name=trim(substr($file_name,3)); if (strpos($file_name,'/')!=false) $file_name=substr($file_name,0,strpos($file_name,'/')); $border=''; if ($image_border) $border="border=\"1\""; $onload=''; if ($slideshow && isset($_REQUEST['slideshow'])) $onload="onload=\"javascript: starttimer()\""; if ($image_resize) echo "\n"; else echo "\n"; $content=''; if ($show_name==true) $content.=str_replace('_',' ',$file_name) . '
'; if ($show_details==true) { $size=@GetImageSize('./' . $showimage); $content.=$size[1] . "x" . $size[0] . " / $file_size Kb
"; } if ($show_date==true) $content.="$file_date"; echo "\n"; } else { // Display thumbnail images $colcount=0; for ($count=$page;$count<$show_files;$count++) { $file_size=floor(filesize($file_names[$count])/1024); $file_date=date('Y-m-d H:i',filemtime($file_names[$count])); $file_name=substr($file_names[$count],0,strpos($file_names[$count],'.')); if (ereg("([0-9]{3})",substr($file_name,0,3))) $file_name=trim(substr($file_name,3)); if (strpos($file_name,'/')!=false) { $link=substr($file_names[$count],0,strpos($file_names[$count],'/')); $file_name=substr($file_name,0,strpos($file_name,'/')); } $size=@GetImageSize('./' . $file_names[$count]); $image_filename=rawurlencode($file_names[$count]); $extension='.' . ltrim(strtolower(substr($file,-4)),'.'); if ($size[2]==1) $extension='.gif'; if ($size[2]==2) $extension='.jpg'; if ($size[2]==3) $extension='.png'; if ($total_amount_albums>0) $thumb_filename=substr($file_names[$count],0,strpos($file_names[$count],'.')) . '_thumbindex' . $extension; else $thumb_filename=substr($file_names[$count],0,strpos($file_names[$count],'.')) . '_thumb' . $extension; $alt=str_replace('_',' ',$file_name); if ($image_resize && $size[0]) { if ($image_resizeto==0) $image_resizeto=$size[0]; if ($size[0]>$size[1]) { $popup_width=$image_resizeto; $popup_height=ceil($size[1]/($size[0]/$popup_width)); } else { $popup_width=ceil($size[0]/($size[1]/$image_resizeto)); $popup_height=$image_resizeto; } } else if ($size[0]) { $popup_width=$size[0]; $popup_height=$size[1]; } if (!$image_inflate) { if ($popup_width>$size[0] || $popup_height>$size[1]) { $popup_width=$size[0]; $popup_height=$size[1]; } } if (file_exists($thumb_filename) && !$createcache) { if (strpos($file_names[$count],'/')===false && $size[0]) $content="\"$language_view\"
"; else if ($size[0]) $content="\"$language_view
"; else $content="
"; } else { if (strpos($file_names[$count],'/')===false && $size[0]) $content="\"$language_view\"
"; else if ($size[0]) $content="\"$language_view
"; else $content="
"; } if ($show_name==true) $content.=str_replace('_',' ',$file_name) . '
'; if ($show_details==true) $content.=$size[0] . "x" . $size[1] . " / $file_size Kb
"; if ($show_date==true) $content.="$file_date"; if ($columns_per_page==1) { echo "\n"; } else { $colcount+=1; if ($colcount==1) { echo "\n"; } else if ($colcount<$columns_per_page) { echo "\n"; } else { echo "\n"; $colcount=0; } } if ($colcount<$columns_per_page && $colcount!=0 && $count==$show_files-1) { for ($emptycol=$colcount;$emptycol<$columns_per_page;$emptycol++) echo ""; echo "\n"; } } // End for } echo "\n"; // Page numbers and back & forward browsing if ($max_files>$images_per_page || isset($_REQUEST['showimage'])) { if ($albumpage==1) echo "\n"; } echo "
$content
$content
$content$content$content
 
 
$language_page 1"; else echo "
$language_page 1"; for ($i=$images_per_page;$i$p"; else echo " | $p"; } // Back & forward browsing (only when slideshow is not active) if (!isset($_REQUEST['slideshow'])) { if (isset($_REQUEST['showimage'])) { if (in_array($_REQUEST['showimage'],$file_names)) { $back=array_search($_REQUEST['showimage'],$file_names)-1; $forward=$back+2; $count=count($file_names); if ($back>=0 && $forward<$count) echo " | <- ->"; if ($forward>=$count) echo " | <-"; if ($back<0) echo " | ->"; } } } if ($slideshow && isset($_REQUEST['showimage']) && isset($_REQUEST['screenwidth'])) { $showimage=rawurlencode($_REQUEST['showimage']); $screenwidth=$_REQUEST['screenwidth']; if (isset($_REQUEST['slideshow'])) echo " | $language_stop_slideshow"; else echo " | $language_slideshow"; } echo "
 
\n"; // Bottom menu echo "
    "; if ($home_page!='') echo "
  • $language_homepage
  • "; if ($total_amount_albums!=0) echo "
    $language_albums: $total_amount_albums | $language_photos: $total_amount_images
    "; if (!$album_show) { for ($count=0;$count$dir_name\n"; } if ($restrict_access) echo "
  • $language_logout
  • \n"; } echo "
\n"; if ($show_poweredby_easyphpalbum) echo "

\n"; echo "

\n"; // Functions // Create error image function invalid_image($message) { $im=imagecreate(80,75); $black=imagecolorallocate($im,0,0,0); $yellow=imagecolorallocate($im,255,255,0); imagefilledrectangle($im,0,0,80,75,imagecolorallocate($im,255,0,0)); imagerectangle($im,0,0,79,74,$black); imageline($im,0,20,80,20,$black); imagefilledrectangle($im,1,1,78,19,$yellow); imagefilledrectangle($im,27,35,52,60,$yellow); imagerectangle($im,26,34,53,61,$black); imageline($im,27,35,52,60,$black); imageline($im,52,35,27,60,$black); imagestring($im,1,5,5,$message,$black); return $im; } function poweredby_image() { $im=imagecreate(64,20); $black=imagecolorallocate($im,0,0,0); imagefilledrectangle($im,0,0,64,20,$black); imagefilledrectangle($im,1,1,62,18,imagecolorallocate($im,160,160,255)); imagestring($im,1,2,2,' Powered by',$black); imagestring($im,1,2,10,'EasyPhpAlbum',$black); return $im; } // Read all GIF,JPG,PNG files in directory function get_images($location) { global $restrict_access; $file_names=array(); if ($dir=@opendir("$location/")) { while ($file=readdir($dir)) { if (($file!='.') && ($file!='..') && !is_dir($file)) { $extension=ltrim(strtolower(substr($file,-4)),'.'); if ($extension=='jpg' || $extension=='jpeg' || $extension=='png' || $extension=='gif') { if (!strpos($file,'_thumb')) { if ($restrict_access) { if (!strpos($file,'_login')) array_push($file_names,$file); } else { array_push($file_names,$file); } } } } } } sort($file_names); return($file_names); } // Login form function require_login() { global $home_page,$language_homepage,$language_login,$language_user,$language_passw; echo "$language_login\n"; echo "\n"; echo "\n"; html_css(); echo "
\n"; echo "

$language_login

 
"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
 
$language_user:
$language_passw:
 
 
 
"; if ($home_page!='') echo ""; echo "
"; ?>

Conference Extras

Roger Schell Presentation

\n"; exit; } // CSS code function html_css() { global $page_color, $text_color,$text_hover_color,$title_color,$border_color,$table_color,$item_border_color,$line_color; global $menu_line_width,$menu_bar_width,$menu_bordertop_color,$menu_borderbottom_color,$menu_borderleft_color,$menu_borderright_color,$menu_bordertop_hover_color,$menu_borderbottom_hover_color,$menu_borderleft_hover_color,$menu_borderright_hover_color; global $menu_text_color,$menu_texthover_color,$menu_background_color,$menu_background_hover_color,$image_border; echo "\n"; return; } ?>