Info: Some of the images which are available by using the links providing are from a TV series and may be contain scenes of a violent nature.
I've modified a free script that displays all images in the folder in which the script appears. I'm trying to get it to display a table with 5 clickable thumbnail images that take you to the picture you clicked on. The table should display in rows of 5. I got the original script working and made a script that displays a clickable thumbnail of an image. However I'm having a job combining the two.
Here's the code so far:
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>
<title>Millennium Image Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
/* This script displays all the images in the current directory. Written
* by Sander Spek <s@sander-s.net>. This script has been copylefted, and
* falls under the GNU General Public License
* <http://www.gnu.org/copyleft/gpl.html>.
*/
// The RegExp for finding images.
$fileregex = "[jpg|jpeg|png|gif]";
// We use the current folder.
$all = opendir('.');
// Create the array containing the image references.
$photos = array();
// Fill the array:
while ($file = readdir($all)) {
if (!is_dir($location.'/'.$file) and $file <> ".." and $file <> ".") {
if (preg_match($fileregex,$file)) {
array_push($photos,$file);
}
}
}
// Let's see how many image references we retrieved.
$arlength = count($photos);
echo "Contents: ".$arlength;
// And finally, let's display our stuff.
echo "<table width='95%' border='0' cellspacing='1' cellpadding='1'><tr>\n";
for ($i=0; $i<$arlength; $i++) {
echo '<td><a href="'.$photos[$i].'" border ='0'><img src="'.$photos[$i].'" border ='0'
width='150' height='100'></a></td>";
}
echo '</tr></table>';
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Millennium Image Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
/* This script displays all the images in the current directory. Written
* by Sander Spek <s@sander-s.net>. This script has been copylefted, and
* falls under the GNU General Public License
* <http://www.gnu.org/copyleft/gpl.html>.
*/
// The RegExp for finding images.
$fileregex = "[jpg|jpeg|png|gif]";
// We use the current folder.
$all = opendir('.');
// Create the array containing the image references.
$photos = array();
// Fill the array:
while ($file = readdir($all)) {
if (!is_dir($location.'/'.$file) and $file <> ".." and $file <> ".") {
if (preg_match($fileregex,$file)) {
array_push($photos,$file);
}
}
}
// Let's see how many image references we retrieved.
$arlength = count($photos);
echo "Contents: ".$arlength;
// And finally, let's display our stuff.
echo "<table width='95%' border='0' cellspacing='1' cellpadding='1'><tr>\n";
for ($i=0; $i<$arlength; $i++) {
echo '<td><a href="'.$photos[$i].'" border ='0'><img src="'.$photos[$i].'" border ='0'
width='150' height='100'></a></td>";
}
echo '</tr></table>';
?>
You can see it run or rather try to here:
http://www.millenniumdesktop.co.uk/cmeacg/...ageLinksgps.php
I'm getting a parse error that reads "Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home/jackal/public_html/cmeacg/img/stills/s1/pilot/TestImageLinksgps.php on line 43"
Also, when it was working, the table had ALL the images within the folder displayed in 1 long row. How can I make it that it displays them in rows of 5 maximum?
I'd be grateful for some help!
Gra.
