View Full Version : Help with slide show .ph

Feb 18th, 2007, 08:20 PM
I am not a coder but just try to use cut & paste code
I am trying to use code from Dynamic PHP Picture Viewer (version 1.0),


The code works But I would like to modify as follows:
1..Resize the photos so all have the same width (height can float)
2..Auto show rather than click on list,... or mouse click to advance to next photo
3..Position the phpto in the same location each time ie center of screen

This link show what is working now: http://www.knottydog.com/photo_table.htm

Application is showing 10,000+ photos in our web site that are in various directories. I want to make a index to the various directories.

2nd problem is the .php code is required to be in each directory. That is fine BUT I need to change the location of where it puts the echo so that my sub directories are found. If the .php is NOT in the same root no pictures are returned.

I assume changing one of the paths in the .php text below will point to where the java code is but I do not know how to do that.

Thanks for any help

Larry Hemmerich
[email protected]

this is the .php code added to each dir where the photos exist..

Header("content-type: application/x-javascript");
$locationstring="http://" . $_SERVER['HTTP_HOST'].$pathstring['dirname'] . "/";

function returnimages($dirname=".") {
$files = array();
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
echo 'picsarray[' . $curimage .']="' . $file . '";';


echo 'var locationstring="' . $locationstring . '";';
echo 'var picsarray=new Array();';