Initial commit

This commit is contained in:
Péntek Sándor
2016-06-18 10:07:35 +02:00
commit 41c686945a
398 changed files with 36832 additions and 0 deletions

BIN
data/.DS_Store vendored Normal file

Binary file not shown.

69
data/imglist.json.php Normal file
View File

@ -0,0 +1,69 @@
<?php
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
$images = array();
function scan_dir($dir) {
$ignored = array('.', '..', '.svn', '.htaccess');
$files = array();
foreach (scandir($dir) as $file) {
if (in_array($file, $ignored)) continue;
$files[$file] = filemtime($dir . '/' . $file);
}
arsort($files);
$files = array_keys($files);
return ($files) ? $files : false;
}
function imagelist($dir)
{
global $images;
//$stuffs = scandir($dir);
$stuffs = scan_dir($dir);
for ($i = 0; $i < sizeof($stuffs); $i++)
{
$farr = explode('.', $stuffs[$i]);
if ($stuffs[$i] != '.' && $stuffs[$i] != '..' && $farr[0] != 'thumb')
if (is_dir($stuffs[$i]))
imagelist($dir.'/'.$stuffs[$i]);
elseif (in_array(end($farr), array('gif', 'png', 'jpg', 'jpeg')))
{
// PATHS
$outdir = '/data/'.ltrim($dir, './').'/';
$img = $dir.'/'.$stuffs[$i];
$thumb = $dir.'/thumb.'.$stuffs[$i];
// THUMBNAIL
if (!file_exists($thumb))
{
$cthumb = new Imagick($img);
$cthumb->cropThumbnailImage(260, 260);
$cthumb->writeImage($thumb);
$cthumb->destroy();
}
// ADD TO LIST
array_push($images, array(
'image' => $outdir.rawurlencode($stuffs[$i]),
'thumb' => $outdir.'thumb.'.$stuffs[$i],
'folder' => ltrim($dir, './')
));
}
}
}
imagelist('./uploads');
foreach(glob('./uploads/*', GLOB_ONLYDIR) as $dir)
imagelist($dir);
echo str_replace('\/', '/', json_encode($images));

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

0
data/imgs/index.html Normal file
View File

BIN
data/imgs/pixel.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
data/imgs/thumb.pixel.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
data/imgs/zuko_default.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

0
data/index.html Normal file
View File

BIN
data/profile_pics/.DS_Store vendored Normal file

Binary file not shown.

View File

0
data/tmp/index.html Normal file
View File

9
data/upload.php Normal file
View File

@ -0,0 +1,9 @@
<?php
if (isset($_FILES["upload"]) && $_FILES["upload"]["error"] < 1 && in_array($_FILES["upload"]["type"], explode(',', $_set['allowedPicTypes'])))
{
if (move_uploaded_file($_FILES["upload"]["tmp_name"], 'data/uploads/'.$_FILES["upload"]["name"]))
die($_locale['upload_successful']);
}
echo $_locale['upload_failed'];

BIN
data/uploads/.DS_Store vendored Normal file

Binary file not shown.

0
data/uploads/index.html Normal file
View File