SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | - | |
2 | + | |
3 | - | include "header.php"; |
3 | + | $page_set = false; |
4 | - | |
4 | + | if(isset($_GET['page'])) { |
5 | - | $category_set = false; |
5 | + | $page = $_GET['page']; |
6 | - | if(isset($_GET['gallery'])) { |
6 | + | page_set = true; |
7 | - | $category_set = true; |
7 | + | } |
8 | - | $category = $_GET['gallery']; |
8 | + | |
9 | - | } |
9 | + | $gallery_set = false; |
10 | - | |
10 | + | if(isset($_GET['gallery'])) { |
11 | - | $file_path = "gallery/{$gallery}.php"; |
11 | + | $gallery = $_GET['gallery']; |
12 | - | if($category_set && file_exists($file_path)) { |
12 | + | $gallery_set = true; |
13 | - | include($file_path); |
13 | + | } |
14 | - | } else { |
14 | + | |
15 | - | include("home.php"); |
15 | + | include("header.php"); |
16 | - | } |
16 | + | |
17 | if($page_set) { | |
18 | switch($page) { | |
19 | - | include "gallery.php"; |
19 | + | case "gallery": |
20 | - | include "footer.php"; |
20 | + | $gallery_path = "/path/to/galleries/{$gallery}.php"; |
21 | if($gallery_set && file_exists($gallery_path)) { | |
22 | include($gallery_path); | |
23 | } else { | |
24 | // include default gallery here | |
25 | } | |
26 | break; | |
27 | default: | |
28 | $page_path = "/path/to/pages/{$page}.php"; | |
29 | if(file_exists($page_set)) { | |
30 | include($page_path); | |
31 | } else { | |
32 | // include home content here | |
33 | } | |
34 | break; | |
35 | } | |
36 | } else { | |
37 | // include home content here | |
38 | } | |
39 | ||
40 | include("footer.php"); | |
41 | ||
42 | ?> |