$_zp_gallery_page = basename($obj = THEMEFOLDER . "/{$theme}/album.php"); } else { handleSearchParms('album', $_zp_current_album); $theme = setupTheme(); $_zp_gallery_page = basename($obj = THEMEFOLDER . "/{$theme}/album.php"); } // update hit counter if (!isMyALbum($_zp_current_album->name, ALL_RIGHTS) && getCurrentPage() == 1) { $hc = $_zp_current_album->get('hitcounter') + 1; $_zp_current_album->set('hitcounter', $hc); $_zp_current_album->save(); } // Display the Index page. } else { if (in_context(ZP_INDEX)) { handleSearchParms('index'); $theme = setupTheme(); $_zp_gallery_page = basename($obj = THEMEFOLDER . "/{$theme}/index.php"); } } } } // Load plugins, then load the requested $obj (page, image, album, or index; defined above). $_zp_loaded_plugins = array(); if (file_exists(SERVERPATH . "/" . UTF8ToFilesystem($obj)) && $zp_request) { foreach (getEnabledPlugins() as $extension) { $_zp_loaded_plugins[] = $extension; require_once SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . $extension; } // Zenpage automatic hitcounter update support if (function_exists("is_NewsArticle") and !$_zp_loggedin) {
/** * * sets up for loading p=page pages * @return string */ function prepareCustomPage() { global $_zp_current_album, $_zp_current_image, $_zp_gallery_page, $_zp_script, $_zp_current_search; $searchalbums = handleSearchParms('page', $_zp_current_album, $_zp_current_image); $album = NULL; $page = str_replace(array('/', '\\', '.'), '', sanitize($_GET['p'])); if (isset($_GET['z'])) { // system page if ($subfolder = sanitize($_GET['z'])) { $subfolder .= '/'; } $_zp_gallery_page = $page . '.php'; $_zp_script = ZENFOLDER . '/' . $subfolder . $page . '.php'; } else { $_zp_gallery_page = $page . '.php'; switch ($_zp_gallery_page) { case 'search.php': if (!empty($searchalbums)) { // we are within a search of a specific album(s) $albums = array(); foreach ($searchalbums as $analbum) { $parent = getUrAlbum(newAlbum($analbum)); $albums[$parent->getID()] = $parent; } if (count($albums) == 1) { // there is only one parent album for the search $album = array_shift($albums); } } break; } } $theme = setupTheme($album); if (empty($_zp_script)) { $_zp_script = THEMEFOLDER . "/{$theme}/{$page}.php"; } return $theme; }