streaming-website/index.php

116 lines
2 KiB
PHP
Raw Normal View History

2014-10-01 08:33:00 +00:00
<?php
2015-03-07 16:58:07 +00:00
require_once('config.php');
require_once('lib/PhpTemplate.php');
require_once('lib/helper.php');
$route = @$_GET['route'];
$route = rtrim($route, '/');
$GLOBALS['ROUTE'] = $route;
2014-10-01 08:33:00 +00:00
2015-03-07 16:58:07 +00:00
$GLOBALS['tpl'] = new PhpTemplate('template/page.phtml');
$GLOBALS['tpl']->set(array(
'baseurl' => baseurl(),
'assemblies' => './template/assemblies/',
));
if($route == '')
{
2015-03-07 16:58:07 +00:00
include('view/overview.php');
}
2015-03-01 15:16:18 +00:00
else if(preg_match('@^about$@', $route, $m))
{
2015-03-07 16:58:07 +00:00
include('view/about.php');
2015-03-01 15:16:18 +00:00
}
else if(preg_match('@^program.json$@', $route, $m))
{
2015-03-02 06:35:29 +00:00
if(!has('SCHEDULE'))
2015-03-07 16:58:07 +00:00
return include('view/404.php');
2015-03-02 06:35:29 +00:00
2015-03-07 16:58:07 +00:00
include('view/program-json.php');
2015-03-01 15:16:18 +00:00
}
else if(preg_match('@^feedback$@', $route, $m))
{
2015-03-02 06:35:29 +00:00
if(!has('FEEDBACK'))
2015-03-07 16:58:07 +00:00
return include('view/404.php');
2015-03-02 06:35:29 +00:00
2015-03-07 16:58:07 +00:00
include('view/feedback.php');
2015-03-01 15:16:18 +00:00
}
else if(preg_match('@^feedback/read$@', $route, $m))
{
2015-03-02 06:35:29 +00:00
if(!has('FEEDBACK'))
2015-03-07 16:58:07 +00:00
return include('view/404.php');
2015-03-02 06:35:29 +00:00
2015-03-07 16:58:07 +00:00
include('view/feedback-read.php');
2015-03-01 15:16:18 +00:00
}
else if(preg_match('@^relive/([0-9]+)$@', $route, $m))
{
2015-03-02 06:35:29 +00:00
if(!has('OVERVIEW.RELIVE_JSON'))
2015-03-07 16:58:07 +00:00
return include('view/404.php');
2015-03-02 06:35:29 +00:00
2015-03-01 15:16:18 +00:00
$_GET = array(
'id' => $m[1],
);
2015-03-07 16:58:07 +00:00
include('view/relive-player.php');
2015-03-01 15:16:18 +00:00
}
else if(preg_match('@^relive$@', $route, $m))
{
2015-03-02 06:35:29 +00:00
if(!has('OVERVIEW.RELIVE_JSON'))
2015-03-07 16:58:07 +00:00
return include('view/404.php');
2015-03-02 06:35:29 +00:00
2015-03-07 16:58:07 +00:00
include('view/relive.php');
2015-03-01 15:16:18 +00:00
}
else if(preg_match('@^([^/]+)$@', $route, $m))
{
$_GET = array(
'room' => $m[1],
2015-02-28 18:12:27 +00:00
'selection' => '',
'language' => 'native',
);
2015-03-07 16:58:07 +00:00
include('view/room.php');
}
else if(preg_match('@^([^/]+)/translated$@', $route, $m))
{
$_GET = array(
'room' => $m[1],
2015-02-28 18:12:27 +00:00
'selection' => '',
'language' => 'translated',
);
2015-03-07 16:58:07 +00:00
include('view/room.php');
}
2015-02-27 16:21:51 +00:00
else if(preg_match('@^([^/]+)/(sd|audio|slides)$@', $route, $m))
{
$_GET = array(
'room' => $m[1],
2015-02-27 16:21:51 +00:00
'selection' => $m[2],
'language' => 'native',
);
2015-03-07 16:58:07 +00:00
include('view/room.php');
}
2015-02-27 16:21:51 +00:00
else if(preg_match('@^([^/]+)/(sd|audio|slides)/translated$@', $route, $m))
{
$_GET = array(
'room' => $m[1],
2015-02-27 16:21:51 +00:00
'selection' => $m[2],
'language' => 'translated',
);
2015-03-07 16:58:07 +00:00
include('view/room.php');
}
else
{
2015-03-07 16:58:07 +00:00
include('view/404.php');
}