Up to parent folder | Jump to files | Script: /var/images/photos/public_html/blog/index.php ( source code )
Icon | Name | Filesize | Timestamp |
![]() |
2014_Summer/ | - | Fri, 11 Jul 2014 14:15:14 +0000 |
![]() |
2014_winter/ | - | Wed, 04 Jun 2014 22:18:38 +0000 |
![]() |
2015/ | - | Sat, 28 Oct 2023 11:59:11 +0000 |
![]() |
2017/ | - | Tue, 27 Mar 2018 20:40:28 +0000 |
![]() |
2018/ | - | Sun, 16 Sep 2018 13:46:32 +0000 |
![]() |
2019/ | - | Sun, 19 Jan 2020 18:17:08 +0000 |
![]() |
2020/ | - | Sun, 26 Apr 2020 16:54:56 +0000 |
![]() |
2022/ | - | Thu, 19 May 2022 12:30:44 +0000 |
![]() |
CabinBoyRefit/ | - | Fri, 23 May 2014 17:06:32 +0000 |
![]() |
agnes/ | - | Sun, 17 Aug 2014 18:48:02 +0000 |
![]() |
big_refit/ | - | Wed, 09 Dec 2015 23:15:10 +0000 |
![]() |
bm_pics/ | - | Sat, 26 Jul 2014 13:34:41 +0000 |
![]() |
brazil/ | - | Fri, 23 May 2014 17:06:28 +0000 |
![]() |
cb-stiffeners/ | - | Fri, 23 May 2014 17:06:31 +0000 |
![]() |
dreamzzzs/ | - | Fri, 23 May 2014 17:06:32 +0000 |
![]() |
dropbox-photos/ | - | Wed, 28 Mar 2018 18:33:07 +0000 |
![]() |
galley/ | - | Fri, 23 May 2014 17:06:30 +0000 |
![]() |
joshua/ | - | Sat, 18 Aug 2018 13:11:45 +0000 |
![]() |
oars/ | - | Fri, 23 May 2014 17:06:31 +0000 |
![]() |
outwales/ | - | Fri, 23 May 2014 17:06:31 +0000 |
![]() |
pennant/ | - | Fri, 23 May 2014 17:06:33 +0000 |
![]() |
root_berth/ | - | Fri, 23 May 2014 17:06:28 +0000 |
![]() |
sample_chapters/ | - | Tue, 27 Mar 2018 20:49:20 +0000 |
![]() |
staysail/ | - | Fri, 23 May 2014 17:06:32 +0000 |
![]() |
tax/ | - | Fri, 30 Mar 2018 13:22:25 +0000 |
![]() |
waterline/ | - | Fri, 23 May 2014 17:06:31 +0000 |
![]() |
wood-pump/ | - | Fri, 23 May 2014 17:06:29 +0000 |
![]() |
31t2TBpUGyL._SL500_AA300_.jpg (300x300) | 12.93 KB | Mon, 23 Jan 2012 14:38:53 +0000 |
![]() |
4560537156_3d92afde9a.jpg (500x375) | 220.54 KB | Wed, 04 Apr 2012 19:15:34 +0000 |
![]() |
51LZYno7+lL._SS500_.jpg (500x500) | 42.1 KB | Mon, 21 Jan 2013 22:36:09 +0000 |
![]() |
8side1.jpg (1280x960) | 179.34 KB | Sat, 25 Feb 2012 22:34:32 +0000 |
![]() |
8side2.jpg (1280x960) | 150.86 KB | Sat, 25 Feb 2012 22:34:32 +0000 |
![]() |
8side3.jpg (1280x960) | 181.32 KB | Sat, 25 Feb 2012 22:34:33 +0000 |
![]() |
8side4.jpg (1280x960) | 180.27 KB | Sat, 25 Feb 2012 22:34:33 +0000 |
![]() |
DSCN4979.jpg (1280x960) | 134.45 KB | Sun, 12 Feb 2012 23:09:52 +0000 |
![]() |
DSCN4981.jpg (1280x960) | 131.52 KB | Sun, 12 Feb 2012 23:09:52 +0000 |
![]() |
DSCN4982.jpg (1280x960) | 148.8 KB | Sun, 12 Feb 2012 23:09:53 +0000 |
![]() |
DSCN4984.jpg (1280x960) | 147.35 KB | Sun, 12 Feb 2012 23:09:50 +0000 |
![]() |
DSCN4988.jpg (1280x960) | 122.5 KB | Sun, 12 Feb 2012 23:09:51 +0000 |
![]() |
DSCN4991.jpg (1280x960) | 293.1 KB | Mon, 13 Feb 2012 18:39:23 +0000 |
![]() |
GrayMarineData.png (886x430) | 110.44 KB | Tue, 04 Sep 2012 13:37:54 +0000 |
HotTug.JPG (705x454) | 54.75 KB | Thu, 22 Nov 2012 15:36:15 +0000 | |
IMG_0035.PNG (481x344) | 31.03 KB | Sat, 01 Sep 2012 14:35:28 +0000 | |
IMG_0911.MOV (1920x1080) | 603.17 KB | Sun, 12 Feb 2012 23:11:26 +0000 | |
![]() |
Nikon Distance Off Table.pdf | 42.3 KB | Sun, 07 Oct 2012 15:19:40 +0000 |
![]() |
Nikon_Distance_Off_Table.pdf | 42.3 KB | Sun, 07 Oct 2012 15:20:16 +0000 |
![]() |
PiXels.jpg (450x600) | 80.69 KB | Mon, 30 Jul 2012 20:04:33 +0000 |
![]() |
Sandy_11.jpg (3264x2448) | 846.35 KB | Sat, 27 Oct 2012 15:40:37 +0000 |
![]() |
Screen Shot 2012-03-19 at 8.47.16 PM.png (842x366) | 129.38 KB | Tue, 20 Mar 2012 00:48:07 +0000 |
![]() |
Screen shot 2010-08-05 at 9.42.35 PM.png (570x387) | 264.26 KB | Wed, 28 Mar 2012 13:52:19 +0000 |
![]() |
Screen shot 2010-08-26 at 10.54.32 AM.png (295x244) | 51.58 KB | Thu, 15 Mar 2012 13:32:28 +0000 |
![]() |
StillLife.jpg (3264x2448) | 755.07 KB | Tue, 15 May 2012 19:46:30 +0000 |
![]() |
_wind_june.png (222x285) | 115.77 KB | Mon, 04 Jun 2012 03:05:01 +0000 |
![]() |
_wind_nov.png (246x254) | 107.99 KB | Mon, 04 Jun 2012 03:05:03 +0000 |
![]() |
backstay.jpg (640x480) | 49.84 KB | Sat, 19 May 2012 12:49:06 +0000 |
![]() |
bad_joint.jpg (378x270) | 41.87 KB | Tue, 17 Jan 2012 20:11:13 +0000 |
![]() |
bayday2.jpg (450x203) | 56.85 KB | Thu, 01 Nov 2012 17:18:11 +0000 |
![]() |
bayside_design(2).png (783x181) | 99.22 KB | Tue, 04 Sep 2012 22:00:57 +0000 |
![]() |
bayside_design(4).png (849x700) | 153.95 KB | Thu, 06 Sep 2012 21:18:39 +0000 |
![]() |
bayside_design.png (783x181) | 135.59 KB | Wed, 05 Sep 2012 19:39:59 +0000 |
![]() |
bh41.jpg (1280x960) | 144.1 KB | Sun, 17 Feb 2013 16:06:21 +0000 |
![]() |
bh42.jpg (1280x960) | 167.63 KB | Sun, 17 Feb 2013 16:06:19 +0000 |
![]() |
bh43.jpg (1280x960) | 102.91 KB | Sun, 17 Feb 2013 16:06:20 +0000 |
![]() |
bh44.jpg (1280x960) | 137.06 KB | Sun, 17 Feb 2013 16:06:20 +0000 |
![]() |
bh45.jpg (1280x960) | 138.12 KB | Sun, 17 Feb 2013 16:06:20 +0000 |
![]() |
bh46.jpg (1280x960) | 149.07 KB | Sun, 17 Feb 2013 16:06:20 +0000 |
![]() |
bh_11.jpg (640x480) | 36.06 KB | Sat, 19 Jan 2013 21:39:14 +0000 |
![]() |
bh_12.jpg (640x480) | 43.14 KB | Sat, 19 Jan 2013 21:39:15 +0000 |
![]() |
bh_21.jpg (640x480) | 52.16 KB | Sun, 20 Jan 2013 00:16:18 +0000 |
![]() |
blackwater-sloop.jpeg (259x194) | 5.2 KB | Mon, 30 Jul 2012 20:14:30 +0000 |
![]() |
blackwater_2.jpg (600x400) | 25.58 KB | Mon, 30 Jul 2012 20:26:21 +0000 |
![]() |
blackwater_3.png (549x416) | 435.94 KB | Mon, 30 Jul 2012 20:47:31 +0000 |
![]() |
blue_moon_sf.png (1197x839) | 550.17 KB | Tue, 28 Feb 2012 20:58:28 +0000 |
![]() |
bluemoon-2.jpg (480x640) | 361.16 KB | Thu, 16 Feb 2012 22:33:51 +0000 |
![]() |
bluemoon.jpg (480x640) | 47.88 KB | Fri, 20 Jan 2012 14:14:25 +0000 |
![]() |
blyth_1.jpg (500x500) | 42.1 KB | Mon, 21 Jan 2013 22:36:25 +0000 |
![]() |
bm-profile.png (842x366) | 129.38 KB | Tue, 20 Mar 2012 00:48:56 +0000 |
![]() |
boomkin-bracket1.jpg (1024x768) | 115.21 KB | Wed, 02 May 2012 21:55:19 +0000 |
![]() |
boomkin-bracket2.jpg (1024x768) | 114.95 KB | Wed, 02 May 2012 21:55:19 +0000 |
![]() |
boomkin-installed1.jpg (1280x960) | 171.79 KB | Tue, 08 May 2012 20:18:53 +0000 |
![]() |
boomkin-installed2.jpg (1280x960) | 574.51 KB | Tue, 08 May 2012 21:39:26 +0000 |
![]() |
boomkin-installed21.jpg (1280x960) | 162.1 KB | Tue, 08 May 2012 22:22:57 +0000 |
![]() |
boomkin-installed3.jpg (1280x960) | 504.46 KB | Tue, 08 May 2012 21:43:21 +0000 |
![]() |
boomkin-installed4.jpg (1280x960) | 161.63 KB | Tue, 08 May 2012 20:18:50 +0000 |
![]() |
boomkin-installed5.jpg (1280x960) | 127.02 KB | Tue, 08 May 2012 20:18:51 +0000 |
![]() |
boomkin-plate1.jpg (1024x768) | 112.19 KB | Wed, 02 May 2012 21:45:35 +0000 |
![]() |
boomkin-plate2.jpg (1024x768) | 112.32 KB | Wed, 02 May 2012 21:45:36 +0000 |
![]() |
boomkin1.jpg (1280x960) | 94.23 KB | Fri, 03 Feb 2012 23:37:42 +0000 |
![]() |
boomkin11.jpg (640x480) | 72.25 KB | Mon, 19 Mar 2012 23:01:57 +0000 |
![]() |
boomkin2.jpg (1280x960) | 167.71 KB | Sat, 04 Feb 2012 14:23:48 +0000 |
![]() |
boomkin3.jpg (1280x960) | 151.56 KB | Sat, 04 Feb 2012 14:25:45 +0000 |
![]() |
boomkin4.jpg (435x759) | 85.23 KB | Sat, 04 Feb 2012 14:34:47 +0000 |
![]() |
boomkin5.jpg (1280x960) | 251.29 KB | Sat, 04 Feb 2012 15:08:42 +0000 |
![]() |
boomkin_spar.png (508x529) | 30.93 KB | Sat, 17 Mar 2012 14:33:50 +0000 |
![]() |
breasthook_10.jpg (1501x607) | 139.05 KB | Tue, 15 Jan 2013 01:32:24 +0000 |
![]() |
breasthook_11.jpg (2448x1245) | 431.71 KB | Tue, 15 Jan 2013 01:37:33 +0000 |
![]() |
breasthook_12.jpg (3264x698) | 234.68 KB | Tue, 15 Jan 2013 01:45:57 +0000 |
![]() |
breasthook_13.jpg (2448x3264) | 918.74 KB | Tue, 15 Jan 2013 01:32:21 +0000 |
![]() |
breasthook_21.jpg (1024x768) | 99.7 KB | Tue, 15 Jan 2013 01:34:11 +0000 |
![]() |
breasthook_22.jpg (1024x768) | 106.28 KB | Tue, 15 Jan 2013 01:34:11 +0000 |
![]() |
breasthook_23.jpg (1024x324) | 90.06 KB | Tue, 15 Jan 2013 01:57:26 +0000 |
![]() |
breasthook_301.jpg (1280x960) | 228.83 KB | Wed, 23 Jan 2013 23:52:08 +0000 |
![]() |
breasthook_302.jpg (1280x960) | 172.41 KB | Wed, 23 Jan 2013 23:52:09 +0000 |
![]() |
breasthook_303.jpg (1280x960) | 136.03 KB | Wed, 23 Jan 2013 23:52:08 +0000 |
![]() |
breasthook_304.jpg (1280x960) | 107.76 KB | Wed, 23 Jan 2013 23:52:08 +0000 |
![]() |
breasthook_305.jpg (1280x960) | 106.73 KB | Wed, 23 Jan 2013 23:52:00 +0000 |
![]() |
breasthook_306.jpg (1280x960) | 80.98 KB | Wed, 23 Jan 2013 23:52:02 +0000 |
![]() |
breasthook_307.jpg (1280x960) | 132.76 KB | Wed, 23 Jan 2013 23:52:01 +0000 |
![]() |
breasthook_308.jpg (1280x960) | 123.33 KB | Wed, 23 Jan 2013 23:52:01 +0000 |
![]() |
breasthook_309.jpg (1280x960) | 128.53 KB | Wed, 23 Jan 2013 23:52:02 +0000 |
![]() |
breasthook_310.jpg (1280x960) | 101.17 KB | Wed, 23 Jan 2013 23:52:02 +0000 |
![]() |
breasthook_311.jpg (1280x960) | 163.52 KB | Wed, 23 Jan 2013 23:52:03 +0000 |
![]() |
breasthook_41.jpg (1280x960) | 96.07 KB | Thu, 24 Jan 2013 00:58:57 +0000 |
![]() |
breasthook_51.jpg (2272x1704) | 354.66 KB | Fri, 25 Jan 2013 21:01:09 +0000 |
![]() |
breasthook_52.jpg (2272x1704) | 286.39 KB | Fri, 25 Jan 2013 21:01:10 +0000 |
![]() |
breasthook_53.jpg (2272x1704) | 296.36 KB | Fri, 25 Jan 2013 21:01:01 +0000 |
![]() |
cb_curves.jpg (1024x768) | 104.22 KB | Tue, 18 Dec 2012 23:36:25 +0000 |
![]() |
cb_gun1.jpg (1280x960) | 149.04 KB | Wed, 02 Jan 2013 14:49:34 +0000 |
![]() |
cb_gun2.jpg (1024x768) | 106.39 KB | Wed, 02 Jan 2013 14:49:35 +0000 |
![]() |
cb_gun21.jpg (1024x768) | 107.74 KB | Wed, 02 Jan 2013 14:55:56 +0000 |
![]() |
cb_gun3.jpg (1024x768) | 147.8 KB | Wed, 02 Jan 2013 14:49:35 +0000 |
![]() |
cb_gun4.jpg (1024x768) | 135.34 KB | Wed, 02 Jan 2013 14:49:35 +0000 |
![]() |
cb_gun5.jpg (1024x768) | 147.77 KB | Wed, 02 Jan 2013 14:49:35 +0000 |
![]() |
cb_gun6.jpg (1280x960) | 180.37 KB | Wed, 02 Jan 2013 14:49:35 +0000 |
![]() |
cb_gun7.jpg (1280x960) | 218.13 KB | Wed, 02 Jan 2013 14:49:38 +0000 |
![]() |
cb_gun8.jpg (1280x960) | 104.36 KB | Wed, 02 Jan 2013 14:49:36 +0000 |
![]() |
cb_refit1.jpg (1024x768) | 104.89 KB | Mon, 17 Dec 2012 15:15:17 +0000 |
Image | Name | Filesize | Timestamp |
<?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=180;
$thumbheight=160;
$thumblimit= 3000; // (Max filesize in KB for displaying thumbnail)
$skip= $_REQUEST["skip"];
$perpage= $_REQUEST["perpage"];
$showsource= $_REQUEST["showsource"];
$REQUEST_URI= getenv("REQUEST_URI");
$DOCUMENT_ROOT= getenv("DOCUMENT_ROOT");
$SCRIPT_NAME= getenv("SCRIPT_NAME");
$SCRIPT_FILENAME= getenv("SCRIPT_FILENAME");
$SERVER_SIGNATURE= getenv("SERVER_SIGNATURE");
if ($skip=="") $skip= 0;
if ($perpage=="") $perpage= 100;
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)=="/") {
$length= strlen($REQUEST_URI)-1;
$uripath= substr($REQUEST_URI,0,$length);
} else {
$uripath= dirname($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 ";
$lastslash= strrpos($uripath,"/");
$parenturi= substr($uripath,0,$lastslash+1);
if ($parenturi=="") $parenturi= "/";
$displayuripath= urldecode($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>Image 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) $prevskip= 0;
$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
$count= 0;
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) {
$timestamp= filemtime("$filepath/$file");
$modified= date("r", $timestamp);
if ($evenrow) {
$evenrow=0;
$rowclass= "evenrow";
}
else {
$evenrow=1;
$rowclass= "oddrow";
}
if ($key==($count-1)) $separator= "<a name='files'> </a>";
$safefile= urlencode($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);
$skipped= 0;
$index= 0;
$count= 0;
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) {
$shownext= 1;
break;
}
if ($skipped<$skip && $skip!= 0) {
$skipped= $skipped + 1;
continue;
}
$index= $index + 1;
$timestamp= filemtime("$filepath/$file");
$modified= date("r", $timestamp);
if ($evenrow) {
$evenrow=0;
$rowclass= "evenrow";
}
else {
$evenrow=1;
$rowclass= "oddrow";
}
unset($info);
unset($extrainfo);
unset($sizetag);
$filesize= myfilesize("$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...
$lastdot= strrpos($file, ".");
$extension= strtolower(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 "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
$safefile= urlencode($file);
print "
<tr class='$rowclass'>
<td valign=top align=right>$icontag</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'> 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>";
$void= show_source($SCRIPT_FILENAME);
}
print "
<hr>
</body>
</html>";
?>