global $scripturl,
$modSettings,
$user_info,
$ID_MEMBER;
$useImageFrames = false;
$imageFrameName = "carbon";
if($useImageFrames)
echo '<link rel="stylesheet" href="'.
$modSettings['galleryUrl'].
'/main.php?g2_controller=imageblock.ExternalCSS&g2_frames='.
$imageFrameName.
'"/>';
require_once($modSettings['galleryPath'].'/embed.php');
$ret = GalleryEmbed::
init(array('fullInit' =>
true,
'embedUri' =>
$scripturl.
'?action=gallery',
'g2Uri' =>
$modSettings['galleryUrl'].
'/',
'activeUserId' =>
($user_info['is_guest'] || !
$user_info['is_gallery_user']) ?
'' :
$ID_MEMBER));
if ($ret) {
print 'GalleryEmbed::init failed, here is the error message: ' .
$ret->
getAsHtml();
}
/*
* See "Site admin" -> "image block" for all available options. the parameters are the same
* as for the external imageblock
*/
$blockData =
array('blocks' =>
'randomImage',
'maxSize' => '120',
'show' => 'title');
if($useImageFrames)
{
$blockData['itemFrame'] = $imageFrameName;
$blockData['albumFrame'] = $imageFrameName;
}
list ($ret,
$bodyHtml,
$headHtml) = GalleryEmbed::
getImageBlock($blockData);
if ($ret) {
print 'GalleryEmbed::getImageBlock failed, here is the error message: ' .
$ret->
getAsHtml();
}
/* $bodyHtml contains the image block. print it somewhere on your website */
echo '<center>' .
$bodyHtml .
'</center>';