web/wp-content/plugins/google-sitemap-generator/sitemap.php
changeset 194 32102edaa81b
parent 136 bde1974c263b
--- a/web/wp-content/plugins/google-sitemap-generator/sitemap.php	Thu Sep 16 15:45:36 2010 +0000
+++ b/web/wp-content/plugins/google-sitemap-generator/sitemap.php	Mon Nov 19 18:26:13 2012 +0100
@@ -1,7 +1,7 @@
 <?php
 
 /*
- $Id: sitemap.php 175664 2009-11-20 21:21:09Z arnee $
+ $Id: sitemap.php 583238 2012-08-08 21:10:26Z arnee $
 
  Google XML Sitemaps Generator for WordPress
  ==============================================================================
@@ -24,10 +24,13 @@
  ==============================================================================
  Plugin Name: Google XML Sitemaps
  Plugin URI: http://www.arnebrachhold.de/redir/sitemap-home/
- Description: This plugin will generate a sitemaps.org compatible sitemap of your WordPress blog which is supported by Ask.com, Google, MSN Search and YAHOO. <a href="options-general.php?page=sitemap.php">Configuration Page</a>
- Version: 3.2
+ Description: This plugin will generate a special XML sitemap which will help search engines like Google, Yahoo, Bing and Ask.com to better index your blog.
+ Version: 3.2.8
  Author: Arne Brachhold
  Author URI: http://www.arnebrachhold.de/
+ Text Domain: sitemap
+ Domain Path: /lang/
+ 
 */
 
 /**
@@ -44,6 +47,15 @@
 	 * If the sm_command and sm_key GET params are given, the function will init the generator to rebuild the sitemap.
 	 */
 	function Enable() {
+
+		//Check for 3.0 multisite, NOT supported yet!
+		if((defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE) || (function_exists('is_multisite') && is_multisite())) {
+			if(function_exists('is_super_admin') && is_super_admin()) {
+				add_action('admin_notices',  array('GoogleSitemapGeneratorLoader', 'AddMultisiteWarning'));
+			}	
+			
+			return;
+		}
 		
 		//Register the sitemap creator to wordpress...
 		add_action('admin_menu', array('GoogleSitemapGeneratorLoader', 'RegisterAdminPage'));
@@ -85,6 +97,13 @@
 			GoogleSitemapGeneratorLoader::CallShowPingResult();
 		}
 	}
+	
+	/**
+	 * Outputs the warning bar if multisite mode is activated
+	 */
+	function AddMultisiteWarning() {
+		echo "<div id='sm-multisite-warning' class='error fade'><p><strong>".__('This version of Google XML Sitemaps is not multisite compatible.','sitemap')."</strong><br /> ".sprintf(__('Unfortunately this version of the Google XML Sitemaps plugin was not tested with the multisite feature of WordPress 3.0 yet. <br />The plugin will not be active until you disable the multisite mode. <br />Or you can <a href="%1$s">try the new beta</a> which supports all the new WordPress features!','sitemap'), "http://www.arnebrachhold.de/redir/sitemap-info-beta/")."</p></div>";
+	}
 
 	/**
 	 * Registers the plugin in the admin menu system
@@ -92,7 +111,7 @@
 	function RegisterAdminPage() {
 		
 		if (function_exists('add_options_page')) {
-			add_options_page(__('XML-Sitemap Generator','sitemap'), __('XML-Sitemap','sitemap'), 10, GoogleSitemapGeneratorLoader::GetBaseName(), array('GoogleSitemapGeneratorLoader','CallHtmlShowOptionsPage'));
+			add_options_page(__('XML-Sitemap Generator','sitemap'), __('XML-Sitemap','sitemap'), 'level_10', GoogleSitemapGeneratorLoader::GetBaseName(), array('GoogleSitemapGeneratorLoader','CallHtmlShowOptionsPage'));
 		}
 	}
 	
@@ -106,10 +125,10 @@
 	function RegisterPluginLinks($links, $file) {
 		$base = GoogleSitemapGeneratorLoader::GetBaseName();
 		if ($file == $base) {
-			$links[] = '<a href="options-general.php?page=' . GoogleSitemapGeneratorLoader::GetBaseName() .'">' . __('Settings') . '</a>';
-			$links[] = '<a href="http://www.arnebrachhold.de/redir/sitemap-plist-faq/">' . __('FAQ') . '</a>';
-			$links[] = '<a href="http://www.arnebrachhold.de/redir/sitemap-plist-support/">' . __('Support') . '</a>';
-			$links[] = '<a href="http://www.arnebrachhold.de/redir/sitemap-plist-donate/">' . __('Donate') . '</a>';
+			$links[] = '<a href="options-general.php?page=' . GoogleSitemapGeneratorLoader::GetBaseName() .'">' . __('Settings','sitemap') . '</a>';
+			$links[] = '<a href="http://www.arnebrachhold.de/redir/sitemap-plist-faq/">' . __('FAQ','sitemap') . '</a>';
+			$links[] = '<a href="http://www.arnebrachhold.de/redir/sitemap-plist-support/">' . __('Support','sitemap') . '</a>';
+			$links[] = '<a href="http://www.arnebrachhold.de/redir/sitemap-plist-donate/">' . __('Donate','sitemap') . '</a>';
 		}
 		return $links;
 	}
@@ -119,7 +138,7 @@
 	 */
 	function CallHtmlShowOptionsPage() {
 		if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
-			$gs = GoogleSitemapGenerator::GetInstance();
+			$gs = &GoogleSitemapGenerator::GetInstance();
 			$gs->HtmlShowOptionsPage();
 		}
 	}
