PageRenderTime 31ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 1ms

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

https://github.com/sharpmachine/wakeupmedia.com
PHP | 986 lines | 808 code | 141 blank | 37 comment | 175 complexity | cc81f65ec2ca560ab3ef0e49c5d0a89c MD5 | raw file
  1. <?php
  2. /*
  3. $Id: sitemap-ui.php 583237 2012-08-08 21:06:12Z arnee $
  4. */
  5. class GoogleSitemapGeneratorUI {
  6. /**
  7. * The Sitemap Generator Object
  8. *
  9. * @var GoogleSitemapGenerator
  10. */
  11. var $sg = null;
  12. var $mode = 21;
  13. function GoogleSitemapGeneratorUI(&$sitemapBuilder) {
  14. global $wp_version;
  15. $this->sg = &$sitemapBuilder;
  16. if(floatval($wp_version) >= 2.7) {
  17. $this->mode = 27;
  18. }
  19. }
  20. function HtmlPrintBoxHeader($id, $title, $right = false) {
  21. if($this->mode == 27) {
  22. ?>
  23. <div id="<?php echo $id; ?>" class="postbox">
  24. <h3 class="hndle"><span><?php echo $title ?></span></h3>
  25. <div class="inside">
  26. <?php
  27. } else {
  28. ?>
  29. <fieldset id="<?php echo $id; ?>" class="dbx-box">
  30. <?php if(!$right): ?><div class="dbx-h-andle-wrapper"><?php endif; ?>
  31. <h3 class="dbx-handle"><?php echo $title ?></h3>
  32. <?php if(!$right): ?></div><?php endif; ?>
  33. <?php if(!$right): ?><div class="dbx-c-ontent-wrapper"><?php endif; ?>
  34. <div class="dbx-content">
  35. <?php
  36. }
  37. }
  38. function HtmlPrintBoxFooter( $right = false) {
  39. if($this->mode == 27) {
  40. ?>
  41. </div>
  42. </div>
  43. <?php
  44. } else {
  45. ?>
  46. <?php if(!$right): ?></div><?php endif; ?>
  47. </div>
  48. </fieldset>
  49. <?php
  50. }
  51. }
  52. /**
  53. * Displays the option page
  54. *
  55. * @since 3.0
  56. * @access public
  57. * @author Arne Brachhold
  58. */
  59. function HtmlShowOptionsPage() {
  60. global $wp_version;
  61. $snl = false; //SNL
  62. $this->sg->Initate();
  63. $message="";
  64. if(!empty($_REQUEST["sm_rebuild"])) { //Pressed Button: Rebuild Sitemap
  65. check_admin_referer('sitemap');
  66. //Clear any outstanding build cron jobs
  67. if(function_exists('wp_clear_scheduled_hook')) wp_clear_scheduled_hook('sm_build_cron');
  68. if(isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"]=="true") {
  69. //Check again, just for the case that something went wrong before
  70. if(!current_user_can("administrator")) {
  71. echo '<p>Please log in as admin</p>';
  72. return;
  73. }
  74. $oldErr = error_reporting(E_ALL);
  75. $oldIni = ini_set("display_errors",1);
  76. echo '<div class="wrap">';
  77. echo '<h2>' . __('XML Sitemap Generator for WordPress', 'sitemap') . " " . $this->sg->GetVersion(). '</h2>';
  78. 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>';
  79. 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>';
  80. echo "<h3>WordPress and PHP Information</h3>";
  81. echo '<p>WordPress ' . $GLOBALS['wp_version'] . ' with ' . ' DB ' . $GLOBALS['wp_db_version'] . ' on PHP ' . phpversion() . '</p>';
  82. echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->_svnVersion . ')';
  83. echo '<h4>Environment</h4>';
  84. echo "<pre>";
  85. $sc = $_SERVER;
  86. unset($sc["HTTP_COOKIE"]);
  87. print_r($sc);
  88. echo "</pre>";
  89. echo "<h4>WordPress Config</h4>";
  90. echo "<pre>";
  91. $opts = array();
  92. if(function_exists('wp_load_alloptions')) {
  93. $opts = wp_load_alloptions();
  94. } else {
  95. global $wpdb;
  96. $os = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options");
  97. foreach ( (array) $os as $o ) $opts[$o->option_name] = $o->option_value;
  98. }
  99. $popts = array();
  100. foreach($opts as $k=>$v) {
  101. //Try to filter out passwords etc...
  102. if(preg_match("/pass|login|pw|secret|user|usr|key|auth|token/si",$k)) continue;
  103. $popts[$k] = htmlspecialchars($v);
  104. }
  105. print_r($popts);
  106. echo "</pre>";
  107. echo '<h4>Sitemap Config</h4>';
  108. echo "<pre>";
  109. print_r($this->sg->_options);
  110. echo "</pre>";
  111. echo '<h3>Errors, Warnings, Notices</h3>';
  112. echo '<div>';
  113. $status = $this->sg->BuildSitemap();
  114. echo '</div>';
  115. echo '<h3>MySQL Queries</h3>';
  116. if(defined('SAVEQUERIES') && SAVEQUERIES) {
  117. echo '<pre>';
  118. var_dump($GLOBALS['wpdb']->queries);
  119. echo '</pre>';
  120. $total = 0;
  121. foreach($GLOBALS['wpdb']->queries as $q) {
  122. $total+=$q[1];
  123. }
  124. echo '<h4>Total Query Time</h4>';
  125. echo '<pre>' . count($GLOBALS['wpdb']->queries) . ' queries in ' . round($total,2) . ' seconds.</pre>';
  126. } else {
  127. echo '<p>Please edit wp-db.inc.php in wp-includes and set SAVEQUERIES to true if you want to see the queries.</p>';
  128. }
  129. echo "<h3>Build Process Results</h3>";
  130. echo "<pre>";
  131. print_r($status);
  132. echo "</pre>";
  133. 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>';
  134. 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>';
  135. echo '</div>';
  136. @error_reporting($oldErr);
  137. @ini_set("display_errors",$oldIni);
  138. return;
  139. } else {
  140. $this->sg->BuildSitemap();
  141. $redirURL = $this->sg->GetBackLink() . '&sm_fromrb=true';
  142. //Redirect so the sm_rebuild GET parameter no longer exists.
  143. @header("location: " . $redirURL);
  144. //If there was already any other output, the header redirect will fail
  145. echo '<script type="text/javascript">location.replace("' . $redirURL . '");</script>';
  146. echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
  147. exit;
  148. }
  149. } else if (!empty($_POST['sm_update'])) { //Pressed Button: Update Config
  150. check_admin_referer('sitemap');
  151. if(isset($_POST['sm_b_style']) && $_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
  152. $_POST['sm_b_style_default'] = true;
  153. $_POST['sm_b_style'] = '';
  154. }
  155. foreach($this->sg->_options as $k=>$v) {
  156. //Check vor values and convert them into their types, based on the category they are in
  157. if(!isset($_POST[$k])) $_POST[$k]=""; // Empty string will get false on 2bool and 0 on 2float
  158. //Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
  159. if(substr($k,0,5)=="sm_b_") {
  160. 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") {
  161. if($k=="sm_b_filename_manual" && strpos($_POST[$k],"\\")!==false){
  162. $_POST[$k]=stripslashes($_POST[$k]);
  163. }
  164. $this->sg->_options[$k]=(string) $_POST[$k];
  165. } else if($k=="sm_b_location_mode") {
  166. $tmp=(string) $_POST[$k];
  167. $tmp=strtolower($tmp);
  168. if($tmp=="auto" || $tmp="manual") $this->sg->_options[$k]=$tmp;
  169. else $this->sg->_options[$k]="auto";
  170. } else if($k == "sm_b_time" || $k=="sm_b_max_posts") {
  171. if($_POST[$k]=='') $_POST[$k] = -1;
  172. $this->sg->_options[$k] = intval($_POST[$k]);
  173. } else if($k== "sm_i_install_date") {
  174. if($this->sg->GetOption('i_install_date')<=0) $this->sg->_options[$k] = time();
  175. } else if($k=="sm_b_exclude") {
  176. $IDss = array();
  177. $IDs = explode(",",$_POST[$k]);
  178. for($x = 0; $x<count($IDs); $x++) {
  179. $ID = intval(trim($IDs[$x]));
  180. if($ID>0) $IDss[] = $ID;
  181. }
  182. $this->sg->_options[$k] = $IDss;
  183. } else if($k == "sm_b_exclude_cats") {
  184. $exCats = array();
  185. if(isset($_POST["post_category"])) {
  186. foreach((array) $_POST["post_category"] AS $vv) if(!empty($vv) && is_numeric($vv)) $exCats[] = intval($vv);
  187. }
  188. $this->sg->_options[$k] = $exCats;
  189. } else {
  190. $this->sg->_options[$k]=(bool) $_POST[$k];
  191. }
  192. //Options of the category "Includes" are boolean
  193. } else if(substr($k,0,6)=="sm_in_") {
  194. if($k=='sm_in_tax') {
  195. $enabledTaxonomies = array();
  196. foreach(array_keys((array) $_POST[$k]) AS $taxName) {
  197. if(empty($taxName) || !is_taxonomy($taxName)) continue;
  198. $enabledTaxonomies[] = $taxName;
  199. }
  200. $this->sg->_options[$k] = $enabledTaxonomies;
  201. } else if($k=='sm_in_customtypes') {
  202. $enabledPostTypes = array();
  203. foreach(array_keys((array) $_POST[$k]) AS $postTypeName) {
  204. if(empty($postTypeName) || !post_type_exists($postTypeName)) continue;
  205. $enabledPostTypes[] = $postTypeName;
  206. }
  207. $this->sg->_options[$k] = $enabledPostTypes;
  208. } else $this->sg->_options[$k]=(bool) $_POST[$k];
  209. //Options of the category "Change frequencies" are string
  210. } else if(substr($k,0,6)=="sm_cf_") {
  211. $this->sg->_options[$k]=(string) $_POST[$k];
  212. //Options of the category "Priorities" are float
  213. } else if(substr($k,0,6)=="sm_pr_") {
  214. $this->sg->_options[$k]=(float) $_POST[$k];
  215. }
  216. }
  217. //No Mysql unbuffered query for WP < 2.2
  218. if(floatval($wp_version) < 2.2) {
  219. $this->sg->SetOption('b_safemode',true);
  220. }
  221. //No Wp-Cron for WP < 2.1
  222. if(floatval($wp_version) < 2.1) {
  223. $this->sg->SetOption('b_auto_delay',false);
  224. }
  225. //Apply page changes from POST
  226. $this->sg->_pages=$this->sg->HtmlApplyPages();
  227. if($this->sg->SaveOptions()) $message.=__('Configuration updated', 'sitemap') . "<br />";
  228. else $message.=__('Error while saving options', 'sitemap') . "<br />";
  229. if($this->sg->SavePages()) $message.=__("Pages saved",'sitemap') . "<br />";
  230. else $message.=__('Error while saving pages', 'sitemap'). "<br />";
  231. } else if(!empty($_POST["sm_reset_config"])) { //Pressed Button: Reset Config
  232. check_admin_referer('sitemap');
  233. $this->sg->InitOptions();
  234. $this->sg->SaveOptions();
  235. $message.=__('The default configuration was restored.','sitemap');
  236. }
  237. //Print out the message to the user, if any
  238. if($message!="") {
  239. ?>
  240. <div class="updated"><strong><p><?php
  241. echo $message;
  242. ?></p></strong></div><?php
  243. }
  244. if(!$snl) {
  245. if(isset($_GET['sm_hidedonate'])) {
  246. $this->sg->SetOption('i_hide_donated',true);
  247. $this->sg->SaveOptions();
  248. }
  249. if(isset($_GET['sm_donated'])) {
  250. $this->sg->SetOption('i_donated',true);
  251. $this->sg->SaveOptions();
  252. }
  253. if(isset($_GET['sm_hide_note'])) {
  254. $this->sg->SetOption('i_hide_note',true);
  255. $this->sg->SaveOptions();
  256. }
  257. if(isset($_GET['sm_hidedonors'])) {
  258. $this->sg->SetOption('i_hide_donors',true);
  259. $this->sg->SaveOptions();
  260. }
  261. if(isset($_GET['sm_hide_works'])) {
  262. $this->sg->SetOption('i_hide_works',true);
  263. $this->sg->SaveOptions();
  264. }
  265. if(isset($_GET['sm_donated']) || ($this->sg->GetOption('i_donated')===true && $this->sg->GetOption('i_hide_donated')!==true)) {
  266. ?>
  267. <div class="updated">
  268. <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>
  269. </div>
  270. <?php
  271. } 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))) {
  272. ?>
  273. <div class="updated">
  274. <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>
  275. <div style="clear:right;"></div>
  276. </div>
  277. <?php
  278. } 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))) {
  279. ?>
  280. <div class="updated">
  281. <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>
  282. <div style="clear:right;"></div>
  283. </div>
  284. <?php
  285. }
  286. }
  287. if(function_exists("wp_next_scheduled")) {
  288. $next = wp_next_scheduled('sm_build_cron');
  289. if($next) {
  290. $diff = (time()-$next)*-1;
  291. if($diff <= 0) {
  292. $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');
  293. } else {
  294. $diffMsg = str_replace("%s",$diff,__('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!','sitemap'));
  295. }
  296. ?>
  297. <div class="updated">
  298. <strong><p><?php echo $diffMsg ?></p></strong>
  299. <div style="clear:right;"></div>
  300. </div>
  301. <?php
  302. }
  303. }
  304. ?>
  305. <style type="text/css">
  306. li.sm_hint {
  307. color:green;
  308. }
  309. li.sm_optimize {
  310. color:orange;
  311. }
  312. li.sm_error {
  313. color:red;
  314. }
  315. input.sm_warning:hover {
  316. background: #ce0000;
  317. color: #fff;
  318. }
  319. a.sm_button {
  320. padding:4px;
  321. display:block;
  322. padding-left:25px;
  323. background-repeat:no-repeat;
  324. background-position:5px 50%;
  325. text-decoration:none;
  326. border:none;
  327. }
  328. a.sm_button:hover {
  329. border-bottom-width:1px;
  330. }
  331. a.sm_donatePayPal {
  332. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-paypal.gif);
  333. }
  334. a.sm_donateAmazon {
  335. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-amazon.gif);
  336. }
  337. a.sm_pluginHome {
  338. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-arne.gif);
  339. }
  340. a.sm_pluginList {
  341. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-email.gif);
  342. }
  343. a.sm_pluginSupport {
  344. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-wordpress.gif);
  345. }
  346. a.sm_pluginBugs {
  347. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-trac.gif);
  348. }
  349. a.sm_resGoogle {
  350. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-google.gif);
  351. }
  352. a.sm_resBing {
  353. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-bing.gif);
  354. }
  355. div.sm-update-nag p {
  356. margin:5px;
  357. }
  358. </style>
  359. <?php
  360. if($this->mode == 27): ?>
  361. <style type="text/css">
  362. .sm-padded .inside {
  363. margin:12px!important;
  364. }
  365. .sm-padded .inside ul {
  366. margin:6px 0 12px 0;
  367. }
  368. .sm-padded .inside input {
  369. padding:1px;
  370. margin:0;
  371. }
  372. <?php if (version_compare($wp_version, "3.4", "<")): //Fix style for WP 3.4 (dirty way for now..) ?>
  373. .inner-sidebar #side-sortables, .columns-2 .inner-sidebar #side-sortables {
  374. min-height: 300px;
  375. width: 280px;
  376. padding: 0;
  377. }
  378. .has-right-sidebar .inner-sidebar {
  379. display: block;
  380. }
  381. .inner-sidebar {
  382. float: right;
  383. clear: right;
  384. display: none;
  385. width: 281px;
  386. position: relative;
  387. }
  388. .has-right-sidebar #post-body-content {
  389. margin-right: 300px;
  390. }
  391. #post-body-content {
  392. width: auto !important;
  393. float: none !important;
  394. }
  395. <?php endif; ?>
  396. </style>
  397. <?php elseif(version_compare($wp_version,"2.5",">=")): ?>
  398. <style type="text/css">
  399. div#moremeta {
  400. float:right;
  401. width:200px;
  402. margin-left:10px;
  403. }
  404. <?php if(!$snl): ?>
  405. div#advancedstuff {
  406. width:770px;
  407. }
  408. <?php endif;?>
  409. div#poststuff {
  410. margin-top:10px;
  411. }
  412. fieldset.dbx-box {
  413. margin-bottom:5px;
  414. }
  415. div.sm-update-nag {
  416. margin-top:10px!important;
  417. }
  418. </style>
  419. <!--[if lt IE 7]>
  420. <style type="text/css">
  421. div#advancedstuff {
  422. width:735px;
  423. }
  424. </style>
  425. <![endif]-->
  426. <?php else: ?>
  427. <style type="text/css">
  428. div.updated-message {
  429. margin-left:0; margin-right:0;
  430. }
  431. </style>
  432. <?php endif;
  433. ?>
  434. <div class="wrap" id="sm_div">
  435. <form method="post" action="<?php echo $this->sg->GetBackLink() ?>">
  436. <h2><?php _e('XML Sitemap Generator for WordPress', 'sitemap'); echo " " . $this->sg->GetVersion() ?> </h2>
  437. <?php
  438. if(function_exists("wp_update_plugins") && (!defined('SM_NO_UPDATE') || SM_NO_UPDATE == false)) {
  439. wp_update_plugins();
  440. $file = GoogleSitemapGeneratorLoader::GetBaseName();
  441. $plugin_data = get_plugin_data(GoogleSitemapGeneratorLoader::GetPluginFile());
  442. $current = function_exists('get_transient')?get_transient('update_plugins'):get_option('update_plugins');
  443. if(isset($current->response[$file])) {
  444. $r = $current->response[$file];
  445. ?><div id="update-nag" class="sm-update-nag"><?php
  446. if ( !current_user_can('edit_plugins') || version_compare($wp_version,"2.5","<") )
  447. printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.','default'), $plugin_data['Name'], $r->url, $r->new_version);
  448. else if ( empty($r->package) )
  449. printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.','default'), $plugin_data['Name'], $r->url, $r->new_version);
  450. else
  451. printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.','default'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin=$file", 'upgrade-plugin_' . $file) );
  452. ?></div><?php
  453. }
  454. }
  455. if(get_option('blog_public')!=1) {
  456. ?><div class="error"><p><?php echo str_replace("%s","options-privacy.php",__('Your blog is currently blocking search engines! Visit the <a href="%s">privacy settings</a> to change this.','sitemap')); ?></p></div><?php
  457. }
  458. ?>
  459. <?php if(version_compare($wp_version,"2.5","<")): ?>
  460. <script type="text/javascript" src="../wp-includes/js/dbx.js"></script>
  461. <script type="text/javascript">
  462. //<![CDATA[
  463. addLoadEvent( function() {
  464. var manager = new dbxManager('sm_sitemap_meta_33');
  465. //create new docking boxes group
  466. var meta = new dbxGroup(
  467. 'grabit', // container ID [/-_a-zA-Z0-9/]
  468. 'vertical', // orientation ['vertical'|'horizontal']
  469. '10', // drag threshold ['n' pixels]
  470. 'no', // restrict drag movement to container axis ['yes'|'no']
  471. '10', // animate re-ordering [frames per transition, or '0' for no effect]
  472. 'yes', // include open/close toggle buttons ['yes'|'no']
  473. 'open', // default state ['open'|'closed']
  474. <?php echo "'" . js_escape(__('open')); ?>', // word for "open", as in "open this box"
  475. <?php echo "'" . js_escape(__('close')); ?>', // word for "close", as in "close this box"
  476. <?php echo "'" . js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
  477. <?php echo "'" . js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
  478. <?php echo "'" . js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
  479. <?php echo "'" . js_escape(__(', or press the enter key to %toggle% it')); ?>', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
  480. '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
  481. );
  482. var advanced = new dbxGroup(
  483. 'advancedstuff', // container ID [/-_a-zA-Z0-9/]
  484. 'vertical', // orientation ['vertical'|'horizontal']
  485. '10', // drag threshold ['n' pixels]
  486. 'yes', // restrict drag movement to container axis ['yes'|'no']
  487. '10', // animate re-ordering [frames per transition, or '0' for no effect]
  488. 'yes', // include open/close toggle buttons ['yes'|'no']
  489. 'open', // default state ['open'|'closed']
  490. <?php echo "'" . js_escape(__('open')); ?>', // word for "open", as in "open this box"
  491. <?php echo "'" . js_escape(__('close')); ?>', // word for "close", as in "close this box"
  492. <?php echo "'" . js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
  493. <?php echo "'" . js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
  494. <?php echo "'" . js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
  495. <?php echo "'" . js_escape(__(', or press the enter key to %toggle% it')); ?>', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
  496. '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
  497. );
  498. });
  499. //]]>
  500. </script>
  501. <?php endif; ?>
  502. <?php if($this->mode == 27): ?>
  503. <?php if(!$snl): ?>
  504. <div id="poststuff" class="metabox-holder has-right-sidebar">
  505. <div class="inner-sidebar">
  506. <div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">
  507. <?php else: ?>
  508. <div id="poststuff" class="metabox-holder">
  509. <?php endif; ?>
  510. <?php else: ?>
  511. <?php if(!$snl): ?>
  512. <div id="poststuff">
  513. <div id="moremeta">
  514. <div id="grabit" class="dbx-group">
  515. <?php else: ?>
  516. <div>
  517. <?php endif; ?>
  518. <?php endif; ?>
  519. <?php if(!$snl): ?>
  520. <?php $this->HtmlPrintBoxHeader('sm_pnres',__('About this Plugin:','sitemap'),true); ?>
  521. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-home'); ?>"><?php _e('Plugin Homepage','sitemap'); ?></a>
  522. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-feedback'); ?>"><?php _e('Suggest a Feature','sitemap'); ?></a>
  523. <a class="sm_button sm_pluginList" href="<?php echo $this->sg->GetRedirectLink('sitemap-list'); ?>"><?php _e('Notify List','sitemap'); ?></a>
  524. <a class="sm_button sm_pluginSupport" href="<?php echo $this->sg->GetRedirectLink('sitemap-support'); ?>"><?php _e('Support Forum','sitemap'); ?></a>
  525. <a class="sm_button sm_pluginBugs" href="<?php echo $this->sg->GetRedirectLink('sitemap-bugs'); ?>"><?php _e('Report a Bug','sitemap'); ?></a>
  526. <a class="sm_button sm_donatePayPal" href="<?php echo $this->sg->GetRedirectLink('sitemap-paypal'); ?>"><?php _e('Donate with PayPal','sitemap'); ?></a>
  527. <a class="sm_button sm_donateAmazon" href="<?php echo $this->sg->GetRedirectLink('sitemap-amazon'); ?>"><?php _e('My Amazon Wish List','sitemap'); ?></a>
  528. <?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 } ?>
  529. <?php $this->HtmlPrintBoxFooter(true); ?>
  530. <?php $this->HtmlPrintBoxHeader('sm_smres',__('Sitemap Resources:','sitemap'),true); ?>
  531. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-gwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
  532. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-gwb'); ?>"><?php _e('Webmaster Blog','sitemap'); ?></a>
  533. <a class="sm_button sm_resBing" href="<?php echo $this->sg->GetRedirectLink('sitemap-lwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
  534. <a class="sm_button sm_resBing" href="<?php echo $this->sg->GetRedirectLink('sitemap-lswcb'); ?>"><?php _e('Webmaster Center Blog','sitemap'); ?></a>
  535. <br />
  536. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-prot'); ?>"><?php _e('Sitemaps Protocol','sitemap'); ?></a>
  537. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-ofaq'); ?>"><?php _e('Official Sitemaps FAQ','sitemap'); ?></a>
  538. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-afaq'); ?>"><?php _e('My Sitemaps FAQ','sitemap'); ?></a>
  539. <?php $this->HtmlPrintBoxFooter(true); ?>
  540. <?php $this->HtmlPrintBoxHeader('dm_donations',__('Recent Donations:','sitemap'),true); ?>
  541. <?php if($this->sg->GetOption('i_hide_donors')!==true) { ?>
  542. <iframe border="0" frameborder="0" scrolling="no" allowtransparency="yes" style="width:100%; height:80px;" src="<?php echo $this->sg->GetRedirectLink('sitemap-donorlist'); ?>">
  543. <?php _e('List of the donors','sitemap'); ?>
  544. </iframe><br />
  545. <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hidedonors=true"; ?>"><small><?php _e('Hide this list','sitemap'); ?></small></a><br /><br />
  546. <?php } ?>
  547. <a style="float:left; margin-right:5px; border:none;" href="javascript:document.getElementById('sm_donate_form').submit();"><img style="vertical-align:middle; border:none; margin-top:2px;" src="<?php echo $this->sg->GetPluginUrl(); ?>img/icon-donate.gif" border="0" alt="PayPal" title="Help me to continue support of this plugin :)" /></a>
  548. <span><small><?php _e('Thanks for your support!','sitemap'); ?></small></span>
  549. <div style="clear:left; height:1px;"></div>
  550. <?php $this->HtmlPrintBoxFooter(true); ?>
  551. </div>
  552. </div>
  553. <?php endif; ?>
  554. <?php if($this->mode == 27): ?>
  555. <div class="has-sidebar sm-padded" >
  556. <div id="post-body-content" class="<?php if(!$snl): ?>has-sidebar-content<?php endif; ?>">
  557. <div class="meta-box-sortabless">
  558. <?php else: ?>
  559. <div id="advancedstuff" class="dbx-group" >
  560. <?php endif; ?>
  561. <!-- Rebuild Area -->
  562. <?php
  563. $status = &GoogleSitemapGeneratorStatus::Load();
  564. $head = __('The sitemap wasn\'t generated yet.','sitemap');
  565. if($status != null) {
  566. $st=$status->GetStartTime();
  567. $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'));
  568. }
  569. $this->HtmlPrintBoxHeader('sm_rebuild',$head); ?>
  570. <ul>
  571. <?php
  572. if($status == null) {
  573. echo "<li>" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&noheader=true",'sitemap'),__('The sitemap wasn\'t built yet. <a href="%s">Click here</a> to build it the first time.','sitemap')) . "</li>";
  574. } else {
  575. if($status->_endTime !== 0) {
  576. if($status->_usedXml) {
  577. if($status->_xmlSuccess) {
  578. $ft = is_readable($status->_xmlPath)?filemtime($status->_xmlPath):false;
  579. if($ft!==false) echo "<li>" . str_replace("%url%",$status->_xmlUrl,str_replace("%date%",date(get_option('date_format'),$ft) . " " . date(get_option('time_format'),$ft),__("Your <a href=\"%url%\">sitemap</a> was last built on <b>%date%</b>.",'sitemap'))) . "</li>";
  580. else echo "<li class=\"sm_error\">" . __("The last build succeeded, but the file was deleted later or can't be accessed anymore. Did you move your blog to another server or domain?",'sitemap') . "</li>";
  581. } else {
  582. echo "<li class=\"sm_error\">" . str_replace("%url%",$this->sg->GetRedirectLink('sitemap-help-files'),__("There was a problem writing your sitemap file. Make sure the file exists and is writable. <a href=\"%url%\">Learn more</a>",'sitemap')) . "</li>";
  583. }
  584. }
  585. if($status->_usedZip) {
  586. if($status->_zipSuccess) {
  587. $ft = is_readable($status->_zipPath)?filemtime($status->_zipPath):false;
  588. if($ft !== false) echo "<li>" . str_replace("%url%",$status->_zipUrl,str_replace("%date%",date(get_option('date_format'),$ft) . " " . date(get_option('time_format'),$ft),__("Your sitemap (<a href=\"%url%\">zipped</a>) was last built on <b>%date%</b>.",'sitemap'))) . "</li>";
  589. else echo "<li class=\"sm_error\">" . __("The last zipped build succeeded, but the file was deleted later or can't be accessed anymore. Did you move your blog to another server or domain?",'sitemap') . "</li>";
  590. } else {
  591. echo "<li class=\"sm_error\">" . str_replace("%url%",$this->sg->GetRedirectLink('sitemap-help-files'),__("There was a problem writing your zipped sitemap file. Make sure the file exists and is writable. <a href=\"%url%\">Learn more</a>",'sitemap')) . "</li>";
  592. }
  593. }
  594. if($status->_usedGoogle) {
  595. if($status->_gooogleSuccess) {
  596. echo "<li>" .__("Google was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  597. $gt = $status->GetGoogleTime();
  598. if($gt>4) {
  599. echo "<li class=\sm_optimize\">" . str_replace("%time%",$gt,__("It took %time% seconds to notify Google, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
  600. }
  601. } else {
  602. 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>";
  603. }
  604. }
  605. if($status->_usedMsn) {
  606. if($status->_msnSuccess) {
  607. echo "<li>" .__("Bing was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  608. $at = $status->GetMsnTime();
  609. if($at>4) {
  610. 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>";
  611. }
  612. } else {
  613. 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>";
  614. }
  615. }
  616. $et = $status->GetTime();
  617. $mem = $status->GetMemoryUsage();
  618. if($mem > 0) {
  619. echo "<li>" .str_replace(array("%time%","%memory%"),array($et,$mem),__("The building process took about <b>%time% seconds</b> to complete and used %memory% MB of memory.",'sitemap')). "</li>";
  620. } else {
  621. echo "<li>" .str_replace("%time%",$et,__("The building process took about <b>%time% seconds</b> to complete.",'sitemap')). "</li>";
  622. }
  623. if(!$status->_hasChanged) {
  624. echo "<li>" . __("The content of your sitemap <strong>didn't change</strong> since the last time so the files were not written and no search engine was pinged.",'sitemap'). "</li>";
  625. }
  626. } else {
  627. if($this->sg->GetOption("b_auto_delay")) {
  628. $st = ($status->GetStartTime() - time()) * -1;
  629. //If the building process runs in background and was started within the last 45 seconds, the sitemap might not be completed yet...
  630. if($st < 45) {
  631. echo '<li class="">'. __("The building process might still be active! Reload the page in a few seconds and check if something has changed.",'sitemap') . '</li>';
  632. }
  633. }
  634. echo '<li class="sm_error">'. str_replace("%url%",$this->sg->GetRedirectLink('sitemap-help-memtime'),__("The last run didn't finish! Maybe you can raise the memory or time limit for PHP scripts. <a href=\"%url%\">Learn more</a>",'sitemap')) . '</li>';
  635. if($status->_memoryUsage > 0) {
  636. echo '<li class="sm_error">'. str_replace(array("%memused%","%memlimit%"),array($status->GetMemoryUsage(),ini_get('memory_limit')),__("The last known memory usage of the script was %memused%MB, the limit of your server is %memlimit%.",'sitemap')) . '</li>';
  637. }
  638. if($status->_lastTime > 0) {
  639. echo '<li class="sm_error">'. str_replace(array("%timeused%","%timelimit%"),array($status->GetLastTime(),ini_get('max_execution_time')),__("The last known execution time of the script was %timeused% seconds, the limit of your server is %timelimit% seconds.",'sitemap')) . '</li>';
  640. }
  641. if($status->GetLastPost() > 0) {
  642. echo '<li class="sm_optimize">'. str_replace("%lastpost%",$status->GetLastPost(),__("The script stopped around post number %lastpost% (+/- 100)",'sitemap')) . '</li>';
  643. }
  644. }
  645. 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>";
  646. }
  647. 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>";
  648. if(version_compare($wp_version,"2.9",">=") && version_compare(PHP_VERSION,"5.1",">=")) {
  649. 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>";
  650. }
  651. ?>
  652. </ul>
  653. <?php $this->HtmlPrintBoxFooter(); ?>
  654. <!-- Basic Options -->
  655. <?php $this->HtmlPrintBoxHeader('sm_basic_options',__('Basic Options', 'sitemap')); ?>
  656. <b><?php _e('Sitemap files:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-files'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  657. <ul>
  658. <li>
  659. <label for="sm_b_xml">
  660. <input type="checkbox" id="sm_b_xml" name="sm_b_xml" <?php echo ($this->sg->GetOption("b_xml")==true?"checked=\"checked\"":"") ?> />
  661. <?php _e('Write a normal XML file (your filename)', 'sitemap') ?>
  662. </label>
  663. </li>
  664. <li>
  665. <label for="sm_b_gzip">
  666. <input type="checkbox" id="sm_b_gzip" name="sm_b_gzip" <?php if(function_exists("gzencode")) { echo ($this->sg->GetOption("b_gzip")==true?"checked=\"checked\"":""); } else echo "disabled=\"disabled\""; ?> />
  667. <?php _e('Write a gzipped file (your filename + .gz)', 'sitemap') ?>
  668. </label>
  669. </li>
  670. </ul>
  671. <b><?php _e('Building mode:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-process'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  672. <ul>
  673. <li>
  674. <label for="sm_b_auto_enabled">
  675. <input type="checkbox" id="sm_b_auto_enabled" name="sm_b_auto_enabled" <?php echo ($this->sg->GetOption("b_auto_enabled")==true?"checked=\"checked\"":""); ?> />
  676. <?php _e('Rebuild sitemap if you change the content of your blog', 'sitemap') ?>
  677. </label>
  678. </li>
  679. <li>
  680. <label for="sm_b_manual_enabled">
  681. <input type="hidden" name="sm_b_manual_key" value="<?php echo $this->sg->GetOption("b_manual_key"); ?>" />
  682. <input type="checkbox" id="sm_b_manual_enabled" name="sm_b_manual_enabled" <?php echo ($this->sg->GetOption("b_manual_enabled")==true?"checked=\"checked\"":"") ?> />
  683. <?php _e('Enable manual sitemap building via GET Request', 'sitemap') ?>
  684. </label>
  685. <a href="javascript:void(document.getElementById('sm_manual_help').style.display='');">[?]</a>
  686. <span id="sm_manual_help" style="display:none;"><br />
  687. <?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')); ?>
  688. </span>
  689. </li>
  690. </ul>
  691. <b><?php _e('Update notification:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-ping'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  692. <ul>
  693. <li>
  694. <input type="checkbox" id="sm_b_ping" name="sm_b_ping" <?php echo ($this->sg->GetOption("b_ping")==true?"checked=\"checked\"":"") ?> />
  695. <label for="sm_b_ping"><?php _e('Notify Google about updates of your Blog', 'sitemap') ?></label><br />
  696. <small><?php echo str_replace("%s",$this->sg->GetRedirectLink('sitemap-gwt'),__('No registration required, but you can join the <a href="%s">Google Webmaster Tools</a> to check crawling statistics.','sitemap')); ?></small>
  697. </li>
  698. <li>
  699. <input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php echo ($this->sg->GetOption("b_pingmsn")==true?"checked=\"checked\"":"") ?> />
  700. <label for="sm_b_pingmsn"><?php _e('Notify Bing (formerly MSN Live Search) about updates of your Blog', 'sitemap') ?></label><br />
  701. <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>
  702. </li>
  703. <li>
  704. <label for="sm_b_robots">
  705. <input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php echo ($this->sg->GetOption("b_robots")==true?"checked=\"checked\"":"") ?> />
  706. <?php _e("Add sitemap URL to the virtual robots.txt file.",'sitemap'); ?>
  707. </label>
  708. <br />
  709. <small><?php _e('The virtual robots.txt generated by WordPress is used. A real robots.txt file must NOT exist in the blog directory!','sitemap'); ?></small>
  710. </li>
  711. </ul>
  712. <b><?php _e('Advanced options:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-adv'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  713. <ul>
  714. <li>
  715. <label for="sm_b_max_posts"><?php _e('Limit the number of posts in the sitemap:', 'sitemap') ?> <input type="text" name="sm_b_max_posts" id="sm_b_max_posts" style="width:40px;" value="<?php echo ($this->sg->GetOption("b_max_posts")<=0?"":$this->sg->GetOption("b_max_posts")); ?>" /></label> (<?php echo __('Newer posts will be included first', 'sitemap'); ?>)
  716. </li>
  717. <li>
  718. <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 $this->sg->GetOption("b_memory"); ?>" /></label> (<?php echo htmlspecialchars(__('e.g. "4M", "16M"', 'sitemap')); ?>)
  719. </li>
  720. <li>
  721. <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 ($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')) ?>)
  722. </li>
  723. <li>
  724. <?php $useDefStyle = ($this->sg->GetDefaultStyle() && $this->sg->GetOption('b_style_default')===true); ?>
  725. <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 $this->sg->GetOption("b_style"); ?>" /></label>
  726. (<?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') ?> <?php endif; ?>
  727. </li>
  728. <li>
  729. <label for="sm_b_safemode">
  730. <?php $forceSafeMode = (floatval($wp_version)<2.2); ?>
  731. <input type="checkbox" <?php if($forceSafeMode):?>disabled="disabled"<?php endif; ?> id="sm_b_safemode" name="sm_b_safemode" <?php echo ($this->sg->GetOption("b_safemode")==true||$forceSafeMode?"checked=\"checked\"":""); ?> />
  732. <?php _e('Enable MySQL standard mode. Use this only if you\'re getting MySQL errors. (Needs much more memory!)', 'sitemap') ?>
  733. <?php if($forceSafeMode):?> <br /><small><?php _e("Upgrade WordPress at least to 2.2 to enable the faster MySQL access",'sitemap'); ?></small><?php endif; ?>
  734. </label>
  735. </li>
  736. <li>
  737. <label for="sm_b_auto_delay">
  738. <?php $forceDirect = (floatval($wp_version) < 2.1);?>
  739. <input type="checkbox" <?php if($forceDirect):?>disabled="disabled"<?php endif; ?> id="sm_b_auto_delay" name="sm_b_auto_delay" <?php echo ($this->sg->GetOption("b_auto_delay")==true&&!$forceDirect?"checked=\"checked\"":""); ?> />
  740. <?php _e('Build the sitemap in a background process (You don\'t have to wait when you save a post)', 'sitemap') ?>
  741. <?php if($forceDirect):?> <br /><small><?php _e("Upgrade WordPress at least to 2.1 to enable background building",'sitemap'); ?></small><?php endif; ?>
  742. </label>
  743. </li>
  744. </ul>
  745. <?php $this->HtmlPrintBoxFooter(); ?>
  746. <?php $this->HtmlPrintBoxHeader('sm_pages',__('Additional pages', 'sitemap')); ?>
  747. <?php
  748. _e('Here you can specify files or URLs which should be included in the sitemap, but do not belong to your Blog/WordPress.<br />For example, if your domain is www.foo.com and your blog is located on www.foo.com/blog you might want to include your homepage at www.foo.com','sitemap');
  749. echo "<ul><li>";
  750. echo "<strong>" . __('Note','sitemap'). "</strong>: ";
  751. _e("If your blog is in a subdirectory and you want to add pages which are NOT in the blog 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');
  752. echo "</li><li>";
  753. echo "<strong>" . __('URL to the page','sitemap'). "</strong>: ";
  754. _e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ",'sitemap');
  755. echo "</li><li>";
  756. echo "<strong>" . __('Priority','sitemap') . "</strong>: ";
  757. _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');
  758. echo "</li><li>";
  759. echo "<strong>" . __('Last Changed','sitemap'). "</strong>: ";
  760. _e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).",'sitemap');
  761. echo "</li></ul>";
  762. ?>
  763. <script type="text/javascript">
  764. //<![CDATA[
  765. <?php
  766. $freqVals = "'" . implode("','",array_keys($this->sg->_freqNames)). "'";
  767. $freqNames = "'" . implode("','",array_values($this->sg->_freqNames)). "'";
  768. ?>
  769. var changeFreqVals = new Array( <?php echo $freqVals; ?> );
  770. var changeFreqNames= new Array( <?php echo $freqNames; ?> );
  771. var priorities= new Array(0 <?php for($i=0.1; $i<1; $i+=0.1) { echo "," . number_format($i,1,".",""); } ?>);
  772. var pages = [ <?php
  773. if(count($this->sg->_pages)>0) {
  774. for($i=0; $i<count($this->sg->_pages); $i++) {
  775. $v=&$this->sg->_pages[$i];
  776. if($i>0) echo ",";
  777. echo '{url:"' . $v->getUrl() . '", priority:' . number_format($v->getPriority(),1,".","") . ', changeFreq:"' . $v->getChangeFreq() . '", lastChanged:"' . ($v!=null && $v->getLastMod()>0?date("Y-m-d",$v->getLastMod()):"") . '"}';
  778. }
  779. }
  780. ?> ];
  781. //]]>
  782. </script>
  783. <script type="text/javascript" src="<?php echo $this->sg->GetPluginUrl(); ?>img/sitemap.js"></script>
  784. <table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
  785. <tr>
  786. <th scope="col"><?php _e('URL to the page','sitemap'); ?></th>
  787. <th scope="col"><?php _e('Priority','sitemap'); ?></th>
  788. <th scope="col"><?php _e('Change Frequency','sitemap'); ?></th>
  789. <th scope="col"><?php _e('Last Changed','sitemap'); ?></th>
  790. <th scope="col"><?php _e('#','sitemap'); ?></th>
  791. </tr>
  792. <?php
  793. if(count($this->sg->_pages)<=0) { ?>
  794. <tr>
  795. <td colspan="5" align="center"><?php _e('No pages defined.','sitemap') ?></td>
  796. </tr><?php
  797. }
  798. ?>
  799. </table>
  800. <a href="javascript:void(0);" onclick="sm_addPage();"><?php _e("Add new page",'sitemap'); ?></a>
  801. <?php $this->HtmlPrintBoxFooter(); ?>
  802. <!-- AutoPrio Options -->
  803. <?php $this->HtmlPrintBoxHeader('sm_postprio',__('Post Priority', 'sitemap')); ?>
  804. <p><?php _e('Please select how the priority of each post should be calculated:', 'sitemap') ?></p>
  805. <ul>
  806. <li><p><input type="radio" name="sm_b_prio_provider" id="sm_b_prio_provider__0" value="" <?php echo $this->sg->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>
  807. <?php
  808. for($i=0; $i<count($this->sg->_prioProviders); $i++) {
  809. echo "<li><p><input type=\"radio\" id=\"sm_b_prio_provider_$i\" name=\"sm_b_prio_provider\" value=\"" . $this->sg->_prioProviders[$i] . "\" " . $this->sg->HtmlGetChecked($this->sg->GetOption("b_prio_provider"),$this->sg->_prioProviders[$i]) . " /> <label for=\"sm_b_prio_provider_$i\">" . call_user_func(array(&$this->sg->_prioProviders[$i], 'getName')) . "</label><br />" . call_user_func(array(&$this->sg->_prioProviders[$i], 'getDescription')) . "</p></li>";
  810. }
  811. ?>
  812. </ul>
  813. <?php $this->HtmlPrintBoxFooter(); ?>
  814. <!-- Location Options -->
  815. <?php $this->HtmlPrintBoxHeader('sm_location',__('Location of your sitemap file', 'sitemap')); ?>
  816. <div>
  817. <b><label for="sm_location_useauto"><input type="radio" id="sm_location_useauto" name="sm_b_location_mode" value="auto" <?php echo ($this->sg->GetOption("b_location_mode")=="auto"?"checked=\"checked\"":"") ?> /> <?php _e('Automatic detection','sitemap') ?></label></b>
  818. <ul>
  819. <li>
  820. <label for="sm_b_filename">
  821. <?php _e('Filename of the sitemap file', 'sitemap') ?>
  822. <input type="text" id="sm_b_filename" name="sm_b_filename" value="<?php echo $this->sg->GetOption("b_filename"); ?>" />
  823. </label><br />
  824. <?php _e('Detected Path', 'sitemap') ?>: <?php echo $this->sg->getXmlPath(true); ?><br /><?php _e('Detected URL', 'sitemap') ?>: <a href="<?php echo $this->sg->getXmlUrl(true); ?>"><?php echo $this->sg->getXmlUrl(true); ?></a>
  825. </li>
  826. </ul>
  827. </div>
  828. <div>
  829. <b><label for="sm_location_usemanual"><input type="radio" id="sm_location_usemanual" name="sm_b_location_mode" value="manual" <?php echo ($this->sg->GetOption("b_location_mode")=="manual"?"checked=\"checked\"":"") ?> /> <?php _e('Custom location','sitemap') ?></label></b>
  830. <ul>
  831. <li>
  832. <label for="sm_b_filename_manual">
  833. <?php _e('Absolute or relative path to the sitemap file, including name.','sitemap');
  834. echo "<br />";
  835. _e('Example','sitemap');
  836. echo ": /var/www/htdocs/wordpress/sitemap.xml"; ?><br />
  837. <input style="width:70%" type="text" id="sm_b_filename_manual" name="sm_b_filename_manual" value="<?php echo (!$this->sg->GetOption("b_filename_manual")?$this->sg->getXmlPath():$this->sg->GetOption("b_filename_manual")); ?>" />
  838. </label>
  839. </li>
  840. <li>