[SHARE]One of the best lithuania community portal
Collapse
X
-
Originally posted by sladex View PostChmod all directory where is iploading photo. and chmod all txt files. 777Last edited by neostream; 05.01.10, 15:12.
Comment
-
Here is copy.php
<?php
header("Cache-Control: no-store, no-cache, must-revalidate");
include("MySQLconnect.php");
$id = trim(htmlspecialchars($_GET['id'],ENT_QUOTES));
$info = base64_decode($id);
$info = explode("|", $info);
$nuotrauka = "$info[0]";
$dydis = "$info[1]";
$vartotojas = "$info[2]";
$vartotojas = strtolower($vartotojas);
$dydis = strtolower($dydis);
$view = mysql_fetch_array(mysql_query("SELECT * FROM nuotraukos WHERE ID='$nuotrauka' and Vartotojas='$vartotojas'"));
$foto = $view["ID"];
$narys = $view["Vartotojas"];
$busena = $view["Busena"];
$formatas = $view["Formatas"];
$rotate = $view["Rotate"];
if(empty($rotate) or $rotate != "-90" and $rotate != "90" and $rotate != "180" and $rotate == "no") {
$rotate = "0"; }
else {
$rotate = "$rotate"; }
$failas = "nuotraukos/$narys/$foto.$formatas";
if(empty($nuotrauka) or empty($vartotojas) or $nuotrauka != "$foto") {
$image = "images/nerasta.gif";
$formatas = "gif"; $reklama = "0"; }
elseif($busena == "ban") {
$image = "images/ban.gif";
$formatas = "gif"; $reklama = "0"; }
elseif(!file_exists($failas)) {
$image = "images/nerasta.gif";
$formatas = "gif"; $reklama = "0"; }
else {
$image = "nuotraukos/$narys/$foto.$formatas";
$formatas = "$formatas"; $reklama = "1"; }
if($rotate == "90" or $rotate == "-90") {
list($height,$width) = getimagesize($image); }
else {
list($width,$height) = getimagesize($image); }
$max = "250";
if($width > $max) {
$procentai = $max*100/$width;
$first = floor(($width/100)*$procentai);
$second = floor(($height/100)*$procentai); }
else {
$first = "$width";
$second = "$height"; }
if($formatas == "jpg") {
header("Content-type: image/Jpeg"); }
elseif($formatas == "gif") {
header("Content-type: image/Gif"); }
elseif($formatas == "png") {
header("Content-type: image/Png"); }
$thumb = imagecreatetruecolor($first,$second);
if($formatas == "jpg") {
$source = imagecreatefromjpeg("$image"); }
elseif($formatas == "gif") {
$source = imagecreatefromgif("$image"); }
elseif($formatas == "png") {
$source = imagecreatefrompng("$image"); }
$source = imagerotate($source, $rotate, 0);
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $first, $second, $width, $height);
if($formatas == "jpg") {
imagejpeg($thumb); }
elseif($formatas == "gif") {
imagegif($thumb); }
elseif($formatas == "png") {
imagepng($thumb); }
imagedestroy($thumb);
?>OR JUST SEND PM
Comment
Comment