Index of /old

Up to parent folder | Jump to files | Script: /home/weidu/public_html/old/imagelist.php ( source code )

Icon Name Filesize Timestamp
archive American-IWD2-dialog.tlk.zip 1.47 MB Wed, 26 Dec 2012 14:36:08 -0500
archive American-ToB-dialog.tlk.zip 2.64 MB Wed, 26 Dec 2012 14:38:17 -0500
file Ascension-WeiDU-v1.4.15.exe 754.53 KB Wed, 26 Dec 2012 14:42:06 -0500
file Ascension-WeiDU-v1.4.16.exe 783.51 KB Wed, 26 Dec 2012 14:42:21 -0500
archive Ascension-WeiDU-v1.4.16.rar 735.51 KB Wed, 26 Dec 2012 14:36:28 -0500
file Ascension-WeiDU-v1.4.17.exe 824.89 KB Wed, 26 Dec 2012 14:39:29 -0500
archive Ascension-WeiDU-v1.4.17.rar 776.89 KB Wed, 26 Dec 2012 14:40:33 -0500
file Ascension-WeiDU-v1.4.19.exe 893.79 KB Wed, 26 Dec 2012 14:35:59 -0500
archive Ascension-WeiDU-v1.4.19.rar 845.79 KB Wed, 26 Dec 2012 14:37:49 -0500
file Ascension-WeiDU-v1.4.20.exe 907.32 KB Wed, 26 Dec 2012 14:42:01 -0500
archive Ascension-WeiDU-v1.4.20.rar 859.32 KB Wed, 26 Dec 2012 14:36:18 -0500
archive Ascension-WeiDU-v1.4.21.rar 862.23 KB Wed, 26 Dec 2012 14:36:49 -0500
archive French-SoA-dialog.tlk.zip 2.4 MB Wed, 26 Dec 2012 14:37:22 -0500
archive French-SoA-dialogF.tlk.zip 2.43 MB Wed, 26 Dec 2012 14:40:23 -0500
archive German-ToB-dialog.tlk.zip 3.1 MB Wed, 26 Dec 2012 14:36:58 -0500
archive Italian-BG1-dialog.tlk.zip 2.16 MB Wed, 26 Dec 2012 14:41:41 -0500
archive Italian-BG2-dialog.tlk.zip 5.6 MB Wed, 26 Dec 2012 14:42:12 -0500
archive WeiDU-125.zip 620.97 KB Wed, 26 Dec 2012 14:36:23 -0500
archive WeiDU-126.zip 621.98 KB Wed, 26 Dec 2012 14:41:20 -0500
archive WeiDU-127.zip 623.22 KB Wed, 26 Dec 2012 14:39:39 -0500
archive WeiDU-128.zip 624 KB Wed, 26 Dec 2012 14:37:52 -0500
archive WeiDU-129.zip 654.03 KB Wed, 26 Dec 2012 14:39:15 -0500
archive WeiDU-130.zip 0 B Wed, 26 Dec 2012 14:41:36 -0500
archive WeiDU-131.zip 659.77 KB Wed, 26 Dec 2012 14:37:31 -0500
archive WeiDU-132.zip 674.24 KB Wed, 26 Dec 2012 14:39:01 -0500
archive WeiDU-133.zip 738.84 KB Wed, 26 Dec 2012 14:39:31 -0500
archive WeiDU-134.zip 739.73 KB Wed, 26 Dec 2012 14:39:47 -0500
archive WeiDU-135.zip 741.22 KB Wed, 26 Dec 2012 14:41:04 -0500
archive WeiDU-136.zip 742.3 KB Wed, 26 Dec 2012 14:36:42 -0500
archive WeiDU-137.zip 748.74 KB Wed, 26 Dec 2012 14:39:18 -0500
archive WeiDU-138.zip 749.23 KB Wed, 26 Dec 2012 14:40:15 -0500
archive WeiDU-139.zip 749.84 KB Wed, 26 Dec 2012 14:40:05 -0500
archive WeiDU-140.zip 770.48 KB Wed, 26 Dec 2012 14:39:43 -0500
archive WeiDU-141.zip 751.68 KB Wed, 26 Dec 2012 14:37:22 -0500
archive WeiDU-142.zip 751.85 KB Wed, 26 Dec 2012 14:40:00 -0500
archive WeiDU-143.zip 754.39 KB Wed, 26 Dec 2012 14:37:56 -0500
archive WeiDU-144.zip 760.02 KB Wed, 26 Dec 2012 14:41:04 -0500
archive WeiDU-145.zip 756.11 KB Wed, 26 Dec 2012 14:36:01 -0500
archive WeiDU-146.zip 763.72 KB Wed, 26 Dec 2012 14:41:10 -0500
archive WeiDU-147.zip 771.92 KB Wed, 26 Dec 2012 14:39:39 -0500
archive WeiDU-148.zip 782.71 KB Wed, 26 Dec 2012 14:37:08 -0500
archive WeiDU-149.zip 784.16 KB Wed, 26 Dec 2012 14:36:15 -0500
archive WeiDU-150.zip 785.26 KB Wed, 26 Dec 2012 14:36:34 -0500
archive WeiDU-151.zip 784.36 KB Wed, 26 Dec 2012 14:41:29 -0500
archive WeiDU-153.zip 783.5 KB Wed, 26 Dec 2012 14:40:44 -0500
archive WeiDU-154.zip 786.87 KB Wed, 26 Dec 2012 14:40:57 -0500
archive WeiDU-155.zip 793.91 KB Wed, 26 Dec 2012 14:42:14 -0500
archive WeiDU-156.zip 796.46 KB Wed, 26 Dec 2012 14:40:39 -0500
archive WeiDU-157.zip 775.28 KB Wed, 26 Dec 2012 14:41:31 -0500
archive WeiDU-158.zip 783.71 KB Wed, 26 Dec 2012 14:41:00 -0500
archive WeiDU-159.zip 784.84 KB Wed, 26 Dec 2012 14:42:18 -0500
archive WeiDU-160.zip 787.32 KB Wed, 26 Dec 2012 14:39:50 -0500
archive WeiDU-161.zip 788.57 KB Wed, 26 Dec 2012 14:37:29 -0500
archive WeiDU-162.zip 794.73 KB Wed, 26 Dec 2012 14:40:48 -0500
archive WeiDU-163.zip 801.83 KB Wed, 26 Dec 2012 14:38:45 -0500
archive WeiDU-164.zip 806.41 KB Wed, 26 Dec 2012 14:42:24 -0500
archive WeiDU-165.zip 814.75 KB Wed, 26 Dec 2012 14:37:26 -0500
archive WeiDU-166.zip 844.53 KB Wed, 26 Dec 2012 14:39:13 -0500
archive WeiDU-167.zip 771.72 KB Wed, 26 Dec 2012 14:39:58 -0500
archive WeiDU-168.zip 774.8 KB Wed, 26 Dec 2012 14:37:36 -0500
archive WeiDU-169.zip 783.85 KB Wed, 26 Dec 2012 14:40:30 -0500
archive WeiDU-170.zip 785.55 KB Wed, 26 Dec 2012 14:39:22 -0500
archive WeiDU-171.zip 785.93 KB Wed, 26 Dec 2012 14:40:43 -0500
archive WeiDU-172.zip 788.77 KB Wed, 26 Dec 2012 14:38:30 -0500
archive WeiDU-173.zip 800.57 KB Wed, 26 Dec 2012 14:36:37 -0500
archive WeiDU-174.zip 803.8 KB Wed, 26 Dec 2012 14:37:58 -0500
archive WeiDU-175.zip 853.64 KB Wed, 26 Dec 2012 14:38:39 -0500
archive WeiDU-176.zip 853.31 KB Wed, 26 Dec 2012 14:40:48 -0500
archive WeiDU-177.zip 854.54 KB Wed, 26 Dec 2012 14:40:12 -0500
archive WeiDU-178.zip 853.65 KB Wed, 26 Dec 2012 14:39:24 -0500
archive WeiDU-179.zip 853.77 KB Wed, 26 Dec 2012 14:41:25 -0500
archive WeiDU-180.zip 855.51 KB Wed, 26 Dec 2012 14:38:35 -0500
archive WeiDU-181.zip 860.24 KB Wed, 26 Dec 2012 14:37:39 -0500
archive WeiDU-182.zip 862.71 KB Wed, 26 Dec 2012 14:39:04 -0500
archive WeiDU-183.zip 863.97 KB Wed, 26 Dec 2012 14:40:52 -0500
archive WeiDU-184.zip 865.89 KB Wed, 26 Dec 2012 14:39:54 -0500
file Weimer-Ease-Latest.exe 401.82 KB Wed, 26 Dec 2012 14:38:02 -0500
file Weimer-Ease-v17.exe 375.34 KB Wed, 26 Dec 2012 14:41:41 -0500
file Weimer-Ease-v18.exe 384.68 KB Wed, 26 Dec 2012 14:35:50 -0500
archive Weimer-Ease-v18.rar 336.68 KB Wed, 26 Dec 2012 14:36:53 -0500
file Weimer-Ease-v19.exe 386.58 KB Wed, 26 Dec 2012 14:41:48 -0500
archive Weimer-Ease-v19.rar 338.58 KB Wed, 26 Dec 2012 14:36:37 -0500
file Weimer-Ease-v20.exe 389.73 KB Wed, 26 Dec 2012 14:39:21 -0500
archive Weimer-Ease-v20.rar 341.73 KB Wed, 26 Dec 2012 14:39:34 -0500
file Weimer-Ease-v21.exe 401.82 KB Wed, 26 Dec 2012 14:41:08 -0500
archive Weimer-Ease-v21.rar 353.82 KB Wed, 26 Dec 2012 14:40:14 -0500
file Weimer-Ease-v22.exe 406.26 KB Wed, 26 Dec 2012 14:40:35 -0500
archive Weimer-Ease-v22.rar 358.26 KB Wed, 26 Dec 2012 14:41:36 -0500
file Weimer-Ease-v23.exe 407.06 KB Wed, 26 Dec 2012 14:39:04 -0500
archive Weimer-Ease-v23.rar 359.06 KB Wed, 26 Dec 2012 14:41:00 -0500
file Weimer-Ease-v24.exe 414.69 KB Wed, 26 Dec 2012 14:39:51 -0500
archive Weimer-Ease-v24.rar 366.83 KB Wed, 26 Dec 2012 14:37:52 -0500
file Weimer-Ease-v25.exe 437.69 KB Wed, 26 Dec 2012 14:40:41 -0500
archive Weimer-Ease-v25.rar 389.69 KB Wed, 26 Dec 2012 14:41:12 -0500
file Weimer-Ease-v26.exe 440.06 KB Wed, 26 Dec 2012 14:38:42 -0500
archive Weimer-Ease-v26.rar 392.06 KB Wed, 26 Dec 2012 14:38:03 -0500
file Weimer-Ease-v27.exe 442.79 KB Wed, 26 Dec 2012 14:41:55 -0500
archive Weimer-Ease-v27.rar 394.79 KB Wed, 26 Dec 2012 14:38:42 -0500
file Weimer-Ease-v28.exe 461.13 KB Wed, 26 Dec 2012 14:37:45 -0500
archive Weimer-Ease-v28.rar 413.13 KB Wed, 26 Dec 2012 14:38:30 -0500
file Weimer-Ease-v29.exe 647.24 KB Wed, 26 Dec 2012 14:39:10 -0500
archive Weimer-Ease-v29.rar 599.24 KB Wed, 26 Dec 2012 14:42:11 -0500
file Weimer-Ease-v30.exe 431.2 KB Wed, 26 Dec 2012 14:36:05 -0500
archive Weimer-Ease-v30.rar 383.2 KB Wed, 26 Dec 2012 14:40:03 -0500
file Weimer-Ease-v31.exe 448.32 KB Wed, 26 Dec 2012 14:36:19 -0500
archive Weimer-Ease-v31.rar 400.32 KB Wed, 26 Dec 2012 14:38:38 -0500
archive Weimer-Ease-v32.rar 400.35 KB Wed, 26 Dec 2012 14:41:19 -0500
file Weimer-IWD2-Ease-v13.exe 365.19 KB Wed, 26 Dec 2012 14:41:16 -0500
file Weimer-IWD2-Ease-v14.exe 381.89 KB Wed, 26 Dec 2012 14:37:04 -0500
archive Weimer-IWD2-Ease-v14.rar 333.89 KB Wed, 26 Dec 2012 14:37:01 -0500
archive Weimer-IWD2-Ease-v15.rar 336.82 KB Wed, 26 Dec 2012 14:36:44 -0500
file Weimer-ItemUpgrade-Latest.exe 560.33 KB Wed, 26 Dec 2012 14:38:18 -0500
file Weimer-ItemUpgrade-v29.exe 472.08 KB Wed, 26 Dec 2012 14:39:31 -0500
archive Weimer-ItemUpgrade-v29.rar 424.08 KB Wed, 26 Dec 2012 14:35:48 -0500
file Weimer-ItemUpgrade-v30.exe 524.97 KB Wed, 26 Dec 2012 14:38:52 -0500
archive Weimer-ItemUpgrade-v30.rar 476.97 KB Wed, 26 Dec 2012 14:37:30 -0500
file Weimer-ItemUpgrade-v31.exe 560.33 KB Wed, 26 Dec 2012 14:40:11 -0500
archive Weimer-ItemUpgrade-v31.rar 512.33 KB Wed, 26 Dec 2012 14:39:47 -0500
archive Weimer-ItemUpgrade-v32.rar 547.93 KB Wed, 26 Dec 2012 14:36:23 -0500
file Weimer-Merchant-v2.exe 313.09 KB Wed, 26 Dec 2012 14:41:33 -0500
file Weimer-Merchant-v3.exe 347.25 KB Wed, 26 Dec 2012 14:40:08 -0500
archive Weimer-Merchant-v3.rar 299.25 KB Wed, 26 Dec 2012 14:40:17 -0500
file Weimer-Merchant-v4.exe 379.77 KB Wed, 26 Dec 2012 14:36:02 -0500
archive Weimer-Merchant-v4.rar 331.76 KB Wed, 26 Dec 2012 14:38:33 -0500
file Weimer-SolaufeinMod-v100.exe 761.32 KB Wed, 26 Dec 2012 14:36:28 -0500
archive Weimer-SolaufeinMod-v100.rar 713.32 KB Wed, 26 Dec 2012 14:42:24 -0500
file Weimer-SolaufeinMod-v101.exe 794.45 KB Wed, 26 Dec 2012 14:37:05 -0500
archive Weimer-SolaufeinMod-v101.rar 746.45 KB Wed, 26 Dec 2012 14:39:43 -0500
archive Weimer-SolaufeinMod-v102.rar 761.89 KB Wed, 26 Dec 2012 14:38:12 -0500
file Weimer-SolaufeinMod-v96.exe 603.47 KB Wed, 26 Dec 2012 14:38:57 -0500
file Weimer-SolaufeinMod-v97.exe 622.45 KB Wed, 26 Dec 2012 14:37:38 -0500
archive Weimer-SolaufeinMod-v97.rar 574.45 KB Wed, 26 Dec 2012 14:37:59 -0500
file Weimer-SolaufeinMod-v98.exe 703.96 KB Wed, 26 Dec 2012 14:40:27 -0500
archive Weimer-SolaufeinMod-v98.rar 655.96 KB Wed, 26 Dec 2012 14:38:49 -0500
file Weimer-SolaufeinMod-v99.exe 708.09 KB Wed, 26 Dec 2012 14:41:14 -0500
archive Weimer-SolaufeinMod-v99.rar 660.09 KB Wed, 26 Dec 2012 14:36:41 -0500
file Weimer-TacticsMod-v14.exe 614.71 KB Wed, 26 Dec 2012 14:38:52 -0500
file Weimer-TacticsMod-v15.exe 622.67 KB Wed, 26 Dec 2012 14:41:50 -0500
archive Weimer-TacticsMod-v15.rar 574.67 KB Wed, 26 Dec 2012 14:39:54 -0500
file Weimer-TacticsMod-v16.exe 684.1 KB Wed, 26 Dec 2012 14:40:35 -0500
archive Weimer-TacticsMod-v16.rar 636.1 KB Wed, 26 Dec 2012 14:36:31 -0500
file Weimer-TacticsMod-v17.exe 746.83 KB Wed, 26 Dec 2012 14:40:01 -0500
archive Weimer-TacticsMod-v17.rar 698.83 KB Wed, 26 Dec 2012 14:38:07 -0500
file Weimer-TacticsMod-v18.exe 705.51 KB Wed, 26 Dec 2012 14:38:59 -0500
archive Weimer-TacticsMod-v18.rar 657.51 KB Wed, 26 Dec 2012 14:41:48 -0500
file Weimer-TacticsMod-v19.exe 708.03 KB Wed, 26 Dec 2012 14:39:15 -0500
archive Weimer-TacticsMod-v19.rar 660.03 KB Wed, 26 Dec 2012 14:39:37 -0500
file Weimer-TacticsMod-v20.exe 728.37 KB Wed, 26 Dec 2012 14:38:24 -0500
archive Weimer-TacticsMod-v20.rar 680.37 KB Wed, 26 Dec 2012 14:36:34 -0500
file Weimer-TacticsMod-v21.exe 769.2 KB Wed, 26 Dec 2012 14:38:54 -0500
archive Weimer-TacticsMod-v21.rar 721.2 KB Wed, 26 Dec 2012 14:42:18 -0500
file Weimer-TacticsMod-v22.exe 704.53 KB Wed, 26 Dec 2012 14:36:12 -0500
archive Weimer-TacticsMod-v22.rar 656.53 KB Wed, 26 Dec 2012 14:40:52 -0500
archive Weimer-TacticsMod-v23.rar 673.87 KB Wed, 26 Dec 2012 14:37:12 -0500
file Weimer-Targos-v3.exe 281.91 KB Wed, 26 Dec 2012 14:37:07 -0500
file Weimer-Targos-v4.exe 315.96 KB Wed, 26 Dec 2012 14:39:26 -0500
archive Weimer-Targos-v4.rar 267.96 KB Wed, 26 Dec 2012 14:40:54 -0500
file Weimer-Targos-v5.exe 316 KB Wed, 26 Dec 2012 14:38:04 -0500
archive Weimer-Targos-v5.rar 268 KB Wed, 26 Dec 2012 14:39:06 -0500
archive Weimer-Targos-v6.rar 291.28 KB Wed, 26 Dec 2012 14:35:57 -0500
file Weimer-Underrep-Latest.exe 418.04 KB Wed, 26 Dec 2012 14:41:45 -0500
file Weimer-Underrep-v1.exe 422.33 KB Wed, 26 Dec 2012 14:41:43 -0500
archive Weimer-Underrep-v1.rar 374.33 KB Wed, 26 Dec 2012 14:38:21 -0500
file Weimer-Underrep-v2.exe 422.17 KB Wed, 26 Dec 2012 14:41:32 -0500
archive Weimer-Underrep-v2.rar 374.17 KB Wed, 26 Dec 2012 14:38:32 -0500
file Weimer-Underrep-v4.exe 418.04 KB Wed, 26 Dec 2012 14:36:24 -0500
archive Weimer-Underrep-v4.rar 370.04 KB Wed, 26 Dec 2012 14:39:18 -0500
archive Weimer-Underrep-v5.rar 388.12 KB Wed, 26 Dec 2012 14:38:49 -0500
file Weimer-Valen-Latest.exe 516.72 KB Wed, 26 Dec 2012 14:41:23 -0500
file Weimer-Valen-v38.exe 398.65 KB Wed, 26 Dec 2012 14:37:42 -0500
file Weimer-Valen-v39.exe 418.43 KB Wed, 26 Dec 2012 14:37:16 -0500
archive Weimer-Valen-v39.rar 370.43 KB Wed, 26 Dec 2012 14:37:01 -0500
file Weimer-Valen-v40.exe 418.44 KB Wed, 26 Dec 2012 14:40:07 -0500
archive Weimer-Valen-v40.rar 370.44 KB Wed, 26 Dec 2012 14:38:27 -0500
file Weimer-Valen-v41.exe 431.38 KB Wed, 26 Dec 2012 14:36:46 -0500
archive Weimer-Valen-v41.rar 383.38 KB Wed, 26 Dec 2012 14:40:22 -0500
file Weimer-Valen-v42.exe 472.82 KB Wed, 26 Dec 2012 14:40:27 -0500
archive Weimer-Valen-v42.rar 424.82 KB Wed, 26 Dec 2012 14:36:58 -0500
file Weimer-Valen-v43.exe 447.26 KB Wed, 26 Dec 2012 14:40:57 -0500
archive Weimer-Valen-v43.rar 399.26 KB Wed, 26 Dec 2012 14:37:26 -0500
file Weimer-Valen-v44.exe 516.72 KB Wed, 26 Dec 2012 14:35:53 -0500
archive Weimer-Valen-v44.rar 468.72 KB Wed, 26 Dec 2012 14:37:09 -0500
archive Weimer-Valen-v45.rar 468.89 KB Wed, 26 Dec 2012 14:36:10 -0500
file error_log 824.88 KB Sat, 16 Dec 2017 08:23:58 -0500
file imagelist.php 12.85 KB Wed, 26 Dec 2012 14:37:23 -0500
Image Name Filesize Timestamp

