forked from michalc/PDW-File-Browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_images_large.php
66 lines (57 loc) · 2.32 KB
/
view_images_large.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
<?php
require_once('functions.php');
if(isset($_REQUEST["ajax"])){
$selectedpath = urldecode($_REQUEST["path"]);
if($selectedpath = checkpath($selectedpath, $uploadpath)){
$dirs = getDirTree(DOCUMENTROOT.$selectedpath, true, false);
} else {
die('0||'.translate("The folder path was tampered with!"));
}
} else {
$selectedpath = $uploadpath;
}
print '<ul id="large_images" class="files clear">' . "\n";
$htmlFiles = '';
$htmlFolders = '';
foreach($dirs as $key => $value){
if($value != "folder"){
if(strtolower($value) == "png" || strtolower($value) == "jpg" || strtolower($value) == "jpeg" || strtolower($value) == "gif" || strtolower($value) == "bmp"){
$htmlFiles .= sprintf(' <li>
<a href="%1$s" title="%2$s" class="image">
<span class="begin"></span>
<span class="filename">%2$s</span>
<span class="icon image"><img src="phpthumb/phpThumb.php?h=97&w=97&src=%4$s&far=1" /></span>
</a>
</li>' . "\n",
$selectedpath.$key,
$key,
$value,
urlencode($selectedpath.$key));
} else {
$htmlFiles .= sprintf(' <li>
<a href="%1$s" title="%2$s" class="file">
<span class="begin"></span>
<span class="filename">%2$s</span>
<span class="icon %3$s"></span>
</a>
</li>' . "\n",
$selectedpath.$key,
$key,
$value);
}
} else {
$htmlFolders .= sprintf(' <li>
<a href="%1$s" title="%2$s" class="folder">
<span class="begin"></span>
<span class="filename">%2$s</span>
<span class="icon folder"></span>
</a>
</li>' . "\n",
$selectedpath.$key."/",
$key);
}
}
print $htmlFolders;
print $htmlFiles;
print ' </ul>'."\n";
?>