'; $environment_html .= __('Wordpress Compatible?' , 'wpg2') .' '; if ($wp_db_version >=$wpg2_option['g2_wpversion_low']) { $environment_html .= '' . __('Success', 'wpg2') . ''; } else { define("WPVERSIONERR", "True"); $environment_html .= '' . __('Failed', 'wpg2') . ''; $validate_err=1; } // Test Gallery2 URL to Embedded Page $environment_html .= ''; $environment_html .= __('URI to Gallery2 Ok?' , 'wpg2') .' '; if (!$validate_err) { $ret = wpg2_validateuri($wpg2_g2path['g2_url'].'embed.php'); if (!$ret) { $environment_html .= '' . __('Success', 'wpg2') . ''; } else { define("G2EMBEDERR", "True"); $environment_html .= '' . __('Failed', 'wpg2') . ''; $validate_err=1; } } else $environment_html .= '' . __('Skipped Due to Validation Error', 'wpg2') . ''; $environment_html .= ""; // Gallery Ok? $environment_html .= ''; $environment_html .= __('Gallery2 can be located in G2 File Path?', 'wpg2') . ''; if (!$validate_err) { if (file_exists( $wpg2_g2path['g2_filepath'].'embed.php' ) ) $environment_html .= '' . __('Success', 'wpg2'); else { $environment_html .= '' . __('Failed', 'wpg2'); define("G2PATHERR", "True"); $validate_err=1; } } else $environment_html .= '' . __('Skipped Due to Validation Error', 'wpg2') . ''; $environment_html .= ""; // Test Initialise G2 $environment_html .= ''; $environment_html .= __('Gallery2 can be initialised?', 'wpg2') . ''; if (!$validate_err) { if (!defined('G2INIT')) { $ret = g2_init(); if (!$ret) $environment_html .= '' . __('Success', 'wpg2') . ''; else { define("G2INITERR", "True"); $environment_html .= '' . __('Failed', 'wpg2') . '->'; $validate_err=1; } } else $environment_html .= '' . __('Success', 'wpg2') . ''; } else $environment_html .= '' . __('Skipped Due to Validation Error', 'wpg2') . ''; $environment_html .= ""; // Test G2 Version $environment_html .= ''; $environment_html .= __('Gallery2 Version Compatible?' , 'wpg2') . ''; if (!$validate_err) { list ($ret, $core) = GalleryCoreApi::loadPlugin('module', 'core', true); $g2version = $core->getInstalledVersions(); $g2version = substr($g2version['gallery'],0,3); if ($wpg2_option['g2_version_low'] <= $g2version) $environment_html .= '' . __('Success', 'wpg2') . ''; else { $environment_html .= '' . __('Failed', 'wpg2') . ''; define("G2VERERR", "True"); $validate_err=1; } } else $environment_html .= '' . __('Skipped Due to Validation Error', 'wpg2') . ''; $environment_html .= ""; // ImageBlock Active? $environment_html .= ''; $environment_html .= __('Gallery2 Module: ImageBlock Active?' , 'wpg2') . ''; if (!$validate_err) { $g2_image_block_active = 0; $g2_moduleid = 'imageblock'; list ($ret, $g2_modulestatus ) = GalleryCoreApi::fetchPluginStatus('module'); if (!$ret) { if (isset($g2_modulestatus[$g2_moduleid]) && !empty($g2_modulestatus[$g2_moduleid]['active']) && $g2_modulestatus[$g2_moduleid]['active']) $environment_html .= '' . __('Success', 'wpg2') . ''; else { $environment_html .= '' . __('Failed', 'wpg2') . ''; define("G2IMAGEBLOCKERR", "True"); $validate_err=1; } } } else $environment_html .= '' . __('Skipped Due to Validation Error', 'wpg2') . ''; $environment_html .= ""; // ImageFrame Active? $environment_html .= ''; $environment_html .= __('Gallery2 Module: ImageFrame Active?' , 'wpg2') . ''; if (!$validate_err) { $g2_image_block_active = 0; $g2_moduleid = 'imageframe'; if (!$ret) { if (isset($g2_modulestatus[$g2_moduleid]) && !empty($g2_modulestatus[$g2_moduleid]['active']) && $g2_modulestatus[$g2_moduleid]['active']) $environment_html .= '' . __('Success', 'wpg2') . ''; else { $environment_html .= '' . __('Failed', 'wpg2') . ''; define("G2IMAGEFRAMEERR", "True"); $validate_err=1; } } } else $environment_html .= '' . __('Skipped Due to Validation Error', 'wpg2') . ''; $environment_html .= ""; // WPG2 Page Output Type? $environment_html .= ''; $environment_html .= __('WPG2 Output Page Type?', 'wpg2') . ''; if ( $wpg2_option['g2_embedpagetype'] == 'wordpress' ) { $environment_html .= '' . __('Wordpress', 'wpg2'); } else { $environment_html .= '' . __('Gallery2', 'wpg2'); } $environment_html .= ""; // WPG2 / Gallery Rewrites Active? $environment_html .= ''; $environment_html .= __('WPG2 Gallery2 Rewrites Status?', 'wpg2') . ''; if ($wpg2_option['g2_rewriteactive'] == 'active') { $environment_html .= '' . __('On', 'wpg2'); } else { if ($wpg2_option['g2_rewriteactive'] == 'safe') $environment_html .= '' . __('Off [Safe]', 'wpg2'); else $environment_html .= '' . __('Off', 'wpg2'); } $environment_html .= ""; // Custom Header? $environment_html .= ''; $environment_html .= __('Embedded Page is using what Header type?', 'wpg2') . ''; if ( file_exists( TEMPLATEPATH . '/wpg2header.php') ) { $environment_html .= '' . __('WPG2HEADER', 'wpg2'); $wpg2_option['g2_externalheader'] = "Yes"; } else { define('WPSIMPLEHEADER',"True"); $environment_html .= '' . __('Simple', 'wpg2'); $wpg2_option['g2_externalheader'] = "No"; } $environment_html .= ""; // Custom Footer? $environment_html .= ''; $environment_html .= __('Embedded Page is using what Footer type?', 'wpg2') . ''; if ( file_exists( TEMPLATEPATH . '/wpg2footer.php') ) { $environment_html .= '' . __('WPG2FOOTER', 'wpg2'); $wpg2_option['g2_externalfooter'] = "Yes"; } else { $environment_html .= '' . __('Simple', 'wpg2'); $wpg2_option['g2_externalfooter'] = "No"; } $environment_html .= ""; // External WPG2 CSS $environment_html .= ''; $environment_html .= __('Using Which WPG2 Stylesheet?', 'wpg2') . ''; if ( file_exists( TEMPLATEPATH . '/wpg2.css') ) { $environment_html .= '' . __('External', 'wpg2'); $wpg2_option['g2_externalcss'] = "Yes"; } else { $environment_html .= '' . __('Internal', 'wpg2'); $wpg2_option['g2_externalcss'] = ""; } $environment_html .= ""; $environment_html .= "
"; if ($validate_err) $wpg2_option['g2_validated'] = "No"; else { if (!$wpg2_option['g2_rewriteactive'] == 'active') { $g2_moduleid = 'rewrite'; list ($ret, $g2_modulestatus ) = GalleryCoreApi::fetchPluginStatus('module'); if (!$ret && isset($g2_modulestatus[$g2_moduleid]) && !empty($g2_modulestatus[$g2_moduleid]['active']) && $g2_modulestatus[$g2_moduleid]['active']) { // Deactivate Rewrite Module as Wordpress Permalink Array will be wrong. list ($ret, $ignored) = GalleryCoreApi::deactivatePlugin('module', 'rewrite'); if (!$ret) define("G2REWRITEDEACTIVATED", "True"); } } $wpg2_option['g2_validated'] = "Yes"; // Close Gallery Connection GalleryEmbed::done(); } // Update the Options update_option('wpg2_options', $wpg2_option); //Output Status if ($wpg2_outputtype != "silent") { echo '
'; echo '

