Need A Good Php/javascript Cooder

Discussion in 'Gaming' started by BlackP, Aug 23, 2006.

  1. BlackP

    BlackP Well-Known Member

    Posts:
    275
    Likes Received:
    0
    Joined:
    Feb 10, 2006
    Code:
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <?php
    // Konfiguration
    // Mapp att läsa
    $dir = "./gallery/";
    ?>
    <body>
    <table width="611" height="221" border="1" align="left" bordercolor="#FFFFFF">
      <tr>
        <td width="610" height="600" align="left" valign="top" nowrap="nowrap">
        
        <?php
        if (isset($_GET['pic'])) {
        $showfile=$_GET['pic'];
            echo "<a href='".$dir.$showfile."' target='_blank'><img src='pp.php?size=608&pic=".$dir.$showfile."'></img></a>";
            }
            else
            {
    
        if (is_dir($dir)) {        //Kollar om mappen finns
           if ($dh = opendir($dir)) {            //Läser mappen
               while (($file = readdir($dh)) !== false) {            //Läser alla filer i mappen
                      $ext = explode(".", $file);                //Kollar om det är jpg
                   if (strtolower(array_pop($ext)) == "jpg") {
                  
                   echo "<a href='".$dir.$file."' target='_blank'><img src='pp.php?size=608&pic=".$dir.$file."'></img></a>";
                   break;
                   }
               }
               closedir($dh);            //Stänger mappen
           }
        }
            
            
            }
        ?></td>
        <td width="150" height="600" align="left" valign="top" style="overflow:hidden; height:600px">
        [url="java script:;"]Uppåt[/url]
        <div id="content" style="height:380px; width:150px overflow:hidden">
            <?php
        
        $dir = "./";             //Mapp att läsa
    
        if (is_dir($dir)) {        //Kollar om mappen finns
           if ($dh = opendir($dir)) {            //Läser mappen
               while (($file = readdir($dh)) !== false) {            //Läser alla filer i mappen
                      $ext = explode(".", $file);                //Kollar om det är jpg
                   if (strtolower(array_pop($ext)) == "jpg") {
                  
                   echo "<a href='?pic=".$file."'><img src='".$dir."pp.php?size=150&pic=".$file."'></img></a>
    ";
                  
                   }
               }
               closedir($dh);            //Stänger mappen
           }
        }
        
        ?>
        </div>
        [url="java script:move_down();"]Neråt[/url]
        </td>
      </tr>
    </table>
    </body>
    </html>
    This is a code for a imagegallery kind of thing
    the thing is i've tried to make it so that when the images overflowes a
    surtent height it will get hidden and to there after to be scrolled with java
    but it doesnt work so i would like to know what ive made wrong
    plz plz plz plz help me i would appreciate it alot :/
     

Share This Page