News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1213157098:v:use_geshi-1:v:type-php

Started by Guest, Jun 11, 2008, 04:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Guest

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();
     exit;
 }
 /*
  * 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();
     exit;
 }
 /* $bodyHtml contains the image block. print it somewhere on your website */
echo '<center>' . $bodyHtml . '</center>';