/** * one initial call of config() is required. multiple calls won't hurt. */ public static function config(array $config = array()) { // merge given (precedence) and default config $ROOT = rtrim($_SERVER['DOCUMENT_ROOT'], '/'); // normalize trailing self::$config = (object) array_merge(self::$defaultConfig, $config); $c =& self::$config; // shorthand $c->STATICPATH = $ROOT . '/' . $c->STATICPATH; //prepend }
<?php /* You probably want to use this file literally, but as a guidance for your own template.php file. * Just take what you need. */ require_once 'inc/common.inc.php'; require_once 'inc/Statics.php'; require_once 'inc/Cache.php'; require_once 'inc/DirList.class.php'; $SLIDESHOWSIZE = 1280; Statics::config(array('STATICPATH' => '/static1234/', 'REWRITE' => false)); Cache::config(array('CACHEPATH' => '/_cache/', 'CACHEURL' => '/cache/', 'BROKENPATH' => '/static1234/icon/broken.png')); $d = new DirList(array('ICONPATH' => '/static1234/icon/', 'ICONURL' => '/static/icon/')); $bodyClasses = array('body'); // helpful for a body.mobile class to allow mobile-specific styling if (isMobile()) { $bodyClasses[] = 'mobile'; } // catch and deal with any download requests. call this before any ensure-Functions $d->checkDownload(); // lazy 'ensure' Functions ==> call before any output (i.e. header), to allow for redirect (in ensureThumbs) $d->ensureThumbs(array(32, 128, $SLIDESHOWSIZE)); $d->ensureMetadata(); ?> <!DOCTYPE HTML> <html lang="de-DE"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo implode(' | ', $d->path); ?> </title>