' . __('Fatal G2 error', 'wpg2') . ' ' . __("Here's the error from G2: ", 'wpg2') . $ret->getAsHtml(); exit; } // Pass through WP URL / Blog Name $site_url = get_option('home'); $site_name = get_option('blogname'); GalleryUtilities::putRequestVariable('wpg2_returnurl', $site_url); GalleryUtilities::putRequestVariable('wpg2_returnname', $site_name); // Switch on Lightbox if ($wpg2_option['wpg2_enableg2lightbox']) { GalleryUtilities::putRequestVariable('wpg2_lightbox', "active"); GalleryUtilities::putRequestVariable('wpg2_lightboxsize', $wpg2_option['g2_lightboximgsize']); } // Grab Gallery2 Output $g2data = GalleryEmbed::handleRequest(); if ($g2data['isDone']) { exit; // G2 has already sent output (redirect or binary data) } // Theme Switcher Hook if(!empty($_COOKIE['wp_ts2_'.COOKIEHASH])) { if ( file_exists( TEMPLATEPATH . '/wpg2header.php') ) { $wpg2_option['g2_externalheader'] = "Yes"; } else { $wpg2_option['g2_externalheader'] = "No"; } if ( file_exists( TEMPLATEPATH . '/wpg2footer.php') ) { $wpg2_option['g2_externalfooter'] = "Yes"; } else { $wpg2_option['g2_externalfooter'] = "No"; } } // Add Page Page - Bug Fix #44 g2_outputpagetitle(); // How Should We Generate the WPG2 Page, Without WP Headers or With? if ($wpg2_option['g2_embedpagetype'] == 'gallery2' ) { g2_addheader(); } else if ($wpg2_option['g2_embedpagetype'] == 'wordpress' ) { // Should we Disable the Header output and instead allow the wpg2header to control the Output? if ( $wpg2_option['g2_externalheader']!="Yes" ) { get_header(); //Include any plug-in header content set in the plugin options echo stripslashes($wpg2_option['g2_header']); } else include (TEMPLATEPATH.'/wpg2header.php'); } echo $g2data['bodyHtml']; //Display the gallery content //Close Gallery Connection GalleryEmbed::done(); // How Should We Generate the WPG2 Page, Without WP Footers or With? if ($wpg2_option['g2_embedpagetype'] == 'wordpress' ) { // Should we Disable the Header output and instead allow the wpg2footer to control the Output? if ($wpg2_option['g2_externalfooter']!="Yes" ) { //Include plug-in footer content echo stripslashes($wpg2_option['g2_footer']); //Include WP footer get_footer(); } else include (TEMPLATEPATH.'/wpg2footer.php'); } } else { // WPG2 has not been Validated.. get_header(); echo '
'.__(' Sorry.. WPG2 Page can not be displayed until WPG2 Plugin has been Validated.', 'wpg2').'