'. __('Help', 'wpg2').'

'; if ($validate_err){ echo '

' . __('WPG2 Status: ', 'wpg2') . '' . __('Not Valid', 'wpg2') . '

'; echo ""; echo $environment_html; } else { echo '

' . __('WPG2 Status: ', 'wpg2') . '' . __('Validated', 'wpg2') . ''.' ('.'View Page »)

'; ?>
'; echo '

' . __('Error: Wordpress Build is NOT Compatible?', 'wpg2').'

'. __(' WPG2 ','wpg2').$wpg2_option['g2_wpg2version']; _e(' requires a minimum Wordpress build of ', 'wpg2'); echo $wpg2_option['g2_wpversion_low']; _e (' and has detected your Wordpress build ', 'wpg2'); echo $wp_db_version; _e (' does not meet the minimum build requirement.', 'wpg2'); echo '

'; } if (defined('G2EMBEDERR')) { echo '
'; echo '

'. __('Error: Invalid URI to Gallery2', 'wpg2').'

'. __('The Gallery2 Embedded Page ', 'wpg2').$wpg2_g2path['g2_url'].'embed.php '.$ret.'

'; echo '
'; } if (defined('G2PATHERR')) { echo '
'; echo '

'. __('Error: embed.php cannot be located in the specified File Path', 'wpg2').'

