gallery help
Posted: Thu Dec 17, 2009 11:58 am
Hi,
somebody send me this script (below) to make gallery for my site, it works well!
I just wondering, if some one can help me on how to make clicked thumbs open (the big picture) on the new windows?
.... click the big picture back to the thumbs? or new template windows?
THANKS. and happy holidays !!!!!!!!
<?php
error_reporting(E_ALL);
if(!is_dir('thumbs')) die('thumbs directory was not found');
$file_list = array();
if ($handle = opendir('thumbs')) {
while (false !== ($file = readdir($handle))) {
if (strtolower(array_pop(explode('.',$file))) == 'jpg') {
$file_list[] = $file;
}
}
closedir($handle);
}
$count = 0;
$total = count($file_list);
?>
<?php
sort($file_list);
foreach($file_list as $file) {
$path = 'thumbs/'.$file;
if(!is_file($file)) continue;
echo "<a href=\"{$file} \"><img src=\"{$path}\" class=\"pic\" alt=\"{$file}\"></a>
";
}
?>
somebody send me this script (below) to make gallery for my site, it works well!
I just wondering, if some one can help me on how to make clicked thumbs open (the big picture) on the new windows?
.... click the big picture back to the thumbs? or new template windows?
THANKS. and happy holidays !!!!!!!!
<?php
error_reporting(E_ALL);
if(!is_dir('thumbs')) die('thumbs directory was not found');
$file_list = array();
if ($handle = opendir('thumbs')) {
while (false !== ($file = readdir($handle))) {
if (strtolower(array_pop(explode('.',$file))) == 'jpg') {
$file_list[] = $file;
}
}
closedir($handle);
}
$count = 0;
$total = count($file_list);
?>
<?php
sort($file_list);
foreach($file_list as $file) {
$path = 'thumbs/'.$file;
if(!is_file($file)) continue;
echo "<a href=\"{$file} \"><img src=\"{$path}\" class=\"pic\" alt=\"{$file}\"></a>
";
}
?>