GUI Code

  Home arrow GUI Code arrow nice looking dir index'r
GUI CODE

nice looking dir index'r
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2004-06-14

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    this file shows you the content of the directory its lying in. just copy this file in the directory and look at it. it DOESN'T shows subdirectories, but the query, which remove the sub-dirs, is marked so you can easily remove it. I've used HTML, CSS and PHP. ps: excuse my bad english please, i'll try to get better. thx.

    By : juna

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <!--
    written by juna reuther - http://snowcristals.net. hope you enjoy it. its none of my business if you leave the comments or not. do as you like :)
    -->
    <HTML>
    <HEAD>
    <TITLE>
    index
    </TITLE>

    </HEAD>

    <BODY>
    <center>
    <style type="text/css">
    A:active {COLOR: #FFFFFF; TEXT-DECORATION: none}
    A:hover { COLOR: #FFFFFF; TEXT-DECORATION: underline}
    A:link {COLOR:#000000; TEXT-DECORATION: none}
    A:visited {COLOR: #C0C0C0; TEXT-DECORATION: none}

    .trone {
    background-color: #E9E9E9;
    font-size: 9pt;
    text-indent: 20px;
    }

    .trtwo{
    background-color: #FFFFFF;
    font-size: 9pt;
    text-indent: 20px;
    }

    BODY { TEXT-DECORATION: none;
    font-family:verdana;
    font-size: 9pt;
    text-indent: 20px;
    }
    </style>

    <br><br>

    <table border=0>
    <tr class="trtwo">
    <td><center><b>file</b></center></td>
    <td><center><b>size</b></center></td>
    <td><center><b>last modified</b></center></td>
    </tr>
    <?
    // shows the correct size & size-label

    function size($file) {
    $size_label = array("Byte", "KB", "MB", "GB", "TB");

    $size=filesize($file);
    for ($c=0;$size>1024; $c++) {
    $size/=1024;
    }

    $size=round($size,1);
    return("$size ".$size_label[$c]);
    }


    $trbg = "1"; // which <TR> - background

    // reading the content and...
    $mydir = dir("./");
    while ($file=$mydir->read()){
    $kind = filetype($file);
    if ($kind != "dir"){ // ATTENTION! if you want this file to show subdirectories, remove this query

    //... showing the content:
    //<tr> - backgroundcolor
    echo "<tr>";
    if ($trbg=="1"){
    echo "<tr class=\"trone\">";
    $trbg = "2";
    }
    else if ($trbg=="2"){
    echo "<tr class = \"trtwo\">";
    $trbg = "1";
    }

    //<td> and filename...
    echo "<td width=300><a href=\"$file\">".$file."</a></td>";
    //...filesize...
    echo "<td width=100>".size($file)." </td>";
    //... last change...
    $change = filemtime($file);
    echo "<td width=200>".date("j. - M. - Y; H:i:s",$change)."</td>";
    }
    }
    $mydir->close();
    ?>
    </tr>
    </table>
    <br><br>
    </center>
    </BODY>
    </HTML>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More GUI Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    GUI CODE ARTICLES

    - PHP Image Manipulation Class 1.0
    - Simple PHP-CAPTCHA,
    - dPhoto
    - nice looking dir index'r
    - Colorpicker
    - Exposure Gallery build 1226
    - Dynamic "AQUA" Buttons
    - AdminTool|1.0 for Exposure Gallery
    - Exposure Gallery v1.2
    - Crop Canvas
    - Display all available background colours
    - Exposure Gallery v1.0
    - JPEG Directory Thumbnail system (Apect ratio)
    - JPEG Directory thumbnail system
    - Change Background Color each day

    Developer Shed Affiliates

     



    © 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap