• 24-04-2014, 23:30:27
    #1
    Merhaba ben buradaki verileri yan yana 6 sıra şeklinde göstermek istiyorum. Yardımcı olursanız sevinirim.

    Şu an tek sıra şeklinde gösteriliyor.

    <?php
    define('_AUTH_PAGE',1);
    @include_once('../config.php');
    @include_once('../inc/function.php');
    @sql_baglan();
    global $conf_url;
    $cat=htmlspecialchars(mysql_real_escape_string($_GET['cat']));
    $related = getRelatedVideos($cat);
    //print_r($related);
    function strCrop($str,$max=6) {
        $len = strlen($str);
        if($len<=$max) return $str;
        $str = substr($str,0,$max);
        $str.='';
        return $str;
    }
    ?>
    <!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>
    <base href="<?php echo $conf_url.'/'; ?>"/>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"/>
    <title>Free Online Games</title>
    <link href="css/gumutuyeni.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
    <div class="gamepagetopwin">
    <?php
        $c=count($related);
        $o='';
        for($i=0; $i<$c; $i++) {
            $link = 'game/'.$related[$i]->id.'/'.$related[$i]->v_link;
            $o.='<a title="'.$related[$i]->baslik.'" href="'.$link.'" target="_top">';
            $o.='<img class="topgames" src="'.$related[$i]->resim.'" width="130" height="90" border="0" alt="'.$related[$i]->baslik.'" /></a>';
        }
        echo $o;
        echo '<a class="gamepageall" title="all" href="games.html" target="_top">All &raquo;</a>';
    ?>
    </div>
    </body>
    </html>
  • 25-04-2014, 14:15:44
    #2
    $totW = "600"; // in type of px
    echo "<div class=\"videoCont\" style=\"width: ".$totW."px;\">"; // start of container
    for($i=0; $i<$c; $i++) {
            $wid = (int)$totW/6;
            echo "<div class=\"video-$i\" style=\"width: ".$wid."; float: left;\">";
            $link = 'game/'.$related[$i]->id.'/'.$related[$i]->v_link;
            $o.='<a title="'.$related[$i]->baslik.'" href="'.$link.'" target="_top">';
            $o.='<img class="topgames" src="'.$related[$i]->resim.'" width="130" height="90" border="0" alt="'.$related[$i]->baslik.'" /></a>';
            echo "</div>"; // end of video $i
    }
    echo "</div>"; // end of container
    Hocam geri kalanı css ile (marginler, paddingler) halledebilirsiniz.