source: trunk/www.guidonia.net/wp/wp-content/plugins/google-sitemap-generator/sitemap-ui.php@ 44

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