-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
37 lines (37 loc) · 823 Bytes
/
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
<html>
<head>
<title>Humble Stats</title>
<meta http-equiv="refresh" content="300; URL=.">
<style>
.stats {
text-align: center;
}
.footer {
text-align: center;
}
</style>
</head>
<body>
<?php
$files = array();
$dir = new DirectoryIterator(dirname(__FILE__));
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot() && strrpos($fileinfo->getFilename(), ".png", -4)) {
$files[$fileinfo->getMTime()][] = $fileinfo->getFilename();
}
}
krsort($files);
$files = call_user_func_array('array_merge', $files);
foreach ($files as $filename) {
?>
<div class="stats">
<img src="<?php echo $filename ?>" />
</div>
<?php
}
?>
<div class="footer">
<span>Source on <a href="https://github.com/matthias-g/humble-stats">GitHub</a></span>
</div>
</body>
</html>