• 07-04-2010, 00:47:22
    #1
    Sanırım Açlık ve Uyku Başıma Vurdu

    Soru Gayet Basit foreach ile 0 dan 10 kadar sayı yazdırmam lazım yani örnek olarak

    <div id="manset_0"
    <div id="manset_1"
    <div id="manset_2"

    Şeklinde Kodud Aşşağıda Veriyorum Umarı Yardım Eden Çıkar
    function HaberManset(){
    	global $db,$site;
    	
    	$Sorgu = $db->get_results("SELECT * FROM haber WHERE manset = 'evet' ORDER BY 'id' limit 10");
    
    		foreach($Sorgu as $Manset){
    
    				$Veri .= '<div id="manset_0" class="yatay_manset" style="width:435px; height: 250px; position: relative;">
    
    								<a target="_self" href="/Gundem/2010/04/06/7_subay_cezaevinde"><img src="'.$site.'/Resimler/Haber/'.$Manset->resim.'" width="435" height="250" alt="" title="'.$Manset->title.'" onmouseover="manset_degistir('.$b.');" onmouseout="manset_degistir(-1);" /></a>
    								<div style="position: absolute; z-index: 99; bottom: 0px; left: 0; height: 40px; width:435px; text-align: left;">
    									<div style="color: #ffffff; text-align: left; font-family: Tahoma; font-size: 20px; font-weight: bold; margin-left: 10px; margin-top: 8px; line-height:18pt">'.$Manset->baslik.'</div>
    								</div>
    								<div class="transparan" style="position: absolute; bottom: 0px; left: 0; background-color: #000000; height: 40px; width:435px; text-align: left;">
    									<div style="color: #ffffff; text-align: left; font-family: Tahoma; font-size: 20px; font-weight: bold; margin-left: 10px; margin-top: 8px;"></div>
    								</div>';
    						
    			}
    		
    	return $Veri;
    }
  • 07-04-2010, 00:52:02
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    function HaberManset(){
        global $db,$site;
        
        $Sorgu = $db->get_results("SELECT * FROM haber WHERE manset = 'evet' ORDER BY 'id' limit 10");
    	$sayi = 1;
    	foreach($Sorgu as $Manset){
    		$sayi++;
    		if($sayi > 10)
    		{
    			$sayi = 1;
    		}
    
    		$Veri .= '<div id="manset_', $sayi, '" class="yatay_manset" style="width:435px; height: 250px; position: relative;">
    								<a target="_self" href="/Gundem/2010/04/06/7_subay_cezaevinde"><img src="'.$site.'/Resimler/Haber/'.$Manset->resim.'" width="435" height="250" alt="" title="'.$Manset->title.'" onmouseover="manset_degistir('.$b.');" onmouseout="manset_degistir(-1);" /></a>
                                    <div style="position: absolute; z-index: 99; bottom: 0px; left: 0; height: 40px; width:435px; text-align: left;">
                                        <div style="color: #ffffff; text-align: left; font-family: Tahoma; font-size: 20px; font-weight: bold; margin-left: 10px; margin-top: 8px; line-height:18pt">'.$Manset->baslik.'</div>
                                    </div>
                                    <div class="transparan" style="position: absolute; bottom: 0px; left: 0; background-color: #000000; height: 40px; width:435px; text-align: left;">
                                        <div style="color: #ffffff; text-align: left; font-family: Tahoma; font-size: 20px; font-weight: bold; margin-left: 10px; margin-top: 8px;"></div>
                                    </div>
    				</div>';
                }
        return $Veri;
    }
    İlk divi kapatmamışsınız. Ben kapattım...
  • 07-04-2010, 00:59:20
    #3
    Eyvallah kardeş Terazinin Tozunu Aldım Yanlız Anlamadığım Aynı Zamazingoyu Bende Yaptım Neden Olmadı Bilmiyom Keramet Senin Eldeymiş
  • 07-04-2010, 01:24:43
    #4
    hehe. İlk $sayi = 1; olan ifadeyi büyük ihtimalle foreach'ın içinde kullanmıştırsın. o nedenle olmamıştır. Neyse, teşekkür ederim. İyi geceler...