$value){ $wpg2_option[$key] = $value; } update_option('wpg2_options', $wpg2_option); if ($wpg2_option['g2_rewriteactive'] == 'active') { // Add BTEV Event Message if (function_exists('btev_trigger_error')) { btev_trigger_error('WPG2 G2 REWRITE PLUGIN ACTIVATED', E_USER_NOTICE, __FILE__); } // Rebuild Rules wpg2_rebuildrewriterules(); ?>

 

'. __('Warning: Do not Activate until you have read the following: ','wpg2').''. __("Gallery2 simplified URLs may not correctly function in your hosting environment. If you experience any problems (EG: 404 Errors) when navigating to your photos or albums, then please deactivate this setting.", 'wpg2').'

'. __('NOTE: You cannot use the Gallery2 "Site Admin" URL rewrite rule with WPG2. It does not work correctly in embedded mode and will break your "Site Admin" link in the embedded gallery. Please ensure that the "Site Admin" rule is off.', 'wpg2'); ?>

'; $environment_html .= __('1. Wordpress Permalinks Active? - [' , 'wpg2'); $wppagestruct = $wp_rewrite->get_page_permastruct(); if ( '' != $wppagestruct ) $environment_html .= '' . __('Yes', 'wpg2') . ''; else { $environment_html .= '' . __('No', 'wpg2') . ''; $validate_err = 1; define("WPNOPERMALINKS", "True"); } $environment_html .= ']
'; // Verify WPG2 Internal g2_embeduri setting wpg2_template_page(); if (!defined('G2INIT')) { $ret = g2_login(); if ($ret) { echo '

' . __('Fatal G2 error', 'wpg2') . '

' . __("Here's the error from G2: ", 'wpg2') . $ret->getAsHtml(); exit; } } // Does the Rewrite Plugin Exist? if (!$validate_err) { $environment_html .= __('2. Is Gallery2 Rewrite Plugin Loaded? - [' , 'wpg2'); list ($ret, $g2_modulestatus ) = GalleryCoreApi::fetchPluginStatus('module'); if (!$ret) { if (isset($g2_modulestatus['rewrite'])) $environment_html .= '' . __('Yes', 'wpg2') . ''; else { $environment_html .= '' . __('No', 'wpg2') . ''; $validate_err = 1; define("G2REWRITEMODULEMISSING", "True"); } } else { $environment_html .= '' . __('No', 'wpg2') . ''; $validate_err = 1; } $environment_html .= ']
'; } // Is the Rewrite Plugin WP Paths able to be Set? if (!$validate_err) { $environment_html .= __('3. Can Gallery2 Rewrite WP Paths be Set? - [' , 'wpg2'); $ret = g2_setrewriteepath(); // Set the WP Path if (!$ret) { $environment_html .= '' . __('Yes', 'wpg2') . ''; } else { $environment_html .= '' . __('No', 'wpg2') . ''; $validate_err = 1; } $environment_html .= ']
'; } // Check For Pathinfo if (!$validate_err) { $environment_html .= __('4. Is Gallery2 Rewrite using Apache Mod_Rewrite? - [' , 'wpg2'); GalleryCoreApi::requireOnce('modules/rewrite/classes/RewriteHelper.class'); list ($ret, $rewriteParser) = RewriteHelper::getRewriteParser(); if (!$ret) { if ('modrewrite' == $rewriteParser->getParserId()) $environment_html .= '' . __('Yes', 'wpg2') . ''; else { $environment_html .= '' . __('No', 'wpg2') . ''; define("G2REWRITEPATHINFO", "True"); $validate_err=1; } } else { $environment_html .= '' . __('NA', 'wpg2') . ''; define("G2REWRITEMODULEERR", "True"); $validate_err = 1; } $environment_html .= ']
'; } // Gallery2 HTACCESS Update if (!$validate_err) { $environment_html .= __('5. Wordpress .htaccess can be updated? - [' , 'wpg2'); $errreturn = g2_verifyhtaccess(); if ($errreturn) { $environment_html .= '' . __('No', 'wpg2') . ''; $errstr = __('Failed to update because ', 'wpg2').$errreturn; define("G2REWRITERULESERR", "True"); $validate_err=1; } else { $environment_html .= '' . __('Yes', 'wpg2') . ''; } } $environment_html .= "] "; $environment_html .= "

"; if ($validate_err || $wpg2_option['g2_rewriteactive'] != 'active') { // Check G2 Rewrite Module, it should be deactivated $g2_moduleid = 'rewrite'; list ($ret, $g2_modulestatus ) = GalleryCoreApi::fetchPluginStatus('module'); if (isset($g2_modulestatus[$g2_moduleid]) && !empty($g2_modulestatus[$g2_moduleid]['active']) && $g2_modulestatus[$g2_moduleid]['active']) { list ($ret, $ignored) = GalleryCoreApi::deactivatePlugin('module', 'rewrite'); } } else { $ret = g2_activaterewrites(); } //Close Gallery Connection GalleryEmbed::done(); //Output Status if ($wpg2_outputtype != "silent") { echo ""; if ($validate_err) { echo '
' . __('Rewrite Validation Check: ', 'wpg2') . '' . __('Failed', 'wpg2') . ' '. __('(Help)', 'wpg2').'
'; // Add BTEV Event Message if (function_exists('btev_trigger_error')) { btev_trigger_error('WPG2 G2 REWRITE PLUGIN VALIDATION FAILED', E_USER_NOTICE, __FILE__); } } else { echo '
' . __('Rewrite Validation Check: ', 'wpg2') . '' . __('Valid', 'wpg2') . ' '. __('(Help)', 'wpg2').'
'; // Add BTEV Event Message if (function_exists('btev_trigger_error')) { btev_trigger_error('WPG2 G2 REWRITE PLUGIN VALIDATION PASSED', E_USER_NOTICE, __FILE__); } } echo $environment_html; if (defined('WPNOPERMALINKS')) { echo '
'; echo '

'. __('Error: Wordpress Permalinks is not Active','wpg2').'

'. __("In order to support Gallery2 Rewrite rules, you must have a Wordpress Permalinks Active, please Configure Wordpress Permalinks from the Wordpres Options Panel.", 'wpg2').'

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

'. __('Error: Gallery2 Rewrite Plugin is not installed','wpg2').'

'. __("You have not installed the Gallery2 Rewrite Plugin, please download/install the rewrite plugin from the Gallery2 Site Admin Plugin Get More Plugins Panel.", 'wpg2').'

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

'. __('Error: Gallery2 Rewrite Plugin is not Installed/Configured','wpg2').'

'. __("Please install/configure the Gallery2 Rewrite Plugin from the Gallery2 Site Admin Plugin Panel.", 'wpg2').'

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

'. __('Error: Gallery2 Rewrite Rules Failed to be updated','wpg2').'

'. $errstr.'

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

'. __('Error: Gallery2 Rewrite is not using mod_rewrite','wpg2').'

'. __("Gallery2 Rewrite module is not using Apache mod_rewrite and cannot be supported within the Wordpress Environment, please configure the Gallery2 Rewrite Module to use Apache Mod_Write.", 'wpg2').'

'; echo $ret; echo '
'; } } return $validate_err; } ?>