Panda Image Gallery – Unified Mode

Unified Mode is designed to make it easy to integrate Panda Image Gallery into any existing website while maintaining usable links in the address bar. This is accomplished by loading the gallery in an iframe and then forcing the gallery engine to utilize a base url (the url of the page the gallery is being embedded on). Some simple code (mixed php/html/javascript) is entered within the page Panda Image Gallery is being embedded on. This code retrieves the variables passed to the parent page and passes them to the iframe in which the gallery is loaded. Unified Mode is compatible with any website regardless of the websites platform (cms or custom).

To enable Unified Mode follow these steps
1) Install Panda Image Gallery
2) Enter the url for the page that Panda Image Gallery is being embedded on in the variable $base_url in config.php.
3) Enable Unified Mode by setting $unified_mode in config.php to 1 or 2. 1 = Unified Mode enabled when the variable cms=1 is passed (as it is when the Embed Code below is utilized). 2 = Unified Mode is ALWAYS enabled (regardless of how the gallery is reached).
4) Paste the Embed Code within the page Panda Image Gallery is being embedded. Update $path_to_image_gallery in the Embed Code with the direct URL to the Panda Image Gallery installation.

Embed Code
Enter the following code on the parent page (the page on which Panda Image Gallery is being embedded). Be sure to update $path_to_image_gallery with the direct URL to the Panda Image Gallery installation. The iframe can be resized and styled inline via the style attribute.

<?php echo "<?php \r\n"; ?>
/* ######################################################################
   # Edit the line below to specify the full path to your image gallery #
   # installation. Be sure to include the trailing slash.               #
   ###################################################################### */

$path_to_image_gallery="http://www.schiffner.com/image_gallery/";
/* ##### DO NOT EDIT BELOW THIS LINE ##### */
<?php echo "?> \r\n"; ?>

<script type="text/javascript" src="<?php echo "<?php echo \$path_to_image_gallery; ?>";?>scripts/resizeiframe.js"></script>

<?php echo "<?php \r\n"; ?>
$get_string="?cms=1&";

while($value = current($_GET)){
    if($get_string!="?cms=1&"){
        $get_string.="&";
    }

    $get_string.=key($_GET)."=".$value;
    next($_GET);
} 

echo "<iframe src='{$path_to_image_gallery}index.php{$get_string}' style='width: 100%; border: 0;'  frameBorder='0' scrolling='no' id='PandaImageGalleryIFRAME' onLoad=\"autoResize('PandaImageGalleryIFRAME');\"></iframe>";
<?php echo "?>"; ?>