How would I alter the following code to make it draw the image blocks from a specific album? I would like to create three such blocks, two of which would be random images, and one would be recent images. They would all be drawn from different albums. Here is the code from a similar block on the user profile:
// Grid block (4 random images in 2 columns from useralbum of the profile's owner)
$params = array(
'blocks' => implode('|', array_fill(0, 2, 'randomImage')),
'itemId' => 'user:'. $profileuser->uid
);
$block = gallery_get_block($params, 2);
print $block['content'];
How would I alter it to meet those needs?
Many thanks.
Comments
Comment #1
profix898 commentedThat's pretty simple:
1. To fetch items from a particular album, you can simply set the 'itemID' parameter to that album's id, i.e. replace
'itemId' => 'user:'. $profileuser->uidwith'itemId' => '123'('123' is the album id).2. To fetch recent items instead of random items from that album, you change 'randomImage' to 'recentImage'.
Is that what you were looking for?
Comment #2
SuperRookie commentedYes. I will try that. Thank you very much.
Comment #3
SuperRookie commentedI can't seem to find the item id for the albums. Gallery displays the images' id, but not the album. This seems trivial to even bother posting, but I just can't seem to find them.
Comment #4
SuperRookie commentedI found the album ids by investigating the page source.