How to Use the BacklitAlbum Class
You create an instance of the BacklitAlbum class like this:
1 | $album = new BacklitAlbum($album_id); |
The album_id parameter corresponds to the album_id field in the bl_albums table in your database.
To get the album's title you use the getTitle method:
1 | echo $album->getTitle(); |
To generate the HTML breadcrumbs for an album, use the getBreadcrumbTrail method:
1 | echo '<div id="breadcrumbs">' . $album->getBreadcrumbTrail() . '</div>'; |
To generate a HTML table of photo thumbnails, each of which are links to the larger photo, use the getPhotosAsTable method:
1 | echo '<div class="photo_album align_center">' . $album->getPhotosAsTable() . '</div>'; |
If the getPhotosAsTable method does not suit your needs, you can use the getPhotos method. The getPhotos method returns an array of objects with the properties: photo_id, caption, publish_date, credit, and display_order. You could then loop through the array and display links in any configuration you liked.
To generate a HTML list of links to the album's children, use the getChildrenAsList method:
1 | echo $album->getChildrenAsList(); |
You can optionally pass in direction, limit, and offset parameters.
The direction parameter is a string and must be either 'ASC' or 'DESC'. The limit parameter allows you to limit the number of children returned. The offset parameter will offset the records returned by the database.
If the getChildrenAsList method does not suit your needs, you can use the getChildren method. The getChildren method returns an array of objects with the properties: album_id and title. You could then loop through the array and display links in any configuration you liked.
To generate a site map for an album, use the getDescendantsAsList method:
1 | echo $album->getDescendantsAsList(); |
Unlike the getChildrenAsList method, the getDescdantsAsList method does not take any parameters.