web/wp-content/plugins/google-sitemap-generator/sitemap-ui.php
changeset 194 32102edaa81b
parent 136 bde1974c263b
equal deleted inserted replaced
193:2f6f6f7551ca 194:32102edaa81b
     1 <?php
     1 <?php
     2 /*
     2 /*
     3  
     3  
     4  $Id: sitemap-ui.php 175669 2009-11-20 21:55:02Z arnee $
     4  $Id: sitemap-ui.php 583237 2012-08-08 21:06:12Z arnee $
     5 
     5 
     6 */
     6 */
     7 
     7 
     8 class GoogleSitemapGeneratorUI {
     8 class GoogleSitemapGeneratorUI {
     9 
     9 
    14 	 */
    14 	 */
    15 	var $sg = null;
    15 	var $sg = null;
    16 	
    16 	
    17 	var $mode = 21;
    17 	var $mode = 21;
    18 
    18 
    19 	function GoogleSitemapGeneratorUI($sitemapBuilder) {
    19 	function GoogleSitemapGeneratorUI(&$sitemapBuilder) {
    20 		global $wp_version;
    20 		global $wp_version;
    21 		$this->sg = $sitemapBuilder;
    21 		$this->sg = &$sitemapBuilder;
    22 		
    22 		
    23 		if(floatval($wp_version) >= 2.7) {
    23 		if(floatval($wp_version) >= 2.7) {
    24 			$this->mode = 27;
    24 			$this->mode = 27;
    25 		}
    25 		}
    26 	}
    26 	}
    72 		
    72 		
    73 		$snl = false; //SNL
    73 		$snl = false; //SNL
    74 		
    74 		
    75 		$this->sg->Initate();
    75 		$this->sg->Initate();
    76 			
    76 			
    77 		//All output should go in this var which get printed at the end
       
    78 		$message="";
    77 		$message="";
    79 		
    78 		
    80 		if(!$snl) {
    79 		if(!empty($_REQUEST["sm_rebuild"])) { //Pressed Button: Rebuild Sitemap
    81 		
    80 			check_admin_referer('sitemap');
    82 			if(isset($_GET['sm_hidedonate'])) {
    81 			
    83 				$this->sg->SetOption('i_hide_donated',true);
       
    84 				$this->sg->SaveOptions();
       
    85 			}
       
    86 			if(isset($_GET['sm_donated'])) {
       
    87 				$this->sg->SetOption('i_donated',true);
       
    88 				$this->sg->SaveOptions();
       
    89 			}
       
    90 			if(isset($_GET['sm_hide_note'])) {
       
    91 				$this->sg->SetOption('i_hide_note',true);
       
    92 				$this->sg->SaveOptions();
       
    93 			}
       
    94 			if(isset($_GET['sm_hidedonors'])) {
       
    95 				$this->sg->SetOption('i_hide_donors',true);
       
    96 				$this->sg->SaveOptions();
       
    97 			}
       
    98 			if(isset($_GET['sm_hide_works'])) {
       
    99 				$this->sg->SetOption('i_hide_works',true);
       
   100 				$this->sg->SaveOptions();
       
   101 			}
       
   102 			
       
   103 			
       
   104 			if(isset($_GET['sm_donated']) || ($this->sg->GetOption('i_donated')===true && $this->sg->GetOption('i_hide_donated')!==true)) {
       
   105 				?>
       
   106 				<div class="updated">
       
   107 					<strong><p><?php _e('Thank you very much for your donation. You help me to continue support and development of this plugin and other free software!','sitemap'); ?> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hidedonate=true"; ?>"><small style="font-weight:normal;"><?php _e('Hide this notice', 'sitemap'); ?></small></a></p></strong>
       
   108 				</div>
       
   109 				<?php
       
   110 			} else if($this->sg->GetOption('i_donated') !== true && $this->sg->GetOption('i_install_date')>0 && $this->sg->GetOption('i_hide_note')!==true && time() > ($this->sg->GetOption('i_install_date') + (60*60*24*30))) {
       
   111 				?>
       
   112 				<div class="updated">
       
   113 					<strong><p><?php echo str_replace("%s",$this->sg->GetRedirectLink("sitemap-donate-note"),__('Thanks for using this plugin! You\'ve installed this plugin over a month ago. If it works and you are satisfied with the results, isn\'t it worth at least a few dollar? <a href="%s">Donations</a> help me to continue support and development of this <i>free</i> software! <a href="%s">Sure, no problem!</a>','sitemap')); ?> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_donated=true"; ?>" style="float:right; display:block; border:none; margin-left:10px;"><small style="font-weight:normal; "><?php _e('Sure, but I already did!', 'sitemap'); ?></small></a> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hide_note=true"; ?>" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php _e('No thanks, please don\'t bug me anymore!', 'sitemap'); ?></small></a></p></strong>
       
   114 					<div style="clear:right;"></div>
       
   115 				</div>
       
   116 				<?php
       
   117 			} else if($this->sg->GetOption('i_install_date')>0 && $this->sg->GetOption('i_hide_works')!==true && time() > ($this->sg->GetOption('i_install_date') + (60*60*24*15))) {
       
   118 				?>
       
   119 				<div class="updated">
       
   120 					<strong><p><?php echo str_replace("%s",$this->sg->GetRedirectLink("sitemap-works-note"),__('Thanks for using this plugin! You\'ve installed this plugin some time ago. If it works and your are satisfied, why not <a href="%s">rate it</a> and <a href="%s">recommend it</a> to others? :-)','sitemap')); ?> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hide_works=true"; ?>" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php _e('Don\'t show this anymore', 'sitemap'); ?></small></a></p></strong>
       
   121 					<div style="clear:right;"></div>
       
   122 				</div>
       
   123 				<?php
       
   124 			}
       
   125 		}
       
   126 		
       
   127 		if(function_exists("wp_next_scheduled")) {
       
   128 			$next = wp_next_scheduled('sm_build_cron');
       
   129 			if($next) {
       
   130 				$diff = (time()-$next)*-1;
       
   131 				if($diff <= 0) {
       
   132 					$diffMsg = __('Your sitemap is being refreshed at the moment. Depending on your blog size this might take some time!','sitemap');
       
   133 				} else {
       
   134 					$diffMsg = str_replace("%s",$diff,__('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!','sitemap'));
       
   135 				}
       
   136 				?>
       
   137 				<div class="updated">
       
   138 					<strong><p><?php echo $diffMsg ?></p></strong>
       
   139 					<div style="clear:right;"></div>
       
   140 				</div>
       
   141 				<?php
       
   142 			}
       
   143 		}
       
   144 		if(!empty($_REQUEST["sm_rebuild"]) || !empty($_REQUEST["sm_rebuild"])) {
       
   145 			//Clear any outstanding build cron jobs
    82 			//Clear any outstanding build cron jobs
   146 			if(function_exists('wp_clear_scheduled_hook')) wp_clear_scheduled_hook('sm_build_cron');
    83 			if(function_exists('wp_clear_scheduled_hook')) wp_clear_scheduled_hook('sm_build_cron');
   147 		}
    84 			
   148 		
       
   149 		if(!empty($_REQUEST["sm_rebuild"])) { //Pressed Button: Rebuild Sitemap
       
   150 			check_admin_referer('sitemap');
       
   151 			if(isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"]=="true") {
    85 			if(isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"]=="true") {
   152 				
    86 				
   153 				//Check again, just for the case that something went wrong before
    87 				//Check again, just for the case that something went wrong before
   154 				if(!current_user_can("administrator")) {
    88 				if(!current_user_can("administrator")) {
   155 					echo '<p>Please log in as admin</p>';
    89 					echo '<p>Please log in as admin</p>';
   184 				}
   118 				}
   185 				
   119 				
   186 				$popts = array();
   120 				$popts = array();
   187 				foreach($opts as $k=>$v) {
   121 				foreach($opts as $k=>$v) {
   188 					//Try to filter out passwords etc...
   122 					//Try to filter out passwords etc...
   189 					if(preg_match("/(pass|login|pw|secret|user|usr)/si",$v)) continue;
   123 					if(preg_match("/pass|login|pw|secret|user|usr|key|auth|token/si",$k)) continue;
   190 					$popts[$k] = htmlspecialchars($v);
   124 					$popts[$k] = htmlspecialchars($v);
   191 				}
   125 				}
   192 				print_r($popts);
   126 				print_r($popts);
   193 				echo "</pre>";
   127 				echo "</pre>";
   194 				echo '<h4>Sitemap Config</h4>';
   128 				echo '<h4>Sitemap Config</h4>';
   247 				//Check vor values and convert them into their types, based on the category they are in
   181 				//Check vor values and convert them into their types, based on the category they are in
   248 				if(!isset($_POST[$k])) $_POST[$k]=""; // Empty string will get false on 2bool and 0 on 2float
   182 				if(!isset($_POST[$k])) $_POST[$k]=""; // Empty string will get false on 2bool and 0 on 2float
   249 				
   183 				
   250 				//Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
   184 				//Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
   251 				if(substr($k,0,5)=="sm_b_") {
   185 				if(substr($k,0,5)=="sm_b_") {
   252 					if($k=="sm_b_filename" || $k=="sm_b_fileurl_manual" || $k=="sm_b_filename_manual" || $k=="sm_b_prio_provider" || $k=="sm_b_manual_key" || $k == "sm_b_yahookey" || $k == "sm_b_style" || $k == "sm_b_memory") {
   186 					if($k=="sm_b_filename" || $k=="sm_b_fileurl_manual" || $k=="sm_b_filename_manual" || $k=="sm_b_prio_provider" || $k=="sm_b_manual_key" || $k == "sm_b_style" || $k == "sm_b_memory") {
   253 						if($k=="sm_b_filename_manual" && strpos($_POST[$k],"\\")!==false){
   187 						if($k=="sm_b_filename_manual" && strpos($_POST[$k],"\\")!==false){
   254 							$_POST[$k]=stripslashes($_POST[$k]);
   188 							$_POST[$k]=stripslashes($_POST[$k]);
   255 						}
   189 						}
   256 						
   190 						
   257 						$this->sg->_options[$k]=(string) $_POST[$k];
   191 						$this->sg->_options[$k]=(string) $_POST[$k];
   295 							$enabledTaxonomies[] = $taxName;
   229 							$enabledTaxonomies[] = $taxName;
   296 						}
   230 						}
   297 
   231 
   298 						$this->sg->_options[$k] = $enabledTaxonomies;
   232 						$this->sg->_options[$k] = $enabledTaxonomies;
   299 												
   233 												
       
   234 					} else if($k=='sm_in_customtypes') {
       
   235 
       
   236 						$enabledPostTypes = array();
       
   237 						
       
   238 						foreach(array_keys((array) $_POST[$k]) AS $postTypeName) {
       
   239 							if(empty($postTypeName) || !post_type_exists($postTypeName)) continue;
       
   240 
       
   241 							$enabledPostTypes[] = $postTypeName;
       
   242 						}
       
   243 
       
   244 						$this->sg->_options[$k] = $enabledPostTypes;
       
   245 												
   300 					} else $this->sg->_options[$k]=(bool) $_POST[$k];
   246 					} else $this->sg->_options[$k]=(bool) $_POST[$k];
   301 				//Options of the category "Change frequencies" are string
   247 				//Options of the category "Change frequencies" are string
   302 				} else if(substr($k,0,6)=="sm_cf_") {
   248 				} else if(substr($k,0,6)=="sm_cf_") {
   303 					$this->sg->_options[$k]=(string) $_POST[$k];
   249 					$this->sg->_options[$k]=(string) $_POST[$k];
   304 				//Options of the category "Priorities" are float
   250 				//Options of the category "Priorities" are float
   339 			?>
   285 			?>
   340 			<div class="updated"><strong><p><?php
   286 			<div class="updated"><strong><p><?php
   341 			echo $message;
   287 			echo $message;
   342 			?></p></strong></div><?php
   288 			?></p></strong></div><?php
   343 		}
   289 		}
       
   290 		
       
   291 		
       
   292 		if(!$snl) {
       
   293 		
       
   294 			if(isset($_GET['sm_hidedonate'])) {
       
   295 				$this->sg->SetOption('i_hide_donated',true);
       
   296 				$this->sg->SaveOptions();
       
   297 			}
       
   298 			if(isset($_GET['sm_donated'])) {
       
   299 				$this->sg->SetOption('i_donated',true);
       
   300 				$this->sg->SaveOptions();
       
   301 			}
       
   302 			if(isset($_GET['sm_hide_note'])) {
       
   303 				$this->sg->SetOption('i_hide_note',true);
       
   304 				$this->sg->SaveOptions();
       
   305 			}
       
   306 			if(isset($_GET['sm_hidedonors'])) {
       
   307 				$this->sg->SetOption('i_hide_donors',true);
       
   308 				$this->sg->SaveOptions();
       
   309 			}
       
   310 			if(isset($_GET['sm_hide_works'])) {
       
   311 				$this->sg->SetOption('i_hide_works',true);
       
   312 				$this->sg->SaveOptions();
       
   313 			}
       
   314 			
       
   315 			
       
   316 			if(isset($_GET['sm_donated']) || ($this->sg->GetOption('i_donated')===true && $this->sg->GetOption('i_hide_donated')!==true)) {
       
   317 				?>
       
   318 				<div class="updated">
       
   319 					<strong><p><?php _e('Thank you very much for your donation. You help me to continue support and development of this plugin and other free software!','sitemap'); ?> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hidedonate=true"; ?>"><small style="font-weight:normal;"><?php _e('Hide this notice', 'sitemap'); ?></small></a></p></strong>
       
   320 				</div>
       
   321 				<?php
       
   322 			} else if($this->sg->GetOption('i_donated') !== true && $this->sg->GetOption('i_install_date')>0 && $this->sg->GetOption('i_hide_note')!==true && time() > ($this->sg->GetOption('i_install_date') + (60*60*24*30))) {
       
   323 				?>
       
   324 				<div class="updated">
       
   325 					<strong><p><?php echo str_replace("%s",$this->sg->GetRedirectLink("sitemap-donate-note"),__('Thanks for using this plugin! You\'ve installed this plugin over a month ago. If it works and you are satisfied with the results, isn\'t it worth at least a few dollar? <a href="%s">Donations</a> help me to continue support and development of this <i>free</i> software! <a href="%s">Sure, no problem!</a>','sitemap')); ?> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_donated=true"; ?>" style="float:right; display:block; border:none; margin-left:10px;"><small style="font-weight:normal; "><?php _e('Sure, but I already did!', 'sitemap'); ?></small></a> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hide_note=true"; ?>" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php _e('No thanks, please don\'t bug me anymore!', 'sitemap'); ?></small></a></p></strong>
       
   326 					<div style="clear:right;"></div>
       
   327 				</div>
       
   328 				<?php
       
   329 			} else if($this->sg->GetOption('i_install_date')>0 && $this->sg->GetOption('i_hide_works')!==true && time() > ($this->sg->GetOption('i_install_date') + (60*60*24*15))) {
       
   330 				?>
       
   331 				<div class="updated">
       
   332 					<strong><p><?php echo str_replace("%s",$this->sg->GetRedirectLink("sitemap-works-note"),__('Thanks for using this plugin! You\'ve installed this plugin some time ago. If it works and your are satisfied, why not <a href="%s">rate it</a> and <a href="%s">recommend it</a> to others? :-)','sitemap')); ?> <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hide_works=true"; ?>" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php _e('Don\'t show this anymore', 'sitemap'); ?></small></a></p></strong>
       
   333 					<div style="clear:right;"></div>
       
   334 				</div>
       
   335 				<?php
       
   336 			}
       
   337 		}
       
   338 		
       
   339 		if(function_exists("wp_next_scheduled")) {
       
   340 			$next = wp_next_scheduled('sm_build_cron');
       
   341 			if($next) {
       
   342 				$diff = (time()-$next)*-1;
       
   343 				if($diff <= 0) {
       
   344 					$diffMsg = __('Your sitemap is being refreshed at the moment. Depending on your blog size this might take some time!<br /><small>Due to limitations of the WordPress scheduler, it might take another 60 seconds until the build process is actually started.</small>','sitemap');
       
   345 				} else {
       
   346 					$diffMsg = str_replace("%s",$diff,__('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!','sitemap'));
       
   347 				}
       
   348 				?>
       
   349 				<div class="updated">
       
   350 					<strong><p><?php echo $diffMsg ?></p></strong>
       
   351 					<div style="clear:right;"></div>
       
   352 				</div>
       
   353 				<?php
       
   354 			}
       
   355 		}
       
   356 		
       
   357 		
   344 		?>
   358 		?>
   345 				
   359 				
   346 		<style type="text/css">
   360 		<style type="text/css">
   347 		
   361 		
   348 		li.sm_hint {
   362 		li.sm_hint {
   402 		
   416 		
   403 		a.sm_resGoogle {
   417 		a.sm_resGoogle {
   404 			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-google.gif);
   418 			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-google.gif);
   405 		}
   419 		}
   406 		
   420 		
   407 		a.sm_resYahoo {
       
   408 			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-yahoo.gif);
       
   409 		}
       
   410 		
       
   411 		a.sm_resBing {
   421 		a.sm_resBing {
   412 			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-bing.gif);
   422 			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-bing.gif);
   413 		}
   423 		}
   414 		
   424 		
   415 		div.sm-update-nag p {
   425 		div.sm-update-nag p {
   431 				
   441 				
   432 				.sm-padded .inside input {
   442 				.sm-padded .inside input {
   433 					padding:1px;
   443 					padding:1px;
   434 					margin:0;
   444 					margin:0;
   435 				}
   445 				}
       
   446 
       
   447 				<?php if (version_compare($wp_version, "3.4", "<")): //Fix style for WP 3.4 (dirty way for now..) ?>
       
   448 
       
   449 				.inner-sidebar #side-sortables, .columns-2 .inner-sidebar #side-sortables {
       
   450 					min-height: 300px;
       
   451 					width: 280px;
       
   452 					padding: 0;
       
   453 				}
       
   454 
       
   455 				.has-right-sidebar .inner-sidebar {
       
   456 					display: block;
       
   457 				}
       
   458 
       
   459 				.inner-sidebar {
       
   460 					float: right;
       
   461 					clear: right;
       
   462 					display: none;
       
   463 					width: 281px;
       
   464 					position: relative;
       
   465 				}
       
   466 
       
   467 				.has-right-sidebar #post-body-content {
       
   468 					margin-right: 300px;
       
   469 				}
       
   470 
       
   471 				#post-body-content {
       
   472 					width: auto !important;
       
   473 					float: none !important;
       
   474 				}
       
   475 
       
   476 				<?php endif; ?>
       
   477 
       
   478 
   436 			</style>
   479 			</style>
   437 				
   480 				
   438 			<?php elseif(version_compare($wp_version,"2.5",">=")): ?>
   481 			<?php elseif(version_compare($wp_version,"2.5",">=")): ?>
   439 				<style type="text/css">
   482 				<style type="text/css">
   440 					div#moremeta {
   483 					div#moremeta {
   591 						
   634 						
   592 						
   635 						
   593 							<?php $this->HtmlPrintBoxHeader('sm_smres',__('Sitemap Resources:','sitemap'),true); ?>
   636 							<?php $this->HtmlPrintBoxHeader('sm_smres',__('Sitemap Resources:','sitemap'),true); ?>
   594 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-gwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
   637 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-gwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
   595 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-gwb'); ?>"><?php _e('Webmaster Blog','sitemap'); ?></a>
   638 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-gwb'); ?>"><?php _e('Webmaster Blog','sitemap'); ?></a>
   596 								
   639 
   597 								<a class="sm_button sm_resYahoo"     href="<?php echo $this->sg->GetRedirectLink('sitemap-yse'); ?>"><?php _e('Site Explorer','sitemap'); ?></a>
   640 								<a class="sm_button sm_resBing"      href="<?php echo $this->sg->GetRedirectLink('sitemap-lwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
   598 								<a class="sm_button sm_resYahoo"     href="<?php echo $this->sg->GetRedirectLink('sitemap-ywb'); ?>"><?php _e('Search Blog','sitemap'); ?></a>
   641 								<a class="sm_button sm_resBing"      href="<?php echo $this->sg->GetRedirectLink('sitemap-lswcb'); ?>"><?php _e('Webmaster Center Blog','sitemap'); ?></a>
   599 								
       
   600 								<a class="sm_button sm_resBing"     href="<?php echo $this->sg->GetRedirectLink('sitemap-lwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
       
   601 								<a class="sm_button sm_resBing"     href="<?php echo $this->sg->GetRedirectLink('sitemap-lswcb'); ?>"><?php _e('Webmaster Center Blog','sitemap'); ?></a>
       
   602 								<br />
   642 								<br />
   603 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-prot'); ?>"><?php _e('Sitemaps Protocol','sitemap'); ?></a>
   643 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-prot'); ?>"><?php _e('Sitemaps Protocol','sitemap'); ?></a>
   604 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-ofaq'); ?>"><?php _e('Official Sitemaps FAQ','sitemap'); ?></a>
   644 								<a class="sm_button sm_resGoogle"    href="<?php echo $this->sg->GetRedirectLink('sitemap-ofaq'); ?>"><?php _e('Official Sitemaps FAQ','sitemap'); ?></a>
   605 								<a class="sm_button sm_pluginHome"   href="<?php echo $this->sg->GetRedirectLink('sitemap-afaq'); ?>"><?php _e('My Sitemaps FAQ','sitemap'); ?></a>
   645 								<a class="sm_button sm_pluginHome"   href="<?php echo $this->sg->GetRedirectLink('sitemap-afaq'); ?>"><?php _e('My Sitemaps FAQ','sitemap'); ?></a>
   606 							<?php $this->HtmlPrintBoxFooter(true); ?>
   646 							<?php $this->HtmlPrintBoxFooter(true); ?>
   632 						<div id="advancedstuff" class="dbx-group" >
   672 						<div id="advancedstuff" class="dbx-group" >
   633 					<?php endif; ?>
   673 					<?php endif; ?>
   634 					
   674 					
   635 					<!-- Rebuild Area -->
   675 					<!-- Rebuild Area -->
   636 					<?php
   676 					<?php
   637 						$status = GoogleSitemapGeneratorStatus::Load();
   677 						$status = &GoogleSitemapGeneratorStatus::Load();
   638 						$head = __('The sitemap wasn\'t generated yet.','sitemap');
   678 						$head = __('The sitemap wasn\'t generated yet.','sitemap');
   639 						if($status != null) {
   679 						if($status != null) {
   640 							$st=$status->GetStartTime();
   680 							$st=$status->GetStartTime();
   641 							$head=str_replace("%date%",date(get_option('date_format'),$st) . " " . date(get_option('time_format'),$st),__("Result of the last build process, started on %date%.",'sitemap'));
   681 							$head=str_replace("%date%",date(get_option('date_format'),$st) . " " . date(get_option('time_format'),$st),__("Result of the last build process, started on %date%.",'sitemap'));
   642 						}
   682 						}
   679 											}
   719 											}
   680 										} else {
   720 										} else {
   681 											echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=google&noheader=true",'sitemap'),__('There was a problem while notifying Google. <a href="%s">View result</a>','sitemap')) . "</li>";
   721 											echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=google&noheader=true",'sitemap'),__('There was a problem while notifying Google. <a href="%s">View result</a>','sitemap')) . "</li>";
   682 										}
   722 										}
   683 									}
   723 									}
   684 									
   724 
   685 									if($status->_usedYahoo) {
       
   686 										if($status->_yahooSuccess) {
       
   687 											echo "<li>" .__("YAHOO was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
       
   688 											$yt = $status->GetYahooTime();
       
   689 											if($yt>4) {
       
   690 												echo "<li class=\sm_optimize\">" . str_replace("%time%",$yt,__("It took %time% seconds to notify YAHOO, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
       
   691 											}
       
   692 										} else {
       
   693 											echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=yahoo&noheader=true",'sitemap'),__('There was a problem while notifying YAHOO. <a href="%s">View result</a>','sitemap')) . "</li>";
       
   694 										}
       
   695 									}
       
   696 									
       
   697 									if($status->_usedMsn) {
   725 									if($status->_usedMsn) {
   698 										if($status->_msnSuccess) {
   726 										if($status->_msnSuccess) {
   699 											echo "<li>" .__("Bing was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
   727 											echo "<li>" .__("Bing was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
   700 											$at = $status->GetMsnTime();
   728 											$at = $status->GetMsnTime();
   701 											if($at>4) {
   729 											if($at>4) {
   702 												echo "<li class=\sm_optimize\">" . str_replace("%time%",$at,__("It took %time% seconds to notify Bing, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
   730 												echo "<li class=\sm_optimize\">" . str_replace("%time%",$at,__("It took %time% seconds to notify Bing, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
   703 											}
   731 											}
   704 										} else {
   732 										} else {
   705 											echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=msn&noheader=true",'sitemap'),__('There was a problem while notifying Bing. <a href="%s">View result</a>','sitemap')) . "</li>";
   733 											echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=msn&noheader=true",'sitemap'),__('There was a problem while notifying Bing. <a href="%s">View result</a>','sitemap')) . "</li>";
   706 										}
       
   707 									}
       
   708 									
       
   709 									if($status->_usedAsk) {
       
   710 										if($status->_askSuccess) {
       
   711 											echo "<li>" .__("Ask.com was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
       
   712 											$at = $status->GetAskTime();
       
   713 											if($at>4) {
       
   714 												echo "<li class=\sm_optimize\">" . str_replace("%time%",$at,__("It took %time% seconds to notify Ask.com, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
       
   715 											}
       
   716 										} else {
       
   717 											echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=ask&noheader=true",'sitemap'),__('There was a problem while notifying Ask.com. <a href="%s">View result</a>','sitemap')) . "</li>";
       
   718 										}
   734 										}
   719 									}
   735 									}
   720 									
   736 									
   721 									$et = $status->GetTime();
   737 									$et = $status->GetTime();
   722 									$mem = $status->GetMemoryUsage();
   738 									$mem = $status->GetMemoryUsage();
   753 									}
   769 									}
   754 								}
   770 								}
   755 								echo "<li>" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&noheader=true",'sitemap'),__('If you changed something on your server or blog, you should <a href="%s">rebuild the sitemap</a> manually.','sitemap')) . "</li>";
   771 								echo "<li>" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&noheader=true",'sitemap'),__('If you changed something on your server or blog, you should <a href="%s">rebuild the sitemap</a> manually.','sitemap')) . "</li>";
   756 							}
   772 							}
   757 							echo "<li>" . str_replace("%d",wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true",'sitemap'),__('If you encounter any problems with the build process you can use the <a href="%d">debug function</a> to get more information.','sitemap')) . "</li>";
   773 							echo "<li>" . str_replace("%d",wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true",'sitemap'),__('If you encounter any problems with the build process you can use the <a href="%d">debug function</a> to get more information.','sitemap')) . "</li>";
       
   774 
       
   775 							if(version_compare($wp_version,"2.9",">=") && version_compare(PHP_VERSION,"5.1",">=")) {
       
   776 								echo "<li class='sm_hint'>" . str_replace("%s",$this->sg->GetRedirectLink('sitemap-info-beta'), __('There is a new beta version of this plugin available which supports the new multi-site feature of WordPress as well as many other new functions! <a href="%s">More information and download</a>','sitemap')) . "</li>";
       
   777 							}
   758 							?>
   778 							?>
   759 
   779 
   760 						</ul>
   780 						</ul>
   761 					<?php $this->HtmlPrintBoxFooter(); ?>
   781 					<?php $this->HtmlPrintBoxFooter(); ?>
   762 						
   782 						
   792 									<input type="checkbox" id="sm_b_manual_enabled" name="sm_b_manual_enabled" <?php echo ($this->sg->GetOption("b_manual_enabled")==true?"checked=\"checked\"":"") ?> />
   812 									<input type="checkbox" id="sm_b_manual_enabled" name="sm_b_manual_enabled" <?php echo ($this->sg->GetOption("b_manual_enabled")==true?"checked=\"checked\"":"") ?> />
   793 									<?php _e('Enable manual sitemap building via GET Request', 'sitemap') ?>
   813 									<?php _e('Enable manual sitemap building via GET Request', 'sitemap') ?>
   794 								</label>
   814 								</label>
   795 								<a href="javascript:void(document.getElementById('sm_manual_help').style.display='');">[?]</a>
   815 								<a href="javascript:void(document.getElementById('sm_manual_help').style.display='');">[?]</a>
   796 								<span id="sm_manual_help" style="display:none;"><br />
   816 								<span id="sm_manual_help" style="display:none;"><br />
   797 								<?php echo str_replace("%1",trailingslashit(get_bloginfo('siteurl')) . "?sm_command=build&amp;sm_key=" . $this->sg->GetOption("b_manual_key"),__('This will allow you to refresh your sitemap if an external tool wrote into the WordPress database without using the WordPress API. Use the following URL to start the process: <a href="%1">%1</a> Please check the result box above to see if sitemap was successfully built.', 'sitemap')); ?>
   817 								<?php echo str_replace("%1",trailingslashit(get_bloginfo('url')) . "?sm_command=build&amp;sm_key=" . $this->sg->GetOption("b_manual_key"),__('This will allow you to refresh your sitemap if an external tool wrote into the WordPress database without using the WordPress API. Use the following URL to start the process: <a href="%1">%1</a> Please check the result box above to see if sitemap was successfully built.', 'sitemap')); ?>
   798 								</span>
   818 								</span>
   799 							</li>
   819 							</li>
   800 						</ul>
   820 						</ul>
   801 						<b><?php _e('Update notification:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-ping'); ?>"><?php _e('Learn more','sitemap'); ?></a>
   821 						<b><?php _e('Update notification:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-ping'); ?>"><?php _e('Learn more','sitemap'); ?></a>
   802 						<ul>
   822 						<ul>
   807 							</li>
   827 							</li>
   808 							<li>
   828 							<li>
   809 								<input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php echo ($this->sg->GetOption("b_pingmsn")==true?"checked=\"checked\"":"") ?> />
   829 								<input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php echo ($this->sg->GetOption("b_pingmsn")==true?"checked=\"checked\"":"") ?> />
   810 								<label for="sm_b_pingmsn"><?php _e('Notify Bing (formerly MSN Live Search) about updates of your Blog', 'sitemap') ?></label><br />
   830 								<label for="sm_b_pingmsn"><?php _e('Notify Bing (formerly MSN Live Search) about updates of your Blog', 'sitemap') ?></label><br />
   811 								<small><?php echo str_replace("%s",$this->sg->GetRedirectLink('sitemap-lwt'),__('No registration required, but you can join the <a href="%s">Bing Webmaster Tools</a> to check crawling statistics.','sitemap')); ?></small>
   831 								<small><?php echo str_replace("%s",$this->sg->GetRedirectLink('sitemap-lwt'),__('No registration required, but you can join the <a href="%s">Bing Webmaster Tools</a> to check crawling statistics.','sitemap')); ?></small>
   812 							</li>
       
   813 							<li>
       
   814 								<input type="checkbox" id="sm_b_pingask" name="sm_b_pingask" <?php echo ($this->sg->GetOption("b_pingask")==true?"checked=\"checked\"":"") ?> />
       
   815 								<label for="sm_b_pingask"><?php _e('Notify Ask.com about updates of your Blog', 'sitemap') ?></label><br />
       
   816 								<small><?php _e('No registration required.','sitemap'); ?></small>
       
   817 							</li>
       
   818 							<li>
       
   819 								<input type="checkbox" id="sm_b_pingyahoo" name="sm_b_pingyahoo" <?php echo ($this->sg->GetOption("b_pingyahoo")==true?"checked=\"checked\"":"") ?> />
       
   820 								<label for="sm_b_pingyahoo"><?php _e('Notify YAHOO about updates of your Blog', 'sitemap') ?></label><br />
       
   821 								<label for="sm_b_yahookey"><?php _e('Your Application ID:', 'sitemap') ?> <input type="text" name="sm_b_yahookey" id="sm_b_yahookey" value="<?php echo $this->sg->GetOption("b_yahookey"); ?>" /></label><br />
       
   822 								<small><?php echo str_replace(array("%s1","%s2"),array($this->sg->GetRedirectLink('sitemap-ykr'),' (<a href="http://developer.yahoo.net/about/">Web Services by Yahoo!</a>)'),__('Don\'t you have such a key? <a href="%s1">Request one here</a>! %s2','sitemap')); ?></small>
       
   823 							</li>
   832 							</li>
   824 							<li>
   833 							<li>
   825 								<label for="sm_b_robots">
   834 								<label for="sm_b_robots">
   826 								<input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php echo ($this->sg->GetOption("b_robots")==true?"checked=\"checked\"":"") ?> />
   835 								<input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php echo ($this->sg->GetOption("b_robots")==true?"checked=\"checked\"":"") ?> />
   827 								<?php _e("Add sitemap URL to the virtual robots.txt file.",'sitemap'); ?>
   836 								<?php _e("Add sitemap URL to the virtual robots.txt file.",'sitemap'); ?>
   988 						
   997 						
   989 					<?php $this->HtmlPrintBoxFooter(); ?>
   998 					<?php $this->HtmlPrintBoxFooter(); ?>
   990 					
   999 					
   991 					<!-- Includes -->
  1000 					<!-- Includes -->
   992 					<?php $this->HtmlPrintBoxHeader('sm_includes',__('Sitemap Content', 'sitemap')); ?>
  1001 					<?php $this->HtmlPrintBoxHeader('sm_includes',__('Sitemap Content', 'sitemap')); ?>
   993 					
  1002 						<b><?php _e('WordPress standard content', 'sitemap') ?>:</b>
   994 						<ul>
  1003 						<ul>
   995 							<li>
  1004 							<li>
   996 								<label for="sm_in_home">
  1005 								<label for="sm_in_home">
   997 									<input type="checkbox" id="sm_in_home" name="sm_in_home"  <?php echo ($this->sg->GetOption("in_home")==true?"checked=\"checked\"":"") ?> />
  1006 									<input type="checkbox" id="sm_in_home" name="sm_in_home"  <?php echo ($this->sg->GetOption("in_home")==true?"checked=\"checked\"":"") ?> />
   998 									<?php _e('Include homepage', 'sitemap') ?>
  1007 									<?php _e('Include homepage', 'sitemap') ?>
  1026 								<label for="sm_in_arch">
  1035 								<label for="sm_in_arch">
  1027 									<input type="checkbox" id="sm_in_arch" name="sm_in_arch"  <?php echo ($this->sg->GetOption("in_arch")==true?"checked=\"checked\"":"") ?> />
  1036 									<input type="checkbox" id="sm_in_arch" name="sm_in_arch"  <?php echo ($this->sg->GetOption("in_arch")==true?"checked=\"checked\"":"") ?> />
  1028 									<?php _e('Include archives', 'sitemap') ?>
  1037 									<?php _e('Include archives', 'sitemap') ?>
  1029 								</label>
  1038 								</label>
  1030 							</li>
  1039 							</li>
       
  1040 							<li>
       
  1041 								<label for="sm_in_auth">
       
  1042 									<input type="checkbox" id="sm_in_auth" name="sm_in_auth"  <?php echo ($this->sg->GetOption("in_auth")==true?"checked=\"checked\"":"") ?> />
       
  1043 									<?php _e('Include author pages', 'sitemap') ?>
       
  1044 								</label>
       
  1045 							</li>
  1031 							<?php if($this->sg->IsTaxonomySupported()): ?>
  1046 							<?php if($this->sg->IsTaxonomySupported()): ?>
  1032 							<li>
  1047 							<li>
  1033 								<label for="sm_in_tags">
  1048 								<label for="sm_in_tags">
  1034 									<input type="checkbox" id="sm_in_tags" name="sm_in_tags"  <?php echo ($this->sg->GetOption("in_tags")==true?"checked=\"checked\"":"") ?> />
  1049 									<input type="checkbox" id="sm_in_tags" name="sm_in_tags"  <?php echo ($this->sg->GetOption("in_tags")==true?"checked=\"checked\"":"") ?> />
  1035 									<?php _e('Include tag pages', 'sitemap') ?>
  1050 									<?php _e('Include tag pages', 'sitemap') ?>
  1036 								</label>
  1051 								</label>
  1037 							</li>
  1052 							</li>
  1038 							<?php
  1053 							<?php endif; ?>
  1039 								$taxonomies = $this->sg->GetCustomTaxonomies();
  1054 						</ul>
       
  1055 							
       
  1056 						<?php 
       
  1057 						
       
  1058 						if($this->sg->IsTaxonomySupported()) {
       
  1059 							$taxonomies = $this->sg->GetCustomTaxonomies();
       
  1060 							
       
  1061 							$enabledTaxonomies = $this->sg->GetOption('in_tax');
       
  1062 							
       
  1063 							if(count($taxonomies)>0) {
       
  1064 								?><b><?php _e('Custom taxonomies', 'sitemap') ?>:</b><ul><?php 
  1040 								
  1065 								
  1041 								$enabledTaxonomies = $this->sg->GetOption('in_tax');
  1066 							
  1042 								
       
  1043 								foreach ($taxonomies as $taxName) {
  1067 								foreach ($taxonomies as $taxName) {
  1044 										
  1068 										
  1045 									$taxonomy = get_taxonomy($taxName);
  1069 									$taxonomy = get_taxonomy($taxName);
  1046 									$selected = in_array($taxonomy->name, $enabledTaxonomies);
  1070 									$selected = in_array($taxonomy->name, $enabledTaxonomies);
  1047 									?>
  1071 									?>
  1048 									<li>
  1072 									<li>
  1049 										<label for="sm_in_tax[<?php echo $taxonomy->name; ?>]">
  1073 										<label for="sm_in_tax[<?php echo $taxonomy->name; ?>]">
  1050 											<input type="checkbox" id="sm_in_tax[<?php echo $taxonomy->name; ?>]" name="sm_in_tax[<?php echo $taxonomy->name; ?>]" <?php echo $selected?"checked=\"checked\"":""; ?> />
  1074 											<input type="checkbox" id="sm_in_tax[<?php echo $taxonomy->name; ?>]" name="sm_in_tax[<?php echo $taxonomy->name; ?>]" <?php echo $selected?"checked=\"checked\"":""; ?> />
  1051 											<?php echo str_replace('%s',$taxonomy->label,__('Include taxonomy pages for %s', 'sitemap')); ?>
  1075 											<?php echo str_replace('%s',$taxonomy->label,__('Include taxonomy pages for %s', 'sitemap')); ?>
  1052 										</label>
  1076 										</label>
  1053 									<li>
  1077 									</li>
  1054 									<?php
  1078 									<?php
  1055 								}
  1079 								}
  1056 							?>
  1080 								
  1057 							<?php endif; ?>
  1081 								?></ul><?php 
  1058 							<li>
  1082 								
  1059 								<label for="sm_in_auth">
  1083 							}
  1060 									<input type="checkbox" id="sm_in_auth" name="sm_in_auth"  <?php echo ($this->sg->GetOption("in_auth")==true?"checked=\"checked\"":"") ?> />
  1084 						}
  1061 									<?php _e('Include author pages', 'sitemap') ?>
  1085 						
  1062 								</label>
  1086 		
  1063 							</li>
  1087 						if($this->sg->IsCustomPostTypesSupported()) {
  1064 						</ul>
  1088 							$custom_post_types = $this->sg->GetCustomPostTypes();
       
  1089 						
       
  1090 							$enabledPostTypes = $this->sg->GetOption('in_customtypes');
       
  1091 						
       
  1092 							if(count($custom_post_types)>0) {
       
  1093 								?><b><?php _e('Custom post types', 'sitemap') ?>:</b><ul><?php 
       
  1094 							
       
  1095 								foreach ($custom_post_types as $post_type) {
       
  1096 									$post_type_object = get_post_type_object($post_type);
       
  1097 									
       
  1098 									if (is_array($enabledPostTypes)) $selected = in_array($post_type_object->name, $enabledPostTypes);
       
  1099 
       
  1100 									?>
       
  1101 									<li>
       
  1102 										<label for="sm_in_customtypes[<?php echo $post_type_object->name; ?>]">
       
  1103 											<input type="checkbox" id="sm_in_customtypes[<?php echo $post_type_object->name; ?>]" name="sm_in_customtypes[<?php echo $post_type_object->name; ?>]" <?php echo $selected?"checked=\"checked\"":""; ?> />
       
  1104 											<?php echo str_replace('%s',$post_type_object->label,__('Include custom post type %s', 'sitemap')); ?>
       
  1105 										</label>
       
  1106 									</li>
       
  1107 									<?php
       
  1108 								}
       
  1109 								
       
  1110 								?></ul><?php 
       
  1111 							}
       
  1112 						}
       
  1113 						
       
  1114 						?>
       
  1115 						
  1065 						<b><?php _e('Further options', 'sitemap') ?>:</b>
  1116 						<b><?php _e('Further options', 'sitemap') ?>:</b>
  1066 						<ul>
  1117 						<ul>
  1067 							<li>
  1118 							<li>
  1068 								<label for="sm_in_lastmod">
  1119 								<label for="sm_in_lastmod">
  1069 									<input type="checkbox" id="sm_in_lastmod" name="sm_in_lastmod"  <?php echo ($this->sg->GetOption("in_lastmod")==true?"checked=\"checked\"":"") ?> />
  1120 									<input type="checkbox" id="sm_in_lastmod" name="sm_in_lastmod"  <?php echo ($this->sg->GetOption("in_lastmod")==true?"checked=\"checked\"":"") ?> />
  1253 				?>
  1304 				?>
  1254 				<input type="hidden" name="cmd" value="_xclick" />
  1305 				<input type="hidden" name="cmd" value="_xclick" />
  1255 				<input type="hidden" name="business" value="<?php echo "donate" /* N O S P A M */ . "@" . "arnebra" . "chhold.de"; ?>" />
  1306 				<input type="hidden" name="business" value="<?php echo "donate" /* N O S P A M */ . "@" . "arnebra" . "chhold.de"; ?>" />
  1256 				<input type="hidden" name="item_name" value="Sitemap Generator for WordPress. Please tell me if if you don't want to be listed on the donator list." />
  1307 				<input type="hidden" name="item_name" value="Sitemap Generator for WordPress. Please tell me if if you don't want to be listed on the donator list." />
  1257 				<input type="hidden" name="no_shipping" value="1" />
  1308 				<input type="hidden" name="no_shipping" value="1" />
  1258 				<input type="hidden" name="return" value="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $this->sg->GetBackLink(); ?>&amp;sm_donated=true" />
  1309 				<input type="hidden" name="return" value="<?php echo $this->sg->GetBackLink(); ?>&amp;sm_donated=true" />
  1259 				<input type="hidden" name="item_number" value="0001" />
  1310 				<input type="hidden" name="item_number" value="0001" />
  1260 				<input type="hidden" name="currency_code" value="<?php echo $myLc["cc"]; ?>" />
  1311 				<input type="hidden" name="currency_code" value="<?php echo $myLc["cc"]; ?>" />
  1261 				<input type="hidden" name="bn" value="PP-BuyNowBF" />
  1312 				<input type="hidden" name="bn" value="PP-BuyNowBF" />
  1262 				<input type="hidden" name="lc" value="<?php echo $myLc["lc"]; ?>" />
  1313 				<input type="hidden" name="lc" value="<?php echo $myLc["lc"]; ?>" />
  1263 				<input type="hidden" name="rm" value="2" />
  1314 				<input type="hidden" name="rm" value="2" />
  1264 				<input type="hidden" name="on0" value="Your Website" />
  1315 				<input type="hidden" name="on0" value="Your Website" />
  1265 				<input type="hidden" name="os0" value="<?php echo get_bloginfo("home"); ?>"/>
  1316 				<input type="hidden" name="os0" value="<?php echo get_bloginfo("url"); ?>"/>
  1266 			</form>
  1317 			</form>
  1267 		</div>
  1318 		</div>
  1268 		<?php
  1319 		<?php
  1269 	}
  1320 	}
  1270 }
  1321 }