-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.php
76 lines (61 loc) · 1.74 KB
/
check.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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>Thumbnail checker</title>
</head>
<body>
<p>
<?php
if (($handle = opendir('.'))) {
$list = array();
while ( !!($entry = readdir($handle) )) {
if (is_dir($entry) && $entry !== '..' && $entry !== '.' && $entry !== 'thumbs') {
$list[] = $entry;
}
}
sort($list);
echo "Galerien:<br>";
foreach ($list as $val) {
$val_html = htmlspecialchars($val);
echo " $val_html<br>";
}
closedir($handle);
} else {
echo "Fehler: Kann lokales Verzeichnis nicht auf Galerien durchsuchen<br>";
}
echo "<br>Teste Galerien auf fehlende Thumbnails...<br>";
foreach ($list as $gallery) {
$val_html = htmlspecialchars($gallery);
echo "<br>Teste $val_html:<br>";
if (($handle = opendir($gallery))) {
$files = array();
while ( !!($entry = readdir($handle) )) {
if (is_file("$gallery/$entry")) {
if (!file_exists("thumbs/$gallery/$entry")) {
$files[] = $entry;
}
}
}
sort($files);
foreach ($files as $val) {
if ($val === " .jpg" || $val === ".jpg") {
rename ("$gallery/$val", "$gallery/restored$val");
continue;
}
$val_html = htmlspecialchars($val);
echo " $val_html<br>";
}
closedir($handle);
} else {
echo " Fehler: Galerie existiert ploetzlich nicht mehr! Bitte den Verzeichnisbaum manuell ueberpruefen.<br>";
}
}
echo "<br>Fertig.<br>
Fehlende Thumbnails werden beim Ansehen einer Galerie automatisch erstellt,<br>
sofern moeglich. Bisher wird nur .jpg unterstuetzt. Andere Formate koennen<br>
oftmals nicht umgewandelt werden.<br>";
?>
</p>
</body>
</html>