Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorbigideaguy
    • CommentTimeFeb 15th 2010
     
    I am trying to display just one album on this page http://204.12.217.114/~oceanbri/custom.php

    this is the album http://204.12.217.114/~oceanbri/gallery/index.php?level=album&id=2

    I can't get it to display and not sure how to remove the error, here is the code i added to custom.php

    <code><?php include("header.php");
    include("gallery/gallery.php");
    include("gallery/plog-includes/plog-functions.php");
    include("gallery/plog-globals.php");
    function get_gallery($collectionId = 1, $albumId) {
    $sql = "select * from plogger_pictures where parent_collection = " . $collectionId . " and parent_album = " . $albumId;
    $result = run_query($sql);
    while ($row = mysql_fetch_assoc($result)) {
    $id = $row["id"];
    $thumbUrl = "/gallery/thumbs/$id-".basename($row["path"]);
    $largeUrl = "/gallery/thumbs/lrg-$id-".basename($row["path"]);
    $caption = $row["caption"];
    echo "<a href='$largeUrl' rel='lightbox' title='" . $caption . "'><img src='" . $thumbUrl . "' alt='" . $caption . "'></a>";
    }
    }
    ?></code>

    and in the body area

    <code><?php get_gallery(1, 2) ?></code>
    •  
      CommentAuthorsidtheduck
    • CommentTimeFeb 16th 2010 edited
     
    It's throwing the error because of this line:
    include("gallery/plog-includes/plog-functions.php");
    As plog-functions.php is already being included with gallery.php (so is plog-globals.php). You can clear up this error if you use "include_once" instead of "include".

    Technically, if you are not using the cruft-free URLs or the_gallery_head() or the_gallery() functions, you can replace your 3 includes at the top from this:
    include("gallery/gallery.php");
    include("gallery/plog-includes/plog-functions.php");
    include("gallery/plog-globals.php");

    to just this 1 line of code:
    include("gallery/plog-load-config.php");
    and you should be fine with your function.

    Hope that helps!