/*
descripton:
Upload picures on your webspace and This file.
you need no modifikatons. upload and enjoy :D
ATTENTION this script kan make traffic :)
if this file modified or fucked up download here
http://www.mulank10.de/instant_gal/
reqired:
PHP 5.X
GD-Lib.
coder: Manuel Tausendfreund
version history:
1.0 final
1.1 IE bug fixing
2.0 folder-sub system, download button ;), grafic bugfixing :P
feel free to use :D
*/
error_reporting (16);
$row = 3; // row´s too show
$max = 200; //preview MAX pixel
if (isset($_GET['code'])){
header('Content-type: application/php');
header('Content-Disposition: attachment; filename="index.php"');
readfile("index.php");
die();
}
if (isset($_GET['Exifpic'])){
$master_folder = getcwd();
$a .= "/".$_GET['folder']."";
chdir($master_folder.$a);
header('Content-type: Image/JPG');
echo(exif_thumbnail($_GET['Exifpic']));
die();
}
if (isset($_GET['Exifdata'])){
$master_folder = getcwd();
$a .= "/".$_GET['folder']."";
chdir($master_folder.$a);
$exif = read_exif_data($_GET['Exifdata']);
echo "test2.jpg:
\n";
foreach ($exif as $key => $section) {
echo "$key.$name: $section
\n";
}
die();
}
if (isset($_GET['sub_graf'])){
$graf = imagecreate(18,15);
$gelb = imagecolorallocate($graf,248,244,94);
$black = imagecolorallocate($graf,0,0,0);
$white = imagecolorallocate($graf,255,255,255);
imagefill($graf,1,1,$white);
imagecolortransparent($graf,$white);
imagerectangle($graf,1,4,17,14,$black);
imagefilltoborder($graf,10,10,$black,$gelb);
imagerectangle($graf,1,1,7,4,$black);
imagefilltoborder($graf,2,2,$black,$gelb);
header('Content-type: Image/png');
imagepng($graf);
die();
}
ob_start();
?>
Instant GAL!
Instant GAL!
function bild_ausgabe ($pic){ // return view
if ($pic[0] > $pic[1]){
$percent = ($pic[1] / $pic[0]) * 100;
$new_height = round($percent * $GLOBALS['max'] / 100);
$new_width = $GLOBALS['max'];
}elseif ($pic[0] < $pic[1]){
$percent = ($pic[0] / $pic[1]) * 100;
$new_width = round($percent * $GLOBALS['max'] / 100);
$new_height = $GLOBALS['max'];
}else{
$new_height = $GLOBALS['max'];
$new_width = $GLOBALS['max'];
}
if (exif_thumbnail($pic['name']) == true){//exif addon
$bild = "\n\n";
$exif2 = "Exif-data: | klick |
\n";
$HTML .= "HTML: | \n' name='HTML'> |
\n";
$BBCODE .= "BB Code: | |
\n ";
} else {
$bild = "\n\n";
$HTML .= "HTML: | ' name='HTML'> |
\n";
$BBCODE .= "BB Code: | |
\n ";
}
//image table
$return .= $bild;
$return .= "";
$return .= "filename: | ".$pic['name']." |
\n";
$return .= "width: | ".$pic[0]." |
\n";
$return .= "height: | ".$pic[1]." |
\n";
$return .= "size: | ".size($pic['size'])." |
\n";
$return .= $HTML;
$return .= $BBCODE;
$return .= $exif2;
$return .= "
";
return $return;
}
function pic ($pic) {//calculating rows
if ($GLOBALS['loop'] <= 1){
print "\n\n".bild_ausgabe($pic)." | \n";
}elseif ($GLOBALS['row'] > $GLOBALS['loop']){
print "\n".bild_ausgabe($pic)." | \n";
}else{
print "\n".bild_ausgabe($pic)." | \n
\n";
$GLOBALS['loop'] = 0;
}
++$GLOBALS['loop'];
}
function size ($num){
if ($num >= 1024 && $num <= 1048576){
$return = $return = $num/1024 ;
$re_ex = " kb";
}elseif ($num >= 1048576 && $num <= 1073741824){
$return = $return = $num/1024/1024;
$re_ex = " mb";
}elseif ($num >= 1073741824){
$return = $return = $num/1024/1024/1024 ;
$re_ex = " gb";
}else {
$return = $num;
$re_ex = " byte";
}
$return = round($return,2);
$return .= $re_ex;
return $return;
}
function folder ($fold){//folder function
print "";
print "".$fold."";
print " |
";
}
function re_folder (){
if (isset($_GET['folder']) and ($GLOBALS['folder_sc'] == 0)){
$arry = explode("/",$_GET['folder']);
$count = count($arry);
$i_count = $count -2;
$count = 0;
while ($i_count > $count){
if (!isset($inside_while_folder)){
$new_folder_aa = "?folder=";
}
$new_folder_aa .= $arry[$count]."/";
$count++;
$inside_while_folder =1;
}
print "";
print "..";
print " |
";
$GLOBALS['folder_sc'] = 1;
}
}
$counter = 0;
$loop = 1;
$folder_sc = 0;
$uri_ex = (explode('/',$_SERVER['SCRIPT_NAME']));
$uri_ex_count = count($uri_ex);
$uri_ex_count = $uri_ex_count-2;
$int_uri_ex = 1;
while ($int_uri_ex <= $uri_ex_count){
$uri_new .= "/".$uri_ex[$int_uri_ex]."" ;
++$int_uri_ex;
}
$master_folder = getcwd();
$a .= "/".$_GET['folder']."";
$hier = dir($master_folder.$a);
$uri = "HTTP://".$_SERVER['HTTP_HOST'].$uri_new."/".$_GET['folder']."";
chdir($master_folder.$a);
while ($aa = $hier->read()){ //read out
if (is_dir($aa)){
if (!($aa != "." xor $aa != "..")){ //DIC to array
$verzeichniss[$aa] = $aa;
}
}else {// file to array
$img = getimagesize($aa);
if (isset($img[2])){
++$counter;
$inhalt[$counter] = $img;
$inhalt[$counter]['name'] = $aa;
$inhalt[$counter]['size'] = filesize($aa);
$totalsize =$totalsize + filesize($aa);
}
}
}
print "";
re_folder();
if (count($verzeichniss) != 0){//folder print
array_walk($verzeichniss,folder);
}
print "
";
if ($counter != 0){//Image print
print "";
array_walk($inhalt,pic);
print "
";
}else{
print "NO images in folder !!!
";
}
print "folder Size: ".size($totalsize)."";
print "
images in folder: ".$counter."";
chdir($master_folder);
print "
aktual Index.php size ".size(filesize("index.php"))."";
Print "
generate HTML Code: ".size(ob_get_length())." ";
ob_end_flush();
print "
Instant GAL! coded by Moppi ver:3.0E
NoDown ! "; // Download this script here";
?>