Makes blocks available to themes for showing random/recent/most-viewed images or albums.
Show random images or the highlight of the most viewed album or choose between a lot of other image block types to show in a specific album or on all of your Gallery pages. Or show these images on other websites with the external image block.
Also see:
The following options are available:
blocks Pipe(|) separate list chosen from: randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem; default is randomImage show Pipe(|) separated list chosen from: title, date, views, owner, heading, fullSize, rawImage, none itemId Limit the item selection to the subtree of the gallery under the album with the given id; or the id of the item to display when used with specificItem block type maxSize Scale images to this maximum size. If used alone Gallery will locate the most-closely-sized image to the specified value - larger images will be scaled down as necessary in your browser. If specified along with g2_show=fullSize the full size image will always be used and scaled down as necessary. exactSize Just like g2_maxSize except that it will not substitute an image smaller than the size you request, so you'll get the closest match in size possible. Note that this may use a lot more bandwidth if a much larger image has to be scaled down in your browser. link Href for link on image; value of none for no link; default is link to item in the Gallery linkTarget Add a link target (for example, to open links in a new browser window)
The maxSize and exactSize parameters may need clarification:
Example Image: 100px thumbnail 500px resize 1024px original maxSize Parameter: maxSize=299 returns the 100px thumbnail because it is the "closest" in size to the requested maxSize. (199px away, whereas the 500px image is 201px away) maxSize=300 returns the 500px resize because in the case of an image having two sizes that are equally close in size (both 200px away) the larger of the two is returned for quality maxSize=800 returns the 1024px original
Example Image: 100px thumbnail 500px resize 1024px original exactSize Parameter: exactSize=299 returns the 500px resize because it is the closest larger image. exactSize=500 returns the 500px resize because it is an exact match. exactSize=800 (and anything larger) returns the 1024px original
NOTE: Until very recent versions of this module, the "exactSize" parameter did not exist and the "maxSize" parameter did not function as described above.
I am not certain, but I _believe_ the documents above apply to version 1.0.11 (which works with Gallery 2.2 RC1) and not to the version of the module that comes with Gallery 2.1.2.
Display images horizontally. Add:
div.one-image {float: left;} div.one-image a { display:inline;} div.one-image img { display:inline;} block-imageblock-ImageBlock { display:inline;}
to the css of the theme you are using.
Display a 4x4 grid of recent images, images set to a max size of 50, in a template:
{literal} <style> .one-image { display: inline; } .g2imageblock { width: 106px; } </style> {/literal}
<div class="g2imageblock"> {g->block type="imageblock.ImageBlock" blocks="recentImage|recentImage|recentImage|recentImage" maxSize=50} </div>
Adjust the .g2imageblock css width if you are using a larger maxSize.
The image block module checks permissions first. This means that a user can only see albums or images in the image block for which he/she has sufficient authorization. If an album is password-protected using the password module, items inside the album will not be shown in the image block (unless the user is the owner of the album). However, the album itself will be shown in the image block. Images or other items that are password-protected directly will also be shown in the image block with their thumbnails. If the user navigates to one of these password-protected albums or items, he/she will be asked for a password.
To exclude password-protected albums and items from the image block completely, the following coding needs to be added to the file gallery2/modules/imageblock/classes/ImageBlockHelper.class before this statement.
list ($ret, $owner) = GalleryCoreApi::loadEntitiesById($item->getOwnerId());
Coding to be added:
//check if the item is directly protected by a password. //in this case, do not show it in the image block, not even as a preview: if( $item->hasOnLoadHandler('Password') ){ continue; }
Currently there are no feature requests for this module.
Currently there are no known issues for this module.