add posters
This commit is contained in:
commit
6198a0732c
15 changed files with 21085 additions and 0 deletions
50
admin.php
Executable file
50
admin.php
Executable file
|
|
@ -0,0 +1,50 @@
|
|||
<?
|
||||
|
||||
include('php/library.php');
|
||||
|
||||
echo '<tt>';
|
||||
|
||||
$poster = $_GET['poster'];
|
||||
$kill = $_GET['kill'];
|
||||
|
||||
if ($poster) {
|
||||
echo '<img src="' . $poster . '" /><br />' . $poster . ' <a href="admin.php?kill=' . $poster . '">kill</a>';
|
||||
exit;
|
||||
}
|
||||
if ($kill) {
|
||||
rename($kill, substr($kill, 0, 27) . '_' . substr($kill, 27));
|
||||
echo $kill . ' killed.';
|
||||
exit;
|
||||
}
|
||||
|
||||
$path = 'posters/wikipedia.org';
|
||||
$list = crawlPath($path);
|
||||
|
||||
foreach ($list as $value) {
|
||||
if (strstr($value, '/_'))
|
||||
$signature[$value] = md5(file_get_contents($value));
|
||||
else if (strstr($value, '_'))
|
||||
unlink($value);
|
||||
|
||||
}
|
||||
|
||||
echo (count($list) - count($signature)) . ' posters<br /><br />';
|
||||
|
||||
sort($list);
|
||||
foreach ($list as $value) {
|
||||
if (!$signature[$value]) {
|
||||
if (in_array(md5(file_get_contents($value)), $signature)) {
|
||||
rename($value, substr($value, 0, 27) . '_' . substr($value, 27));
|
||||
// echo '<img src="' . substr($value, 0, 27) . '_' . substr($value, 27) . '" /><br />';
|
||||
}
|
||||
else {
|
||||
$pathinfo = pathinfo($value);
|
||||
$extension = $pathinfo['extension'];
|
||||
$imagesize = getimagesize($value);
|
||||
if ($extension == 'png' || $imagesize[0] >= $imagesize[1])
|
||||
echo '<img src="' . $value . '" /><br />' . $value . ' <a href="admin.php?poster=' . $value . '">kill</a><br /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue