update poster service
This commit is contained in:
parent
6198a0732c
commit
cf8e33ec65
6 changed files with 36 additions and 14 deletions
25
js.php
Normal file
25
js.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?
|
||||
|
||||
$i = 0;
|
||||
$path = 'posters/0xdb.org';
|
||||
$dir = dir($path);
|
||||
while ($file = $dir->read()) {
|
||||
if (substr($file, 0, 1) != '.') {
|
||||
$subdir = dir($path . '/' . $file);
|
||||
while ($subfile = $subdir->read()) {
|
||||
if (substr($subfile, 0, 1) != '.') {
|
||||
$url = "http://services.0xdb.org/posters/$path/$file/$subfile";
|
||||
$size = getimagesize($url);
|
||||
echo "poster[$i] = [];\n";
|
||||
echo "poster[$i]['url'] = '$url';\n";
|
||||
echo "poster[$i]['width'] = " . $size[0] . ";\n";
|
||||
echo "poster[$i]['height'] = " . $size[1] . ";\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rnd = floor(mt_rand() / mt_getrandmax() * count($poster));
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue