Mam problem z układem. Kod dotyczy banerów które układają się w kolumnie czyli
1.baner (1)
2.baner (2)
itd.
a chciałbym układ wierszowy
1. baner (1), 2.baner (2) itd.
o to kod:
Kod
<?
include("admin/wyniki_1.php");
$limit=$_POST['banerlewe'];
$pobieranie = mysql_query ("SELECT * FROM banery WHERE aktywny = 'T' AND CURDATE()< dataw ORDER BY rand() LIMIT $limit");
while ($zapisz = mysql_fetch_array($pobieranie)) {
$id_banera_inf =$zapisz['id'];
$plik_banera_inf =$zapisz['plik_banera'];
$adres_banera_inf =$zapisz['adres_banera'];
$url_strony_inf =$zapisz['url_strony'];
$width_ban_inf =$zapisz['width_ban'];
$height_ban_inf =$zapisz['height_ban'];
$rozszerzenie = strtolower(substr($plik_banera_inf, strrpos($plik_banera_inf, '.') + 1));
if($plik_banera_inf) {$addr = "banery/$plik_banera_inf";}
if($adres_banera_inf) {$addr = "$adres_banera_inf";}
$max_width = 158;//default 150
$max_height = 60;//default 300
$width = $width_ban_inf;
$height = $height_ban_inf;
@$x_ratio = $max_width / $width;
@$y_ratio = $max_height / $height;
if(($width <= $max_width) && ($height <= $max_height))
{
$tn_width = $width;
$tn_height = $height;
}
else if(($x_ratio * $height) < $max_height)
{
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
}
else
{
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
?>
<?
if($rozszerzenie === "swf") {
echo "
<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"[url="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"]http://download.macromedia.com/pub/shockwa...=6,0,29,0\[/url]" width=\"".$tn_width."\" height=\"".$tn_height."\">
<param name=\"movie\" value=\"468-60-baner.swf\">
<param name=\"quality\" value=\"high\">
<embed src=\"".$addr."\" quality=\"high\" pluginspage=\"[url="http://www.macromedia.com/go/getflashplayer\"]http://www.macromedia.com/go/getflashplayer\[/url]" type=\"application/x-shockwave-flash\" width=\"".$tn_width."\" height=\"".$tn_height."\"></embed>
</object>
";
}
else
{
echo "<a href=\"header_baner.php?id_b=".$id_banera_inf."\" target=\"_blank\"><img src=\"".$addr."\" border=\"0\" width=\"".$tn_width."\" height=\"".$tn_height."\" alt=\"Reklama\"></a>";
}
?>
<TABLE height=5 CELLPADDING="0" CELLSPACING="0"><tr><td></td></tr></table>
<?}
?>
include("admin/wyniki_1.php");
$limit=$_POST['banerlewe'];
$pobieranie = mysql_query ("SELECT * FROM banery WHERE aktywny = 'T' AND CURDATE()< dataw ORDER BY rand() LIMIT $limit");
while ($zapisz = mysql_fetch_array($pobieranie)) {
$id_banera_inf =$zapisz['id'];
$plik_banera_inf =$zapisz['plik_banera'];
$adres_banera_inf =$zapisz['adres_banera'];
$url_strony_inf =$zapisz['url_strony'];
$width_ban_inf =$zapisz['width_ban'];
$height_ban_inf =$zapisz['height_ban'];
$rozszerzenie = strtolower(substr($plik_banera_inf, strrpos($plik_banera_inf, '.') + 1));
if($plik_banera_inf) {$addr = "banery/$plik_banera_inf";}
if($adres_banera_inf) {$addr = "$adres_banera_inf";}
$max_width = 158;//default 150
$max_height = 60;//default 300
$width = $width_ban_inf;
$height = $height_ban_inf;
@$x_ratio = $max_width / $width;
@$y_ratio = $max_height / $height;
if(($width <= $max_width) && ($height <= $max_height))
{
$tn_width = $width;
$tn_height = $height;
}
else if(($x_ratio * $height) < $max_height)
{
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
}
else
{
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
?>
<?
if($rozszerzenie === "swf") {
echo "
<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"[url="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"]http://download.macromedia.com/pub/shockwa...=6,0,29,0\[/url]" width=\"".$tn_width."\" height=\"".$tn_height."\">
<param name=\"movie\" value=\"468-60-baner.swf\">
<param name=\"quality\" value=\"high\">
<embed src=\"".$addr."\" quality=\"high\" pluginspage=\"[url="http://www.macromedia.com/go/getflashplayer\"]http://www.macromedia.com/go/getflashplayer\[/url]" type=\"application/x-shockwave-flash\" width=\"".$tn_width."\" height=\"".$tn_height."\"></embed>
</object>
";
}
else
{
echo "<a href=\"header_baner.php?id_b=".$id_banera_inf."\" target=\"_blank\"><img src=\"".$addr."\" border=\"0\" width=\"".$tn_width."\" height=\"".$tn_height."\" alt=\"Reklama\"></a>";
}
?>
<TABLE height=5 CELLPADDING="0" CELLSPACING="0"><tr><td></td></tr></table>
<?}
?>
poprawiony