/Web/image.php |
---|
0,0 → 1,48 |
<?php |
header("Content-type: image/jpeg"); |
function file_type($file){ |
$path_chunks = explode("/", $file); |
$thefile = $path_chunks[count($path_chunks) - 1]; |
$dotpos = strrpos($thefile, "."); |
return strtolower(substr($thefile, $dotpos + 1)); |
} |
$path = "/var/www/Modules/".$HTTP_GET_VARS["pth"]."/"; |
$filename = $HTTP_GET_VARS["fname"]."_Small.jpg"; |
// $thumbnail = thumbnail_name($filename); |
$extension = file_type($filename); |
$remove_thumb = false; |
if(in_array($extension, array('png', 'gif', 'jpg', 'jpeg'))){ |
if(!$img_size = getimagesize($path.$filename)){ |
$remove_thumb = true; |
} |
if($extension == 'gif'){ |
if(!$image = imagecreatefromgif($path.$filename)){ |
$remove_thumb = true; |
} |
}elseif($extension == 'png'){ |
if(!$image = imagecreatefrompng($path.$filename)){ |
$remove_thumb = true; |
} |
}elseif($extension == 'jpg' || $extension == 'jpeg'){ |
if(!$image = imagecreatefromjpeg($path.$filename)){ |
$remove_thumb = true; |
} |
} |
if($remove_thumb == false){ |
$black = ImageColorAllocate($thumb, 0, 0, 0); |
ImageString ($thumb, 3, $thumb_width-80, $thumb_height-15, "www.mlab.cz", $black); |
imagejpeg($image); |
} |
}else{ |
$remove_thumb = true; |
} |
} |
?> |
/Web/modules.inc.php |
---|
11,8 → 11,11 |
echo "<td><img src=\"".$www.$folder.'/'.$HTTP_GET_VARS["file"]."/".$soubor1."/".$img."\"></td>\n"; |
} else { echo "<td><img src=\"http://www.mlab.cz/Web/PIC/nopicture2.jpg\"></td>\n"; }*/ |
echo "<td><img src=\"thumb.php?pth=".$HTTP_GET_VARS["file"]."/".$soubor1."&fname=".$soubor1."\"></td>\n"; |
if (file_exists($path.$folder.'/'.$soubor."/".$img)) { echo "<td><A HREF=\"thumb.php?pth=".$HTTP_GET_VARS["file"]."/".$soubor1."&fname=".$soubor1."\" TARGET=\"_blank\"><img src=\"thumb.php?pth=".$HTTP_GET_VARS["file"]."/".$soubor1."&fname=".$soubor1."\" border=\"0\"></a></td>\n"; |
} else { echo "<td><img src=\"thumb.php?pth=".$HTTP_GET_VARS["file"]."/".$soubor1."&fname=".$soubor1."\"></td>\n"; } |
// echo "<td><img src=\"thumb.php?pth=".$HTTP_GET_VARS["file"]."/".$soubor1."&fname=".$soubor1."\"></td>\n"; |
if (file_exists($path.$folder."/".$HTTP_GET_VARS["file"]."/".$soubor1."/DOC/HTML/".$soubor1.".".$lang.".html")) { |
echo "<td><a href=\"".$www.$folder."/".$HTTP_GET_VARS["file"]."/".$soubor1."/DOC/HTML/".$soubor1.".".$lang.".html\">".$soubor1."</a></td>\n"; |
} else { echo "<td>".$soubor."<b>".$soubor1."</b></td>\n"; } |
/Web/modules.php |
---|
119,7 → 119,8 |
echo "<tr>"; |
/* if (file_exists($path.$folder.'/'.$soubor."/".$img)) { echo "<td><img src=\"".$www.$folder.'/'.$soubor."/".$img."\"></td>\n"; } |
else { echo "<td><img src=\"http://www.mlab.cz/Web/PIC/nopicture2.jpg\"></td>\n"; }*/ |
echo "<td><img src=\"thumb.php?pth=".$soubor."&fname=".$soubor."\"></td>\n"; |
if (file_exists($path.$folder.'/'.$soubor."/".$img)) { echo "<td><A HREF=\"thumb.php?pth=".$soubor."&fname=".$soubor."\" TARGET=\"_blank\"><img src=\"thumb.php?pth=".$soubor."&fname=".$soubor."\" border=\"0\"></a></td>\n"; |
} else { echo "<td><img src=\"thumb.php?pth=".$soubor."&fname=".$soubor."\"></td>\n"; } |
if (file_exists($path.$folder."/".$soubor."/DOC/HTML/".$soubor.".".$lang.".html")) { |
echo "<td><b><a href=\"".$www.$folder."/".$soubor."/DOC/HTML/".$soubor.".".$lang.".html\">".$soubor."</a></b></td>\n"; |
} else { echo "<td><b>".$soubor."</b></td>\n"; } |