-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.php
47 lines (37 loc) · 1.36 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
loader_import ('sitegallery.Functions');
if (session_admin ()) {
$acl = session_allowed_sql ();
} else {
$acl = session_approved_sql ();
}
$res = db_fetch_array (
'select name, display_title, extension, description from sitellite_filesystem where path = ? and ' . $acl . ' order by name asc',
$parameters['path']
);
if ($parameters['title'] && $box['context'] == 'action') {
page_title ($parameters['title']);
}
$valid = appconf ('valid');
foreach (array_keys ($res) as $k) {
if (! in_array (strtolower ($res[$k]->extension), $valid)) {
unset ($res[$k]);
continue;
}
$res[$k]->src = sitegallery_get_thumbnail ($parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension, true);
//list ($res[$k]->width, $res[$k]->height) = getimagesize ('inc/data/' . $parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension);
}
template_simple_register ('results', $res);
page_add_script (site_prefix () . '/inc/app/sitegallery/js/prototype.js');
page_add_script (site_prefix () . '/inc/app/sitegallery/js/scriptaculous.js?load=effects');
page_add_script (site_prefix () . '/inc/app/sitegallery/js/lightbox.js');
page_add_style (site_prefix () . '/inc/app/sitegallery/html/lightbox.css');
echo template_simple (
'gallery.spt',
array (
'path' => $parameters['path'],
'total' => count ($res) + 1,
'desc' => $parameters['descriptions'],
)
);
?>