Have you got too many albums to list without having a huge block?
Here is how to modify the block-NG-AlbumList.php block to make it scroll.
1. After line 39:
Code: › $content .= "</div>";
ADD
Code: › $content .= "</marquee>";
2. After lines 45 and 46:
Code: › return $content;
}
ADD
Code: ›
$content .= "<marquee loop=\"infinite\" direction=\"up\" behavior=\"scroll\" align=\"center\" scrollamount= \"2\" scrolldelay=\"60\" height=\"220\" onmouseover='this.stop()' onmouseout='this.start()'>";
Here is the entire block with the modified code for scrolling
Code: ›
<?php
global $gallery, $GALLERY_EMBEDDED_INSIDE, $GALLERY_MODULENAME;
// CHANGE THIS TO REFLECT YOUR INSTALLATION
$GALLERY_BASEDIR = "/var/www/virtual/artish.org/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>";
$content .= "</marquee>";
}
}
}
return $content;
}
$content .= "<marquee loop=\"infinite\" direction=\"up\" behavior=\"scroll\" align=\"center\" scrollamount= \"2\" scrolldelay=\"60\" height=\"220\" onmouseover='this.stop()' onmouseout='this.start()'>";
foreach ($albumDB->albumList as $album) {
if (!$album->isRoot()) {
continue;
}
$content .= "<a href=\"".makeAlbumUrl($album->fields['name'])."\">" .$album->fields['title'] ."</a>\n<br>";
$content .= printAlbumList($album->fields["name"]);
}
?>
enjoy!
~tonyash