diff --git a/cfg/conf.sample.php b/cfg/conf.sample.php index d2d285de..8485899d 100644 --- a/cfg/conf.sample.php +++ b/cfg/conf.sample.php @@ -134,6 +134,10 @@ limit = 10 ; directory to store the traffic limits in dir = PATH "data" +; prefix that appends on location of static files like js and css. +; useful for serving on subdirectory behind reverse proxy. +staticurlprefix = "" + [purge] ; minimum time limit between two purgings of expired pastes, it is only ; triggered when pastes are created diff --git a/lib/Configuration.php b/lib/Configuration.php index 06edf68b..8279af83 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -77,9 +77,10 @@ class Configuration 'markdown' => 'Markdown', ), 'traffic' => array( - 'limit' => 10, - 'header' => null, - 'dir' => 'data', + 'limit' => 10, + 'header' => null, + 'dir' => 'data', + 'staticurlprefix' => '', ), 'purge' => array( 'limit' => 300, diff --git a/lib/Controller.php b/lib/Controller.php index 21a27b27..fa498f76 100644 --- a/lib/Controller.php +++ b/lib/Controller.php @@ -388,6 +388,7 @@ class Controller $page->assign('HTTPWARNING', $this->_conf->getKey('httpwarning')); $page->assign('HTTPSLINK', 'https://' . $this->_request->getHost() . $this->_request->getRequestUri()); $page->assign('COMPRESSION', $this->_conf->getKey('compression')); + $page->assign('STATICURLPREFIX', $this->_conf->getKey('staticurlprefix', 'traffic')); $page->draw($this->_conf->getKey('template')); } diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 0b2d95a3..f8e7954d 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -15,82 +15,82 @@ $isPage = substr($template, -5) === '-page'; - + - + - + - + - + - + - - + + - + - + - - - - + + + + - + - + - - - + + + - - - + + + - - + + - + - + @@ -179,7 +179,7 @@ endif; - <?php echo I18n::_($NAME); ?> + <?php echo I18n::_($NAME); ?>