-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
105 lines (80 loc) · 3.72 KB
/
Copy pathindex.php
File metadata and controls
105 lines (80 loc) · 3.72 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,700">
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="content/css/bootstrap.css" >
<title>Home page</title>
</head>
<body >
</body>
<!-- Optional JavaScript; choose one of the two! -->
<!-- Option 1: jQuery and Bootstrap Bundle (includes Popper) -->
<script src="content/js/jquery-3.5.1.min.js" ></script>
<script src="content/js/bootstrap.min.js" ></script>
<!-- Option 2: jQuery, Popper.js, and Bootstrap JS
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
-->
<div class="ml-4 pl-4 mt-2 pt-2">
<?php
error_reporting(E_ALL);
$ext = [
'css' => '<i class="fab fa-css3-alt"></i>',
'php' => '<i class="fab fa-php"></i>',
'pdf' => '<i class="far fa-file-pdf"></i>',
'zip' => '<i class="far fa-file-archive"></i>',
'rar' => '<i class="far fa-file-archive"></i>',
'jpg' => '<i class="fas fa-file-image"></i>',
'jpeg' => '<i class="fas fa-file-image"></i>',
'png' => '<i class="fas fa-file-image"></i>',
'css.map' => '<i class="fab fa-css3"></i>',
'js' => '<i class="fab fa-js-square"></i>',
'folder' => '<i class="fas fa-folder-open"></i>',
'other' => '<i class="fas fa-file-code"></i>',
'txt' => '<i class="fas fa-comment-dots"></i>',
];
function scan($dir, $tab) {
global $ext;
$d = opendir($dir);
while ( ($name = readdir($d)) !== false ){
if ($name == '.' or $name == '..' or $name == (stripos ($name, 'docker' ))
or $name == (stripos ($name, 'js' )) or $name == (stripos ($name, 'css' ))
or $name == (stripos ($name, '.git' ))
or $name == (stripos ($name, 'chatstorage' )) or $name == (stripos ($name, 'content' ))
or $name == (stripos ($name, '.idea' )) or $name == (stripos ($name, '.user.ini' )) ) continue;
$path = $dir . '/' . $name;
if (is_dir($path) ) {
echo "<b>{$tab} {$ext['folder']} {$name}</b><br>";
scan ($path, $tab . " " );
} else {
$path_parts = pathinfo($path);
if (isset($path_parts['extension'], $ext) )
echo "{$tab}{$ext[$path_parts['extension']]} <a target='_blank' href='/{$path}'> {$name}</a><br>";
else {
echo "{$tab}{$ext['other']}<a target='_blank' href='/{$path}'> {$name}</a><br>";
}
}
}
closedir($d);
}
scan('./' , '');
?>
<style>
a {
text-decoration: none;
}
a:link {
color:#0c5460; /* Цвет ссылок */
padding: 2px; /* Поля вокруг текста */
}
a:hover {
color: #17a2b8; /* Цвет ссылки */
}
body {background: url(/img/64.jpg);}
</style>