PageRenderTime 54ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

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

https://gitlab.com/endomorphosis/reservationtelco
PHP | 954 lines | 789 code | 129 blank | 36 comment | 174 complexity | e7d2439d7ab5e735579a47926585768a MD5 | raw file
  1. <?php
  2. /*
  3. $Id: sitemap-ui.php 241392 2010-05-15 09:51:44Z 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_yahookey" || $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 $this->sg->_options[$k]=(bool) $_POST[$k];
  202. //Options of the category "Change frequencies" are string
  203. } else if(substr($k,0,6)=="sm_cf_") {
  204. $this->sg->_options[$k]=(string) $_POST[$k];
  205. //Options of the category "Priorities" are float
  206. } else if(substr($k,0,6)=="sm_pr_") {
  207. $this->sg->_options[$k]=(float) $_POST[$k];
  208. }
  209. }
  210. //No Mysql unbuffered query for WP < 2.2
  211. if(floatval($wp_version) < 2.2) {
  212. $this->sg->SetOption('b_safemode',true);
  213. }
  214. //No Wp-Cron for WP < 2.1
  215. if(floatval($wp_version) < 2.1) {
  216. $this->sg->SetOption('b_auto_delay',false);
  217. }
  218. //Apply page changes from POST
  219. $this->sg->_pages=$this->sg->HtmlApplyPages();
  220. if($this->sg->SaveOptions()) $message.=__('Configuration updated', 'sitemap') . "<br />";
  221. else $message.=__('Error while saving options', 'sitemap') . "<br />";
  222. if($this->sg->SavePages()) $message.=__("Pages saved",'sitemap') . "<br />";
  223. else $message.=__('Error while saving pages', 'sitemap'). "<br />";
  224. } else if(!empty($_POST["sm_reset_config"])) { //Pressed Button: Reset Config
  225. check_admin_referer('sitemap');
  226. $this->sg->InitOptions();
  227. $this->sg->SaveOptions();
  228. $message.=__('The default configuration was restored.','sitemap');
  229. }
  230. //Print out the message to the user, if any
  231. if($message!="") {
  232. ?>
  233. <div class="updated"><strong><p><?php
  234. echo $message;
  235. ?></p></strong></div><?php
  236. }
  237. if(!$snl) {
  238. if(isset($_GET['sm_hidedonate'])) {
  239. $this->sg->SetOption('i_hide_donated',true);
  240. $this->sg->SaveOptions();
  241. }
  242. if(isset($_GET['sm_donated'])) {
  243. $this->sg->SetOption('i_donated',true);
  244. $this->sg->SaveOptions();
  245. }
  246. if(isset($_GET['sm_hide_note'])) {
  247. $this->sg->SetOption('i_hide_note',true);
  248. $this->sg->SaveOptions();
  249. }
  250. if(isset($_GET['sm_hidedonors'])) {
  251. $this->sg->SetOption('i_hide_donors',true);
  252. $this->sg->SaveOptions();
  253. }
  254. if(isset($_GET['sm_hide_works'])) {
  255. $this->sg->SetOption('i_hide_works',true);
  256. $this->sg->SaveOptions();
  257. }
  258. if(isset($_GET['sm_donated']) || ($this->sg->GetOption('i_donated')===true && $this->sg->GetOption('i_hide_donated')!==true)) {
  259. ?>
  260. <div class="updated">
  261. <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>
  262. </div>
  263. <?php
  264. } 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))) {
  265. ?>
  266. <div class="updated">
  267. <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>
  268. <div style="clear:right;"></div>
  269. </div>
  270. <?php
  271. } 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))) {
  272. ?>
  273. <div class="updated">
  274. <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>
  275. <div style="clear:right;"></div>
  276. </div>
  277. <?php
  278. }
  279. }
  280. if(function_exists("wp_next_scheduled")) {
  281. $next = wp_next_scheduled('sm_build_cron');
  282. if($next) {
  283. $diff = (time()-$next)*-1;
  284. if($diff <= 0) {
  285. $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');
  286. } else {
  287. $diffMsg = str_replace("%s",$diff,__('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!','sitemap'));
  288. }
  289. ?>
  290. <div class="updated">
  291. <strong><p><?php echo $diffMsg ?></p></strong>
  292. <div style="clear:right;"></div>
  293. </div>
  294. <?php
  295. }
  296. }
  297. ?>
  298. <style type="text/css">
  299. li.sm_hint {
  300. color:green;
  301. }
  302. li.sm_optimize {
  303. color:orange;
  304. }
  305. li.sm_error {
  306. color:red;
  307. }
  308. input.sm_warning:hover {
  309. background: #ce0000;
  310. color: #fff;
  311. }
  312. a.sm_button {
  313. padding:4px;
  314. display:block;
  315. padding-left:25px;
  316. background-repeat:no-repeat;
  317. background-position:5px 50%;
  318. text-decoration:none;
  319. border:none;
  320. }
  321. a.sm_button:hover {
  322. border-bottom-width:1px;
  323. }
  324. a.sm_donatePayPal {
  325. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-paypal.gif);
  326. }
  327. a.sm_donateAmazon {
  328. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-amazon.gif);
  329. }
  330. a.sm_pluginHome {
  331. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-arne.gif);
  332. }
  333. a.sm_pluginList {
  334. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-email.gif);
  335. }
  336. a.sm_pluginSupport {
  337. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-wordpress.gif);
  338. }
  339. a.sm_pluginBugs {
  340. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-trac.gif);
  341. }
  342. a.sm_resGoogle {
  343. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-google.gif);
  344. }
  345. a.sm_resYahoo {
  346. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-yahoo.gif);
  347. }
  348. a.sm_resBing {
  349. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-bing.gif);
  350. }
  351. div.sm-update-nag p {
  352. margin:5px;
  353. }
  354. </style>
  355. <?php
  356. if($this->mode == 27): ?>
  357. <style type="text/css">
  358. .sm-padded .inside {
  359. margin:12px!important;
  360. }
  361. .sm-padded .inside ul {
  362. margin:6px 0 12px 0;
  363. }
  364. .sm-padded .inside input {
  365. padding:1px;
  366. margin:0;
  367. }
  368. </style>
  369. <?php elseif(version_compare($wp_version,"2.5",">=")): ?>
  370. <style type="text/css">
  371. div#moremeta {
  372. float:right;
  373. width:200px;
  374. margin-left:10px;
  375. }
  376. <?php if(!$snl): ?>
  377. div#advancedstuff {
  378. width:770px;
  379. }
  380. <?php endif;?>
  381. div#poststuff {
  382. margin-top:10px;
  383. }
  384. fieldset.dbx-box {
  385. margin-bottom:5px;
  386. }
  387. div.sm-update-nag {
  388. margin-top:10px!important;
  389. }
  390. </style>
  391. <!--[if lt IE 7]>
  392. <style type="text/css">
  393. div#advancedstuff {
  394. width:735px;
  395. }
  396. </style>
  397. <![endif]-->
  398. <?php else: ?>
  399. <style type="text/css">
  400. div.updated-message {
  401. margin-left:0; margin-right:0;
  402. }
  403. </style>
  404. <?php endif;
  405. ?>
  406. <div class="wrap" id="sm_div">
  407. <form method="post" action="<?php echo $this->sg->GetBackLink() ?>">
  408. <h2><?php _e('XML Sitemap Generator for WordPress', 'sitemap'); echo " " . $this->sg->GetVersion() ?> </h2>
  409. <?php
  410. if(function_exists("wp_update_plugins") && (!defined('SM_NO_UPDATE') || SM_NO_UPDATE == false)) {
  411. wp_update_plugins();
  412. $file = GoogleSitemapGeneratorLoader::GetBaseName();
  413. $plugin_data = get_plugin_data(GoogleSitemapGeneratorLoader::GetPluginFile());
  414. $current = function_exists('get_transient')?get_transient('update_plugins'):get_option('update_plugins');
  415. if(isset($current->response[$file])) {
  416. $r = $current->response[$file];
  417. ?><div id="update-nag" class="sm-update-nag"><?php
  418. if ( !current_user_can('edit_plugins') || version_compare($wp_version,"2.5","<") )
  419. 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);
  420. else if ( empty($r->package) )
  421. 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);
  422. else
  423. 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) );
  424. ?></div><?php
  425. }
  426. }
  427. if(get_option('blog_public')!=1) {
  428. ?><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
  429. }
  430. ?>
  431. <?php if(version_compare($wp_version,"2.5","<")): ?>
  432. <script type="text/javascript" src="../wp-includes/js/dbx.js"></script>
  433. <script type="text/javascript">
  434. //<![CDATA[
  435. addLoadEvent( function() {
  436. var manager = new dbxManager('sm_sitemap_meta_33');
  437. //create new docking boxes group
  438. var meta = new dbxGroup(
  439. 'grabit', // container ID [/-_a-zA-Z0-9/]
  440. 'vertical', // orientation ['vertical'|'horizontal']
  441. '10', // drag threshold ['n' pixels]
  442. 'no', // restrict drag movement to container axis ['yes'|'no']
  443. '10', // animate re-ordering [frames per transition, or '0' for no effect]
  444. 'yes', // include open/close toggle buttons ['yes'|'no']
  445. 'open', // default state ['open'|'closed']
  446. <?php echo "'" . js_escape(__('open')); ?>', // word for "open", as in "open this box"
  447. <?php echo "'" . js_escape(__('close')); ?>', // word for "close", as in "close this box"
  448. <?php echo "'" . js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
  449. <?php echo "'" . js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
  450. <?php echo "'" . js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
  451. <?php echo "'" . js_escape(__(', or press the enter key to %toggle% it')); ?>', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
  452. '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
  453. );
  454. var advanced = new dbxGroup(
  455. 'advancedstuff', // container ID [/-_a-zA-Z0-9/]
  456. 'vertical', // orientation ['vertical'|'horizontal']
  457. '10', // drag threshold ['n' pixels]
  458. 'yes', // restrict drag movement to container axis ['yes'|'no']
  459. '10', // animate re-ordering [frames per transition, or '0' for no effect]
  460. 'yes', // include open/close toggle buttons ['yes'|'no']
  461. 'open', // default state ['open'|'closed']
  462. <?php echo "'" . js_escape(__('open')); ?>', // word for "open", as in "open this box"
  463. <?php echo "'" . js_escape(__('close')); ?>', // word for "close", as in "close this box"
  464. <?php echo "'" . js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
  465. <?php echo "'" . js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
  466. <?php echo "'" . js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
  467. <?php echo "'" . js_escape(__(', or press the enter key to %toggle% it')); ?>', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
  468. '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
  469. );
  470. });
  471. //]]>
  472. </script>
  473. <?php endif; ?>
  474. <?php if($this->mode == 27): ?>
  475. <?php if(!$snl): ?>
  476. <div id="poststuff" class="metabox-holder has-right-sidebar">
  477. <div class="inner-sidebar">
  478. <div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">
  479. <?php else: ?>
  480. <div id="poststuff" class="metabox-holder">
  481. <?php endif; ?>
  482. <?php else: ?>
  483. <?php if(!$snl): ?>
  484. <div id="poststuff">
  485. <div id="moremeta">
  486. <div id="grabit" class="dbx-group">
  487. <?php else: ?>
  488. <div>
  489. <?php endif; ?>
  490. <?php endif; ?>
  491. <?php if(!$snl): ?>
  492. <?php $this->HtmlPrintBoxHeader('sm_pnres',__('About this Plugin:','sitemap'),true); ?>
  493. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-home'); ?>"><?php _e('Plugin Homepage','sitemap'); ?></a>
  494. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-feedback'); ?>"><?php _e('Suggest a Feature','sitemap'); ?></a>
  495. <a class="sm_button sm_pluginList" href="<?php echo $this->sg->GetRedirectLink('sitemap-list'); ?>"><?php _e('Notify List','sitemap'); ?></a>
  496. <a class="sm_button sm_pluginSupport" href="<?php echo $this->sg->GetRedirectLink('sitemap-support'); ?>"><?php _e('Support Forum','sitemap'); ?></a>
  497. <a class="sm_button sm_pluginBugs" href="<?php echo $this->sg->GetRedirectLink('sitemap-bugs'); ?>"><?php _e('Report a Bug','sitemap'); ?></a>
  498. <a class="sm_button sm_donatePayPal" href="<?php echo $this->sg->GetRedirectLink('sitemap-paypal'); ?>"><?php _e('Donate with PayPal','sitemap'); ?></a>
  499. <a class="sm_button sm_donateAmazon" href="<?php echo $this->sg->GetRedirectLink('sitemap-amazon'); ?>"><?php _e('My Amazon Wish List','sitemap'); ?></a>
  500. <?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 } ?>
  501. <?php $this->HtmlPrintBoxFooter(true); ?>
  502. <?php $this->HtmlPrintBoxHeader('sm_smres',__('Sitemap Resources:','sitemap'),true); ?>
  503. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-gwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
  504. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-gwb'); ?>"><?php _e('Webmaster Blog','sitemap'); ?></a>
  505. <a class="sm_button sm_resYahoo" href="<?php echo $this->sg->GetRedirectLink('sitemap-yse'); ?>"><?php _e('Site Explorer','sitemap'); ?></a>
  506. <a class="sm_button sm_resYahoo" href="<?php echo $this->sg->GetRedirectLink('sitemap-ywb'); ?>"><?php _e('Search Blog','sitemap'); ?></a>
  507. <a class="sm_button sm_resBing" href="<?php echo $this->sg->GetRedirectLink('sitemap-lwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
  508. <a class="sm_button sm_resBing" href="<?php echo $this->sg->GetRedirectLink('sitemap-lswcb'); ?>"><?php _e('Webmaster Center Blog','sitemap'); ?></a>
  509. <br />
  510. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-prot'); ?>"><?php _e('Sitemaps Protocol','sitemap'); ?></a>
  511. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-ofaq'); ?>"><?php _e('Official Sitemaps FAQ','sitemap'); ?></a>
  512. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-afaq'); ?>"><?php _e('My Sitemaps FAQ','sitemap'); ?></a>
  513. <?php $this->HtmlPrintBoxFooter(true); ?>
  514. <?php $this->HtmlPrintBoxHeader('dm_donations',__('Recent Donations:','sitemap'),true); ?>
  515. <?php if($this->sg->GetOption('i_hide_donors')!==true) { ?>
  516. <iframe border="0" frameborder="0" scrolling="no" allowtransparency="yes" style="width:100%; height:80px;" src="<?php echo $this->sg->GetRedirectLink('sitemap-donorlist'); ?>">
  517. <?php _e('List of the donors','sitemap'); ?>
  518. </iframe><br />
  519. <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hidedonors=true"; ?>"><small><?php _e('Hide this list','sitemap'); ?></small></a><br /><br />
  520. <?php } ?>
  521. <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>
  522. <span><small><?php _e('Thanks for your support!','sitemap'); ?></small></span>
  523. <div style="clear:left; height:1px;"></div>
  524. <?php $this->HtmlPrintBoxFooter(true); ?>
  525. </div>
  526. </div>
  527. <?php endif; ?>
  528. <?php if($this->mode == 27): ?>
  529. <div class="has-sidebar sm-padded" >
  530. <div id="post-body-content" class="<?php if(!$snl): ?>has-sidebar-content<?php endif; ?>">
  531. <div class="meta-box-sortabless">
  532. <?php else: ?>
  533. <div id="advancedstuff" class="dbx-group" >
  534. <?php endif; ?>
  535. <!-- Rebuild Area -->
  536. <?php
  537. $status = &GoogleSitemapGeneratorStatus::Load();
  538. $head = __('The sitemap wasn\'t generated yet.','sitemap');
  539. if($status != null) {
  540. $st=$status->GetStartTime();
  541. $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'));
  542. }
  543. $this->HtmlPrintBoxHeader('sm_rebuild',$head); ?>
  544. <ul>
  545. <?php
  546. if($status == null) {
  547. 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>";
  548. } else {
  549. if($status->_endTime !== 0) {
  550. if($status->_usedXml) {
  551. if($status->_xmlSuccess) {
  552. $ft = is_readable($status->_xmlPath)?filemtime($status->_xmlPath):false;
  553. 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>";
  554. 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>";
  555. } else {
  556. 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>";
  557. }
  558. }
  559. if($status->_usedZip) {
  560. if($status->_zipSuccess) {
  561. $ft = is_readable($status->_zipPath)?filemtime($status->_zipPath):false;
  562. 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>";
  563. 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>";
  564. } else {
  565. 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>";
  566. }
  567. }
  568. if($status->_usedGoogle) {
  569. if($status->_gooogleSuccess) {
  570. echo "<li>" .__("Google was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  571. $gt = $status->GetGoogleTime();
  572. if($gt>4) {
  573. 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>";
  574. }
  575. } else {
  576. 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>";
  577. }
  578. }
  579. if($status->_usedYahoo) {
  580. if($status->_yahooSuccess) {
  581. echo "<li>" .__("YAHOO was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  582. $yt = $status->GetYahooTime();
  583. if($yt>4) {
  584. echo "<li class=\sm_optimize\">" . str_replace("%time%",$yt,__("It took %time% seconds to notify YAHOO, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
  585. }
  586. } else {
  587. echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=yahoo&noheader=true",'sitemap'),__('There was a problem while notifying YAHOO. <a href="%s">View result</a>','sitemap')) . "</li>";
  588. }
  589. }
  590. if($status->_usedMsn) {
  591. if($status->_msnSuccess) {
  592. echo "<li>" .__("Bing was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  593. $at = $status->GetMsnTime();
  594. if($at>4) {
  595. 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>";
  596. }
  597. } else {
  598. 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>";
  599. }
  600. }
  601. if($status->_usedAsk) {
  602. if($status->_askSuccess) {
  603. echo "<li>" .__("Ask.com was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  604. $at = $status->GetAskTime();
  605. if($at>4) {
  606. echo "<li class=\sm_optimize\">" . str_replace("%time%",$at,__("It took %time% seconds to notify Ask.com, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
  607. }
  608. } else {
  609. echo "<li class=\"sm_error\">" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=ask&noheader=true",'sitemap'),__('There was a problem while notifying Ask.com. <a href="%s">View result</a>','sitemap')) . "</li>";
  610. }
  611. }
  612. $et = $status->GetTime();
  613. $mem = $status->GetMemoryUsage();
  614. if($mem > 0) {
  615. 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>";
  616. } else {
  617. echo "<li>" .str_replace("%time%",$et,__("The building process took about <b>%time% seconds</b> to complete.",'sitemap')). "</li>";
  618. }
  619. if(!$status->_hasChanged) {
  620. 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>";
  621. }
  622. } else {
  623. if($this->sg->GetOption("b_auto_delay")) {
  624. $st = ($status->GetStartTime() - time()) * -1;
  625. //If the building process runs in background and was started within the last 45 seconds, the sitemap might not be completed yet...
  626. if($st < 45) {
  627. 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>';
  628. }
  629. }
  630. 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>';
  631. if($status->_memoryUsage > 0) {
  632. 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>';
  633. }
  634. if($status->_lastTime > 0) {
  635. 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>';
  636. }
  637. if($status->GetLastPost() > 0) {
  638. echo '<li class="sm_optimize">'. str_replace("%lastpost%",$status->GetLastPost(),__("The script stopped around post number %lastpost% (+/- 100)",'sitemap')) . '</li>';
  639. }
  640. }
  641. 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>";
  642. }
  643. 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>";
  644. ?>
  645. </ul>
  646. <?php $this->HtmlPrintBoxFooter(); ?>
  647. <!-- Basic Options -->
  648. <?php $this->HtmlPrintBoxHeader('sm_basic_options',__('Basic Options', 'sitemap')); ?>
  649. <b><?php _e('Sitemap files:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-files'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  650. <ul>
  651. <li>
  652. <label for="sm_b_xml">
  653. <input type="checkbox" id="sm_b_xml" name="sm_b_xml" <?php echo ($this->sg->GetOption("b_xml")==true?"checked=\"checked\"":"") ?> />
  654. <?php _e('Write a normal XML file (your filename)', 'sitemap') ?>
  655. </label>
  656. </li>
  657. <li>
  658. <label for="sm_b_gzip">
  659. <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\""; ?> />
  660. <?php _e('Write a gzipped file (your filename + .gz)', 'sitemap') ?>
  661. </label>
  662. </li>
  663. </ul>
  664. <b><?php _e('Building mode:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-process'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  665. <ul>
  666. <li>
  667. <label for="sm_b_auto_enabled">
  668. <input type="checkbox" id="sm_b_auto_enabled" name="sm_b_auto_enabled" <?php echo ($this->sg->GetOption("b_auto_enabled")==true?"checked=\"checked\"":""); ?> />
  669. <?php _e('Rebuild sitemap if you change the content of your blog', 'sitemap') ?>
  670. </label>
  671. </li>
  672. <li>
  673. <label for="sm_b_manual_enabled">
  674. <input type="hidden" name="sm_b_manual_key" value="<?php echo $this->sg->GetOption("b_manual_key"); ?>" />
  675. <input type="checkbox" id="sm_b_manual_enabled" name="sm_b_manual_enabled" <?php echo ($this->sg->GetOption("b_manual_enabled")==true?"checked=\"checked\"":"") ?> />
  676. <?php _e('Enable manual sitemap building via GET Request', 'sitemap') ?>
  677. </label>
  678. <a href="javascript:void(document.getElementById('sm_manual_help').style.display='');">[?]</a>
  679. <span id="sm_manual_help" style="display:none;"><br />
  680. <?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')); ?>
  681. </span>
  682. </li>
  683. </ul>
  684. <b><?php _e('Update notification:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-ping'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  685. <ul>
  686. <li>
  687. <input type="checkbox" id="sm_b_ping" name="sm_b_ping" <?php echo ($this->sg->GetOption("b_ping")==true?"checked=\"checked\"":"") ?> />
  688. <label for="sm_b_ping"><?php _e('Notify Google about updates of your Blog', 'sitemap') ?></label><br />
  689. <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>
  690. </li>
  691. <li>
  692. <input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php echo ($this->sg->GetOption("b_pingmsn")==true?"checked=\"checked\"":"") ?> />
  693. <label for="sm_b_pingmsn"><?php _e('Notify Bing (formerly MSN Live Search) about updates of your Blog', 'sitemap') ?></label><br />
  694. <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>
  695. </li>
  696. <li>
  697. <input type="checkbox" id="sm_b_pingask" name="sm_b_pingask" <?php echo ($this->sg->GetOption("b_pingask")==true?"checked=\"checked\"":"") ?> />
  698. <label for="sm_b_pingask"><?php _e('Notify Ask.com about updates of your Blog', 'sitemap') ?></label><br />
  699. <small><?php _e('No registration required.','sitemap'); ?></small>
  700. </li>
  701. <li>
  702. <input type="checkbox" id="sm_b_pingyahoo" name="sm_b_pingyahoo" <?php echo ($this->sg->GetOption("b_pingyahoo")==true?"checked=\"checked\"":"") ?> />
  703. <label for="sm_b_pingyahoo"><?php _e('Notify YAHOO about updates of your Blog', 'sitemap') ?></label><br />
  704. <label for="sm_b_yahookey"><?php _e('Your Application ID:', 'sitemap') ?> <input type="text" name="sm_b_yahookey" id="sm_b_yahookey" value="<?php echo $this->sg->GetOption("b_yahookey"); ?>" /></label><br />
  705. <small><?php echo str_replace(array("%s1","%s2"),array($this->sg->GetRedirectLink('sitemap-ykr'),' (<a href="http://developer.yahoo.net/about/">Web Services by Yahoo!</a>)'),__('Don\'t you have such a key? <a href="%s1">Request one here</a>! %s2','sitemap')); ?></small>
  706. </li>
  707. <li>
  708. <label for="sm_b_robots">
  709. <input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php echo ($this->sg->GetOption("b_robots")==true?"checked=\"checked\"":"") ?> />
  710. <?php _e("Add sitemap URL to the virtual robots.txt file.",'sitemap'); ?>
  711. </label>
  712. <br />
  713. <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>
  714. </li>
  715. </ul>
  716. <b><?php _e('Advanced options:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-adv'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  717. <ul>
  718. <li>
  719. <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'); ?>)
  720. </li>
  721. <li>
  722. <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')); ?>)
  723. </li>
  724. <li>
  725. <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')) ?>)
  726. </li>
  727. <li>
  728. <?php $useDefStyle = ($this->sg->GetDefaultStyle() && $this->sg->GetOption('b_style_default')===true); ?>
  729. <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>
  730. (<?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; ?>
  731. </li>
  732. <li>
  733. <label for="sm_b_safemode">
  734. <?php $forceSafeMode = (floatval($wp_version)<2.2); ?>
  735. <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\"":""); ?> />
  736. <?php _e('Enable MySQL standard mode. Use this only if you\'re getting MySQL errors. (Needs much more memory!)', 'sitemap') ?>
  737. <?php if($forceSafeMode):?> <br /><small><?php _e("Upgrade WordPress at least to 2.2 to enable the faster MySQL access",'sitemap'); ?></small><?php endif; ?>
  738. </label>
  739. </li>
  740. <li>
  741. <label for="sm_b_auto_delay">
  742. <?php $forceDirect = (floatval($wp_version) < 2.1);?>
  743. <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\"":""); ?> />
  744. <?php _e('Build the sitemap in a background process (You don\'t have to wait when you save a post)', 'sitemap') ?>
  745. <?php if($forceDirect):?> <br /><small><?php _e("Upgrade WordPress at least to 2.1 to enable background building",'sitemap'); ?></small><?php endif; ?>
  746. </label>
  747. </li>
  748. </ul>
  749. <?php $this->HtmlPrintBoxFooter(); ?>
  750. <?php $this->HtmlPrintBoxHeader('sm_pages',__('Additional pages', 'sitemap')); ?>
  751. <?php
  752. _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');
  753. echo "<ul><li>";
  754. echo "<strong>" . __('Note','sitemap'). "</strong>: ";
  755. _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');
  756. echo "</li><li>";
  757. echo "<strong>" . __('URL to the page','sitemap'). "</strong>: ";
  758. _e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ",'sitemap');
  759. echo "</li><li>";
  760. echo "<strong>" . __('Priority','sitemap') . "</strong>: ";
  761. _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');
  762. echo "</li><li>";
  763. echo "<strong>" . __('Last Changed','sitemap'). "</strong>: ";
  764. _e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).",'sitemap');
  765. echo "</li></ul>";
  766. ?>
  767. <script type="text/javascript">
  768. //<![CDATA[
  769. <?php
  770. $freqVals = "'" . implode("','",array_keys($this->sg->_freqNames)). "'";
  771. $freqNames = "'" . implode("','",array_values($this->sg->_freqNames)). "'";
  772. ?>
  773. var changeFreqVals = new Array( <?php echo $freqVals; ?> );
  774. var changeFreqNames= new Array( <?php echo $freqNames; ?> );
  775. var priorities= new Array(0 <?php for($i=0.1; $i<1; $i+=0.1) { echo "," . number_format($i,1,".",""); } ?>);
  776. var pages = [ <?php
  777. if(count($this->sg->_pages)>0) {
  778. for($i=0; $i<count($this->sg->_pages); $i++) {
  779. $v=&$this->sg->_pages[$i];
  780. if($i>0) echo ",";
  781. 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()):"") . '"}';
  782. }
  783. }
  784. ?> ];
  785. //]]>
  786. </script>
  787. <script type="text/javascript" src="<?php echo $this->sg->GetPluginUrl(); ?>img/sitemap.js"></script>
  788. <table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
  789. <tr>
  790. <th scope="col"><?php _e('URL to the page','sitemap'); ?></th>
  791. <th scope="col"><?php _e('Priority','sitemap'); ?></th>
  792. <th scope="col"><?php _e('Change Frequency','sitemap'); ?></th>
  793. <th scope="col"><?php _e('Last Changed','sitemap'); ?></th>
  794. <th scope="col"><?php _e('#','sitemap'); ?></th>
  795. </tr>
  796. <?php
  797. if(count($this->sg->_pages)<=0) { ?>
  798. <tr>
  799. <td colspan="5" align="center"><?php _e('No pages defined.','sitemap') ?></td>
  800. </tr><?php
  801. }
  802. ?>
  803. </table>
  804. <a href="javascript:void(0);" onclick="sm_addPage();"><?php _e("Add new page",'sitemap'); ?></a>
  805. <?php $this->HtmlPrintBoxFooter(); ?>
  806. <!-- AutoPrio Options -->
  807. <?php $this->HtmlPrintBoxHeader('sm_postprio',__('Post Priority', 'sitemap')); ?>
  808. <p><?php _e('Please select how the priority of each post should be calculated:', 'sitemap') ?></p>
  809. <ul>
  810. <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>
  811. <?php
  812. for($i=0; $i<count($this->sg->_prioProviders); $i++) {
  813. 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>";
  814. }
  815. ?>
  816. </ul>
  817. <?php $this->HtmlPrintBoxFooter(); ?>
  818. <!-- Location Options -->
  819. <?php $this->HtmlPrintBoxHeader('sm_location',__('Location of your sitemap file', 'sitemap')); ?>