nach 4 Bilder neue Zeile!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • nach 4 Bilder neue Zeile!

    ich habe volgendes script:

    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>
    nun möchte ich das nach jedem 4tem bild ein zeilenumbruch stattfindet!!

    THX
    the end comes faster than you think - you've already reached it!

  • #2
    Du baust z.B. im PHP Teil ein Counter ein, der sich bei jedem Durchgang um 1 erhöht, und der, sobald er auf 4 ist, wieder auf 0 gesetzt wird und gleichzeitig auch ein echo "<br>" auslöst. Ein paar if()-Anweisungen halt
    mfg

    Comment


    • #3
      das sind halt nunmal die sachen die ich nicht kann!!

      also alles was irgendwie "zählt" (count)!!


      d.h. ich bräuchte das ganze script komplett überarbeitet!!


      THX
      the end comes faster than you think - you've already reached it!

      Comment


      • #4
        unterhalb dieser zeile: echo "</a>";
        fügst du ein:

        $counter=$counter+1;
        if ($counter==4)
        {
        $counter=0;
        echo "<br>";
        }

        sollte gehen (alle Angaben ohne Gewähr )
        mfg

        Comment


        • #5
          jo big thx!!

          funz einwadfrei!!


          JOAt
          the end comes faster than you think - you've already reached it!

          Comment

          Working...
          X