PageRenderTime 31ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/google-sitemap-generator/sitemap-ui.php

https://bitbucket.org/carloskikea/helpet
PHP | 1309 lines | 1070 code | 149 blank | 90 comment | 144 complexity | 4f86a5a75082d8fc6f3cceca2b0a7edf MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1<?php
   2/*
   3
   4 $Id: sitemap-ui.php 935247 2014-06-19 17:13:03Z arnee $
   5
   6*/
   7
   8class GoogleSitemapGeneratorUI {
   9
  10	/**
  11	 * The Sitemap Generator Object
  12	 *
  13	 * @var GoogleSitemapGenerator
  14	 */
  15	private $sg = null;
  16
  17
  18	public function __construct(GoogleSitemapGenerator $sitemapBuilder) {
  19		$this->sg = $sitemapBuilder;
  20	}
  21
  22	private function HtmlPrintBoxHeader($id, $title) {
  23		?>
  24			<div id="<?php echo $id; ?>" class="postbox">
  25				<h3 class="hndle"><span><?php echo $title ?></span></h3>
  26				<div class="inside">
  27		<?php
  28	}
  29
  30	private function HtmlPrintBoxFooter() {
  31			?>
  32				</div>
  33			</div>
  34		<?php
  35	}
  36
  37	/**
  38	 * Echos option fields for an select field containing the valid change frequencies
  39	 *
  40	 * @since 4.0
  41	 * @param $currentVal mixed The value which should be selected
  42	 */
  43	public function HtmlGetFreqNames($currentVal) {
  44
  45		foreach($this->sg->GetFreqNames() AS $k=>$v) {
  46			echo "<option value=\"" . esc_attr($k) . "\" " . self::HtmlGetSelected($k,$currentVal) .">" . esc_attr($v) . "</option>";
  47		}
  48	}
  49
  50	/**
  51	 * Echos option fields for an select field containing the valid priorities (0- 1.0)
  52	 *
  53	 * @since 4.0
  54	 * @param $currentVal string The value which should be selected
  55	 * @return void
  56	 */
  57	public static function HtmlGetPriorityValues($currentVal) {
  58		$currentVal=(float) $currentVal;
  59		for($i=0.0; $i<=1.0; $i+=0.1) {
  60			$v = number_format($i,1,".","");
  61			echo "<option value=\"" . esc_attr($v) . "\" " . self::HtmlGetSelected("$i","$currentVal") .">";
  62			echo esc_attr(number_format_i18n($i,1));
  63			echo "</option>";
  64		}
  65	}
  66
  67	/**
  68	 * Returns the checked attribute if the given values match
  69	 *
  70	 * @since 4.0
  71	 * @param $val string The current value
  72	 * @param $equals string The value to match
  73	 * @return string The checked attribute if the given values match, an empty string if not
  74	 */
  75	public static function HtmlGetChecked($val, $equals) {
  76		if($val==$equals) return self::HtmlGetAttribute("checked");
  77		else return "";
  78	}
  79
  80	/**
  81	 * Returns the selected attribute if the given values match
  82	 *
  83	 * @since 4.0
  84	 * @param $val string The current value
  85	 * @param $equals string The value to match
  86	 * @return string The selected attribute if the given values match, an empty string if not
  87	 */
  88	public static function HtmlGetSelected($val,$equals) {
  89		if($val==$equals) return self::HtmlGetAttribute("selected");
  90		else return "";
  91	}
  92
  93	/**
  94	 * Returns an formatted attribute. If the value is NULL, the name will be used.
  95	 *
  96	 * @since 4.0
  97	 * @param $attr string The attribute name
  98	 * @param $value string The attribute value
  99	 * @return string The formatted attribute
 100	 */
 101	public static function HtmlGetAttribute($attr,$value=NULL) {
 102		if($value==NULL) $value=$attr;
 103		return " " . $attr . "=\"" . esc_attr($value) . "\" ";
 104	}
 105
 106	/**
 107	 * Returns an array with GoogleSitemapGeneratorPage objects which is generated from POST values
 108	 *
 109	 * @since 4.0
 110	 * @see GoogleSitemapGeneratorPage
 111	 * @return array An array with GoogleSitemapGeneratorPage objects
 112	 */
 113	public function HtmlApplyPages() {
 114		// Array with all page URLs
 115		$pages_ur=(!isset($_POST["sm_pages_ur"]) || !is_array($_POST["sm_pages_ur"])?array():$_POST["sm_pages_ur"]);
 116
 117		//Array with all priorities
 118		$pages_pr=(!isset($_POST["sm_pages_pr"]) || !is_array($_POST["sm_pages_pr"])?array():$_POST["sm_pages_pr"]);
 119
 120		//Array with all change frequencies
 121		$pages_cf=(!isset($_POST["sm_pages_cf"]) || !is_array($_POST["sm_pages_cf"])?array():$_POST["sm_pages_cf"]);
 122
 123		//Array with all lastmods
 124		$pages_lm=(!isset($_POST["sm_pages_lm"]) || !is_array($_POST["sm_pages_lm"])?array():$_POST["sm_pages_lm"]);
 125
 126		//Array where the new pages are stored
 127		$pages=array();
 128		//Loop through all defined pages and set their properties into an object
 129		if(isset($_POST["sm_pages_mark"]) && is_array($_POST["sm_pages_mark"])) {
 130			for($i=0; $i<count($_POST["sm_pages_mark"]); $i++) {
 131				//Create new object
 132				$p=new GoogleSitemapGeneratorPage();
 133				if(substr($pages_ur[$i],0,4)=="www.") $pages_ur[$i]="http://" . $pages_ur[$i];
 134				$p->SetUrl($pages_ur[$i]);
 135				$p->SetProprity($pages_pr[$i]);
 136				$p->SetChangeFreq($pages_cf[$i]);
 137				//Try to parse last modified, if -1 (note ===) automatic will be used (0)
 138				$lm=(!empty($pages_lm[$i])?strtotime($pages_lm[$i],time()):-1);
 139				if($lm===-1) $p->setLastMod(0);
 140				else $p->setLastMod($lm);
 141				//Add it to the array
 142				array_push($pages,$p);
 143			}
 144		}
 145
 146		return $pages;
 147	}
 148
 149	/**
 150	 * Displays the option page
 151	 *
 152	 * @since 3.0
 153	 * @access public
 154	 * @author Arne Brachhold
 155	 */
 156	public function HtmlShowOptionsPage() {
 157		global $wp_version;
 158
 159		$snl = false; //SNL
 160
 161		$this->sg->Initate();
 162
 163		$message="";
 164
 165		if(!empty($_REQUEST["sm_rebuild"])) { //Pressed Button: Rebuild Sitemap
 166			check_admin_referer('sitemap');
 167
 168
 169			if(isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"]=="true") {
 170
 171				//Check again, just for the case that something went wrong before
 172				if(!current_user_can("administrator") || !is_super_admin()) {
 173					echo '<p>Please log in as admin</p>';
 174					return;
 175				}
 176
 177				$oldErr = error_reporting(E_ALL);
 178				$oldIni = ini_set("display_errors",1);
 179
 180				echo '<div class="wrap">';
 181				echo '<h2>' .  __('XML Sitemap Generator for WordPress', 'sitemap') .  " " . $this->sg->GetVersion(). '</h2>';
 182				echo '<p>This is the debug mode of the XML Sitemap Generator. It will show all PHP notices and warnings as well as the internal logs, messages and configuration.</p>';
 183				echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
 184				echo "<h3>WordPress and PHP Information</h3>";
 185				echo '<p>WordPress ' . $GLOBALS['wp_version'] . ' with ' . ' DB ' . $GLOBALS['wp_db_version'] . ' on PHP ' . phpversion() . '</p>';
 186				echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->GetSvnVersion() . ')';
 187				echo '<h4>Environment</h4>';
 188				echo "<pre>";
 189				$sc = $_SERVER;
 190				unset($sc["HTTP_COOKIE"]);
 191				print_r($sc);
 192				echo "</pre>";
 193				echo "<h4>WordPress Config</h4>";
 194				echo "<pre>";
 195				$opts = array();
 196				if(function_exists('wp_load_alloptions')) {
 197					$opts = wp_load_alloptions();
 198				} else {
 199					/** @var $wpdb wpdb*/
 200					global $wpdb;
 201					$os = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options");
 202					foreach ( (array) $os as $o ) $opts[$o->option_name] = $o->option_value;
 203				}
 204
 205				$popts = array();
 206				foreach($opts as $k=>$v) {
 207					//Try to filter out passwords etc...
 208					if(preg_match("/pass|login|pw|secret|user|usr|key|auth|token/si",$k)) continue;
 209					$popts[$k] = htmlspecialchars($v);
 210				}
 211				print_r($popts);
 212				echo "</pre>";
 213				echo '<h4>Sitemap Config</h4>';
 214				echo "<pre>";
 215				print_r($this->sg->GetOptions());
 216				echo "</pre>";
 217				echo '<h3>Sitemap Content and Errors, Warnings, Notices</h3>';
 218				echo '<div>';
 219
 220				$sitemaps = $this->sg->SimulateIndex();
 221
 222				foreach($sitemaps AS $sitemap) {
 223
 224					/** @var $s GoogleSitemapGeneratorSitemapEntry */
 225					$s = $sitemap["data"];
 226
 227					echo "<h4>Sitemap: <a href=\"" . $s->GetUrl() . "\">" . $sitemap["type"] . "/" . ($sitemap["params"]?$sitemap["params"]:"(No parameters)") .  "</a> by " . $sitemap["caller"]["class"] . "</h4>";
 228
 229					$res = $this->sg->SimulateSitemap($sitemap["type"], $sitemap["params"]);
 230
 231					echo "<ul style='padding-left:10px;'>";
 232					foreach($res AS $s) {
 233						/** @var $d GoogleSitemapGeneratorSitemapEntry */
 234						$d = $s["data"];
 235						echo "<li>" . $d->GetUrl() . "</li>";
 236					}
 237					echo "</ul>";
 238				}
 239
 240				$status = GoogleSitemapGeneratorStatus::Load();
 241				echo '</div>';
 242				echo '<h3>MySQL Queries</h3>';
 243				if(defined('SAVEQUERIES') && SAVEQUERIES) {
 244					echo '<pre>';
 245					var_dump($GLOBALS['wpdb']->queries);
 246					echo '</pre>';
 247
 248					$total = 0;
 249					foreach($GLOBALS['wpdb']->queries as $q) {
 250						$total+=$q[1];
 251					}
 252					echo '<h4>Total Query Time</h4>';
 253					echo '<pre>' . count($GLOBALS['wpdb']->queries) . ' queries in ' . round($total,2) . ' seconds.</pre>';
 254				} else {
 255					echo '<p>Please edit wp-db.inc.php in wp-includes and set SAVEQUERIES to true if you want to see the queries.</p>';
 256				}
 257				echo "<h3>Build Process Results</h3>";
 258				echo "<pre>";
 259				print_r($status);
 260				echo "</pre>";
 261				echo '<p>Done. <a href="' . wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true",'sitemap') . '">Rebuild</a> or <a href="' . $this->sg->GetBackLink() . '">Return</a></p>';
 262				echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
 263				echo '</div>';
 264				@error_reporting($oldErr);
 265				@ini_set("display_errors",$oldIni);
 266				return;
 267			} else {
 268
 269				$redirURL = $this->sg->GetBackLink() . '&sm_fromrb=true';
 270
 271				//Redirect so the sm_rebuild GET parameter no longer exists.
 272				@header("location: " . $redirURL);
 273				//If there was already any other output, the header redirect will fail
 274				echo '<script type="text/javascript">location.replace("' . $redirURL . '");</script>';
 275				echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
 276				exit;
 277			}
 278		} else if (!empty($_POST['sm_update'])) { //Pressed Button: Update Config
 279			check_admin_referer('sitemap');
 280
 281			if(isset($_POST['sm_b_style']) && $_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
 282				$_POST['sm_b_style_default'] = true;
 283				$_POST['sm_b_style'] = '';
 284			}
 285
 286			foreach($this->sg->GetOptions() as $k=>$v) {
 287
 288				//Skip some options if the user is not super admin...
 289				if(!is_super_admin() && in_array($k,array("sm_b_time","sm_b_memory","sm_b_style","sm_b_style_default"))) {
 290					continue;
 291				}
 292
 293				//Check vor values and convert them into their types, based on the category they are in
 294				if(!isset($_POST[$k])) $_POST[$k]=""; // Empty string will get false on 2bool and 0 on 2float
 295
 296				//Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
 297				if(substr($k,0,5)=="sm_b_") {
 298					if($k=="sm_b_prio_provider" || $k == "sm_b_style" || $k == "sm_b_memory" || $k == "sm_b_baseurl") {
 299						if($k=="sm_b_filename_manual" && strpos($_POST[$k],"\\")!==false){
 300							$_POST[$k]=stripslashes($_POST[$k]);
 301						} else if($k=="sm_b_baseurl") {
 302							$_POST[$k] = trim($_POST[$k]);
 303							if(!empty($_POST[$k])) $_POST[$k] = trailingslashit($_POST[$k]);
 304						}
 305						$this->sg->SetOption($k,(string) $_POST[$k]);
 306					} else if($k == "sm_b_time") {
 307						if($_POST[$k]=='') $_POST[$k] = -1;
 308						$this->sg->SetOption($k,intval($_POST[$k]));
 309					} else if($k== "sm_i_install_date") {
 310						if($this->sg->GetOption('i_install_date')<=0) $this->sg->SetOption($k,time());
 311					} else if($k=="sm_b_exclude") {
 312						$IDss = array();
 313						$IDs = explode(",",$_POST[$k]);
 314						for($x = 0; $x<count($IDs); $x++) {
 315							$ID = intval(trim($IDs[$x]));
 316							if($ID>0) $IDss[] = $ID;
 317						}
 318						$this->sg->SetOption($k,$IDss);
 319					} else if($k == "sm_b_exclude_cats") {
 320						$exCats = array();
 321						if(isset($_POST["post_category"])) {
 322							foreach((array) $_POST["post_category"] AS $vv) if(!empty($vv) && is_numeric($vv)) $exCats[] = intval($vv);
 323						}
 324						$this->sg->SetOption($k,$exCats);
 325					} else {
 326						$this->sg->SetOption($k,(bool) $_POST[$k]);
 327
 328					}
 329				//Options of the category "Includes" are boolean
 330				} else if(substr($k,0,6)=="sm_in_") {
 331					if($k=='sm_in_tax') {
 332
 333						$enabledTaxonomies = array();
 334
 335						foreach(array_keys((array) $_POST[$k]) AS $taxName) {
 336							if(empty($taxName) || !taxonomy_exists($taxName)) continue;
 337
 338							$enabledTaxonomies[] = $taxName;
 339						}
 340
 341						$this->sg->SetOption($k,$enabledTaxonomies);
 342
 343					} else if($k=='sm_in_customtypes') {
 344
 345						$enabledPostTypes = array();
 346
 347						foreach(array_keys((array) $_POST[$k]) AS $postTypeName) {
 348							if(empty($postTypeName) || !post_type_exists($postTypeName)) continue;
 349
 350							$enabledPostTypes[] = $postTypeName;
 351						}
 352
 353						$this->sg->SetOption($k, $enabledPostTypes);
 354
 355					} else $this->sg->SetOption($k,(bool) $_POST[$k]);
 356				//Options of the category "Change frequencies" are string
 357				} else if(substr($k,0,6)=="sm_cf_") {
 358					$this->sg->SetOption($k,(string) $_POST[$k]);
 359				//Options of the category "Priorities" are float
 360				} else if(substr($k,0,6)=="sm_pr_") {
 361					$this->sg->SetOption($k,(float) $_POST[$k]);
 362				}
 363			}
 364
 365			//Apply page changes from POST
 366			if(is_super_admin()) $this->sg->SetPages($this->HtmlApplyPages());
 367
 368			if($this->sg->SaveOptions()) $message.=__('Configuration updated', 'sitemap') . "<br />";
 369			else $message.=__('Error while saving options', 'sitemap') . "<br />";
 370
 371			if(is_super_admin()) {
 372				if($this->sg->SavePages()) $message.=__("Pages saved",'sitemap') . "<br />";
 373				else $message.=__('Error while saving pages', 'sitemap'). "<br />";
 374			}
 375
 376		} else if(!empty($_POST["sm_reset_config"])) { //Pressed Button: Reset Config
 377			check_admin_referer('sitemap');
 378			$this->sg->InitOptions();
 379			$this->sg->SaveOptions();
 380
 381			$message.=__('The default configuration was restored.','sitemap');
 382		} else if(!empty($_GET["sm_delete_old"])) { //Delete old sitemap files
 383			check_admin_referer('sitemap');
 384
 385			//Check again, just for the case that something went wrong before
 386			if(!current_user_can("administrator")) {
 387				echo '<p>Please log in as admin</p>';
 388				return;
 389			}
 390			if(!$this->sg->DeleteOldFiles()) {
 391				$message = __("The old files could NOT be deleted. Please use an FTP program and delete them by yourself.","sitemap");
 392			} else {
 393				$message = __("The old files were successfully deleted.","sitemap");
 394			}
 395		} else if(!empty($_GET["sm_ping_all"])) {
 396			check_admin_referer('sitemap');
 397
 398			//Check again, just for the case that something went wrong before
 399			if(!current_user_can("administrator")) {
 400				echo '<p>Please log in as admin</p>';
 401				return;
 402			}
 403
 404			echo <<<HTML
 405<html>
 406	<head>
 407		<style type="text/css">
 408		html {
 409			background: #f1f1f1;
 410		}
 411
 412		body {
 413			color: #444;
 414			font-family: "Open Sans", sans-serif;
 415			font-size: 13px;
 416			line-height: 1.4em;
 417			min-width: 600px;
 418		}
 419
 420		h2 {
 421			font-size: 23px;
 422			font-weight: 400;
 423			padding: 9px 10px 4px 0;
 424			line-height: 29px;
 425		}
 426		</style>
 427	</head>
 428	<body>
 429HTML;
 430			echo "<h2>" . __('Notify Search Engines about all sitemaps','sitemap') ."</h2>";
 431			echo "<p>" . __('The plugin is notifying the selected search engines about your main sitemap and all sub-sitemaps. This might take a minute or two.','sitemaps') . "</p>";
 432			flush();
 433			$results = $this->sg->SendPingAll();
 434
 435			echo "<ul>";
 436
 437			foreach($results AS $result) {
 438
 439				$sitemapUrl = $result["sitemap"];
 440				/** @var $status GoogleSitemapGeneratorStatus */
 441				$status = $result["status"];
 442
 443				echo "<li><a href=\"" . esc_url($sitemapUrl) . "\">" . $sitemapUrl . "</a><ul>";
 444				$services = $status->GetUsedPingServices();
 445				foreach($services AS $serviceId) {
 446					echo "<li>";
 447					echo $status->GetServiceName($serviceId) . ": " . ($status->GetPingResult($serviceId)==true?"OK":"ERROR");
 448					echo "</li>";
 449				}
 450				echo "</ul></li>";
 451			}
 452			echo "</ul>";
 453			echo "<p>" . __('All done!','sitemap') . "</p>";
 454			echo <<<HTML
 455
 456	</body>
 457HTML;
 458			exit;
 459		} else if(!empty($_GET["sm_ping_main"])) {
 460
 461			check_admin_referer('sitemap');
 462
 463			//Check again, just for the case that something went wrong before
 464			if(!current_user_can("administrator")) {
 465				echo '<p>Please log in as admin</p>';
 466				return;
 467			}
 468
 469			$this->sg->SendPing();
 470			$message = __("Ping was executed, please see below for the result.","sitemap");
 471		}
 472
 473		//Print out the message to the user, if any
 474		if($message!="") {
 475			?>
 476			<div class="updated"><p><strong><?php
 477			echo $message;
 478			?></strong></p></div><?php
 479		}
 480
 481
 482		if(!$snl) {
 483
 484			if(isset($_GET['sm_hidedonate'])) {
 485				$this->sg->SetOption('i_hide_donated',true);
 486				$this->sg->SaveOptions();
 487			}
 488			if(isset($_GET['sm_donated'])) {
 489				$this->sg->SetOption('i_donated',true);
 490				$this->sg->SaveOptions();
 491			}
 492			if(isset($_GET['sm_hide_note'])) {
 493				$this->sg->SetOption('i_hide_note',true);
 494				$this->sg->SaveOptions();
 495			}
 496			if(isset($_GET['sm_hide_survey'])) {
 497				$this->sg->SetOption('i_hide_survey',true);
 498				$this->sg->SaveOptions();
 499			}
 500			if(isset($_GET['sm_hidedonors'])) {
 501				$this->sg->SetOption('i_hide_donors',true);
 502				$this->sg->SaveOptions();
 503			}
 504			if(isset($_GET['sm_hide_works'])) {
 505				$this->sg->SetOption('i_hide_works',true);
 506				$this->sg->SaveOptions();
 507			}
 508			if(isset($_GET['sm_disable_supportfeed'])) {
 509				$this->sg->SetOption('i_supportfeed',$_GET["sm_disable_supportfeed"]=="true"?false:true);
 510				$this->sg->SaveOptions();
 511			}
 512
 513
 514			if(isset($_GET['sm_donated']) || ($this->sg->GetOption('i_donated')===true && $this->sg->GetOption('i_hide_donated')!==true)) {
 515				?>
 516				<!--
 517				<div class="updated">
 518					<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>
 519				</div>
 520				-->
 521				<?php
 522			} 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))) {
 523				?>
 524				<!--
 525				<div class="updated">
 526					<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="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-donate-note">Donations</a> help me to continue support and development of this <i>free</i> software! <a href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-donate-note">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>
 527					<div style="clear:right;"></div>
 528				</div>
 529				-->
 530				<?php
 531			} 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))) {
 532				?>
 533				<div class="updated">
 534					<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="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-works-note">rate it</a> and <a href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-works-note">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>
 535					<div style="clear:right;"></div>
 536				</div>
 537				<?php
 538			}
 539
 540			if ($this->sg->ShowSurvey())
 541				$this->sg->HtmlSurvey();
 542		}
 543
 544		?>
 545
 546		<style type="text/css">
 547
 548		li.sm_hint {
 549			color:green;
 550		}
 551
 552		li.sm_optimize {
 553			color:orange;
 554		}
 555
 556		li.sm_error {
 557			color:red;
 558		}
 559
 560		input.sm_warning:hover {
 561			background: #ce0000;
 562			color: #fff;
 563		}
 564
 565		a.sm_button {
 566			padding:4px;
 567			display:block;
 568			padding-left:25px;
 569			background-repeat:no-repeat;
 570			background-position:5px 50%;
 571			text-decoration:none;
 572			border:none;
 573		}
 574
 575		a.sm_button:hover {
 576			border-bottom-width:1px;
 577		}
 578
 579		a.sm_donatePayPal {
 580			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-paypal.gif);
 581		}
 582
 583		a.sm_donateAmazon {
 584			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-amazon.gif);
 585		}
 586
 587		a.sm_pluginHome {
 588			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-arne.gif);
 589		}
 590
 591		a.sm_pluginHelp {
 592			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-help.png);
 593		}
 594
 595		a.sm_pluginList {
 596			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-email.gif);
 597		}
 598
 599		a.sm_pluginSupport {
 600			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-wordpress.gif);
 601		}
 602
 603		a.sm_pluginBugs {
 604			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-trac.gif);
 605		}
 606
 607		a.sm_resGoogle {
 608			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-google.gif);
 609		}
 610
 611		a.sm_resYahoo {
 612			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-yahoo.gif);
 613		}
 614
 615		a.sm_resBing {
 616			background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-bing.gif);
 617		}
 618
 619		div.sm-update-nag p {
 620			margin:5px;
 621		}
 622
 623		.sm-padded .inside {
 624			margin: 12px !important;
 625		}
 626
 627		.sm-padded .inside ul {
 628			margin: 6px 0 12px 0;
 629		}
 630
 631		.sm-padded .inside input {
 632			padding: 1px;
 633			margin: 0;
 634		}
 635
 636		.hndle {
 637			cursor:auto!important;
 638			-webkit-user-select:auto!important;
 639			-moz-user-select:auto!important;
 640			-ms-user-select:auto!important;
 641			user-select:auto!important;
 642		}
 643
 644
 645		<?php if (version_compare($wp_version, "3.4", "<")): //Fix style for WP 3.4 (dirty way for now..) ?>
 646
 647		.inner-sidebar #side-sortables, .columns-2 .inner-sidebar #side-sortables {
 648			min-height: 300px;
 649			width: 280px;
 650			padding: 0;
 651		}
 652
 653		.has-right-sidebar .inner-sidebar {
 654			display: block;
 655		}
 656
 657		.inner-sidebar {
 658			float: right;
 659			clear: right;
 660			display: none;
 661			width: 281px;
 662			position: relative;
 663		}
 664
 665		.has-right-sidebar #post-body-content {
 666			margin-right: 300px;
 667		}
 668
 669		#post-body-content {
 670			width: auto !important;
 671			float: none !important;
 672		}
 673
 674		<?php endif; ?>
 675
 676
 677		</style>
 678
 679
 680		<div class="wrap" id="sm_div">
 681			<form method="post" action="<?php echo $this->sg->GetBackLink() ?>">
 682				<h2><?php _e('XML Sitemap Generator for WordPress', 'sitemap'); echo " " . $this->sg->GetVersion() ?> </h2>
 683				<?php
 684
 685				if(get_option('blog_public')!=1) {
 686					?><div class="error"><p><?php echo str_replace("%s","options-reading.php#blog_public",__('Your site is currently blocking search engines! Visit the <a href="%s">Reading Settings</a> to change this.','sitemap')); ?></p></div><?php
 687				}
 688
 689				?>
 690
 691					<?php if(!$snl): ?>
 692						<div id="poststuff" class="metabox-holder has-right-sidebar">
 693							<div class="inner-sidebar">
 694								<div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">
 695					<?php else: ?>
 696						<div id="poststuff" class="metabox-holder">
 697					<?php endif; ?>
 698
 699
 700					<?php if(!$snl): ?>
 701							<?php $this->HtmlPrintBoxHeader('sm_pnres',__('About this Plugin:','sitemap'),true); ?>
 702								<a class="sm_button sm_pluginHome"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-home"><?php _e('Plugin Homepage','sitemap'); ?></a>
 703								<a class="sm_button sm_pluginHome"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-feedback"><?php _e('Suggest a Feature','sitemap'); ?></a>
 704								<a class="sm_button sm_pluginHelp"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-help"><?php _e('Help / FAQ','sitemap'); ?></a>
 705								<a class="sm_button sm_pluginList"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-list"><?php _e('Notify List','sitemap'); ?></a>
 706								<a class="sm_button sm_pluginSupport" href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-support"><?php _e('Support Forum','sitemap'); ?></a>
 707								<a class="sm_button sm_pluginBugs"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-bugs"><?php _e('Report a Bug','sitemap'); ?></a>
 708
 709								<?php if(__('translator_name','sitemap')!='translator_name') {?><a class="sm_button sm_pluginSupport" href="<?php _e('translator_url','sitemap'); ?>"><?php _e('translator_name','sitemap'); ?></a><?php } ?>
 710							<?php $this->HtmlPrintBoxFooter(true); ?>
 711
 712							<?php $this->HtmlPrintBoxHeader('sm_smres',__('Sitemap Resources:','sitemap'),true); ?>
 713								<a class="sm_button sm_resGoogle"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-gwt"><?php _e('Webmaster Tools','sitemap'); ?></a>
 714								<a class="sm_button sm_resGoogle"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-gwb"><?php _e('Webmaster Blog','sitemap'); ?></a>
 715
 716								<a class="sm_button sm_resYahoo"     href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-ywb"><?php _e('Search Blog','sitemap'); ?></a>
 717
 718								<a class="sm_button sm_resBing"      href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-lwt"><?php _e('Webmaster Tools','sitemap'); ?></a>
 719								<a class="sm_button sm_resBing"      href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-lswcb"><?php _e('Webmaster Center Blog','sitemap'); ?></a>
 720								<br />
 721								<a class="sm_button sm_resGoogle"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-prot"><?php _e('Sitemaps Protocol','sitemap'); ?></a>
 722								<a class="sm_button sm_resGoogle"    href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-ofat"><?php _e('Official Sitemaps FAQ','sitemap'); ?></a>
 723								<a class="sm_button sm_pluginHome"   href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-afaq"><?php _e('My Sitemaps FAQ','sitemap'); ?></a>
 724							<?php $this->HtmlPrintBoxFooter(true); ?>
 725
 726
 727						</div>
 728					</div>
 729					<?php endif; ?>
 730
 731					<div class="has-sidebar sm-padded" >
 732
 733						<div id="post-body-content" class="<?php if(!$snl): ?>has-sidebar-content<?php endif; ?>">
 734
 735							<div class="meta-box-sortabless">
 736
 737
 738					<!-- Rebuild Area -->
 739					<?php
 740
 741						$status = GoogleSitemapGeneratorStatus::Load();
 742						$head = __('Search engines haven\'t been notified yet','sitemap');
 743						if($status != null && $status->GetStartTime() > 0) {
 744							$st=$status->GetStartTime() + (get_option( 'gmt_offset' ) * 3600);
 745
 746							$head=str_replace("%date%",date_i18n(get_option('date_format'),$st) . " " . date_i18n(get_option('time_format'),$st),__('Result of the last ping, started on %date%.','sitemap'));
 747						}
 748
 749						$this->HtmlPrintBoxHeader('sm_rebuild',$head); ?>
 750
 751
 752						<div style="border-left: 1px #DFDFDF solid; float:right; padding-left:15px; margin-left:10px; width:35%;">
 753							<strong><?php _e('Recent Support Topics / News','sitemap'); ?></strong>
 754							<?php
 755							if($this->sg->GetOption('i_supportfeed')) {
 756
 757								echo "<small><a href=\"" . wp_nonce_url($this->sg->GetBackLink() . "&sm_disable_supportfeed=true") . "\">" . __('Disable','sitemap') . "</a></small>";
 758
 759								$supportFeed = $this->sg->GetSupportFeed();
 760
 761								if (!is_wp_error($supportFeed) && $supportFeed) {
 762									$supportItems = $supportFeed->get_items(0, $supportFeed->get_item_quantity(3));
 763
 764									if(count($supportItems)>0) {
 765										echo "<ul>";
 766										foreach($supportItems AS $item) {
 767											$url = esc_url($item->get_permalink());
 768											$title = esc_html($item->get_title());
 769											echo "<li><a rel=\"external\" target=\"_blank\" href=\"{$url}\">{$title}</a></li>";
 770
 771										}
 772										echo "</ul>";
 773									}
 774								} else {
 775									echo "<ul><li>" . __('No support topics available or an error occurred while fetching them.','sitemap') . "</li></ul>";
 776								}
 777							} else {
 778								echo "<ul><li>" . __('Support Topics have been disabled. Enable them to see useful information regarding this plugin. No Ads or Spam!','sitemap') . " " . "<a href=\"" . wp_nonce_url($this->sg->GetBackLink() . "&sm_disable_supportfeed=false") . "\">" . __('Enable','sitemap') . "</a>". "</li></ul>";
 779							}
 780							?>
 781						</div>
 782
 783
 784						<div style="min-height:150px;">
 785							<ul>
 786								<?php
 787
 788								if($this->sg->OldFileExists()) {
 789									echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_delete_old=true",'sitemap'),__('There is still a sitemap.xml or sitemap.xml.gz file in your site directory. Please delete them as no static files are used anymore or <a href="%s">try to delete them automatically</a>.','sitemap')) . "</li>";
 790								}
 791
 792								echo "<li>" . str_replace("%s",$this->sg->getXmlUrl(),__('The URL to your sitemap index file is: <a href="%s">%s</a>.','sitemap')) . "</li>";
 793
 794								if($status == null) {
 795									echo "<li>" . __('Search engines haven\'t been notified yet. Write a post to let them know about your sitemap.','sitemap') . "</li>";
 796								}  else {
 797
 798									$services = $status->GetUsedPingServices();
 799
 800									foreach($services AS $service) {
 801										$name = $status->GetServiceName($service);
 802
 803										if($status->GetPingResult($service)) {
 804											echo "<li>" . sprintf(__("%s was <b>successfully notified</b> about changes.",'sitemap'),$name). "</li>";
 805											$dur = $status->GetPingDuration($service);
 806											if($dur > 4) {
 807												echo "<li class=\sm_optimize\">" . str_replace(array("%time%","%name%"),array($dur,$name),__("It took %time% seconds to notify %name%, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
 808											}
 809										} else {
 810											echo "<li class=\"sm_error\">" . str_replace(array("%s","%name%"),array(wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=" . $service . "&noheader=true",'sitemap'),$name),__('There was a problem while notifying %name%. <a href="%s" target="_blank">View result</a>','sitemap')) . "</li>";
 811										}
 812									}
 813								}
 814
 815								?>
 816								<?php if($this->sg->GetOption('b_ping') || $this->sg->GetOption('b_pingmsn')): ?>
 817									<li>
 818										Notify Search Engines about <a href="<?php echo wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_main=true",'sitemap'); ?>">your sitemap </a> or <a href="#" onclick="window.open('<?php echo wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_all=true&noheader=true",'sitemap'); ?>','','width=650, height=500, resizable=yes'); return false;">your main sitemap and all sub-sitemaps</a> now.
 819									</li>
 820								<?php endif; ?>
 821
 822								<?php if(is_super_admin()) 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 your sitemap you can use the <a href="%d">debug function</a> to get more information.','sitemap')) . "</li>"; ?>
 823							</ul>
 824							<ul>
 825								<li>
 826									<?php echo sprintf(__('If you like the plugin, please <a target="_blank" href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-works-note">rate it 5 stars</a>! :)','sitemap'),$this->sg->GetRedirectLink('sitemap-works-note'),$this->sg->GetRedirectLink('sitemap-paypal')); ?>
 827								</li>
 828
 829							</ul>
 830						</div>
 831					<?php $this->HtmlPrintBoxFooter(); ?>
 832
 833					<?php if($this->sg->IsNginx() && $this->sg->IsUsingPermalinks()): ?>
 834						<?php $this->HtmlPrintBoxHeader('ngin_x',__('Webserver Configuration', 'sitemap')); ?>
 835						<?php _e('Since you are using Nginx as your web-server, please configure the following rewrite rules in case you get 404 Not Found errors for your sitemap:','sitemap'); ?>
 836						<p>
 837							<code style="display:block; overflow-x:auto; white-space: nowrap;">
 838								<?php
 839								$rules = GoogleSitemapGeneratorLoader::GetNginXRules();
 840								foreach($rules AS $rule) {
 841									echo $rule . "<br />";
 842								}
 843								?>
 844							</code>
 845						</p>
 846						<?php $this->HtmlPrintBoxFooter(); ?>
 847					<?php endif; ?>
 848
 849
 850					<!-- Basic Options -->
 851					<?php $this->HtmlPrintBoxHeader('sm_basic_options',__('Basic Options', 'sitemap')); ?>
 852
 853					<b><?php _e('Update notification:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-ping'); ?>"><?php _e('Learn more','sitemap'); ?></a>
 854					<ul>
 855						<li>
 856							<input type="checkbox" id="sm_b_ping" name="sm_b_ping" <?php echo ($this->sg->GetOption("b_ping")==true?"checked=\"checked\"":"") ?> />
 857							<label for="sm_b_ping"><?php _e('Notify Google about updates of your site', 'sitemap') ?></label><br />
 858							<small><?php echo str_replace("%s",$this->sg->GetRedirectLink('sitemap-gwt'),__('No registration required, but you can join the <a href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-gwt">Google Webmaster Tools</a> to check crawling statistics.','sitemap')); ?></small>
 859						</li>
 860						<li>
 861							<input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php echo ($this->sg->GetOption("b_pingmsn")==true?"checked=\"checked\"":"") ?> />
 862							<label for="sm_b_pingmsn"><?php _e('Notify Bing (formerly MSN Live Search) about updates of your site', 'sitemap') ?></label><br />
 863							<small><?php echo str_replace("%s",$this->sg->GetRedirectLink('sitemap-lwt'),__('No registration required, but you can join the <a href="https://8rkh4sskhh.execute-api.us-east-1.amazonaws.com/gsg/v1/sitemap-lwt">Bing Webmaster Tools</a> to check crawling statistics.','sitemap')); ?></small>
 864						</li>
 865						<li>
 866							<label for="sm_b_robots">
 867							<input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php echo ($this->sg->GetOption("b_robots")==true?"checked=\"checked\"":"") ?> />
 868							<?php _e("Add sitemap URL to the virtual robots.txt file.",'sitemap'); ?>
 869							</label>
 870
 871							<br />
 872							<small><?php _e('The virtual robots.txt generated by WordPress is used. A real robots.txt file must NOT exist in the site directory!','sitemap'); ?></small>
 873						</li>
 874					</ul>
 875					<?php if(is_super_admin()): ?>
 876						<b><?php _e('Advanced options:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-adv'); ?>"><?php _e('Learn more','sitemap'); ?></a>
 877						<ul>
 878							<li>
 879								<label for="sm_b_memory"><?php _e('Try to increase the memory limit to:', 'sitemap') ?> <input type="text" name="sm_b_memory" id="sm_b_memory" style="width:40px;" value="<?php echo esc_attr($this->sg->GetOption("b_memory")); ?>" /></label> (<?php echo htmlspecialchars(__('e.g. "4M", "16M"', 'sitemap')); ?>)
 880							</li>
 881							<li>
 882								<label for="sm_b_time"><?php _e('Try to increase the execution time limit to:', 'sitemap') ?> <input type="text" name="sm_b_time" id="sm_b_time" style="width:40px;" value="<?php echo esc_attr(($this->sg->GetOption("b_time")===-1?'':$this->sg->GetOption("b_time"))); ?>" /></label> (<?php echo htmlspecialchars(__('in seconds, e.g. "60" or "0" for unlimited', 'sitemap')) ?>)
 883							</li>
 884							<li>
 885								<label for="sm_b_autozip">
 886									<input type="checkbox" id="sm_b_autozip" name="sm_b_autozip" <?php echo ($this->sg->GetOption("b_autozip")==true?"checked=\"checked\"":"") ?> />
 887									<?php _e('Try to automatically compress the sitemap if the requesting client supports it.', 'sitemap') ?>
 888								</label><br />
 889								<small><?php _e('Disable this option if you get garbled content or encoding errors in your sitemap.','sitemap'); ?></small>
 890							</li>
 891							<li>
 892								<?php $useDefStyle = ($this->sg->GetDefaultStyle() && $this->sg->GetOption('b_style_default')===true); ?>
 893								<label for="sm_b_style"><?php _e('Include a XSLT stylesheet:', 'sitemap') ?> <input <?php echo ($useDefStyle?'disabled="disabled" ':'') ?> type="text" name="sm_b_style" id="sm_b_style"  value="<?php echo esc_attr($this->sg->GetOption("b_style")); ?>" /></label>
 894								(<?php _e('Full or relative URL to your .xsl file', 'sitemap') ?>) <?php if($this->sg->GetDefaultStyle()): ?><label for="sm_b_style_default"><input <?php echo ($useDefStyle?'checked="checked" ':'') ?> type="checkbox" id="sm_b_style_default" name="sm_b_style_default" onclick="document.getElementById('sm_b_style').disabled = this.checked;" /> <?php _e('Use default', 'sitemap') ?></label> <?php endif; ?>
 895							</li>
 896							<li>
 897								<label for="sm_b_baseurl"><?php _e('Override the base URL of the sitemap:', 'sitemap') ?> <input type="text" name="sm_b_baseurl" id="sm_b_baseurl"  value="<?php echo esc_attr($this->sg->GetOption("b_baseurl")); ?>" /></label><br />
 898								<small><?php _e('Use this if your site is in a sub-directory, but you want the sitemap be located in the root. Requires .htaccess modification.','sitemap'); ?> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-adv-baseurl'); ?>"><?php _e('Learn more','sitemap'); ?></a></small>
 899							</li>
 900							<li>
 901								<label for="sm_b_html">
 902									<input type="checkbox" id="sm_b_html" name="sm_b_html" <?php if(!$this->sg->IsXslEnabled()) echo 'disabled="disabled"'; ?>  <?php echo ($this->sg->GetOption("b_html")==true && $this->sg->IsXslEnabled()?"checked=\"checked\"":"") ?> />
 903									<?php _e('Include sitemap in HTML format', 'sitemap') ?>  <?php if(!$this->sg->IsXslEnabled()) _e('(The required PHP XSL Module is not installed)', 'sitemap') ?>
 904								</label>
 905							</li>
 906							<li>
 907								<label for="sm_b_stats">
 908									<input type="checkbox" id="sm_b_stats" name="sm_b_stats" <?php echo ($this->sg->GetOption("b_stats")==true?"checked=\"checked\"":"") ?> />
 909									<?php _e('Allow anonymous statistics (no personal information)', 'sitemap') ?>
 910								</label> <label><a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-adv-stats'); ?>"><?php _e('Learn more','sitemap'); ?></a></label>
 911							</li>
 912						</ul>
 913					<?php endif; ?>
 914
 915					<?php $this->HtmlPrintBoxFooter(); ?>
 916
 917					<?php if(is_super_admin()): ?>
 918						<?php $this->HtmlPrintBoxHeader('sm_pages',__('Additional Pages', 'sitemap')); ?>
 919
 920						<?php
 921							_e('Here you can specify files or URLs which should be included in the sitemap, but do not belong to your Site/WordPress.<br />For example, if your domain is www.foo.com and your site is located on www.foo.com/site you might want to include your homepage at www.foo.com','sitemap');
 922							echo "<ul><li>";
 923							echo "<strong>" . __('Note','sitemap'). "</strong>: ";
 924							_e("If your site is in a subdirectory and you want to add pages which are NOT in the site directory or beneath, you MUST place your sitemap file in the root directory (Look at the &quot;Location of your sitemap file&quot; section on this page)!",'sitemap');
 925							echo "</li><li>";
 926							echo "<strong>" . __('URL to the page','sitemap'). "</strong>: ";
 927							_e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ",'sitemap');
 928							echo "</li><li>";
 929							echo "<strong>" . __('Priority','sitemap') . "</strong>: ";
 930							_e("Choose the priority of the page relative to the other pages. For example, your homepage might have a higher priority than your imprint.",'sitemap');
 931							echo "</li><li>";
 932							echo "<strong>" . __('Last Changed','sitemap'). "</strong>: ";
 933							_e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).",'sitemap');
 934
 935							echo "</li></ul>";
 936						?>
 937						<script type="text/javascript">
 938							//<![CDATA[
 939								<?php
 940								$freqVals = "'" . implode("','",array_keys($this->sg->GetFreqNames())). "'";
 941								$freqNames = "'" . implode("','",array_values($this->sg->GetFreqNames())). "'";
 942								?>
 943
 944							var changeFreqVals = [<?php echo $freqVals; ?>];
 945							var changeFreqNames = [ <?php echo $freqNames; ?>];
 946							var priorities= [0<?php for($i=0.1; $i<1; $i+=0.1) { echo "," .  number_format($i,1,".",""); } ?>];
 947
 948							var pages = [ <?php
 949								$pages = $this->sg->GetPages();
 950								$fd = false;
 951								foreach($pages AS $page) {
 952									if($page instanceof GoogleSitemapGeneratorPage) {
 953										if($fd) echo ",";
 954										else $fd = true;
 955										echo '{url:"' . esc_js($page->getUrl()) . '", priority:' . esc_js(number_format($page->getPriority(),1,".","")) . ', changeFreq:"' . esc_js($page->getChangeFreq()) . '", lastChanged:"' . esc_js(($page->getLastMod()>0?date("Y-m-d",$page->getLastMod()):"")) . '"}';
 956									}
 957
 958								}
 959								?> ];
 960							//]]>
 961						</script>
 962						<script type="text/javascript" src="<?php echo $this->sg->GetPluginUrl(); ?>img/sitemap.js"></script>
 963						<table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
 964							<tr>
 965								<th scope="col"><?php _e('URL to the page','sitemap'); ?></th>
 966								<th scope="col"><?php _e('Priority','sitemap'); ?></th>
 967								<th scope="col"><?php _e('Change Frequency','sitemap'); ?></th>
 968								<th scope="col"><?php _e('Last Changed','sitemap'); ?></th>
 969								<th scope="col"><?php _e('#','sitemap'); ?></th>
 970							</tr>
 971							<?php
 972							if(count($pages)<=0) { ?>
 973								<tr>
 974									<td colspan="5" align="center"><?php _e('No pages defined.','sitemap') ?></td>
 975								</tr><?php
 976							}
 977							?>
 978						</table>
 979						<a href="javascript:void(0);" onclick="sm_addPage();"><?php _e("Add new page",'sitemap'); ?></a>
 980						<?php $this->HtmlPrintBoxFooter(); ?>
 981					<?php endif; ?>
 982
 983
 984					<!-- AutoPrio Options -->
 985					<?php $this->HtmlPrintBoxHeader('sm_postprio',__('Post Priority', 'sitemap')); ?>
 986
 987						<p><?php _e('Please select how the priority of each post should be calculated:', 'sitemap') ?></p>
 988						<ul>
 989							<li><p><input type="radio" name="sm_b_prio_provider" id="sm_b_prio_provider__0" value="" <?php echo $this->HtmlGetChecked($this->sg->GetOption("b_prio_provider"),"") ?> /> <label for="sm_b_prio_provider__0"><?php _e('Do not use automatic priority calculation', 'sitemap') ?></label><br /><?php _e('All posts will have the same priority which is defined in &quot;Priorities&quot;', 'sitemap') ?></p></li>
 990							<?php
 991							$provs = $this->sg->GetPrioProviders();
 992							for($i=0; $i<count($provs); $i++) {
 993								echo "<li><p><input type=\"radio\" id=\"sm_b_prio_provider_$i\" name=\"sm_b_prio_provider\" value=\"" . $provs[$i] . "\" " .  $this->HtmlGetChecked($this->sg->GetOption("b_prio_provider"),$provs[$i]) . " /> <label for=\"sm_b_prio_provider_$i\">" . call_user_func(array($provs[$i], 'getName'))  . "</label><br />" .  call_user_func(array($provs[$i], 'getDescription')) . "</p></li>";
 994							}
 995							?>
 996						</ul>
 997					<?php $this->HtmlPrintBoxFooter(); ?>
 998
 999					<!-- Includes -->
1000					<?php $this->HtmlPrintBoxHeader('sm_includes',__('Sitemap Content', 'sitemap')); ?>
1001						<b><?php _e('WordPress standard content', 'sitemap') ?>:</b>
1002						<ul>
1003							<li>
1004								<label for="sm_in_home">
1005									<input type="checkbox" id="sm_in_home" name="sm_in_home"  <?php echo ($this->sg->GetOption("in_home")==true?"checked=\"checked\"":"") ?> />
1006									<?php _e('Include homepage', 'sitemap') ?>
1007								</label>
1008							</li>
1009							<li>
1010								<label for="sm_in_posts">
1011									<input type="checkbox" id="sm_in_posts" name="sm_in_posts"  <?php echo ($this->sg->GetOption("in_posts")==true?"checked=\"checked\"":"") ?> />
1012									<?php _e('Include posts', 'sitemap') ?>
1013								</label>
1014							</li>
1015							<li>
1016								<label for="sm_in_pages">
1017									<input type="checkbox" id="sm_in_pages" name="sm_in_pages"  <?php echo ($this->sg->GetOption("in_pages")==true?"checked=\"checked\"":"") ?> />
1018									<?php _e('Include static pages', 'sitemap') ?>
1019								</label>
1020							</li>
1021							<li>
1022								<label for="sm_in_cats">
1023									<input type="checkbox" id="sm_in_cats" name="sm_in_cats"  <?php echo ($this->sg->GetOption("in_cats")==true?"checked=\"checked\"":"") ?> />
1024									<?php _e('Include categories', 'sitemap') ?>
1025								</label>
1026							</li>
1027							<li>
1028								<label for="sm_in_arch">
1029									<input type="checkbox" id="sm_in_arch" name="sm_in_arch"  <?php echo ($this->sg->GetOption("in_arch")==true?"checked=\"checked\"":"") ?> />
1030									<?php _e('Include archives', 'sitemap') ?>
1031								</label>
1032							</li>
1033							<li>
1034								<label for="sm_in_auth">
1035									<input type="checkbox" id="sm_in_auth" name="sm_in_auth"  <?php echo ($this->sg->GetOption("in_auth")==true?"checked=\"checked\"":"") ?> />
1036									<?php _e('Include author pages', 'sitemap') ?>
1037								</label>
1038							</li>
1039							<?php if($this->sg->IsTaxonomySupported()): ?>
1040							<li>
1041								<label for="sm_in_tags">
1042									<input type="checkbox" id="sm_in_tags" name="sm_in_tags"  <?php echo ($this->sg->GetOption("in_tags")==true?"checked=\"checked\"":"") ?> />
1043									<?php _e('Include tag pages', 'sitemap') ?>
1044								</label>
1045							</li>
1046							<?php endif; ?>
1047						</ul>
1048
1049						<?php
1050
1051						if($this->sg->IsTaxonomySupported()) {
1052							$taxonomies = $this->sg->GetCustomTaxonomies();
1053
1054							$enabledTaxonomies = $this->sg->GetOption('in_tax');
1055
1056							if(count($taxonomies)>0) {
1057								?><b><?php _e('Custom taxonomies', 'sitemap') ?>:</b><ul><?php
1058
1059
1060								foreach ($taxonomies as $taxName) {
1061
1062									$taxonomy = get_taxonomy($taxName);
1063									$selected = in_array($taxonomy->name, $enabledTaxonomies);
1064									?>
1065									<li>
1066										<label for="sm_in_tax[<?php echo $taxonomy->name; ?>]">
1067											<input type="checkbox" id="sm_in_tax[<?php echo $taxonomy->name; ?>]" name="sm_in_tax[<?php echo $taxonomy->name; ?>]" <?php echo $selected?"checked=\"checked\"":""; ?> />
1068											<?php echo str_replace('%s',$taxonomy->label,__('Include taxonomy pages for %s', 'sitemap')); ?>
1069										</label>
1070									</li>
1071									<?php
1072								}
1073
1074								?></ul><?php
1075
1076							}
1077						}
1078
1079
1080						if($this->sg->IsCustomPostTypesSupported()) {
1081							$custom_post_types = $this->sg->GetCustomPostTypes();
1082
1083							$enabledPostTypes = $this->sg->GetOption('in_customtypes');
1084
1085							if(count($custom_post_types)>0) {
1086								?><b><?php _e('Custom post types', 'sitemap') ?>:</b><ul><?php
1087
1088								foreach ($custom_post_types as $post_type) {
1089									$post_type_object = get_post_type_object($post_type);
1090
1091									if (is_array($enabledPostTypes)) $selected = in_array($post_type_object->name, $enabledPostTypes);
1092
1093									?>
1094									<li>
1095										<label for="sm_in_customtypes[<?php echo $post_type_object->name; ?>]">
1096											<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\"":""; ?> />
1097											<?php echo str_replace('%s',$post_type_object->label,__('Include custom post type %s', 'sitemap')); ?>
1098										</label>
1099									</li>
1100									<?php
1101								}
1102
1103								?></ul><?php
1104							}
1105						}
1106
1107						?>
1108
1109						<b><?php _e('Further options', 'sitemap') ?>:</b>
1110						<ul>
1111							<li>
1112								<label for="sm_in_lastmod">
1113									<input type="checkbox" id="sm_in_lastmod" name="sm_in_lastmod"  <?php echo ($this->sg->GetOption("in_lastmod")==true?"checked=\"checked\"":"") ?> />
1114									<?php _e('Include the last modification time.', 'sitemap') ?>
1115								</label><br />
1116								<small><?php _e('This is highly recommended and helps the search engines to know when your content has changed. This option affects <i>all</i> sitemap entries.', 'sitemap') ?></small>
1117							</li>
1118						</ul>
1119
1120					<?php $this->HtmlPrintBoxFooter(); ?>
1121
1122					<!-- Excluded Items -->
1123					<?php $this->HtmlPrintBoxHeader('sm_excludes',__('Excluded Items', 'sitemap')); ?>
1124
1125						<b><?php _e('Excluded categories', 'sitemap') ?>:</b>
1126
1127						<div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; margin:5px 0px 5px 40px; overflow:auto; padding:0.5em 0.5em;">
1128							<ul>
1129								<?php wp_category_checklist(0,0,$this->sg->GetOption("b_exclude_cats"),false); ?>
1130							</ul>
1131						</div>
1132
1133						<b><?php _e("Exclude posts","sitemap"); ?>:</b>
1134						<div style="margin:5px 0 13px 40px;">
1135							<label for="sm_b_exclude"><?php _e('Exclude the following posts or pages:', 'sitemap') ?> <small><?php _e('List of IDs, separated by comma', 'sitemap') ?></small><br />
1136							<input name="sm_b_exclude" id="sm_b_exclude" type="text" style="width:400px;" value="<?php echo esc_attr(implode(",",$this->sg->GetOption("b_exclude"))); ?>" /></label><br />
1137							<cite><?php _e("Note","sitemap") ?>: <?php _e("Child posts won't be excluded automatically!","sitemap"); ?></cite>
1138						</div>
1139
1140					<?php $this->HtmlPrintBoxFooter(); ?>
1141
1142					<!-- Change frequencies -->
1143					<?php $this->HtmlPrintBoxHeader('sm_change_frequencies',__('Change Frequencies', 'sitemap')); ?>
1144
1145						<p>
1146

Large files files are truncated, but you can click here to view the full file