Up to parent folder


PHP Source:

<?php
// 2002-06-25 17:44 by Chris Snyder  (csnyder@chxo.com)
// 2002-07-28 16:44 added paging ($skip and $perpage)
// 2002-08-16 11:50 updated for REGISTER_GLOBALS turned off
// 2002-08-25 20:11 listing directories first
// 2003-01-06 12:56 alphabetize folders and files, use apache icons, and don't show thumbs over 500k
// 2003-01-09 18:08 skip-to-files link
// 2003-01-22 18:20 fix alt/title tags for filetype icons, add .zip
// 2003-02-14 10:50 add $filepath suggestion on line 78
// 2003-03-15 19:49 urlencode foldernames
//
// find and list images in path (a folder) as thumbnails
// drop in replacement for fancyindexing -> either drop into an image directory as index.php
//              -OR-  point to script in Apache DirectoryIndex directive:
//                    DirectoryIndex index.html index.htm /cgi-bin/image-list.php

/*
image-list.php -- fancy image indexing using PHP
Copyright (C) 2003 by Chris Snyder (csnyder@chxo.com)
    
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

$thumbwidth=80;
$thumbheight=60;
$thumblimit800;  // (Max filesize in KB for displaying thumbnail)
$skip$_REQUEST["skip"];
$perpage$_REQUEST["perpage"];
$showsource$_REQUEST["showsource"];
$REQUEST_URIgetenv("REQUEST_URI");
$DOCUMENT_ROOTgetenv("DOCUMENT_ROOT");
$SCRIPT_NAMEgetenv("SCRIPT_NAME");
$SCRIPT_FILENAMEgetenv("SCRIPT_FILENAME");
$SERVER_SIGNATUREgetenv("SERVER_SIGNATURE");

if (
$skip==""$skip0;
if (
$perpage==""$perpage9999;

function 
myfilesize($file) {
    
// First check if the file exists.
    
if(!is_file($file)) exit("File does not exist!");
    
    
// Setup some common file size measurements.
    
$kb 1024;         // Kilobyte
    
$mb 1024 $kb;   // Megabyte
    
$gb 1024 $mb;   // Gigabyte
    
$tb 1024 $gb;   // Terabyte
    
    // Get the file size in bytes.
    
$size filesize($file);
    
    if(
$size $kb) return $size." B";
    else if(
$size $mb) return round($size/$kb,2)." KB";
    else if(
$size $gb) return round($size/$mb,2)." MB";
    else if(
$size $tb) return round($size/$gb,2)." GB";
    else return 
round($size/$tb,2)." TB";
    }

if (
substr($REQUEST_URI,-1)=="/") {
    
$lengthstrlen($REQUEST_URI)-1;
    
$uripathsubstr($REQUEST_URI,0,$length);
    }
else {
    
$uripathdirname($REQUEST_URI);
    }
$filepath$DOCUMENT_ROOT.urldecode($uripath);
// Some users have suggested:
// $filepath= realpath(".");
// instead of using $DOCUMENT_ROOT.
// print "filepath= $filepath and realpath=".realpath(".")." and uripath= $uripath ";

$lastslashstrrpos($uripath,"/");
$parenturisubstr($uripath,0,$lastslash+1);
if (
$parenturi==""$parenturi"/";
$displayuripathurldecode($uripath);

// show source code?
if ($showsource$sourceinfo"| Script: $SCRIPT_FILENAME ( <a href='#source'>source code</a> )";
else 
$sourceinfo"| <a href='$SCRIPT_NAME?showsource=1#source'>show source code</a>";

print 
"<html>
<head>
<title>
$displayuripath</title>
<style type='text/css'>
    body { font-family: Verdana, Geneva, sans-serif; font-size: 12px; background-color: #ffffee;}
    table { font-family: Verdana, Geneva, sans-serif; font-size: 12px; }
    .heading { font-size: 12px; font-weight: bold; background-color: #666677; color: #dddddd; border: 1px; border-style: solid; }
    .oddrow { background-color: #ffffff; }
    .evenrow { background-color: #eeffee; }
</style>
</head>
<body>
<h1>Index of 
$displayuripath</h1>
<p><a href='
$parenturi'><img src='/icons/back.gif' border=0 hspace=5 align=absmiddle>Up to parent folder</a> | <a href='#files'>Jump to files</a> $sourceinfo</p>";

if (
$skip) {
    
$prevskip$skip $perpage;
    if (
$prevskip<0$prevskip0;
    
$prevtag"<a href='?skip=$prevskip'>Previous Page</a>";
    print 
"<p>$prevtag</p>";
    }

if (
$handle opendir($filepath)) {
    print 
"
<table cellpadding=5>
    <tr class=heading>
        <td align=center>Icon</td>
        <td>Name</td>
        <td align=center>Filesize</td>
                <td>Timestamp</td>
    </tr>"
;
        
        
// FIRST PASS for subdirectories only -- makes $mydirarray, which can be sorted alphabetically
        
$count0;
    while (
$file readdir($handle)) {
        if (
substr($file,0,1)==".") continue;
        if (
$file=="index.php") continue;
        if (@
is_dir("$filepath/$file")) {
                        
$mydirarray[$count]="$file";
                        
$count$count+1;
            }
                }
        
closedir($handle);
        
        
// now sort and print subfolders...
        
if (is_array($mydirarray)) {
                
sort($mydirarray);
                
reset($mydirarray);
                foreach (
$mydirarray AS $key=>$file) {
                        
$timestampfilemtime("$filepath/$file");
                        
$modifieddate("r"$timestamp);
                        if (
$evenrow) {
                                
$evenrow=0;
                                
$rowclass"evenrow";
                                }
                        else {
                                
$evenrow=1;
                                
$rowclass"oddrow";
                                }
            if (
$key==($count-1)) $separator"<a name='files'> </a>";
            
$safefileurlencode($file);
                        print 
"
                        <tr class='
$rowclass'>
                                <td align=right><img src='/icons/folder.gif' alt=folder title=folder></td>
                                <td><a href='
$uripath/$safefile/'>$file/</a>$separator</td>
                                <td align=center>-</td>
                                <td>
$modified</td>
                        </tr>"
;
                        }
                }


        
// SECOND PASS for files only
    
$handle opendir($filepath);
    
$skipped0;
    
$index0;
    
$count0;
    while (
$file readdir($handle)) {
        
// don't show .dotfiles, self, directories, or links (links are bad??? hmm)
        
if (substr($file,0,1)==".") continue;
        if (
$file=="index.php") continue;
        if (@
is_dir("$filepath/$file")) continue;
        if (@
is_link("$filepath/$file")) continue;
        
$myfilearray[$count]= $file;
        
$count$count+1;
        }
        
closedir($handle);

    
// now sort on filename
    
if (is_array($myfilearray)) {
        
sort($myfilearray);
        
reset($myfilearray);
        foreach (
$myfilearray AS $key=>$file) {
            if (
$index >= $perpage) {
                
$shownext1;
                break;
                }
            if (
$skipped<$skip && $skip!= 0) {
                
$skipped$skipped 1;
                continue;
                }
            
$index$index 1;
            
$timestampfilemtime("$filepath/$file");
            
$modifieddate("r"$timestamp);
            if (
$evenrow) {
                
$evenrow=0;
                
$rowclass"evenrow";
                }
            else {
                
$evenrow=1;
                
$rowclass"oddrow";
                }
            unset(
$info);
            unset(
$extrainfo);
            unset(
$sizetag);
            
$filesizemyfilesize("$filepath/$file");
            if (
$imagesize=@getimagesize("$filepath/$file",$info)) {
                
$width$imagesize[0];
                
$height$imagesize[1];
                if (
$width>$thumbwidth) {
                    
$ratio$thumbwidth $width;
                    
$width=$thumbwidth;
                    
$height$height*$ratio;
                    }
                if (
$height>$thumbheight) {
                    
$ratio$thumbheight $height;
                    
$height=$thumbheight;
                    
$width$width*$ratio;
                    }

                switch (
$imagesize[2]) {
                    case 
5$icontag"<img src='/icons/image3.gif' alt=file title='photoshop image'>"; break;
                    case 
7$icontag"<img src='/icons/image2.gif' alt=file title='tiff image'>"; break;
                    case 
8$icontag"<img src='/icons/image2.gif' alt=file title='tiff image'>"; break;
                    default: 
$icontag"<img src='$uripath/$file' width=$width height=$height alt=image title=image>"; break;
                    }
                
$sizetag"($imagesize[0]x$imagesize[1])";

                if (isset (
$info['APP13'])) {
                    
$iptc iptcparse ($info['APP13']);
                    if (
is_array($iptc)) {
                        foreach (
$iptc AS $key=>$val) {
                            if (
$key=="2#000") continue;
                            
$extrainfo.="$val[0]<br>";
                            }
                        }
                    }
                
// don't show thumbnails bigger than 500K!
                
if (filesize("$filepath/$file")>($thumblimit*1024)) $icontag"<img src='/icons/image2.gif' alt=file title='image'>";
                }
            else {
                
// try to determine from extension...
                
$lastdotstrrpos($file".");
                
$extensionstrtolower(substr($file,$lastdot+1));
                
//flerror("File extension is $extension.");
                
switch ($extension) {
                    case 
"pdf"$icontag"<img src='/icons/layout.gif' alt=pdf title=pdf>"; break;
                    case 
"txt"$icontag"<img src='/icons/text.gif' alt=text title=text>"; break;
                    case 
"htm"$icontag"<img src='/icons/text.gif' alt=html title=html>"; break;
                    case 
"html"$icontag"<img src='/icons/text.gif' alt=html title=html>"; break;
                    case 
"wav"$icontag"<img src='/icons/sound1.gif' alt=sound title=sound>"; break;
                    case 
"au"$icontag"<img src='/icons/sound1.gif' alt=sound title=sound>"; break;
                    case 
"aiff"$icontag"<img src='/icons/sound1.gif' alt=sound title=sound>"; break;
                    case 
"mp3"$icontag"<img src='/icons/sound2.gif' alt=sound title=sound>"; break;
                    case 
"ogg"$icontag"<img src='/icons/sound2.gif' alt=sound title=sound>"; break;
                    case 
"mov"$icontag"<img src='/icons/movie.gif' alt=video title=video>"; break;
                    case 
"avi"$icontag"<img src='/icons/movie.gif' alt=video title=video>"; break;
                    case 
"mpg"$icontag"<img src='/icons/movie.gif' alt=video title=video>"; break;
                    case 
"mpeg"$icontag"<img src='/icons/movie.gif' alt=video title=video>"; break;
                    case 
"mp4"$icontag"<img src='/icons/movie.gif' alt=video title=video>"; break;
                    case 
"divx"$icontag"<img src='/icons/movie.gif' alt=video title=video>"; break;
                    case 
"rar"
                    case 
"zip"$icontag"<img src='/icons/compressed.gif' alt='archive' title='zip archive'>"; break;
                    default: 
$icontag"<img src='/icons/generic.gif' alt=file title=file>"; break;
                    }
                }
            
// file row
            
$safefileurlencode($file);
            print 
"
        <tr class='
$rowclass'>
            <td valign=top align=right><a href='
$uripath/$safefil'>$icontag</a></td>
            <td valign=top><a href='
$uripath/$safefile'>$file</a> $sizetag</td>
            <td valign=top align=center>
$filesize</td>
            <td valign=top>
$modified</td>
            </tr>"
;
            }
        }
    else print 
"
        <tr>
            <td valign=middle colspan='4'>&nbsp; No files here.</td>
            </tr>"
;

    print 
"
    <tr class=heading>
        <td align=center>Image</td>
        <td>Name</td>
        <td align=center>Filesize</td>
        <td>Timestamp</td>
    </tr>
</table>"
;

    if (
$shownext) {
        
$nextskip$skip $index;
        if (
$prevtag$prevtag .= " | ";
        print 
"<p>$prevtag <a href='?skip=$nextskip'>Next Page</a></p>";
        }
    elseif (
$skip) {
        print 
"<p>$prevtag</p>";
        }

    print 
"
<p><a href='
$parenturi'><img src='/icons/back.gif' border=0 hspace=5 align=absmiddle>Up to parent folder</a></p>";
    }

if (
$showsource) {
    print 
"<hr><a name='source'> </a><h1>PHP Source:</h1>";
    
$voidshow_source($SCRIPT_FILENAME);
    }
print 
"
<hr>
image-list.php Copyright (C) 2003 by Chris Snyder<br>
This program comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are welcome
to redistribute it under certain conditions; please refer to the
<a href='http://www.gnu.org/licenses/gpl.html'>GNU General Public License</a> for details.
</body>
</html>"
;
?>

image-list.php Copyright (C) 2003 by Chris Snyder
This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; please refer to the GNU General Public License for details.