ich habe volgendes script:
nun möchte ich das nach jedem 4tem bild ein zeilenumbruch stattfindet!!
THX
PHP-Code:
<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.availWidth)?Math.floor(Math.random()*(screen.availWidth-w)):0;TopPosition=(screen.availHeight)?Math.floor(Math.random()*((screen.availHeight-h)-75)):0;}
if(pos=="center"){LeftPosition=(screen.availWidth)?(screen.availWidth-w)/2:0;TopPosition=(screen.availHeight)?(screen.availHeight-h)/2:0;}
if(pos=="default"){LeftPosition=0;TopPosition=0}
else if((pos!="center" && pos!="random" && pos!="default") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
function CloseNewWin(){if(win!=null && win.open)win.close()}
window.onfocus=CloseNewWin;
//--->
</script>
<?PHP
for ($i=$von;$i<=$bis;$i++)
{
$bildname = "$i.jpg";
$bild = "pictures/$art/$i.jpg";
if (file_exists($bild))
{
$info = getimagesize($bild);
$file_size = filesize($bild);
$perfekte_fensterhoehe = $info[1] + 40; /*+100px, damit genug platz da ist!"*/
$perfekte_fensterbreite = $info[0] + 40;
echo "<a href=show_pic.php?file=pictures/$art/$i.jpg&art=$art&b=$info[0]&h=$info[1]";
echo " onclick=\"NewWindow(this.href,'juckts_net','$perfekte_fensterbreite','$perfekte_fensterhoehe','yes','center');return false\">";
echo "<img src=\"pictures/$art/tn.$i.jpg\" border=0>";
echo "</a>";
$anz_bilder = $i;
}
else
{
break;
}
}
?>
<?php
$x = 0;
do
{
$x == $x++;
$bild = "pictures/$art/$x.jpg";
if (file_exists($bild))
{
$anz_bilder_ges = $x;
}
}
while(file_exists($bild));
echo "<br>";
$von_neu = $bis + 1;
$bis_neu = $von_neu + 4;
if ($bis_neu < $x)
{
echo "<div align=center><a href=";
echo "pictures_main.php?art=$art&von=$von_neu&bis=$bis_neu";
echo ">weiter</a></div>";
}
echo "<div align=center><a href=";
echo "\"javascript:history.back()\">zurück</a></div>";
?>
</body>
</html>
THX
Kommentar