'; _e('WPG2 plugin cannot locate the Gallery2 file ', 'wpg2'); echo ($wpg2_g2path['g2_filepath']). __('embed.php', 'wpg2').'

'; echo '
'; } if (defined('G2INITERR')) { echo '
'; echo '

'. __('Error: Gallery2 cannot be initialised', 'wpg2').'

'. __('Check to ensure Gallery2 is correctly working and revalidate.', 'wpg2').'
'; echo $ret.'

'; echo '
'; } if (defined('G2VERERR')) { echo '
'; echo '

'. __('Error: Gallery2 version is incompatible','wpg2').'

'. __('WPG2 plugin requires at least Gallery2 version ', 'wpg2'); echo $wpg2_option['g2_version_low']. __(', Gallery2 reports you are running version ','wpg2'); echo $g2version.'

'; echo '
'; } if (defined('G2IMAGEBLOCKERR')) { echo '
'; echo '

'. __('Error: Gallery2 Imageblock plugin is not activated','wpg2').'

'. __('Ensure the Gallery2 ImageBlock is installed / activated via the Gallery2 Site Admin -> Plugin Panel.', 'wpg2').'

'; echo $ret; echo '
'; } if (defined('G2IMAGEFRAMEERR')) { echo '
'; echo '

'. __('Error: Gallery2 Imageframe plugin is not activated','wpg2').'

'. __('Ensure the Gallery2 ImageFrame is installed / activated via the Gallery2 Site Admin -> Plugin Panel.', 'wpg2').'

'; echo $ret; echo '
'; } if (defined('G2REWRITEDEACTIVATED')) { echo '
'; echo '

'. __('Warning: Gallery2 Rewrite Plugin was deactived','wpg2').'

'. __('WPG2 has automatically deactivated the Gallery2 Rewrite Plugin, to reactive, enable Gallery2 Rewrites in the WPG2 Gallery2 Rewrites Tab.','wpg2').'

'; echo '
'; } if (defined('WPSIMPLEHEADER')) { echo '
'; echo '

'. __('Warning: Using the Simple Header','wpg2').'

'. __('WPG2 will generate your Wordpress header using the CSS Elements specified in the embedded page options. For some Wordpress themes this will incorrectly distort the output from Gallery2 and instead you may need to create your own WPG2 Header.','wpg2').'

'; echo '
'; } echo ''; } } ?>