diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 46 |
1 files changed, 23 insertions, 23 deletions
@@ -3,6 +3,7 @@ if(!ini_get('short_open_tag')) die('`short_open_tag = On` is required'); +require_once('config.php'); require_once('lib/helper.php'); require_once('lib/PhpTemplate.php'); @@ -29,6 +30,27 @@ try { $route = @$_GET['route']; $route = rtrim($route, '/'); + // generic template + $tpl = new PhpTemplate('template/page.phtml'); + $tpl->set(array( + 'baseurl' => forceslash(baseurl()), + 'route' => $route, + 'canonicalurl' => forceslash(baseurl()).forceslash($route), + 'assemblies' => 'template/assemblies/', + 'assets' => 'assets/', + + 'conference' => new GenericConference(), + )); + + if(startswith('//', @$GLOBALS['CONFIG']['BASEURL'])) + { + $tpl->set(array( + 'httpsurl' => forceslash(forceslash('https:'.$GLOBALS['CONFIG']['BASEURL']).@$GLOBALS['MANDATOR']).forceslash($route), + 'httpurl' => forceslash(forceslash('http:'. $GLOBALS['CONFIG']['BASEURL']).@$GLOBALS['MANDATOR']).forceslash($route), + )); + } + + // GLOBAL ROUTES if($route == 'gen/main.css') { @@ -43,19 +65,6 @@ try { exit; } - - // generic template - $tpl = new PhpTemplate('template/page.phtml'); - $tpl->set(array( - 'baseurl' => forceslash(baseurl()), - 'route' => $route, - 'canonicalurl' => forceslash(baseurl()).forceslash($route), - 'assemblies' => './template/assemblies/', - 'assets' => 'assets/', - - 'conference' => new GenericConference(), - )); - @list($mandator, $route) = explode('/', $route, 2); if(!$mandator) { @@ -109,12 +118,11 @@ catch(Exception $e) $GLOBALS['MANDATOR'] = $mandator; $conference = new Conference(); -$tpl = new PhpTemplate('template/page.phtml'); +// update template information $tpl->set(array( 'baseurl' => forceslash(baseurl()), 'route' => $route, 'canonicalurl' => forceslash(baseurl()).forceslash($route), - 'assemblies' => './template/assemblies/', 'assets' => '../assets/', 'conference' => $conference, @@ -122,14 +130,6 @@ $tpl->set(array( 'schedule' => new Schedule(), )); -if(startswith('//', @$GLOBALS['CONFIG']['BASEURL'])) -{ - $tpl->set(array( - 'httpsurl' => forceslash(forceslash('https:'.$GLOBALS['CONFIG']['BASEURL']).@$GLOBALS['MANDATOR']).forceslash($route), - 'httpurl' => forceslash(forceslash('http:'. $GLOBALS['CONFIG']['BASEURL']).@$GLOBALS['MANDATOR']).forceslash($route), - )); -} - ob_start(); try { |