-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
83 lines (72 loc) · 2.93 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/*
* © 2014 Michael Demetriou
*
This file is part of viood.
viood is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
viood is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
*/
require_once './config.php';
require_once './functions.php';
require_once './Livethumb.class.php';
//require_once './averageColor.php';
if (strstr($_SERVER["HTTP_REFERER"],$base_url)===FALSE) $internal = false; else $internal=true;
$requested_path = str_replace($folder, "", $_SERVER['REQUEST_URI']);
$requested_path = urldecode($requested_path);
$requested_path_array = explode("/", $requested_path);
//remove the first empty entry
array_shift($requested_path_array);
//handle the different pages
if ($requested_path_array[0]=="imageviewer"){
$image = str_replace("imageviewer/", "", $requested_path);
include 'imageviewer.php';
//slideshow
} else if ($requested_path_array[0]=="slideshow"){
$goToImage = "";
$goToImageIndex = 0;
$counter = 0;
$requested_path = str_replace("/slideshow/", "", $requested_path);
if (!is_dir($pictureDir."/".$requested_path)) {
$goToImage = basename($requested_path);
$requested_path = str_replace($goToImage, "", $requested_path);
}
$path = $requested_path;
$array = recurse_dir($requested_path, $galleries, 1);
$galleryName = basename($requested_path);
// echo $requested_path; die;
include 'slideshow.php';
//showcase
} else if ($requested_path_array[0]=="showcase"){
$counter = 0;
$requested_path = str_replace("/showcase/", "", $requested_path);
$path = $requested_path;
$array = flatten(recurse_dir($requested_path, $galleries, 100, false, true));
shuffle($array);
$galleryName = basename($requested_path);
// echo $requested_path; die;
include 'showcase.php';
//image
} else if ($requested_path_array[0]=="image"){
$requested_path = str_replace("/image/", "", $requested_path);
$path = $requested_path;
include 'getimage.php';
//gallery
} else {
$galleryInfo = getGalleryInfo($pictureDir."/".$requested_path);
if ($galleryInfo["name"]!="") $galleryName = "- ".$galleryInfo["name"];
$array = recurse_dir($requested_path, $galleries, 1);
ksort($array);
$hasImages = hasImages($array);
include './gallery.php';
}
//styling
if ($square) $rect = ""; else $rect = "rect"; //Add a class to body if we want rectangular photos
if (!isset($title)) $title = "viood - qwazix's photo gallery";