error_reporting(0);
echo "
GuitarHQ.com - Fender Vintage Guitar Detail Pictures
";
//--------------------------------
// -- Read the SB description database text file.
$dbfile="fenddiff.txt";
//echo "database file=$dbfile
";
if (file_exists($dbfile)):
$sbinfo = File($dbfile);
$sbinfolen = sizeof($sbinfo);
sort($sbinfo); //-- Sort the array.
$i = 0;
while ($i < $sbinfolen):
$tok = strtok($sbinfo[$i],"|");
$sbname[$i] = $tok;
$tok = strtok("|");
$sbdesc[$i] = $tok;
$sbdesc[$i] =substr($sbdesc[$i],0,strlen($sbdesc[$i])-1); //-- strip off the CR.
//echo "\n";
$i++;
endwhile;
endif;
//--------------------------------
//-- Read in the directory file names.
$handle=opendir('.');
//echo "Directory handle: $handle\n";
while ($false != ($file = readdir($handle))) {
//-- Ignore certain files.
if ($file!="." && $file!=".." && substr($file,0,5)!="index"
&& $file!="makehtml.php" && substr($file,0,8)!="fenddiff") {
//echo "filename=$file
";
$size=filesize($file);
$size = number_format ($size, 0); //-- add commas to number.
$filename[count($filelist)] = "$file"; //-- Put file name only into an array.
$filenoext=substr($file,0,strlen($file)-4); //-- remove the file extension.
//-- Get the correct file description.
$desc=" ";
$i = 0;
while ($i < $sbinfolen):
if ($sbname[$i] != $filenoext):
//-- Do nothing...
else:
$desc=$sbdesc[$i];
endif;
$i++;
endwhile;
//-- Set up the HTML tags.
if (substr($file,-4)!=".gif" && substr($file,-4)!=".jpg") {
//-- do this for all non-graphic file types.
$filelist[count($filelist)] = "$filenoext | | $desc |
\n"; #-- Put files into an array
//-- the comment at the beginning of the above HTML line is there for sorting purposes.
}
else {
//-- do this for GIF/JPG files only.
$filelist[count($filelist)] = "$filenoext | | $desc |
\n"; #-- Put files into an array
//-- the comment at the beginning of the above HTML line is there for sorting purposes.
}
}
}
closedir($handle);
sort($filelist); //-- Sort the array.
sort($filename); //-- Sort the array.
//-------------------------------------------------------
echo "
GuitarHQ.com
- Fender Vintage Guitar Detail Pictures.
From the GuitarHQ.com
Fender Vintage Guitar Info Web page.
Most pictures taken by and thanks to Jim Shine.
|
|
Picture Name | Description |
\n
";
//-------------------------------------------------------
//-- Print the sorted array.
$i=0;
do {
if ($i > 0) {
if (substr($filename[$i],0,3) <> substr($filename[$i-1],0,3)) {
//-- If the first 3 chars of the prior array element is not the same, print a blank line.
//print " |
\n";
print "
|
\n";
}
}
print ($filelist[key($filelist)]); //-- print the array element.
$i++;
}
while (next($filelist));
//---------------------------------------------
//-- Finish off the html table.
echo "
|
\n";
echo "
\n";
echo "
";
?>