@@ -129,7 +148,7 @@
 	 */
 	function CallCheckForAutoBuild($args) {
 		if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
-			$gs = GoogleSitemapGenerator::GetInstance();
+			$gs = &GoogleSitemapGenerator::GetInstance();
 			$gs->CheckForAutoBuild($args);
 		}
 	}
@@ -139,7 +158,7 @@
 	 */
 	function CallBuildNowRequest() {
 		if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
-			$gs = GoogleSitemapGenerator::GetInstance();
+			$gs = &GoogleSitemapGenerator::GetInstance();
 			$gs->BuildNowRequest();
 		}
 	}
@@ -149,7 +168,7 @@
 	 */
 	function CallBuildSitemap() {
 		if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
-			$gs = GoogleSitemapGenerator::GetInstance();
+			$gs = &GoogleSitemapGenerator::GetInstance();
 			$gs->BuildSitemap();
 		}
 	}
@@ -159,7 +178,7 @@
 	 */
 	function CallCheckForManualBuild() {
 		if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
-			$gs = GoogleSitemapGenerator::GetInstance();
+			$gs = &GoogleSitemapGenerator::GetInstance();
 			$gs->CheckForManualBuild();
 		}
 	}
@@ -169,24 +188,27 @@
 	 */
 	function CallShowPingResult() {
 		if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
-			$gs = GoogleSitemapGenerator::GetInstance();
+			$gs = &GoogleSitemapGenerator::GetInstance();
 			$gs->ShowPingResult();
 		}
 	}
 	
 
 	function CallHtmlShowHelpList($filterVal,$screen) {
-		if($screen == "settings_page_sitemap") {
+		
+		$id = get_plugin_page_hookname(GoogleSitemapGeneratorLoader::GetBaseName(),'options-general.php');		
+		
+		if($screen == $id) {
 			$links = array(
 				__('Plugin Homepage','sitemap')=>'http://www.arnebrachhold.de/redir/sitemap-help-home/',
-				__('Sitemap FAQ')=>'http://www.arnebrachhold.de/redir/sitemap-help-faq/'
+				__('My Sitemaps FAQ','sitemap')=>'http://www.arnebrachhold.de/redir/sitemap-help-faq/'
 			);
 			
-			$filterVal["settings_page_sitemap"] = '';
+			$filterVal[$id] = '';
 			
 			$i=0;
 			foreach($links AS $text=>$url) {
-				$filterVal["settings_page_sitemap"].='<a href="' . $url . '">' . $text . '</a>' . ($i < (count($links)-1)?'<br />':'') ;
+				$filterVal[$id].='<a href="' . $url . '">' . $text . '</a>' . ($i < (count($links)-1)?'<br />':'') ;
 				$i++;
 			}
 		}
@@ -195,7 +217,7 @@
 	
 	function CallDoRobots() {
 		if(GoogleSitemapGeneratorLoader::LoadPlugin()) {
-			$gs = GoogleSitemapGenerator::GetInstance();
+			$gs = &GoogleSitemapGenerator::GetInstance();
 			$gs->DoRobots();
 		}
 	}
@@ -208,8 +230,8 @@
 	function LoadPlugin() {
 		
 		$mem = abs(intval(@ini_get('memory_limit')));
-		if($mem && $mem < 32) {
-			@ini_set('memory_limit', '32M');
+		if($mem && $mem < 64) {
+			@ini_set('memory_limit', '64M');
 		}
 		
 		$time = abs(intval(@ini_get("max_execution_time")));
@@ -255,16 +277,17 @@
 	 * @return string The version like 3.1.1
 	 */
 	function GetVersion() {
-		if(!function_exists('get_plugin_data')) {
-			if(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+
-			else if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1
-			else return "0.ERROR";
+		if(!isset($GLOBALS["sm_version"])) {
+			if(!function_exists('get_plugin_data')) {
+				if(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+
+				else if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1
+				else return "0.ERROR";
+			}
+			$data = get_plugin_data(__FILE__, false, false);
+			$GLOBALS["sm_version"] = $data['Version'];
 		}
-		$data = get_plugin_data(__FILE__);
-		return $data['Version'];
+		return $GLOBALS["sm_version"];
 	}
-	
-
 }
 
 //Enable the plugin for the init hook, but only if WP is loaded. Calling this php file directly will do nothing.