• 26-11-2010, 17:59:39
    #10
    zaten ilk verdiğim kod bunu yapmıyormuydu sen 100x100 istiyorsan genişliği uzunluğuyla aynı olan şunu dene

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>DragDropCart - Photo Upload</title>
    </head>
    
    <body>
    
    <?php
    
    	include('../includes/config.php');
    	include('includes/functions.php');
    
    	if($_FILES['productimage']['name'] != "") {
    		$sourcename = "source_".$_FILES['productimage']['name'];
    		move_uploaded_file($_FILES['productimage']['tmp_name'], getOptionValue('ddcartpath')."productimages/".$sourcename);
    
    		//create regular sized copy
    		$srcImg = imagecreatefromjpeg(getOptionValue('ddcartpath')."productimages/".$sourcename);
    		
    		imagejpeg($srcImg, getOptionValue('ddcartpath')."productimages/"."reg_".$_FILES['productimage']['name']);
    		
    		//create thumb sized copy
    		$srcImg = imagecreatefromjpeg(getOptionValue('ddcartpath')."productimages/".$sourcename);
    		$origWidth = imagesx($srcImg);
    		$origHeight = imagesy($srcImg);
    		
    		$ratio = 100 / $origWidth; // 300 is width
    		#$thumbHeight = $origHeight * $ratio;
    		$thumbHeight = 100;
    		$thumbImg = imagecreatetruecolor(100, $thumbHeight);
    		fastimagecopyresampled($thumbImg, $srcImg, 0, 0, 0, 0, 100, $thumbHeight, $origWidth, $origHeight); //300 is width
    		
    		imagejpeg($thumbImg, getOptionValue('ddcartpath')."productimages/"."thumb_".$_FILES['productimage']['name']);
    		
    		$imgdivname = time();
    		
    		?>
            <script type="text/javascript">
    			window.opener.imageAdd('<?php echo $_FILES['productimage']['name']; ?>', '<?php echo $imgdivname; ?>');
    		</script>
            
            Image uploaded. <a href="photoupload.php">Upload another image.</a>
            <?php
    	} else {
    
    ?>
    
    
    	<p><strong>Important Note:</strong> Make sure that your images have unique filenames. Uploading an image that has the same filename as an image already in the system will cause it to be overwritten!</p>
    
    	<form method="post" action="photoupload.php" enctype="multipart/form-data">
    		Image File: <input type="file" name="productimage" /> <input type="submit" value="Upload" />
        </form>
        
    <?php
    	} ?>
    
    </body>
    </html>
  • 26-11-2010, 18:36:16
    #11
    Üyeliği durduruldu
    en son verdiğiniz kod anasayfayı thum yaptı ama detay sayfasınıda thumb yaptı hocam

    anasayfa küçük resim olucak - detay sayfası büyük resim (orjinal boyut) olucak

    çok uğraştırdım ama kusra bakmayın
  • 26-11-2010, 18:39:42
    #12
    sana öyle geliyor :S tıklayınca büyük resim açılıyor işte

    http://www.5tl.org/productdetail.php?product=73
  • 26-11-2010, 19:08:30
    #13
    Üyeliği durduruldu
    Tontonq adlı üyeden alıntı: mesajı görüntüle
    sana öyle geliyor :S tıklayınca büyük resim açılıyor işte

    http://www.5tl.org/productdetail.php?product=73
    tıkladığında zaten büyük resim açılıyor hocam scriptte var o ben tıklamadan büyük gözükmesini istiyorum.
  • 26-11-2010, 19:24:10
    #14
    Valla hocam sopa isteyen çocuklar gibisiniz
    productdetail.php yi editleyin o zaman büyük resmi çağırsın küçüğü değil upload ile olan ilgisi nedir bunun