if (!empty($skin)) { // We want to display with a skin now: $Timer->resume('SKIN DISPLAY'); $Debuglog->add('Selected skin: ' . $skin, 'skins'); // Instantiate PageCache: $Timer->resume('PageCache'); load_class('_core/model/_pagecache.class.php', 'PageCache'); $PageCache = new PageCache($Blog); // Check for cached content & Start caching if needed // Note: there are some redirects inside the skins themselves for canonical URLs, // If we have a cache hit, the redirect won't take place until the cache expires -- probably ok. // If we start collecting and a redirect happens, the collecting will just be lost and that's what we want. if (!$PageCache->check()) { // Cache miss, we have to generate: $Timer->pause('PageCache'); if ($skin_provided_by_plugin = skin_provided_by_plugin($skin)) { $Plugins->call_method($skin_provided_by_plugin, 'DisplaySkin', $tmp_params = array('skin' => $skin)); } else { // Path for the current skin: $ads_current_skin_path = $skins_path . $skin . '/'; $disp_handlers = array('404' => '404_not_found.main.php', 'activateinfo' => 'activateinfo.main.php', 'arcdir' => 'arcdir.main.php', 'catdir' => 'catdir.main.php', 'comments' => 'comments.main.php', 'feedback-popup' => 'feedback_popup.main.php', 'login' => 'login.main.php', 'mediaidx' => 'mediaidx.main.php', 'msgform' => 'msgform.main.php', 'page' => 'page.main.php', 'postidx' => 'postidx.main.php', 'posts' => 'posts.main.php', 'profile' => 'profile.main.php', 'search' => 'search.main.php', 'single' => 'single.main.php', 'sitemap' => 'sitemap.main.php', 'subs' => 'subs.main.php', 'threads' => 'threads.main.php', 'messages' => 'messages.main.php', 'contacts' => 'contacts.main.php', 'user' => 'user.main.php', 'users' => 'users.main.php', 'edit' => 'edit.main.php', 'edit_comment' => 'edit_comment.main.php', 'front' => 'front.main.php', 'useritems' => 'useritems.main.php', 'usercomments' => 'usercomments.main.php', 'download' => 'download.main.php', 'access_requires_login' => 'access_requires_login.main.php', 'tags' => 'tags.main.php', 'terms' => 'terms.main.php'); // Handle custom templates defined by the Item Type: if (!empty($disp) && ($disp == 'single' || $disp == 'page') && !empty($Item) && ($ItemType =& $Item->get_ItemType()) && $ItemType->get('template_name') != '') { // Get template name for the current Item if it is defined by its Item Type: $disp_handler_custom = $ItemType->get('template_name') . '.main.php'; if (file_exists($disp_handler = $ads_current_skin_path . $disp_handler_custom)) { // Custom template is found in skin folder: $disp_handler_custom_found = true; $Debuglog->add('blog_main: include ' . rel_path_to_base($disp_handler) . ' (custom for item type)', 'skins'); } else { // Custom template not found:
/** * Check if a skin is installed. * * This can either be a regular skin or a skin provided by a plugin. * * @param Skin name (directory name) * @return boolean True if the skin is installed, false otherwise. */ function skin_installed($name) { $SkinCache =& get_SkinCache(); if (skin_provided_by_plugin($name) || $SkinCache->get_by_folder($name, false)) { return true; } return false; }
/** * Checks if a skin exists. This can either be a regular skin directory * or can be in the list {@link Plugin::GetProvidedSkins()}. * * Used by front-end. * * @param skin name (directory name) * @return boolean true is exists, false if not */ function skin_exists($name, $filename = 'index.main.php') { global $skins_path; if (is_readable($skins_path . $name . '/' . $filename)) { return true; } // Check list provided by plugins: if (skin_provided_by_plugin($name)) { return true; } return false; }