Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Posts
    21

    Unanswered: photo gallery with script

    whats up everyone

    i got the script that i want to use for my photo albumbut i have a question.

    function getImageArray()
    {
    $images = array();
    $cwd = getcwd();
    chdir($_SERVER['DOCUMENT_ROOT']);
    $images = glob($this->imageDir.'/*.{'.$this->suffixes.'}', GLOB_BRACE);
    chdir($cwd); // back to original directory
    return($images);
    }

    its a pretty standard php script with an ajax called timer and i was wondering how can you have the images be working with the script if you have a databse setup and not an array like the function above?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    weel presumably there must be some form of documentation that came with the script, unless its lifted form another site. What you could do is 'stuff' the images to be displayed into the Array at the time the script is intialised, you coudl populate the array with the results returned form a PHP sdript ectracting the images from a db.

    in essence, instead of stuffing the array with files form a specified location in a directory (The GLOB bit), replace that with appropriate code to retrieve data from a MySQL db.

    I found Paul Zackas's stuff pretty helpful on PHP & AJAX... heck he even has an array class for use in Javascript
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2008
    Posts
    21
    http://charles-reace.com/PHP_and_MySQL/Image_Rotator/

    that is the link to the script that i will be using. using the script from the link provided, you think that i should have a php file place all the images into arrays when the file is initiated? or is there a better method now knowing the script that i will be using?

Posting Permissions

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