OK sorted this out by adapting the scolling script.
Code: › if (eregi("block-G2_ImageBlock.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
global $admin, $user, $cookie, $db, $prefix;
define("_G2_EMBED_PHP_FILE","embed.php");
define("_G2_CONFIGURATION_NOT_DONE","The module has not yet been configured.");
$g2result = $db->sql_query("SELECT * FROM ".$prefix."_g2config");
list($embedUri, $g2Uri, $activeUserId, $cookiepath, $showSidebar, $g2configurationDone, $embedVersion) = $db->sql_fetchrow($g2result);
if ($g2configurationDone != 1) {
$content = _G2_CONFIGURATION_NOT_DONE;
return;
}
preg_match("/^(.*)?(modules\/.*)/i", $g2Uri, $matches);
require_once($matches[2]._G2_EMBED_PHP_FILE);
if (is_admin($admin)) {
$uid='admin';
}
else {
if (is_user($user)) {
cookiedecode($user);
$uid='';
if (is_user($user)) {
$uid = $cookie[0];
}
}
}
$ret = GalleryEmbed::init(array(
'embedUri' => $embedUri,
'g2Uri' => $g2Uri,
'activeUserId' => "$uid",
'fullInit' => true));
//if ($showSidebar) {
//$content = "The Gallery2 sidebar is enabled.<br>You should disable it before using this block.";
// return true;
//}
list($ret, $modulestatus) = GalleryCoreApi::fetchPluginStatus('module');
if($modulestatus['imageblock']['active'] != '1') {
$content = 'You need to install and/or activate the ImageBlock module in Gallery 2 before using this block';
return true;
}
$g2moddata = GalleryEmbed::handleRequest();
if(intval($maxSize) > 0) {
list($ret,$html1, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block1, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid','maxSize' => $maxSize));
list($ret,$html2, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block2, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid','maxSize' => $maxSize));
list($ret,$html3, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block3, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid','maxSize' => $maxSize));
list($ret,$html4, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block4, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid','maxSize' => $maxSize));
list($ret,$html5, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block5, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid','maxSize' => $maxSize));
}
else {
list($ret,$html1, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block1, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid'));
list($ret,$html2, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block2, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid'));
list($ret,$html3, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block3, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid'));
list($ret,$html4, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block4, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid'));
list($ret,$html5, $head) = GalleryEmbed::getImageBlock(array('blocks'=>$block5, 'show'=>$display1,'itemFrame'=>'solid','albumFrame'=>'solid'));
}
if (!isset($g2moddata['isDone'])) {
echo 'isDone is not defined, something very bad must have happened.';
exit;
}
if ($g2moddata['isDone']) {
exit;
}
// This Code Extracts the Image & Link
$b1 = substr($html1,$pad,$pad2);
$b2 = substr($html2,$pad,$pad2);
$b3 = substr($html3,$pad,$pad2);
$b4 = substr($html4,$pad,$pad2);
$b5 = substr($html5,$pad,$pad2);
$content ="\n<center> <i>Selection Of Pictures From The Gallery</i> <br \>";
$content .="<table><tr><td>".$b1;
$content .="</td><td>".$b2;
$content .="</td><td>".$b3;
$content .="</td><td>".$b4;
$content .="</td><td>".$b5;
$content .="</td></tr></table></center>"
?>