Exemplo n.º 1
0
            die(gettext("Static HTML Cache folder could not be created. Please try to create it manually via FTP with chmod 0777."));
        }
    }
}
if (OFFSET_PATH) {
    if (isset($_GET['action']) && $_GET['action'] == 'clear_html_cache' && zp_loggedin(ADMIN_RIGHTS)) {
        XSRFdefender('ClearHTMLCache');
        $_zp_HTML_cache = new staticCache();
        $_zp_HTML_cache->clearHTMLCache();
        header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=external&msg=' . gettext('HTML cache cleared.'));
        exit;
    }
} else {
    //	if the page is cached then handle it early
    $_zp_HTML_cache = new staticCache();
    $_zp_HTML_cache->startHTMLCache();
}
/**
 * Plugin option handling class
 *
 */
class staticCache_options
{
    function staticCache_options()
    {
        setOptionDefault('static_cache_expire', 86400);
        setOptionDefault('static_cache_excludedpages', 'search.php/,contact.php/,register.php/');
    }
    function getOptionsSupported()
    {
        return array(gettext('Static HTML cache expire') => array('key' => 'static_cache_expire', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("When the cache should expire in seconds. Default is 86400 seconds (1 day  = 24 hrs * 60 min * 60 sec).")), gettext('Excluded pages') => array('key' => 'static_cache_excludedpages', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("The list of pages to excluded from cache generation. Pages that can be excluded are custom theme pages including Zenpage pages (these optionally more specific by titlelink) and the standard theme files image.php (optionally by image file name), album.php (optionally by album folder name) or index.php.<br /> If you want to exclude a page completely enter <em>page-filename.php/</em>. <br />If you want to exclude a page by a specific title, image filename, or album folder name enter <em>pagefilename.php/titlelink or image filename or album folder</em>. Separate several entries by comma.")));