• 25-11-2010, 14:18:58
    #1
    Bir çok tasarımda küçük resimler için can kurtaran olan timthumb script kullanıyor fakat bu scriptin kullanıldığı tasarımlarda resimler tasarımın kullanıldığı sunucuya yüklenmez ise resimler görüntülenmiyor

    bu sıralar yeni bir wordpress teması ile uğraşıyorum timthumb kullanacağım için yeni sürüme göz attım farklı sitelerden resim çekip görüntüleme özelliği eklenmiş denedim sorunsuz çalışıyor.

    öncelikle son sürümü buradan indirin timthumb.php dosyasında satır 24-30 arasındaki site listesine upload için kullandığınız resim sitelerinin adresini ekleyin (http://www olmadan)

    $allowedSites = array (
    	'flickr.com',
    	'picasa.com',
    	'blogger.com',
    	'wordpress.com',
    	'img.youtube.com',
    );
    sonra cache klasörünün olduğu yere birde "temp" adında bir klasör oluşturun yazma izinlerini 777 yapın her hangi bir hata yapılmadıysa artık dış sitelerdeki resimlerde sorunsuz görüntülenecek
  • 25-11-2010, 18:38:34
    #2
    Üyeliği durduruldu
    bandwith sorunu olan siteler can simidi gibi oldu bu bilgi,
    tesekkurler
  • 27-11-2010, 02:02:08
    #3
    Temada timthumb scripti var fakat dış sunucudaki resimlerin görünebilmesi şeklinde kodlanmamış galiba söylediğiniz gibi yaptım görünmedi ufak resim..


    Functions daki kodlar

    # Get image attachment (sizes: thumbnail, medium, full)
    function get_thumbnail($postid=0, $size='full') {
    	if ($postid<1) 
    	$postid = get_the_ID();
    	$thumb = get_post_meta($postid, "thumb", TRUE); // Declare the custom field for the image
    	if ($thumb != null or $thumb != '') {
    		echo $thumb; 
    	}
    	elseif ($images = get_children(array(
    		'post_parent' => $postid,
    		'post_type' => 'attachment',
    		'numberposts' => '1',
    		'post_mime_type' => 'image', )))
    		foreach($images as $image) {
    			$thumbnail=wp_get_attachment_image_src($image->ID, $size);
    			?>
    <?php echo $thumbnail[0]; ?>
    <?php
    		}
    	else {
    		echo get_bloginfo ( 'stylesheet_directory' );
    		echo '/images/image-pending.gif';
    	}
    	
    }
    
    # Automatically display/resize thumbnail
    function tj_thumbnail($width, $height) {
    ?>
    
    <a href="<?php the_permalink() ?>" rel="bookmark"> <img src="<?php bloginfo('template_directory'); ?>/includes/timthumb.php?src=<?php get_thumbnail($post->ID, 'full'); ?>&amp;h=<?php echo get_theme_mod($height); ?>&amp;w=<?php echo get_theme_mod($width); ?>&amp;zc=1" alt="<?php the_title(); ?>" /> </a>
    <?php
    }
  • 27-11-2010, 15:11:06
    #4
    hocam timthumb scripti yenisi ile değiştirip resim yüklediğiniz siteyi scripte eklediyseniz görünmesi lazım

    bu arada temp klasörünü oluşturup chmod izinlerini 777 yapmanız lazım
  • 27-11-2010, 17:13:53
    #5
    gevv adlı üyeden alıntı: mesajı görüntüle
    hocam timthumb scripti yenisi ile değiştirip resim yüklediğiniz siteyi scripte eklediyseniz görünmesi lazım

    bu arada temp klasörünü oluşturup chmod izinlerini 777 yapmanız lazım
    harfi harfine uyguladım fakat görünmüyor resimler... imzamdaki blog
  • 27-11-2010, 18:59:15
    #6
    peki normal şekilde yani resimi kendi sunucuza yüklediğinizde ne oluyor ?
  • 27-11-2010, 19:03:44
    #7
    site'de hem kendi sunucum'da hemde imageshack.us'den resimler mevcut.

    kendi sunucumda olan resimleri thumb olarak gösteriyor. konudaki ilk resim'i çekiyor.

    fakat imageshack.us'deki resimler'de sonuç yok.

    timthumb.php'ye aşağıdaki gibi ekledim.

    'flickr.com',
    	'picasa.com',
    	'blogger.com',
    	'wordpress.com',
    	'imageshack.us',
    belki sorun imageshack'den dir diye diğer sitelerden de yükledim sonuç yok..
  • 27-11-2010, 19:26:17
    #8
    hocam imageshack ve diğer resim yükleme sitelerinin bir çoğu resimleri farklı sunucularda tutuyor

    img98.imageshack.us gibi yüklediğiniz resimlerin adresine bakın onları ekleyin

    mesela ben bir resim yükledim

    http://img98.imageshack.us/img98/5017/bingikonu.png
    olarak göründü yani scripte eklenecek adres: img98.imageshack.us olacak img99, img97 de vardır belki dediğim gibi yüklediğiniz resimlerin adresini kontrol edin
  • 27-11-2010, 19:34:18
    #9
    Resimleri kontrol ettim img100, 200,250 gibi sürekli değişik. imageshack den sorun olsa diğer resim sitelerinide denedim. timthumb.php ile tüm işlemler doğru şekilde olduktan sonra functions.php'de ki işlemler fark etmiyor mu?.

    başka bir tema mevcut elimde functions'da sadece bulunan kod.

    function resimgoster() {
    
     global $post, $posts;
    
     $resimbir = '';
    
     ob_start();
    
     ob_end_clean();
    
     $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
    
     $resimbir = $matches [1] [0];
    
     if(empty($resimbir)){ //Eger resim eklememisseniz
    
     $resimbir = "http://www.site.biz/wp-content/themes/images/images/no.gif";
    
     }
    
     return $resimbir;
    
    }
    bu kod ile hangi siteden resim yüklesek fark etmiyor ve hepsini thumb olarak gösteriyor bunuda yeni temaya uyarlayamadım