Results 1 to 3 of 3

Thread: PHP photo album, Can getpics script call images from another location?

  1. #1
    Join Date
    Jan 2007
    Location
    Northern Ireland
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP photo album, Can getpics script call images from another location?

    1) Script Title:
    PHP Photo Album Script

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem:
    First oif all, this is a fantastic script, much quicker than creating galleries in any WYSIWYG program I've come accross.

    My problem is, the script, as its shown on DD, requires the getpics script to be in the same folder as the thumbnails.
    With my host, or freespace I get from my ISP, I can only run scripts, perl, php etc from my cgi bin, and I can't use images in my cgi bin.

    What I want to know, if anyone can help me is, can the script be altered, so that the getpics can call images from another directory, so I could have the getpics script in my cgi bin, calling images from my normal webspace?
    If so, what needs to be changed and how.

    Many thanks in advance to anyone who can help me with this one.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Certainly. Inside getpics.php, find the line:

    Code:
    returnimages();
    And change that to:

    Code:
    $imagesdirpath=$_SERVER['DOCUMENT_ROOT'] . "/phpalbum/"; //server path to your images directory
    returnimages($imagesdirpath);
    Where $imagesdirpath=$_SERVER['DOCUMENT_ROOT'] . "/phpalbum/" is the path to your images directory. Just change "/phpalbum" to the full path of your images directory relative to your server's root (ie: mydomain.com).

    You may want to read up on PHP's predefined variables to find out the various ways you can retrieve the path to a folder on your server. There are a few ways.

  3. #3
    Join Date
    Jan 2007
    Location
    Northern Ireland
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Many thanks for that.

    I managed to get it working on a gallery, but I then tried it again in a different page, and instead of displaying images 3x3, it show2s them all in 1 column, but 3 groups of 3. The cell width should be ample to accomidate the images 3 wide.

    Any suggestions on how I can fix this would be greatly appreciatted.
    I have tried it on the following URLS, and can't get it to work
    http://ccgi.niftwo.force9.co.uk/past...2005/index.php
    http://ccgi.niftwo.force9.co.uk/past...005/index2.htm
    http://ccgi.niftwo.force9.co.uk/past...2004/index.php

    Could it conflict with using "include" scripts in PHP?

Bookmarks

Posting Permissions

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