Results 1 to 6 of 6

Thread: PHP Photo Album Script - Nothing shows up after install

  1. #1
    Join Date
    Feb 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default PHP Photo Album Script - Nothing shows up after install

    1) Script Title: PHP Photo Album Script

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

    3) Describe problem:

    Despite having gone over the implementation directions and my own modifications SUPER carefully, I'm getting zero results from this script. Nothing shows up at all... no errors, nothing.

    Before posting this, I was searching the forums for possible fixes, and made one or two small modifications to the php script, but nothing helped.

    The files can be found here:

    http://www.legacystudies.org/galleries/general.html
    http://www.legacystudies.org/galleries/getpics.php

    I'd appreciate any help I can get here... I'm totally baffled.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    One major problem is that there appear to be no image files in this folder:

    Code:
    http://www.legacystudies.org/galleries/
    As a result:

    Code:
    http://www.legacystudies.org/galleries/getpics.php
    has nothing to find there. Your script code would seem to indicate that the image files are actually here:

    Code:
    http://www.legacystudies.org/galleries/general/
    If so, the external tag calling getpics.php should be:

    Code:
    <script src="general/getpics.php" type="text/javascript"></script>
    and getpics.php should be in that folder.

    There could still be other problems.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    beck.thomson (03-05-2008)

  4. #3
    Join Date
    Feb 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Well, that seems to have done it. I guess I figured that as long as I referenced getpics.php correctly, it wouldn't be an issue. The thing is, if I want to have more than one photo gallery in different folders, will I need to copy the php file into each of those folders now?

    Thanks so much for your help... I was totally stymied.

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by beck.thomson View Post
    if I want to have more than one photo gallery in different folders, will I need to copy the php file into each of those folders now?
    Yes, that's the way that it works. If you are much up on PHP, you could modify getpics.php to accept a query to tell it which folder to look in. I'm not though, so what follows is just my best guess. The basic concept though would be to use the PHP GET to get the folder from a script tag with a src attribute like:

    Code:
    <script src="getpics.php?folder=general" type="text/javascript"></script>
    Then in getpics.php, this line would receive that info:

    Code:
    function returnimages($dirname=".") {
    by being modified something like:

    Code:
    function returnimages($dirname="./" . $_GET["folder"] . "/") {
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #5
    Join Date
    Feb 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yeah, PHP isn't really my strong point either.

    One last question--do you know whether it's possible with this script to specify custom captions for each photo?

  7. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    On the PHP issue - I just tested it, and it did not work. However, this did - instead of making the change to getpics that I thought, do this, change:

    PHP Code:
    function returnimages($dirname=".") {
       
    $pattern="\.(jpg|jpeg|png|gif|bmp)$"
    to:

    PHP Code:
    function returnimages() {
       
    $dirname="./" $_GET["folder"] . "/";
       
    $pattern="\.(jpg|jpeg|png|gif|bmp)$"
    As to your other question, captions? Sure we can do just about any sort of captions that you like. But I would need to know where these captions should appear, and what the typical content of the captions would be, as well as how you want to define the captions.

    With this script, the easiest way to define captions is as a subset of each image's filename. Like if you want a caption:

    Great Image!

    The image should be called:

    Great_Image!.jpg

    Working on that basis, if you want the captions to appear below the images in the gallery itself, you would edit this line in the script:

    Code:
    tempcontainer+=(descriptionprefix[0]==1)? descriptionprefix[1]+(i+1) : ""
    to be like so:

    Code:
    tempcontainer+=galleryarray[i][0].replace(/_|(\..*)/g,' ');
    If there is something else that you have in mind, or you have any problems with implementing this let me know.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •