findPath($target_path); if( !isGalleryAllow($this_gallery) ) goAuth(); if( !$this_gallery ) throw new Exception("Gallery does not exist"); $Model_Gallery->buildAccessLog($this_gallery); //old album compatible $old_index = ALBUM_DIR . $target_path . "/index.php"; if( is_file($old_index) ){ require_once($old_index); die(); } $template_path = TEMPLATE . $this_gallery['gallery_template']; $template_file = $template_path . "/template.php"; if( !is_file($template_file) ) throw new Exception("Invalid template"); require_once($template_file); }catch(Exception $e){ header("HTTP/1.0 404 Not Found"); $_SESSION["page_error"] = "GALLERY_DOES_NOT_EXIST"; require_once( ALBUM_ROOT . "/index.php"); die(); } ?>