Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with slide show .ph

    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),

    http://www.javascriptkit.com/script/script2/phpviewer/


    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...lhemmerich@knottydog.com

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

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

    function returnimages($dirname=".") {
    $pattern="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)";
    $files = array();
    $curimage=0;
    if($handle = opendir($dirname)) {
    while(false !== ($file = readdir($handle))){
    if(eregi($pattern, $file)){
    echo 'picsarray[' . $curimage .']="' . $file . '";';
    $curimage++;
    }
    }

    closedir($handle);
    }
    return($files);
    }

    echo 'var locationstring="' . $locationstring . '";';
    echo 'var picsarray=new Array();';
    returnimages()
    ?>
    Last edited by lhemmerich; 02-18-2007 at 09:59 PM. Reason: spelling


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •