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

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

https://github.com/alx/barceloneta
PHP | 1169 lines | 1005 code | 126 blank | 38 comment | 168 complexity | c602e9bfa6b8af8886d6aaa85da225b8 MD5 | raw file
  1. <?php
  2. /*
  3. $Id: sitemap-ui.php 82176 2008-12-24 04:25:18Z 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 HtmlRegScripts() {
  21. }
  22. function HtmlPrintBoxHeader($id, $title, $right = false) {
  23. if($this->mode == 27) {
  24. ?>
  25. <div id="<?php echo $id; ?>" class="postbox">
  26. <h3 class="hndle"><span><?php echo $title ?></span></h3>
  27. <div class="inside">
  28. <?php
  29. } else {
  30. ?>
  31. <fieldset id="<?php echo $id; ?>" class="dbx-box">
  32. <?php if(!$right): ?><div class="dbx-h-andle-wrapper"><?php endif; ?>
  33. <h3 class="dbx-handle"><?php echo $title ?></h3>
  34. <?php if(!$right): ?></div><?php endif; ?>
  35. <?php if(!$right): ?><div class="dbx-c-ontent-wrapper"><?php endif; ?>
  36. <div class="dbx-content">
  37. <?php
  38. }
  39. }
  40. function HtmlPrintBoxFooter( $right = false) {
  41. if($this->mode == 27) {
  42. ?>
  43. </div>
  44. </div>
  45. <?php
  46. } else {
  47. ?>
  48. <?php if(!$right): ?></div><?php endif; ?>
  49. </div>
  50. </fieldset>
  51. <?php
  52. }
  53. }
  54. /**
  55. * Displays the option page
  56. *
  57. * @since 3.0
  58. * @access public
  59. * @author Arne Brachhold
  60. */
  61. function HtmlShowOptionsPage() {
  62. global $wp_version;
  63. $this->sg->Initate();
  64. //All output should go in this var which get printed at the end
  65. $message="";
  66. if(isset($_GET['sm_hidedonate'])) {
  67. $this->sg->SetOption('i_hide_donated',true);
  68. $this->sg->SaveOptions();
  69. }
  70. if(isset($_GET['sm_donated'])) {
  71. $this->sg->SetOption('i_donated',true);
  72. $this->sg->SaveOptions();
  73. }
  74. if(isset($_GET['sm_hide_note'])) {
  75. $this->sg->SetOption('i_hide_note',true);
  76. $this->sg->SaveOptions();
  77. }
  78. if(isset($_GET['sm_hidedonors'])) {
  79. $this->sg->SetOption('i_hide_donors',true);
  80. $this->sg->SaveOptions();
  81. }
  82. if(isset($_GET['sm_donated']) || ($this->sg->GetOption('i_donated')===true && $this->sg->GetOption('i_hide_donated')!==true)) {
  83. ?>
  84. <div class="updated">
  85. <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>
  86. </div>
  87. <?php
  88. } 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))) {
  89. ?>
  90. <div class="updated">
  91. <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 your are satisfied with the results, isn\'t it worth at least one 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_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>
  92. <div style="clear:right;"></div>
  93. </div>
  94. <?php
  95. }
  96. if(function_exists("wp_next_scheduled")) {
  97. $next = wp_next_scheduled('sm_build_cron');
  98. if($next) {
  99. $diff = (time()-$next)*-1;
  100. if($diff <= 0) {
  101. $diffMsg = __('Your sitemap is being refreshed at the moment. Depending on your blog size this might take some time!','sitemap');
  102. } else {
  103. $diffMsg = str_replace("%s",$diff,__('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!','sitemap'));
  104. }
  105. ?>
  106. <div class="updated">
  107. <strong><p><?php echo $diffMsg ?></p></strong>
  108. <div style="clear:right;"></div>
  109. </div>
  110. <?php
  111. }
  112. }
  113. if(!empty($_REQUEST["sm_rebuild"])) { //Pressed Button: Rebuild Sitemap
  114. check_admin_referer('sitemap');
  115. if(isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"]=="true") {
  116. //Check again, just for the case that something went wrong before
  117. if(!current_user_can("administrator")) {
  118. echo '<p>Please log in as admin</p>';
  119. return;
  120. }
  121. $oldErr = error_reporting(E_ALL);
  122. $oldIni = ini_set("display_errors",1);
  123. echo '<div class="wrap">';
  124. echo '<h2>' . __('XML Sitemap Generator for WordPress', 'sitemap') . " " . $this->sg->GetVersion(). '</h2>';
  125. 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>';
  126. 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>';
  127. echo "<h3>WordPress and PHP Information</h3>";
  128. echo '<p>WordPress ' . $GLOBALS['wp_version'] . ' with ' . ' DB ' . $GLOBALS['wp_db_version'] . ' on PHP ' . phpversion() . '</p>';
  129. echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->_svnVersion . ')';
  130. echo '<h4>Environment</h4>';
  131. echo "<pre>";
  132. $sc = $_SERVER;
  133. unset($sc["HTTP_COOKIE"]);
  134. print_r($sc);
  135. echo "</pre>";
  136. echo "<h4>WordPress Config</h4>";
  137. echo "<pre>";
  138. $opts = array();
  139. if(function_exists('wp_load_alloptions')) {
  140. $opts = wp_load_alloptions();
  141. } else {
  142. global $wpdb;
  143. $os = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options");
  144. foreach ( (array) $os as $o ) $opts[$o->option_name] = $o->option_value;
  145. }
  146. $popts = array();
  147. foreach($opts as $k=>$v) {
  148. //Try to filter out passwords etc...
  149. if(preg_match("/(pass|login|pw|secret|user|usr)/si",$v)) continue;
  150. $popts[$k] = htmlspecialchars($v);
  151. }
  152. print_r($popts);
  153. echo "</pre>";
  154. echo '<h4>Sitemap Config</h4>';
  155. echo "<pre>";
  156. print_r($this->sg->_options);
  157. echo "</pre>";
  158. echo '<h3>Errors, Warnings, Notices</h3>';
  159. echo '<div>';
  160. $status = $this->sg->BuildSitemap();
  161. echo '</div>';
  162. echo '<h3>MySQL Queries</h3>';
  163. if(defined('SAVEQUERIES') && SAVEQUERIES) {
  164. echo '<pre>';
  165. var_dump($GLOBALS['wpdb']->queries);
  166. echo '</pre>';
  167. $total = 0;
  168. foreach($GLOBALS['wpdb']->queries as $q) {
  169. $total+=$q[1];
  170. }
  171. echo '<h4>Total Query Time</h4>';
  172. echo '<pre>' . count($GLOBALS['wpdb']->queries) . ' queries in ' . round($total,2) . ' seconds.</pre>';
  173. } else {
  174. echo '<p>Please edit wp-db.inc.php in wp-includes and set SAVEQUERIES to true if you want to see the queries.</p>';
  175. }
  176. echo "<h3>Build Process Results</h3>";
  177. echo "<pre>";
  178. print_r($status);
  179. echo "</pre>";
  180. 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>';
  181. 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>';
  182. echo '</div>';
  183. @error_reporting($oldErr);
  184. @ini_set("display_errors",$oldIni);
  185. return;
  186. } else {
  187. $this->sg->BuildSitemap();
  188. //Redirect so the sm_rebuild GET parameter no longer exists.
  189. @header("location: " . $this->sg->GetBackLink());
  190. //If there was already any other output, the header redirect will fail
  191. echo '<script type="text/javascript">location.replace("' . $this->sg->GetBackLink() . '");</script>';
  192. echo '<noscript><a href="' . $this->sg->GetBackLink() . '">Click here to continue</a></noscript>';
  193. exit;
  194. }
  195. } else if (!empty($_POST['sm_update'])) { //Pressed Button: Update Config
  196. check_admin_referer('sitemap');
  197. if($_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
  198. $_POST['sm_b_style_default'] = true;
  199. $_POST['sm_b_style'] = '';
  200. }
  201. foreach($this->sg->_options as $k=>$v) {
  202. //Check vor values and convert them into their types, based on the category they are in
  203. if(!isset($_POST[$k])) $_POST[$k]=""; // Empty string will get false on 2bool and 0 on 2float
  204. //Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
  205. if(substr($k,0,5)=="sm_b_") {
  206. 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") {
  207. if($k=="sm_b_filename_manual" && strpos($_POST[$k],"\\")!==false){
  208. $_POST[$k]=stripslashes($_POST[$k]);
  209. }
  210. $this->sg->_options[$k]=(string) $_POST[$k];
  211. } else if($k=="sm_b_location_mode") {
  212. $tmp=(string) $_POST[$k];
  213. $tmp=strtolower($tmp);
  214. if($tmp=="auto" || $tmp="manual") $this->sg->_options[$k]=$tmp;
  215. else $this->sg->_options[$k]="auto";
  216. } else if($k == "sm_b_time" || $k=="sm_b_max_posts") {
  217. if($_POST[$k]=='') $_POST[$k] = -1;
  218. $this->sg->_options[$k] = intval($_POST[$k]);
  219. } else if($k== "sm_i_install_date") {
  220. if($this->sg->GetOption('i_install_date')<=0) $this->sg->_options[$k] = time();
  221. } else if($k=="sm_b_exclude") {
  222. $IDss = array();
  223. $IDs = explode(",",$_POST[$k]);
  224. for($x = 0; $x<count($IDs); $x++) {
  225. $ID = intval(trim($IDs[$x]));
  226. if($ID>0) $IDss[] = $ID;
  227. }
  228. $this->sg->_options[$k] = $IDss;
  229. } else if($k == "sm_b_exclude_cats") {
  230. $exCats = array();
  231. foreach((array) $_POST["post_category"] AS $vv) {
  232. if(!empty($vv) && is_numeric($vv)) $exCats[] = intval($vv);
  233. }
  234. $this->sg->_options[$k] = $exCats;
  235. } else {
  236. $this->sg->_options[$k]=(bool) $_POST[$k];
  237. if($k == "sm_b_auto_delay" && $this->sg->_options[$k] == false) {
  238. //If cron doesn't work and the user disables it, clear any remaining hooks
  239. if(function_exists('wp_clear_scheduled_hook')) wp_clear_scheduled_hook('sm_build_cron');
  240. }
  241. }
  242. //Options of the category "Includes" are boolean
  243. } else if(substr($k,0,6)=="sm_in_") {
  244. $this->sg->_options[$k]=(bool) $_POST[$k];
  245. //Options of the category "Change frequencies" are string
  246. } else if(substr($k,0,6)=="sm_cf_") {
  247. $this->sg->_options[$k]=(string) $_POST[$k];
  248. //Options of the category "Priorities" are float
  249. } else if(substr($k,0,6)=="sm_pr_") {
  250. $this->sg->_options[$k]=(float) $_POST[$k];
  251. }
  252. }
  253. //No Mysql unbuffered query for WP < 2.2
  254. if(floatval($wp_version) < 2.2) {
  255. $this->sg->SetOption('b_safemode',true);
  256. }
  257. //No Wp-Cron for WP < 2.1
  258. if(floatval($wp_version) < 2.1) {
  259. $this->sg->SetOption('b_auto_delay',false);
  260. }
  261. //Apply page changes from POST
  262. $this->sg->_pages=$this->sg->HtmlApplyPages();
  263. if($this->sg->SaveOptions()) $message.=__('Configuration updated', 'sitemap') . "<br />";
  264. else $message.=__('Error while saving options', 'sitemap') . "<br />";
  265. if($this->sg->SavePages()) $message.=__("Pages saved",'sitemap') . "<br />";
  266. else $message.=__('Error while saving pages', 'sitemap'). "<br />";
  267. } else if(!empty($_POST["sm_reset_config"])) { //Pressed Button: Reset Config
  268. check_admin_referer('sitemap');
  269. $this->sg->InitOptions();
  270. $this->sg->SaveOptions();
  271. $message.=__('The default configuration was restored.','sitemap');
  272. }
  273. //Print out the message to the user, if any
  274. if($message!="") {
  275. ?>
  276. <div class="updated"><strong><p><?php
  277. echo $message;
  278. ?></p></strong></div><?php
  279. }
  280. ?>
  281. <style type="text/css">
  282. li.sm_hint {
  283. color:green;
  284. }
  285. li.sm_optimize {
  286. color:orange;
  287. }
  288. li.sm_error {
  289. color:red;
  290. }
  291. input.sm_warning:hover {
  292. background: #ce0000;
  293. color: #fff;
  294. }
  295. a.sm_button {
  296. padding:4px;
  297. display:block;
  298. padding-left:25px;
  299. background-repeat:no-repeat;
  300. background-position:5px 50%;
  301. text-decoration:none;
  302. border:none;
  303. }
  304. a.sm_button:hover {
  305. border-bottom-width:1px;
  306. }
  307. a.sm_donatePayPal {
  308. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-paypal.gif);
  309. }
  310. a.sm_donateAmazon {
  311. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-amazon.gif);
  312. }
  313. a.sm_pluginHome {
  314. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-arne.gif);
  315. }
  316. a.sm_pluginList {
  317. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-email.gif);
  318. }
  319. a.sm_pluginSupport {
  320. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-wordpress.gif);
  321. }
  322. a.sm_pluginBugs {
  323. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-trac.gif);
  324. }
  325. a.sm_resGoogle {
  326. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-google.gif);
  327. }
  328. a.sm_resYahoo {
  329. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-yahoo.gif);
  330. }
  331. a.sm_resLive {
  332. background-image:url(<?php echo $this->sg->GetPluginUrl(); ?>img/icon-live.gif);
  333. }
  334. div.sm-update-nag p {
  335. margin:5px;
  336. }
  337. </style>
  338. <?php
  339. if($this->mode == 27): ?>
  340. <style type="text/css">
  341. .sm-padded .inside {
  342. margin:12px!important;
  343. }
  344. .sm-padded .inside ul {
  345. margin:6px 0 12px 0;
  346. }
  347. .sm-padded .inside input {
  348. padding:1px;
  349. margin:0;
  350. }
  351. </style>
  352. <?php elseif(version_compare($wp_version,"2.5",">=")): ?>
  353. <style type="text/css">
  354. div#moremeta {
  355. float:right;
  356. width:200px;
  357. margin-left:10px;
  358. }
  359. div#advancedstuff {
  360. width:770px;
  361. }
  362. div#poststuff {
  363. margin-top:10px;
  364. }
  365. fieldset.dbx-box {
  366. margin-bottom:5px;
  367. }
  368. div.sm-update-nag {
  369. margin-top:10px!important;
  370. }
  371. </style>
  372. <!--[if lt IE 7]>
  373. <style type="text/css">
  374. div#advancedstuff {
  375. width:735px;
  376. }
  377. </style>
  378. <![endif]-->
  379. <?php else: ?>
  380. <style type="text/css">
  381. div.updated-message {
  382. margin-left:0; margin-right:0;
  383. }
  384. </style>
  385. <?php endif;
  386. ?>
  387. <div class="wrap" id="sm_div">
  388. <form method="post" action="<?php echo $this->sg->GetBackLink() ?>">
  389. <h2><?php _e('XML Sitemap Generator for WordPress', 'sitemap'); echo " " . $this->sg->GetVersion() ?> </h2>
  390. <?php
  391. if(function_exists("wp_update_plugins") && (!defined('SM_NO_UPDATE') || SM_NO_UPDATE == false)) {
  392. wp_update_plugins();
  393. $file = GoogleSitemapGeneratorLoader::GetBaseName();
  394. $plugin_data = get_plugin_data(GoogleSitemapGeneratorLoader::GetPluginFile());
  395. $current = get_option( 'update_plugins' );
  396. if(isset($current->response[$file])) {
  397. $r = $current->response[$file];
  398. ?><div id="update-nag" class="sm-update-nag"><?php
  399. if ( !current_user_can('edit_plugins') || version_compare($wp_version,"2.5","<") )
  400. 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);
  401. else if ( empty($r->package) )
  402. 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);
  403. else
  404. 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) );
  405. ?></div><?php
  406. }
  407. }
  408. ?>
  409. <?php if(version_compare($wp_version,"2.5","<")): ?>
  410. <script type="text/javascript" src="../wp-includes/js/dbx.js"></script>
  411. <script type="text/javascript">
  412. //<![CDATA[
  413. addLoadEvent( function() {
  414. var manager = new dbxManager('sm_sitemap_meta_33');
  415. //create new docking boxes group
  416. var meta = new dbxGroup(
  417. 'grabit', // container ID [/-_a-zA-Z0-9/]
  418. 'vertical', // orientation ['vertical'|'horizontal']
  419. '10', // drag threshold ['n' pixels]
  420. 'no', // restrict drag movement to container axis ['yes'|'no']
  421. '10', // animate re-ordering [frames per transition, or '0' for no effect]
  422. 'yes', // include open/close toggle buttons ['yes'|'no']
  423. 'open', // default state ['open'|'closed']
  424. <?php echo "'" . js_escape(__('open')); ?>', // word for "open", as in "open this box"
  425. <?php echo "'" . js_escape(__('close')); ?>', // word for "close", as in "close this box"
  426. <?php echo "'" . js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
  427. <?php echo "'" . js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
  428. <?php echo "'" . js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
  429. <?php echo "'" . js_escape(__(', or press the enter key to %toggle% it')); ?>', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
  430. '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
  431. );
  432. var advanced = new dbxGroup(
  433. 'advancedstuff', // container ID [/-_a-zA-Z0-9/]
  434. 'vertical', // orientation ['vertical'|'horizontal']
  435. '10', // drag threshold ['n' pixels]
  436. 'yes', // restrict drag movement to container axis ['yes'|'no']
  437. '10', // animate re-ordering [frames per transition, or '0' for no effect]
  438. 'yes', // include open/close toggle buttons ['yes'|'no']
  439. 'open', // default state ['open'|'closed']
  440. <?php echo "'" . js_escape(__('open')); ?>', // word for "open", as in "open this box"
  441. <?php echo "'" . js_escape(__('close')); ?>', // word for "close", as in "close this box"
  442. <?php echo "'" . js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
  443. <?php echo "'" . js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
  444. <?php echo "'" . js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
  445. <?php echo "'" . js_escape(__(', or press the enter key to %toggle% it')); ?>', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
  446. '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
  447. );
  448. });
  449. //]]>
  450. </script>
  451. <?php endif; ?>
  452. <?php if($this->mode == 27): ?>
  453. <div id="poststuff" class="metabox-holder">
  454. <div class="inner-sidebar">
  455. <div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">
  456. <?php else: ?>
  457. <div id="poststuff">
  458. <div id="moremeta">
  459. <div id="grabit" class="dbx-group">
  460. <?php endif; ?>
  461. <?php $this->HtmlPrintBoxHeader('sm_pnres',__('About this Plugin:','sitemap'),true); ?>
  462. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-home'); ?>"><?php _e('Plugin Homepage','sitemap'); ?></a>
  463. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-feedback'); ?>"><?php _e('Suggest a Feature','sitemap'); ?></a>
  464. <a class="sm_button sm_pluginList" href="<?php echo $this->sg->GetRedirectLink('sitemap-list'); ?>"><?php _e('Notify List','sitemap'); ?></a>
  465. <a class="sm_button sm_pluginSupport" href="<?php echo $this->sg->GetRedirectLink('sitemap-support'); ?>"><?php _e('Support Forum','sitemap'); ?></a>
  466. <a class="sm_button sm_pluginBugs" href="<?php echo $this->sg->GetRedirectLink('sitemap-bugs'); ?>"><?php _e('Report a Bug','sitemap'); ?></a>
  467. <a class="sm_button sm_donatePayPal" href="<?php echo $this->sg->GetRedirectLink('sitemap-paypal'); ?>"><?php _e('Donate with PayPal','sitemap'); ?></a>
  468. <a class="sm_button sm_donateAmazon" href="<?php echo $this->sg->GetRedirectLink('sitemap-amazon'); ?>"><?php _e('My Amazon Wish List','sitemap'); ?></a>
  469. <?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 } ?>
  470. <?php $this->HtmlPrintBoxFooter(true); ?>
  471. <?php $this->HtmlPrintBoxHeader('sm_smres',__('Sitemap Resources:','sitemap'),true); ?>
  472. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-gwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
  473. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-gwb'); ?>"><?php _e('Webmaster Blog','sitemap'); ?></a>
  474. <a class="sm_button sm_resYahoo" href="<?php echo $this->sg->GetRedirectLink('sitemap-yse'); ?>"><?php _e('Site Explorer','sitemap'); ?></a>
  475. <a class="sm_button sm_resYahoo" href="<?php echo $this->sg->GetRedirectLink('sitemap-ywb'); ?>"><?php _e('Search Blog','sitemap'); ?></a>
  476. <a class="sm_button sm_resLive" href="<?php echo $this->sg->GetRedirectLink('sitemap-lwt'); ?>"><?php _e('Webmaster Tools','sitemap'); ?></a>
  477. <a class="sm_button sm_resLive" href="<?php echo $this->sg->GetRedirectLink('sitemap-lswcb'); ?>"><?php _e('Webmaster Center Blog','sitemap'); ?></a>
  478. <br />
  479. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-prot'); ?>"><?php _e('Sitemaps Protocol','sitemap'); ?></a>
  480. <a class="sm_button sm_resGoogle" href="<?php echo $this->sg->GetRedirectLink('sitemap-ofaq'); ?>"><?php _e('Official Sitemaps FAQ','sitemap'); ?></a>
  481. <a class="sm_button sm_pluginHome" href="<?php echo $this->sg->GetRedirectLink('sitemap-afaq'); ?>"><?php _e('My Sitemaps FAQ','sitemap'); ?></a>
  482. <?php $this->HtmlPrintBoxFooter(true); ?>
  483. <?php $this->HtmlPrintBoxHeader('dm_donations',__('Recent Donations:','sitemap'),true); ?>
  484. <?php if($this->sg->GetOption('i_hide_donors')!==true) { ?>
  485. <iframe border="0" frameborder="0" scrolling="no" allowtransparency="yes" style="width:100%; height:80px;" src="<?php echo $this->sg->GetRedirectLink('sitemap-donorlist'); ?>">
  486. <?php _e('List of the donors','sitemap'); ?>
  487. </iframe><br />
  488. <a href="<?php echo $this->sg->GetBackLink() . "&amp;sm_hidedonors=true"; ?>"><small><?php _e('Hide this list','sitemap'); ?></small></a><br /><br />
  489. <?php } ?>
  490. <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>
  491. <span><small><?php _e('Thanks for your support!','sitemap'); ?></small></span>
  492. <div style="clear:left; height:1px;"></div>
  493. <?php $this->HtmlPrintBoxFooter(true); ?>
  494. </div>
  495. </div>
  496. <?php if($this->mode == 27): ?>
  497. <div class="has-sidebar sm-padded" >
  498. <div id="post-body-content" class="has-sidebar-content">
  499. <div class="meta-box-sortabless">
  500. <?php else: ?>
  501. <div id="advancedstuff" class="dbx-group" >
  502. <?php endif; ?>
  503. <!-- Rebuild Area -->
  504. <?php $this->HtmlPrintBoxHeader('sm_rebuild',__('Status', 'sitemap')); ?>
  505. <ul>
  506. <?php
  507. //#type $status GoogleSitemapGeneratorStatus
  508. $status = GoogleSitemapGeneratorStatus::Load();
  509. if($status == null) {
  510. echo "<li>" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true",'sitemap'),__('The sitemap wasn\'t built yet. <a href="%s">Click here</a> to build it the first time.','sitemap')) . "</li>";
  511. } else {
  512. if($status->_endTime !== 0) {
  513. if($status->_usedXml) {
  514. if($status->_xmlSuccess) {
  515. $ft = filemtime($status->_xmlPath);
  516. 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>";
  517. } else {
  518. 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>";
  519. }
  520. }
  521. if($status->_usedZip) {
  522. if($status->_zipSuccess) {
  523. $ft = filemtime($status->_zipPath);
  524. 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>";
  525. } else {
  526. 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>";
  527. }
  528. }
  529. if($status->_usedGoogle) {
  530. if($status->_gooogleSuccess) {
  531. echo "<li>" .__("Google was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  532. $gt = $status->GetGoogleTime();
  533. if($gt>4) {
  534. 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>";
  535. }
  536. } else {
  537. echo "<li class=\"sm_error\">" . str_replace("%s",$status->_googleUrl,__('There was a problem while notifying Google. <a href="%s">View result</a>','sitemap')) . "</li>";
  538. }
  539. }
  540. if($status->_usedYahoo) {
  541. if($status->_yahooSuccess) {
  542. echo "<li>" .__("YAHOO was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  543. $yt = $status->GetYahooTime();
  544. if($yt>4) {
  545. 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>";
  546. }
  547. } else {
  548. echo "<li class=\"sm_error\">" . str_replace("%s",$status->_yahooUrl,__('There was a problem while notifying YAHOO. <a href="%s">View result</a>','sitemap')) . "</li>";
  549. }
  550. }
  551. if($status->_usedMsn) {
  552. if($status->_msnSuccess) {
  553. echo "<li>" .__("MSN was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  554. $at = $status->GetMsnTime();
  555. if($at>4) {
  556. echo "<li class=\sm_optimize\">" . str_replace("%time%",$at,__("It took %time% seconds to notify MSN.com, maybe you want to disable this feature to reduce the building time.",'sitemap')) . "</li>";
  557. }
  558. } else {
  559. echo "<li class=\"sm_error\">" . str_replace("%s",$status->_msnUrl,__('There was a problem while notifying MSN.com. <a href="%s">View result</a>','sitemap')) . "</li>";
  560. }
  561. }
  562. if($status->_usedAsk) {
  563. if($status->_askSuccess) {
  564. echo "<li>" .__("Ask.com was <b>successfully notified</b> about changes.",'sitemap'). "</li>";
  565. $at = $status->GetAskTime();
  566. if($at>4) {
  567. 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>";
  568. }
  569. } else {
  570. echo "<li class=\"sm_error\">" . str_replace("%s",$status->_askUrl,__('There was a problem while notifying Ask.com. <a href="%s">View result</a>','sitemap')) . "</li>";
  571. }
  572. }
  573. $et = $status->GetTime();
  574. $mem = $status->GetMemoryUsage();
  575. if($mem > 0) {
  576. 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>";
  577. } else {
  578. echo "<li>" .str_replace("%time%",$et,__("The building process took about <b>%time% seconds</b> to complete.",'sitemap')). "</li>";
  579. }
  580. if(!$status->_hasChanged) {
  581. 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>";
  582. }
  583. } else {
  584. if($this->sg->GetOption("b_auto_delay")) {
  585. $st = ($status->GetStartTime() - time()) * -1;
  586. //If the building process runs in background and was started within the last 45 seconds, the sitemap might not be completed yet...
  587. if($st < 45) {
  588. 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>';
  589. }
  590. }
  591. 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>';
  592. if($status->_memoryUsage > 0) {
  593. 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>';
  594. }
  595. if($status->_lastTime > 0) {
  596. 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>';
  597. }
  598. if($status->GetLastPost() > 0) {
  599. echo '<li class="sm_optimize">'. str_replace("%lastpost%",$status->GetLastPost(),__("The script stopped around post number %lastpost% (+/- 100)",'sitemap')) . '</li>';
  600. }
  601. }
  602. echo "<li>" . str_replace("%s",wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true",'sitemap'),__('If you changed something on your server or blog, you should <a href="%s">rebuild the sitemap</a> manually.','sitemap')) . "</li>";
  603. }
  604. 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>";
  605. ?>
  606. </ul>
  607. <?php $this->HtmlPrintBoxFooter(); ?>
  608. <!-- Basic Options -->
  609. <?php $this->HtmlPrintBoxHeader('sm_basic_options',__('Basic Options', 'sitemap')); ?>
  610. <b><?php _e('Sitemap files:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-files'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  611. <ul>
  612. <li>
  613. <label for="sm_b_xml">
  614. <input type="checkbox" id="sm_b_xml" name="sm_b_xml" <?php echo ($this->sg->GetOption("b_xml")==true?"checked=\"checked\"":"") ?> />
  615. <?php _e('Write a normal XML file (your filename)', 'sitemap') ?>
  616. </label>
  617. </li>
  618. <li>
  619. <label for="sm_b_gzip">
  620. <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\""; ?> />
  621. <?php _e('Write a gzipped file (your filename + .gz)', 'sitemap') ?>
  622. </label>
  623. </li>
  624. </ul>
  625. <b><?php _e('Building mode:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-process'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  626. <ul>
  627. <li>
  628. <label for="sm_b_auto_enabled">
  629. <input type="checkbox" id="sm_b_auto_enabled" name="sm_b_auto_enabled" <?php echo ($this->sg->GetOption("b_auto_enabled")==true?"checked=\"checked\"":""); ?> />
  630. <?php _e('Rebuild sitemap if you change the content of your blog', 'sitemap') ?>
  631. </label>
  632. </li>
  633. <li>
  634. <label for="sm_b_manual_enabled">
  635. <input type="hidden" name="sm_b_manual_key" value="<?php echo $this->sg->GetOption("b_manual_key"); ?>" />
  636. <input type="checkbox" id="sm_b_manual_enabled" name="sm_b_manual_enabled" <?php echo ($this->sg->GetOption("b_manual_enabled")==true?"checked=\"checked\"":"") ?> />
  637. <?php _e('Enable manual sitemap building via GET Request', 'sitemap') ?>
  638. </label>
  639. <a href="javascript:void(document.getElementById('sm_manual_help').style.display='');">[?]</a>
  640. <span id="sm_manual_help" style="display:none;"><br />
  641. <?php echo str_replace("%1",trailingslashit(get_bloginfo('siteurl')) . "?sm_command=build&amp;sm_key=" . $this->sg->GetOption("b_manual_key"),__('This will allow you to refresh your sitemap if an external tool wrote into the WordPress database without using the WordPress API. Use the following URL to start the process: <a href="%1">%1</a> Please check the logfile above to see if sitemap was successfully built.', 'sitemap')); ?>
  642. </span>
  643. </li>
  644. </ul>
  645. <b><?php _e('Update notification:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-ping'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  646. <ul>
  647. <li>
  648. <input type="checkbox" id="sm_b_ping" name="sm_b_ping" <?php echo ($this->sg->GetOption("b_ping")==true?"checked=\"checked\"":"") ?> />
  649. <label for="sm_b_ping"><?php _e('Notify Google about updates of your Blog', 'sitemap') ?></label><br />
  650. <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>
  651. </li>
  652. <li>
  653. <input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php echo ($this->sg->GetOption("b_pingmsn")==true?"checked=\"checked\"":"") ?> />
  654. <label for="sm_b_pingmsn"><?php _e('Notify MSN Live Search about updates of your Blog', 'sitemap') ?></label><br />
  655. <small><?php echo str_replace("%s",$this->sg->GetRedirectLink('sitemap-lwt'),__('No registration required, but you can join the <a href="%s">MSN Live Webmaster Tools</a> to check crawling statistics.','sitemap')); ?></small>
  656. </li>
  657. <li>
  658. <input type="checkbox" id="sm_b_pingask" name="sm_b_pingask" <?php echo ($this->sg->GetOption("b_pingask")==true?"checked=\"checked\"":"") ?> />
  659. <label for="sm_b_pingask"><?php _e('Notify Ask.com about updates of your Blog', 'sitemap') ?></label><br />
  660. <small><?php _e('No registration required.','sitemap'); ?></small>
  661. </li>
  662. <li>
  663. <input type="checkbox" id="sm_b_pingyahoo" name="sm_b_pingyahoo" <?php echo ($this->sg->GetOption("b_pingyahoo")==true?"checked=\"checked\"":"") ?> />
  664. <label for="sm_b_pingyahoo"><?php _e('Notify YAHOO about updates of your Blog', 'sitemap') ?></label><br />
  665. <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 />
  666. <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>
  667. </li>
  668. <li>
  669. <label for="sm_b_robots">
  670. <input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php echo ($this->sg->GetOption("b_robots")==true?"checked=\"checked\"":"") ?> />
  671. <?php _e("Add sitemap URL to the virtual robots.txt file.",'sitemap'); ?>
  672. </label>
  673. <br />
  674. <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>
  675. </li>
  676. </ul>
  677. <b><?php _e('Advanced options:','sitemap'); ?></b> <a href="<?php echo $this->sg->GetRedirectLink('sitemap-help-options-adv'); ?>"><?php _e('Learn more','sitemap'); ?></a>
  678. <ul>
  679. <li>
  680. <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'); ?>)
  681. </li>
  682. <li>
  683. <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')); ?>)
  684. </li>
  685. <li>
  686. <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')) ?>)
  687. </li>
  688. <li>
  689. <?php $useDefStyle = ($this->sg->GetDefaultStyle() && $this->sg->GetOption('b_style_default')===true); ?>
  690. <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>
  691. (<?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; ?>
  692. </li>
  693. <li>
  694. <label for="sm_b_safemode">
  695. <?php $forceSafeMode = (floatval($wp_version)<2.2); ?>
  696. <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\"":""); ?> />
  697. <?php _e('Enable MySQL standard mode. Use this only if you\'re getting MySQL errors. (Needs much more memory!)', 'sitemap') ?>
  698. <?php if($forceSafeMode):?> <br /><small><?php _e("Upgrade WordPress at least to 2.2 to enable the faster MySQL access",'sitemap'); ?></small><?php endif; ?>
  699. </label>
  700. </li>
  701. <li>
  702. <label for="sm_b_auto_delay">
  703. <?php $forceDirect = (floatval($wp_version) < 2.1);?>
  704. <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\"":""); ?> />
  705. <?php _e('Build the sitemap in a background process (You don\'t have to wait when you save a post)', 'sitemap') ?>
  706. <?php if($forceDirect):?> <br /><small><?php _e("Upgrade WordPress at least to 2.1 to enable background building",'sitemap'); ?></small><?php endif; ?>
  707. </label>
  708. </li>
  709. </ul>
  710. <?php $this->HtmlPrintBoxFooter(); ?>
  711. <?php $this->HtmlPrintBoxHeader('sm_pages',__('Additional pages', 'sitemap')); ?>
  712. <?php
  713. _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');
  714. echo "<ul><li>";
  715. echo "<strong>" . __('Note','sitemap'). "</strong>: ";
  716. _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');
  717. echo "</li><li>";
  718. echo "<strong>" . __('URL to the page','sitemap'). "</strong>: ";
  719. _e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ",'sitemap');
  720. echo "</li><li>";
  721. echo "<strong>" . __('Priority','sitemap') . "</strong>: ";
  722. _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');
  723. echo "</li><li>";
  724. echo "<strong>" . __('Last Changed','sitemap'). "</strong>: ";
  725. _e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).",'sitemap');
  726. echo "</li></ul>";
  727. ?>
  728. <script type="text/javascript">
  729. //<![CDATA[
  730. <?php
  731. $freqVals = "'" . implode("','",array_keys($this->sg->_freqNames)). "'";
  732. $freqNames = "'" . implode("','",array_values($this->sg->_freqNames)). "'";
  733. ?>
  734. var changeFreqVals = new Array( <?php echo $freqVals; ?> );
  735. var changeFreqNames= new Array( <?php echo $freqNames; ?> );
  736. var priorities= new Array(0 <?php for($i=0.1; $i<1; $i+=0.1) { echo "," . $i; } ?>);
  737. var pages = [ <?php
  738. if(count($this->sg->_pages)>0) {
  739. for($i=0; $i<count($this->sg->_pages); $i++) {
  740. $v=&$this->sg->_pages[$i];
  741. if($i>0) echo ",";
  742. echo '{url:"' . $v->getUrl() . '", priority:"' . $v->getPriority() . '", changeFreq:"' . $v->getChangeFreq() . '", lastChanged:"' . ($v!=null && $v->getLastMod()>0?date("Y-m-d",$v->getLastMod()):"") . '"}';
  743. }
  744. }
  745. ?> ];
  746. //]]>
  747. </script>
  748. <script type="text/javascript" src="<?php echo $this->sg->GetPluginUrl(); ?>img/sitemap.js"></script>
  749. <table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
  750. <tr>
  751. <th scope="col"><?php _e('URL to the page','sitemap'); ?></th>
  752. <th scope="col"><?php _e('Priority','sitemap'); ?></th>
  753. <th scope="col"><?php _e('Change Frequency','sitemap'); ?></th>
  754. <th scope="col"><?php _e('Last Changed','sitemap'); ?></th>
  755. <th scope="col"><?php _e('#','sitemap'); ?></th>
  756. </tr>
  757. <?php
  758. if(count($this->sg->_pages)<=0) { ?>
  759. <tr>
  760. <td colspan="5" align="center"><?php _e('No pages defined.','sitemap') ?></td>
  761. </tr><?php
  762. }
  763. ?>
  764. </table>
  765. <a href="javascript:void(0);" onclick="sm_addPage();"><?php _e("Add new page",'sitemap'); ?></a>
  766. <?php $this->HtmlPrintBoxFooter(); ?>
  767. <!-- AutoPrio Options -->
  768. <?php $this->HtmlPrintBoxHeader('sm_postprio',__('Post Priority', 'sitemap')); ?>
  769. <p><?php _e('Please select how the priority of each post should be calculated:', 'sitemap') ?></p>
  770. <ul>
  771. <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>
  772. <?php
  773. for($i=0; $i<count($this->sg->_prioProviders); $i++) {
  774. 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>";
  775. }
  776. ?>
  777. </ul>
  778. <?php $this->HtmlPrintBoxFooter(); ?>
  779. <!-- Location Options -->
  780. <?php $this->HtmlPrintBoxHeader('sm_location',__('Location of your sitemap file', 'sitemap')); ?>
  781. <div>
  782. <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>
  783. <ul>
  784. <li>
  785. <label for="sm_b_filename">
  786. <?php _e('Filename of the sitemap file', 'sitemap') ?>
  787. <input type="text" id="sm_b_filename" name="sm_b_filename" value="<?php echo $this->sg->GetOption("b_filename"); ?>" />
  788. </label><br />
  789. <?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>
  790. </li>
  791. </ul>
  792. </div>
  793. <div>
  794. <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>
  795. <ul>
  796. <li>
  797. <label for="sm_b_filename_manual">
  798. <?php _e('Absolute or relative path to the sitemap file, including name.','sitemap');
  799. echo "<br />";
  800. _e('Example','sitemap');
  801. echo ": /var/www/htdocs/wordpress/sitemap.xml"; ?><br />
  802. <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")); ?>" />
  803. </label>
  804. </li>
  805. <li>
  806. <label for="sm_b_fileurl_manual">
  807. <?php _e('Complete URL to the sitemap file, including name.','sitemap');
  808. echo "<br />";
  809. _e('Example','sitemap');
  810. echo ": http://www.yourdomain.com/sitemap.xml"; ?><br />
  811. <input style="width:70%" type="text" id="sm_b_fileurl_manual" name="sm_b_fileurl_manual" value="<?php echo (!$this->sg->GetOption("b_fileurl_manual")?$this->sg->getXmlUrl():$this->sg->GetOption("b_fileurl_manual")); ?>" />
  812. </label>
  813. </li>
  814. </ul>
  815. </div>
  816. <?php $this->HtmlPrintBoxFooter(); ?>
  817. <!-- Includes -->
  818. <?php $this->HtmlPrintBoxHeader('sm_includes',__('Sitemap Content', 'sitemap')); ?>
  819. <ul>
  820. <li>
  821. <label for="sm_in_home">
  822. <input type="checkbox" id="sm_in_home" name="sm_in_home" <?php echo ($this->sg->GetOption("in_home")==true?"checked=\"checked\"":"") ?> />
  823. <?php _e('Include homepage', 'sitemap') ?>
  824. </label>
  825. </li>
  826. <li>
  827. <label for="sm_in_posts">
  828. <input type="checkbox" id="sm_in_posts" name="sm_in_posts" <?php echo ($this->sg->GetOption("in_posts")==true?"checked=\"checked\"":"") ?> />
  829. <?php _e('Include posts', 'sitemap') ?>
  830. </label>
  831. </li>
  832. <li>
  833. <label for="sm_in_posts_sub">
  834. <input type="checkbox" id="sm_in_posts_sub" name="sm_in_posts_sub" <?php echo ($this->sg->GetOption("in_posts_sub")==true?"checked=\"checked\"":"") ?> />
  835. <?php _e('Include following pages of multi-page posts (&lt;!--nextpage--&gt;)', 'sitemap') ?>
  836. </label>
  837. </li>
  838. <li>
  839. <label for="sm_in_pages">
  840. <input type="checkbox" id="sm_in_pages" name="sm_in_pages" <?php echo ($this->sg->GetOption("in_pages")==true?"checked=\"checked\"":"") ?> />
  841. <?php _e('Include static pages', 'sitemap') ?>
  842. </label>
  843. </li>
  844. <li>
  845. <label for="sm_in_cats">
  846. <input type="checkbox" id="sm_in_cats" name="sm_in_cats" <?php echo ($this->sg->GetOption("in_cats")==true?"checked=\"checked\"":"") ?> />
  847. <?php _e('Include categories', 'sitemap') ?>
  848. </label>
  849. </li>
  850. <li>
  851. <label for="sm_in_arch">
  852. <input type="checkbox" id="sm_in_arch" name="sm_in_arch" <?php echo ($this->sg->GetOption("in_arch")==true?"checked=\"checked\"":"") ?> />
  853. <?php _e('Include archives', 'sitemap') ?>
  854. </label>
  855. </li>
  856. <?php if($this->sg->IsTaxonomySupported()): ?>
  857. <li>
  858. <label for="sm_in_tags">
  859. <input type="checkbox" id="sm_in_tags" name="sm_in_tags" <?php echo ($this->sg->GetOption("in_tags")==true?"checked=\"checked\"":"") ?> />
  860. <?php _e('Include tag pages', 'sitemap') ?>
  861. </label>
  862. </li>
  863. <?php endif; ?>
  864. <li>
  865. <label for="sm_in_auth">
  866. <input type="checkbox" id="sm_in_auth" name="sm_in_auth" <?php echo ($this->sg->GetOption("in_auth")==true?"checked=\"checked\"":"") ?> />
  867. <?php _e('Include author pages', 'sitemap') ?>
  868. </label>
  869. </li>
  870. </ul>
  871. <?php $this->HtmlPrintBoxFooter(); ?>
  872. <!-- Excluded Items -->
  873. <?php $this->HtmlPrintBoxHeader('sm_excludes',__('Excluded items', 'sitemap')); ?>
  874. <b><?php _e('Excluded categories', 'sitemap') ?>:</b>
  875. <?php if(version_compare($wp_version,"2.5",">=")): ?>
  876. <cite style="display:block; margin-left:40px;"><?php _e("Note","sitemap") ?>: <?php _e("Using this feature will increase build time and memory usage!","sitemap"); ?></cite>
  877. <div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; margin:5px 0px 5px 40px; overflow:auto; padding:0.5em 0.5em;">
  878. <ul>
  879. <?php wp_category_checklist(0,0,$this->sg->GetOption("b_exclude_cats"),false); ?>
  880. </ul>
  881. </div>
  882. <?php else: ?>
  883. <ul><li><?php echo sprintf(__("This feature requires at least WordPress 2.5, you are using %s","sitemap"),$wp_version); ?></li></ul>
  884. <?php endif; ?>
  885. <b><?php _e("Exclude posts","sitemap"); ?>:</b>
  886. <div style="margin:5px 0 13px 40px;">
  887. <label for="sm_b_exclude"><?php _e('Exclude the following posts or pages:', 'sitemap') ?> <small><?php _e('List of IDs, separated by comma', 'sitemap') ?></small><br />
  888. <input name="sm_b_exclude" id="sm_b_exclude" type="text" style="width:400px;" value="<?php echo implode(",",$this->sg->GetOption("b_exclude")); ?>" /></label><br />
  889. <cite><?php _e("Note","sitemap") ?>: <?php _e("Child posts will not automatically be excluded!","sitemap"); ?></cite>
  890. </div>
  891. <?php $this->HtmlPrintBoxFooter(); ?>
  892. <!-- Change frequencies -->
  893. <?php $this->HtmlPrintBoxHeader('sm_change_frequencies',__('Change frequencies', 'sitemap')); ?>
  894. <p>
  895. <b><?php _e('Note', 'sitemap') ?>:</b>
  896. <?php _e('Please note that the value of this tag is considered a hint and not a command. Even though search engine crawlers consider this information when making decisions, they may crawl pages marked "hourly" less frequently than that, and they may crawl pages marked "yearly" more frequently than that. It is also likely that crawlers will periodically crawl pages marked "never" so that they can handle unexpected changes to those pages.', 'sitemap') ?>
  897. </p>
  898. <ul>
  899. <li>
  900. <label for="sm_cf_home">
  901. <select id="sm_cf_home" name="sm_cf_home"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_home")); ?></select>
  902. <?php _e('Homepage', 'sitemap') ?>
  903. </label>
  904. </li>
  905. <li>
  906. <label for="sm_cf_posts">
  907. <select id="sm_cf_posts" name="sm_cf_posts"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_posts")); ?></select>
  908. <?php _e('Posts', 'sitemap') ?>
  909. </label>
  910. </li>
  911. <li>
  912. <label for="sm_cf_pages">
  913. <select id="sm_cf_pages" name="sm_cf_pages"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_pages")); ?></select>
  914. <?php _e('Static pages', 'sitemap') ?>
  915. </label>
  916. </li>
  917. <li>
  918. <label for="sm_cf_cats">
  919. <select id="sm_cf_cats" name="sm_cf_cats"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_cats")); ?></select>
  920. <?php _e('Categories', 'sitemap') ?>
  921. </label>
  922. </li>
  923. <li>
  924. <label for="sm_cf_arch_curr">
  925. <select id="sm_cf_arch_curr" name="sm_cf_arch_curr"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_arch_curr")); ?></select>
  926. <?php _e('The current archive of this month (Should be the same like your homepage)', 'sitemap') ?>
  927. </label>
  928. </li>
  929. <li>
  930. <label for="sm_cf_arch_old">
  931. <select id="sm_cf_arch_old" name="sm_cf_arch_old"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_arch_old")); ?></select>
  932. <?php _e('Older archives (Changes only if you edit an old post)', 'sitemap') ?>
  933. </label>
  934. </li>
  935. <?php if($this->sg->IsTaxonomySupported()): ?>
  936. <li>
  937. <label for="sm_cf_tags">
  938. <select id="sm_cf_tags" name="sm_cf_tags"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_tags")); ?></select>
  939. <?php _e('Tag pages', 'sitemap') ?>
  940. </label>
  941. </li>
  942. <?php endif; ?>
  943. <li>
  944. <label for="sm_cf_auth">
  945. <select id="sm_cf_auth" name="sm_cf_auth"><?php $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_auth")); ?></select>
  946. <?php _e('Author pages', 'sitemap') ?>
  947. </label>
  948. </li>
  949. </ul>
  950. <?php $this->HtmlPrintBoxFooter(); ?>
  951. <!-- Priorities -->
  952. <?php $this->HtmlPrintBoxHeader('sm_priorities',__('Priorities', 'sitemap')); ?>
  953. <ul>
  954. <li>
  955. <label for="sm_pr_home">
  956. <select id="sm_pr_home" name="sm_pr_home"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_home")); ?></select>
  957. <?php _e('Homepage', 'sitemap') ?>
  958. </label>
  959. </li>
  960. <li>
  961. <label for="sm_pr_posts">
  962. <select id="sm_pr_posts" name="sm_pr_posts"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_posts")); ?></select>
  963. <?php _e('Posts (If auto calculation is disabled)', 'sitemap') ?>
  964. </label>
  965. </li>
  966. <li>
  967. <label for="sm_pr_posts_min">
  968. <select id="sm_pr_posts_min" name="sm_pr_posts_min"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_posts_min")); ?></select>
  969. <?php _e('Minimum post priority (Even if auto calculation is enabled)', 'sitemap') ?>
  970. </label>
  971. </li>
  972. <li>
  973. <label for="sm_pr_pages">
  974. <select id="sm_pr_pages" name="sm_pr_pages"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_pages")); ?></select>
  975. <?php _e('Static pages', 'sitemap'); ?>
  976. </label>
  977. </li>
  978. <li>
  979. <label for="sm_pr_cats">
  980. <select id="sm_pr_cats" name="sm_pr_cats"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_cats")); ?></select>
  981. <?php _e('Categories', 'sitemap') ?>
  982. </label>
  983. </li>
  984. <li>
  985. <label for="sm_pr_arch">
  986. <select id="sm_pr_arch" name="sm_pr_arch"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_arch")); ?></select>
  987. <?php _e('Archives', 'sitemap') ?>
  988. </label>
  989. </li>
  990. <?php if($this->sg->IsTaxonomySupported()): ?>
  991. <li>
  992. <label for="sm_pr_tags">
  993. <select id="sm_pr_tags" name="sm_pr_tags"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_tags")); ?></select>
  994. <?php _e('Tag pages', 'sitemap') ?>
  995. </label>
  996. </li>
  997. <?php endif; ?>
  998. <li>
  999. <label for="sm_pr_auth">
  1000. <select id="sm_pr_auth" name="sm_pr_auth"><?php $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_auth")); ?></select>
  1001. <?php _e('Author pages', 'sitemap') ?>
  1002. </label>
  1003. </li>
  1004. </ul>
  1005. <?php $this->HtmlPrintBoxFooter(); ?>
  1006. </div>
  1007. <div>
  1008. <p class="submit">
  1009. <?php wp_nonce_field('sitemap') ?>
  1010. <input type="submit" name="sm_update" value="<?php _e('Update options', 'sitemap'); ?>" />
  1011. <input type="submit" onclick='return confirm("Do you really want to reset your configuration?");' class="sm_warning" name="sm_reset_config" value="<?php _e('Reset options', 'sitemap'); ?>" />
  1012. </p>
  1013. </div>
  1014. <?php if($this->mode == 27): ?>
  1015. </div>
  1016. </div>
  1017. <?php endif; ?>
  1018. </div>
  1019. <script type="text/javascript">if(typeof(sm_loadPages)=='function') addLoadEvent(sm_loadPages); </script>
  1020. </form>
  1021. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="sm_donate_form">
  1022. <input type="hidden" name="cmd" value="_xclick" />
  1023. <input type="hidden" name="business" value="<?php echo "donate" /* N O S P A M */ . "@" . "arnebra" . "chhold.de"; ?>" />
  1024. <input type="hidden" name="item_name" value="Sitemap Generator for WordPress. Please tell me if if you don't want to be listed on the donator list." />
  1025. <input type="hidden" name="no_shipping" value="1" />
  1026. <input type="hidden" name="return" value="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $this->sg->GetBackLink(); ?>&amp;sm_donated=true" />
  1027. <input type="hidden" name="item_number" value="0001" />
  1028. <input type="hidden" name="currency_code" value="USD" />
  1029. <input type="hidden" name="bn" value="PP-BuyNowBF" />
  1030. <input type="hidden" name="lc" value="US" />
  1031. <input type="hidden" name="rm" value="2" />
  1032. <input type="hidden" name="on0" value="Your Website" />
  1033. <input type="hidden" name="os0" value="<?php echo get_bloginfo("home"); ?>"/>
  1034. </form>
  1035. </div>
  1036. <?php
  1037. }
  1038. }