Topic Title: Get GT-AlbumList.php code here

Forum Index » GalleryTap » Get GT-AlbumList.php code here
Topic URL: http://www.nukedgallery.net/postt989.html

AuthorMessage
Post Title: Get GT-AlbumList.php code here
wHiTeHaT
Joined: Jul 28, 2003
Posts: 10

Posted: Fri Jul 02, 2004 2:38 pm
i hope it is usefull

Code: › <?php

if (eregi("block-GT-AlbumList.php",$PHP_SELF)) {
    Header("Location: index.html");
    die();
}

global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;
define(PHPNUKE_ADDR,"http://www.yoururl.com/");

// CHANGE THIS TO REFLECT YOUR INSTALLATION     
$GALLERY_BASEDIR = "/YOURPATH/modules/gallery/";
$GALLERY_MODULENAME = "gallery";
// DON"T CHANGE ANYTHING BELOW HERE

require_once($GALLERY_BASEDIR."init.php");
$GALLERY_EMBEDDED_INSIDE = "nuke";
$GALLERY_EMBEDDED_INSIDE_TYPE = "phpnuke";

$content = "";

$albumDB = new AlbumDB(FALSE);

function printAlbumList($albumName,$depth=0) {
        global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;

        $printedHeader = 0;
        $myAlbum = new Album();
        $myAlbum->load($albumName);
        $numPhotos = $myAlbum->numPhotos(1);
        for ($i=1; $i <= $numPhotos; $i++) {
                $myName = $myAlbum->getAlbumName($i);
                if ($myName && !$myAlbum->isHidden($i)) {
                        $nestedAlbum = new Album();
                        $nestedAlbum->load($myName);
                        if ($gallery->user->canReadAlbum($nestedAlbum)) {
                                $val2 = $nestedAlbum->fields['title'];
                                $content .= "<div style=\"margin: 0px 0px 0px 20px\">";
                                $content .= "<span class=fineprint>";
                                $content .= "<a href=\"";
                                $content .= makeAlbumUrl($myName);
                                $content .= "\">$val2</a>\n";
                                $content .= printAlbumList($myName,$depth+1);
                                $content .= "</span>";
                                $content .= "</div>";
                        }
                }
        }
   return $content;
}


foreach ($albumDB->albumList as $album) {
   if (!$album->isRoot()) {
      continue;
   }
   $content .= "<a href=\"".PHPNUKE_ADDR."gallery-album_".$album->fields['name'].".html\">" .$album->fields['title'] ."</a>\n<br><hr>";
   $content .=  printAlbumList($album->fields["name"]);

}
?>


Have fun with it

All times are GMT - 5 Hours
Powered by PHPNuke and phpBB2 © 2006 phpBB Group