All pastes #278114 Raw Edit

sqwob

public php v1 · immutable
·published 2006-12-13 21:14 UTC
rendered paste body
<?php/*+---------------------------------------------------------------+| e107 website system Gallery2 Plugin| g2random_image_menu.php|| Garbor and Rashan 2006| (garbor@gmx.net, rashan@hagan-net.net)|| For gallery2.1|| Released under the terms and conditions of the| GNU General Public License (http://gnu.org).+---------------------------------------------------------------+Displays a random Gallery image in an e107 menu*/if (!defined('e107_INIT')) { exit; }// the common gallery tasks are now in functions.phprequire_once(e_PLUGIN."gallery1/functions.php");// Load configured values from dbg1_LoadConfig();// Initialize gallery2 embedding$ret = g1_Init(true);list ($ret, $imageBlockHtml) = GalleryEmbed::getImageBlock( array(    'blocks'  => 'randomImage',    'show'    => 'title',    'maxSize' => 170));    if ($ret){  if (($ret->getErrorCode() & ERROR_CONFIGURATION_REQUIRED) > 0)    $imageBlockHtml = G2_LAN_ERROR_ACTIVATE_BLOCK;  else  {    $imageBlockHtml = G2_LAN_ERROR_GET_IMAGE_BLOCK.    'ErrorCode: '.$ret->getErrorCode().'<BR>'.    'ErrorMessage: '.$ret->getErrorMessage().'<BR>';  }}$text     = "<div style='text-align:center'>".$imageBlockHtml."</div>";$caption  = G2_LAN_RANDOM_HEAD;$ns->tablerender($caption, $text, 'g1random_photo');g1_Close();?>