/
index.php
47 lines (40 loc) · 1.31 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Photo Promenade -- a tiny PHP photo gallery
*
* @version 1.3
* @link http://www.naehrstoff.ch/code/photo-promenade
*
* @author Peter Gassner <peter@naehrstoff.ch>
* @author Benjamin Wiederkehr <benjamin.wiederkehr@artillery.ch>
* @author Carlo Joerges <carlo.joerges@gmail.com>
*
* @copyright Copyright 2008 Peter Gassner
* @license http://www.opensource.org/licenses/gpl-3.0.html GPLv3
*/
require_once('./system/spyc.php');
require_once('./system/pclzip.php');
require_once('./system/image.php');
require_once('./system/system.php');
require_once('./system/application.php');
require_once('./system/helpers.php');
/* Define Filesystem Anchors
------------------------------------------------ */
define('WEB_ROOT', dirname($_SERVER['PHP_SELF'])).'/';
define('ALBUMS_ROOT', dirname(__FILE__).'/albums/');
/* Load Configuration
------------------------------------------------ */
$params = Spyc::YAMLLoad('albums/config.yml');
define('USE_MOD_REWRITE', $params['nice_urls']);
/* Start Application
------------------------------------------------ */
if (array_key_exists('q', $_GET)) {
$args = split('/', $_GET['q']);
switch ($args[0]) {
case 'album':
return (isset($args[1])) ? album($args[1]) : index();
case 'rss':
return (isset($args[1])) ? rss($args[1]) : rss();
}
}
return index();