• 19-05-2009, 17:41:52
    #1
    Alttaki kodu; çekilen verilerin 3 yanyana sonra alta geçebilecek şekilde olması için yardımcı olursanız sevinirim.

    <?php
    
    $limit = $this->config['news_block'];
    if (!$limit) {
    	$limit = 5;
    }
    
    $cont = "";
    $content = "";
    $link_user = $mklib_board->forum_link("profile");
    
    
    
    	$query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona, n.pinned
    	FROM mkp_news AS n
    	LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
    	WHERE n.idcategoria = '2' ORDER BY `id` DESC LIMIT $limit");
    	while( $row = $DB->fetch_row($query) ) {
    		$idnt = $row['id'];
    		$totcomments = $row['totalcomm'];
    		$id_orig_name = $row['idautore'];
    		$idcategoria = $row['idcategoria'];
    		$titolo = stripslashes($row['titolo']);
    		$name = $row['autore'];
    		$testo = stripslashes($row['testo']);
    		if ($this->mkeditor == "BBCODE") {
    			$testo = $this->decode_bb($testo);
    			$testo = $mklib_board->decode_smilies($testo);
    		}
    		$sezione = $row['titcat'];
    		$cdata = $this->create_date($row['data']);
    		$news_words= $this->config['news_words'];
    		if ($this->config['news_html']) {
    			$testo = str_replace ("<br />", " ", $testo);
    			$testo = strip_tags ($testo);
       		}
    		if ($news_words) {
    			$testo = substr ($testo, 0, $news_words);
    			$testo .= " ...";
       		}
    
    		$cont .= "
    		<table class=\"tabnews\" align='left' cellspacing=\"0\" cellpadding=\"0\" width=\"33%\">
    
    <tr>
    <td class=\"tdblock\" valign=\"top\"><p style=\"text-align:center\"><a href=\"index.php?ind=news&amp;op=news_show_single&amp;ide={$row['id']}\"><font  color=\"red\" size=\"1pt\">$titolo</font><br /><img src=\"$this->siteurl/mkportal/upload_image/images/$idnt.jpg\" border=\"0\" width=\"165\" height=\"55\" alt=\"$testo\" /><br />$testo</a></p>
    
    					      </td>
    
        						</tr>   
    
    
    
                              </table>
    		";
    	}
    	$content = "
    				<tr>
    				  <td class=\"contents\">
    				  <div class=\"taburlo\">
    				    <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
    				      <tr>
    					<td class=\"taburlo\" valign=\"top\">
    					{$cont}
    					</td>
    				      </tr>
    				    </table>
    				  </div>
    				  </td>
    			      	</tr>
    				  ";
    
    		unset($cont);
    		unset($row);
    		unset($idcat);
    		unset($categoria);
    		unset($idnt);
    		unset($query);
    		unset($query2);
    		unset($totcomments);
    		unset($id_orig_name);
    		unset($idcategoria);
    		unset($titolo);
    		unset($name);
    		unset($testo);
    		unset($sezione);
    		unset($cdata);
    		unset($news_words);
    
    
    
    
    ?>
  • 19-05-2009, 18:11:18
    #2
    Bu şekilde 3 taneden sonra alta geçmesi gerekir.
    Denermisin
    <?php
    
    $limit = $this->config['news_block'];
    if (!$limit) {
        $limit = 5;
    }
    
    $cont = "";
    $content = "";
    $link_user = $mklib_board->forum_link("profile");
    
    
    
        $query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona, n.pinned
        FROM mkp_news AS n
        LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
        WHERE n.idcategoria = '2' ORDER BY `id` DESC LIMIT $limit");
    $x = 0;
        echo $cont .="<table class=\"tabnews\" align='left' cellspacing=\"0\" cellpadding=\"0\" width=\"33%\">
    		<tr>";
        while( $row = $DB->fetch_row($query) ) {
            $idnt = $row['id'];
            $totcomments = $row['totalcomm'];
            $id_orig_name = $row['idautore'];
            $idcategoria = $row['idcategoria'];
            $titolo = stripslashes($row['titolo']);
            $name = $row['autore'];
            $testo = stripslashes($row['testo']);
            if ($this->mkeditor == "BBCODE") {
                $testo = $this->decode_bb($testo);
                $testo = $mklib_board->decode_smilies($testo);
            }
            $sezione = $row['titcat'];
            $cdata = $this->create_date($row['data']);
            $news_words= $this->config['news_words'];
            if ($this->config['news_html']) {
                $testo = str_replace ("<br />", " ", $testo);
                $testo = strip_tags ($testo);
               }
            if ($news_words) {
                $testo = substr ($testo, 0, $news_words);
                $testo .= " ...";
               }
    
            $cont .= "<td class=\"tdblock\" valign=\"top\"><p style=\"text-align:center\"><a href=\"index.php?ind=news&amp;op=news_show_single&amp;ide={$row['id']}\"><font  color=\"red\" size=\"1pt\">$titolo</font><br /><img src=\"$this->siteurl/mkportal/upload_image/images/$idnt.jpg\" border=\"0\" width=\"165\" height=\"55\" alt=\"$testo\" /><br />$testo</a></p></td>";
    		if ($x==3) {
    		echo $cont .="</tr><tr>";	
    		$x = 0;
    		}
        }
    	echo $cont .="</tr>   
             </table>";
    
        $content = "
                    <tr>
                      <td class=\"contents\">
                      <div class=\"taburlo\">
                        <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
                          <tr>
                        <td class=\"taburlo\" valign=\"top\">
                        {$cont}
                        </td>
                          </tr>
                        </table>
                      </div>
                      </td>
                          </tr>
                      ";
    
            unset($cont);
            unset($row);
            unset($idcat);
            unset($categoria);
            unset($idnt);
            unset($query);
            unset($query2);
            unset($totcomments);
            unset($id_orig_name);
            unset($idcategoria);
            unset($titolo);
            unset($name);
            unset($testo);
            unset($sezione);
            unset($cdata);
            unset($news_words);
    
    
    
    
    ?>
  • 19-05-2009, 20:29:58
    #3
    olmadı malesef, hepsini yanyana sıralıyor.
  • 19-05-2009, 20:36:06
    #4
    Üyeliği durduruldu
    slm tablo kullanımını CSS ye aktarın ve verilerin basılmasını istediğiniz alan ölçülerini CSS olarak girin ilaveten bu veriyi bastıracağınız alan için yazdığınız CSS kod a şunu ilave edin

    float: left;

    komutunu ekleyin ve 3 . veriden sonra aşağı geçtiğini göreceksiniz.. bunun için php kodlarda var ama bu yazdığım yöntemle kod kalabalığına gerek kalmadan halledebilirsin..
  • 19-05-2009, 20:45:24
    #5
    aynı classı çok fazla tabloda kullanıyor sistem. php olarak düzenleyebilirsem güzel olacak.
  • 19-05-2009, 21:57:27
    #6
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Kısaltarak yazıyorum. 3 kolonlu tablo için yaptım. Değiştirmek isterseniz %3 ü değiştirebilirsiniz.

    echo '<table>';
    
    while(){
    
    
    if ($sayac%3==0){echo '<tr>';}
    
    echo '<td>TD İÇİNE YAZILACAK DEĞİŞKEN</td>';
    
    $sayac++;
    if ($sayac%3==0){echo '</tr>';}
    
    }
    
    $bostd=$sayac%3;
    
    if($bostd!=0){
    for($i=0;$i<$bostd;$i++){
    echo '<td>&nbsp;</td>';
    }
    
    echo '</tr>';
    }
    echo '</table>';
  • 19-05-2009, 23:00:37
    #7
    GeCe_ o kodları uygulayamadım. Kendim yazdım aslında ama 3.üden sonra alta geçmiyor </tr><tr> atması gerekmiyormu, hatayı nerde yapıyorum acaba?

    <?php
    
    $limit = $this->config['news_block'];
    if (!$limit) {
        $limit = 5;
    }
    $count = 1;
    $cont = "<tr>";
    $content = "";
    $link_user = $mklib_board->forum_link("profile");
    
    
    
        $query = $DB->query( "SELECT n.id, n.idcategoria, n.idautore, n.titolo, n.autore, n.testo, n.data, n.totalcomm, s.id AS idcat, s.titolo AS titcat, s.icona, n.pinned
        FROM mkp_news AS n
        LEFT JOIN mkp_news_sections AS s ON(s.id = n.idcategoria)
        WHERE n.idcategoria = '12' ORDER BY `id` DESC LIMIT $limit");
            while( $row = $DB->fetch_row($query) ) {
            $idnt = $row['id'];
            $totcomments = $row['totalcomm'];
            $id_orig_name = $row['idautore'];
            $idcategoria = $row['idcategoria'];
            $titolo = stripslashes($row['titolo']);
            $name = $row['autore'];
            $testo = stripslashes($row['testo']);
            if ($this->mkeditor == "BBCODE") {
                $testo = $this->decode_bb($testo);
                $testo = $mklib_board->decode_smilies($testo);
            }
            $sezione = $row['titcat'];
            $cdata = $this->create_date($row['data']);
            $news_words= $this->config['news_words'];
            if ($this->config['news_html']) {
                $testo = str_replace ("<br />", " ", $testo);
                $testo = strip_tags ($testo);
               }
            if ($news_words) {
                $testo = substr ($testo, 0, $news_words);
                $testo .= " ...";
               }
    
            $cont .= "
    <td class=\"tdblock\" valign=\"top\"><p style=\"text-align:center\"><a href=\"index.php?ind=news&amp;op=news_show_single&amp;ide={$row['id']}\"><font  color=\"red\" size=\"1pt\">$titolo</font><br /><img src=\"$this->siteurl/mkportal/upload_image/images/$idnt.jpg\" border=\"0\" width=\"165\" height=\"55\" alt=\"$testo\" /><br />$testo</a></p></td>";
    if ( (($count) % 3 ) == 0 ) {
    		$content .= '</tr><tr>';
    	}
    
    $count++;
    
    }
        
    
       $cont .="</td>   
             </tr>";
    
        $content = "
                    <tr>
                      <td class=\"contents\">
                      <div class=\"taburlo\">
                        <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
                          <tr>
                        <td class=\"taburlo\" valign=\"top\">
                        {$cont}
                        </td>
                          </tr>
                        </table>
                      </div>
                      </td>
                          </tr>
                      ";
    
            unset($cont);
           unset($count);
            unset($row);
            unset($idcat);
            unset($categoria);
            unset($idnt);
            unset($query);
            unset($query2);
            unset($totcomments);
            unset($id_orig_name);
            unset($idcategoria);
            unset($titolo);
            unset($name);
            unset($testo);
            unset($sezione);
            unset($cdata);
            unset($news_words);
    
    
    ?>
  • 20-05-2009, 00:40:36
    #8
    Verdiğim kodu tekrar denermisin. Düzenledim
  • 20-05-2009, 00:51:51
    #9
    yine olmadı 6 tane yanyana basıyor ekrana.

                    <tr>
                      <td class="contents">
                      <div class="taburlo">
                        <table width="100%" border="0" cellspacing="0" cellpadding="2">
                          <tr>
                        <td class="taburlo" valign="top">
                        <table class="tabnews" align='left' cellspacing="0" cellpadding="0" width="33%">
            <tr>
    <td class="tdblock" valign="top"></td>
    <td class="tdblock" valign="top"></td>
    <td class="tdblock" valign="top"></td>
    <td class="tdblock" valign="top"></td>
    <td class="tdblock" valign="top"></td>
    <td class="tdblock" valign="top"></td></tr>   
             </table>
                        </td>
                          </tr>
                        </table>
                      </div>
                      </td>
                          </tr>