PS Auto Sitemap - Version 1.1.4

Version Description

Download this release

Release Info

Developer jim912
Plugin Icon wp plugin PS Auto Sitemap
Version 1.1.4
Comparing to
See all releases

Code changes from version 1.1.3 to 1.1.4

language/ps_auto_sitemap-ja.mo CHANGED
Binary file
language/ps_auto_sitemap-ja.po CHANGED
@@ -1,10 +1,10 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: PS Auto Sitemap 1.1.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2008-12-26 14:24+0900\n"
6
- "PO-Revision-Date: 2009-02-17 21:15+0900\n"
7
- "Last-Translator: hitoshi omagari\n"
8
  "Language-Team: Prime Strategy Co.,Ltd. <system@prime-strategy.co.jp>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -99,7 +99,7 @@ msgstr "投稿リストの出力"
99
 
100
  #: ps-auto-sitemap/ps_auto_sitemap.php:389
101
  msgid "Display page tree"
102
- msgstr "ページリストの出力"
103
 
104
  #: ps-auto-sitemap/ps_auto_sitemap.php:393
105
  msgid "PostID of the sitemap"
@@ -167,7 +167,7 @@ msgstr "投稿"
167
 
168
  #: ps-auto-sitemap/ps_auto_sitemap.php:422
169
  msgid "Page"
170
- msgstr "ページ"
171
 
172
  #: ps-auto-sitemap/ps_auto_sitemap.php:426
173
  msgid "Display of categories &amp; posts"
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: PS Auto Sitemap\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2008-12-26 14:24+0900\n"
6
+ "PO-Revision-Date: 2011-12-12 11:17+0900\n"
7
+ "Last-Translator: Hitoshi Omagari \n"
8
  "Language-Team: Prime Strategy Co.,Ltd. <system@prime-strategy.co.jp>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
99
 
100
  #: ps-auto-sitemap/ps_auto_sitemap.php:389
101
  msgid "Display page tree"
102
+ msgstr "固定ページリストの出力"
103
 
104
  #: ps-auto-sitemap/ps_auto_sitemap.php:393
105
  msgid "PostID of the sitemap"
167
 
168
  #: ps-auto-sitemap/ps_auto_sitemap.php:422
169
  msgid "Page"
170
+ msgstr "固定ページ"
171
 
172
  #: ps-auto-sitemap/ps_auto_sitemap.php:426
173
  msgid "Display of categories &amp; posts"
ps_auto_sitemap.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: PS Auto Sitemap
4
  Plugin URI: http://www.web-strategy.jp/wp_plugin/ps_auto_sitemap/
5
  Description: Auto generator of a customizable and designed sitemap page.
6
  Author: Hitoshi Omagari
7
- Version: 1.1.3
8
  Author URI: http://www.web-strategy.jp/
9
  */
10
 
@@ -100,7 +100,7 @@ class ps_auto_sitemap {
100
  }
101
  $sitemap_content = "<ul id=\"sitemap_list\" class=\"sitemap_disp_level_" . $this->option['disp_level'] . "\">\n";
102
  if ($this->option['home_list'] ) {
103
- $sitemap_content .= '<li class="home-item"><a href="' . get_bloginfo( 'url' ) . '" title="' . get_bloginfo( 'name' ) . '">' . wp_specialchars( get_bloginfo( 'name' ) ) . "</a></li>\n";
104
  }
105
  if ( $this->option['disp_first'] == 'post' ) {
106
  $sitemap_content .= $post_list;
@@ -178,7 +178,7 @@ class ps_auto_sitemap {
178
  }
179
 
180
  foreach( $category_tree as $cat_id => $category ) {
181
- $post_list .= '<li class="cat-item cat-item-' . $cat_id . '"><a href="' . get_category_link( $cat_id ). '" title="' . get_the_category_by_ID( $cat_id ) . '">' . wp_specialchars( get_the_category_by_ID( $cat_id ) ) . '</a>';
182
 
183
  if ( !$this->option['disp_posts'] || $this->option['disp_posts'] == 'combine' ) {
184
  if ( ! $depth || $depth > $cur_depth ) {
@@ -187,7 +187,7 @@ class ps_auto_sitemap {
187
  } else {
188
  $cur_category = get_category( $cat_id );
189
  if ( $cur_category->count ) {
190
- $post_list .= '<span class="posts_in_category"><a href="' . clean_url( add_query_arg( array( 'category' => $cat_id ), $_SERVER['REQUEST_URI'] ) ) . '"title="'. attribute_escape( __( 'Show posts in this category.', 'ps_auto_sitemap' ) ) .'">' . wp_specialchars( __( 'Show posts in this category.', 'ps_auto_sitemap' ) ) . '</a></span>' . "\n";
191
  }
192
  }
193
 
@@ -231,7 +231,7 @@ ORDER BY `posts`.`post_date` DESC";
231
  if ( $category_posts ) {
232
  $post_list_in_category .= "\n<ul>\n";
233
  foreach( $category_posts as $post ) {
234
- $post_list_in_category .= "\t" . '<li class="post-item post-item-' . $post['ID'] . '"><a href="' . get_permalink( $post['ID'] ) . '" title="' . attribute_escape( $post['post_title'] ) . '">' . wp_specialchars( $post['post_title'] ) . "</a></li>\n";
235
  }
236
  if ( ! $has_child ) {
237
  $post_list_in_category .= "</ul>\n";
@@ -242,13 +242,7 @@ ORDER BY `posts`.`post_date` DESC";
242
 
243
 
244
  function add_sitemap_setting_menu() {
245
- if ( function_exists( 'add_options_page' ) ) {
246
- add_options_page( 'PS Sitemap output setting',
247
- 'PS Auto Sitemap',
248
- 8,
249
- basename(__FILE__),
250
- array( &$this, 'sitemap_setting') );
251
- }
252
  }
253
 
254
 
@@ -258,7 +252,7 @@ ORDER BY `posts`.`post_date` DESC";
258
  $ex_post_ids = $this->form_ids_for_sql();
259
 
260
  $sitemap_content = '<ul id="sitemap_list">' . "\n";
261
- $sitemap_content .= '<li class="cat-item cat-item-' . $category->term_id . '"><a href="' . get_category_link( $category->term_id ). '" title="' . attribute_escape( $category->name ) . '">' . wp_specialchars( $category->name ) . '</a>';
262
  $sitemap_content .= $this->make_posts_list_in_category( $ex_post_ids, (int)$_GET['category'], false );
263
  $sitemap_content .= '</li>' . "\n";
264
  $sitemap_content .= '</ul>' . "\n";
@@ -286,9 +280,10 @@ ORDER BY `posts`.`post_date` DESC";
286
  if ( file_exists( $lang_file ) ) {
287
  load_textdomain( 'ps_auto_sitemap', $lang_file );
288
  }
 
289
 
290
- if( $_POST['_wpnonce'] ) {
291
- check_admin_referer();
292
  $sitemap_option_keys = array( 'home_list', 'post_tree', 'page_tree', 'post_id', 'disp_level', 'disp_first','disp_posts', 'ex_cat_ids', 'ex_post_ids', 'prepared_style', 'use_cache', 'suppress_link' );
293
 
294
  foreach ( $sitemap_option_keys as $key ) {
@@ -298,14 +293,14 @@ ORDER BY `posts`.`post_date` DESC";
298
  case 'page_tree' :
299
  case 'use_cache' :
300
  case 'suppress_link' :
301
- if ( ! $_POST['ps_sitemap_' . $key] ) {
302
  $_POST['ps_sitemap_' . $key] = '';
303
  } else {
304
  $this->validate_bool( $_POST['ps_sitemap_' . $key] );
305
  }
306
  break;
307
  case 'post_id' :
308
- if ( $_POST['ps_sitemap_' . $key] != '' ) {
309
  if ( function_exists( 'mb_convert_kana' ) ) {
310
  $_POST['ps_sitemap_' . $key] = mb_convert_kana( $_POST['ps_sitemap_' . $key], 'as', 'UTF-8' );
311
  }
@@ -363,7 +358,7 @@ ORDER BY `posts`.`post_date` DESC";
363
  <div id="message" class="updated">
364
  <p><?php _e('The settings of PS Auto Sitemap has changed successfully.', 'ps_auto_sitemap' );?></p>
365
  </div>
366
- <?php } elseif ( $_POST['ps_sitemap_submit'] && ! $ret ) { ?>
367
  <div id="notice" class="error">
368
  <p><?php _e('The settings has not been changed. There were no changes or failed to update the data base.', 'ps_auto_sitemap' );?></p>
369
  </div>
@@ -375,7 +370,7 @@ ORDER BY `posts`.`post_date` DESC";
375
 
376
  <?php } ?>
377
  <form method="post" action="">
378
- <?php wp_nonce_field(); ?>
379
  <table class="form-table">
380
  <tr>
381
  <th><?php _e( 'Display home list', 'ps_auto_sitemap' ); ?></th>
@@ -483,7 +478,7 @@ ORDER BY `posts`.`post_date` DESC";
483
 
484
 
485
  function print_sitemap_admin_css() {
486
- if( $_GET['page'] == 'ps_auto_sitemap.php' ) {
487
  if ( defined( 'WP_PLUGIN_URL' ) ) {
488
  echo '<link rel="stylesheet" href="' . WP_PLUGIN_URL . str_replace( str_replace( '\\', '/', WP_PLUGIN_DIR ), '', str_replace( '\\', '/', dirname( __file__ ) ) ) . '/css/ps_auto_sitemap_admin.css" type="text/css" media="all" />' . "\n";
489
  } else {
@@ -592,4 +587,17 @@ ORDER BY `posts`.`post_date` DESC";
592
 
593
  }
594
 
595
- $ps_auto_sitemap =& new ps_auto_sitemap();
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  Plugin URI: http://www.web-strategy.jp/wp_plugin/ps_auto_sitemap/
5
  Description: Auto generator of a customizable and designed sitemap page.
6
  Author: Hitoshi Omagari
7
+ Version: 1.1.4
8
  Author URI: http://www.web-strategy.jp/
9
  */
10
 
100
  }
101
  $sitemap_content = "<ul id=\"sitemap_list\" class=\"sitemap_disp_level_" . $this->option['disp_level'] . "\">\n";
102
  if ($this->option['home_list'] ) {
103
+ $sitemap_content .= '<li class="home-item"><a href="' . get_bloginfo( 'url' ) . '" title="' . get_bloginfo( 'name' ) . '">' . esc_html( get_bloginfo( 'name' ) ) . "</a></li>\n";
104
  }
105
  if ( $this->option['disp_first'] == 'post' ) {
106
  $sitemap_content .= $post_list;
178
  }
179
 
180
  foreach( $category_tree as $cat_id => $category ) {
181
+ $post_list .= '<li class="cat-item cat-item-' . $cat_id . '"><a href="' . get_category_link( $cat_id ). '" title="' . get_the_category_by_ID( $cat_id ) . '">' . esc_html( get_the_category_by_ID( $cat_id ) ) . '</a>';
182
 
183
  if ( !$this->option['disp_posts'] || $this->option['disp_posts'] == 'combine' ) {
184
  if ( ! $depth || $depth > $cur_depth ) {
187
  } else {
188
  $cur_category = get_category( $cat_id );
189
  if ( $cur_category->count ) {
190
+ $post_list .= '<span class="posts_in_category"><a href="' . clean_url( add_query_arg( array( 'category' => $cat_id ), $_SERVER['REQUEST_URI'] ) ) . '"title="'. esc_attr( __( 'Show posts in this category.', 'ps_auto_sitemap' ) ) .'">' . esc_html( __( 'Show posts in this category.', 'ps_auto_sitemap' ) ) . '</a></span>' . "\n";
191
  }
192
  }
193
 
231
  if ( $category_posts ) {
232
  $post_list_in_category .= "\n<ul>\n";
233
  foreach( $category_posts as $post ) {
234
+ $post_list_in_category .= "\t" . '<li class="post-item post-item-' . $post['ID'] . '"><a href="' . get_permalink( $post['ID'] ) . '" title="' . esc_attr( $post['post_title'] ) . '">' . esc_html( $post['post_title'] ) . "</a></li>\n";
235
  }
236
  if ( ! $has_child ) {
237
  $post_list_in_category .= "</ul>\n";
242
 
243
 
244
  function add_sitemap_setting_menu() {
245
+ add_options_page( 'PS Auto Sitemap setting', 'PS Auto Sitemap', 'manage_options', basename(__FILE__), array( &$this, 'sitemap_setting') );
 
 
 
 
 
 
246
  }
247
 
248
 
252
  $ex_post_ids = $this->form_ids_for_sql();
253
 
254
  $sitemap_content = '<ul id="sitemap_list">' . "\n";
255
+ $sitemap_content .= '<li class="cat-item cat-item-' . $category->term_id . '"><a href="' . get_category_link( $category->term_id ). '" title="' . esc_attr( $category->name ) . '">' . esc_html( $category->name ) . '</a>';
256
  $sitemap_content .= $this->make_posts_list_in_category( $ex_post_ids, (int)$_GET['category'], false );
257
  $sitemap_content .= '</li>' . "\n";
258
  $sitemap_content .= '</ul>' . "\n";
280
  if ( file_exists( $lang_file ) ) {
281
  load_textdomain( 'ps_auto_sitemap', $lang_file );
282
  }
283
+ $ret = false;
284
 
285
+ if( isset( $_POST['_wpnonce'] ) && $_POST['_wpnonce'] ) {
286
+ check_admin_referer( 'ps_auto_sitemap' );
287
  $sitemap_option_keys = array( 'home_list', 'post_tree', 'page_tree', 'post_id', 'disp_level', 'disp_first','disp_posts', 'ex_cat_ids', 'ex_post_ids', 'prepared_style', 'use_cache', 'suppress_link' );
288
 
289
  foreach ( $sitemap_option_keys as $key ) {
293
  case 'page_tree' :
294
  case 'use_cache' :
295
  case 'suppress_link' :
296
+ if ( ! isset( $_POST['ps_sitemap_' . $key] ) ) {
297
  $_POST['ps_sitemap_' . $key] = '';
298
  } else {
299
  $this->validate_bool( $_POST['ps_sitemap_' . $key] );
300
  }
301
  break;
302
  case 'post_id' :
303
+ if ( isset( $_POST['ps_sitemap_' . $key] ) && $_POST['ps_sitemap_' . $key] != '' ) {
304
  if ( function_exists( 'mb_convert_kana' ) ) {
305
  $_POST['ps_sitemap_' . $key] = mb_convert_kana( $_POST['ps_sitemap_' . $key], 'as', 'UTF-8' );
306
  }
358
  <div id="message" class="updated">
359
  <p><?php _e('The settings of PS Auto Sitemap has changed successfully.', 'ps_auto_sitemap' );?></p>
360
  </div>
361
+ <?php } elseif ( isset( $_POST['ps_sitemap_submit'] ) && $_POST['ps_sitemap_submit'] && ! $ret ) { ?>
362
  <div id="notice" class="error">
363
  <p><?php _e('The settings has not been changed. There were no changes or failed to update the data base.', 'ps_auto_sitemap' );?></p>
364
  </div>
370
 
371
  <?php } ?>
372
  <form method="post" action="">
373
+ <?php wp_nonce_field( 'ps_auto_sitemap' ); ?>
374
  <table class="form-table">
375
  <tr>
376
  <th><?php _e( 'Display home list', 'ps_auto_sitemap' ); ?></th>
478
 
479
 
480
  function print_sitemap_admin_css() {
481
+ if( isset( $_GET['page'] ) && $_GET['page'] == 'ps_auto_sitemap.php' ) {
482
  if ( defined( 'WP_PLUGIN_URL' ) ) {
483
  echo '<link rel="stylesheet" href="' . WP_PLUGIN_URL . str_replace( str_replace( '\\', '/', WP_PLUGIN_DIR ), '', str_replace( '\\', '/', dirname( __file__ ) ) ) . '/css/ps_auto_sitemap_admin.css" type="text/css" media="all" />' . "\n";
484
  } else {
587
 
588
  }
589
 
590
+ $ps_auto_sitemap =& new ps_auto_sitemap();
591
+
592
+
593
+ if ( ! function_exists( 'esc_attr' ) ) {
594
+ function esc_attr( $text ) {
595
+ return attribute_escape( $text );
596
+ }
597
+ }
598
+
599
+ if ( ! function_exists( 'esc_html' ) ) {
600
+ function esc_html( $text ) {
601
+ return wp_specialchars( $text );
602
+ }
603
+ }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: jim912
3
  Tags: sitemap, post, page, seo, cms
4
  Requires at least: 2.3.1
5
- Tested up to: 2.7.1
6
- Stable tag: trunk
7
 
8
  Auto generator of a customizable and designed sitemap page.
9
 
@@ -29,6 +29,10 @@ When you use WordPress as CMS of the Web site, you can expect the **effect of SE
29
  * Use or not caching sitemap content.
30
 
31
  = Latest change =
 
 
 
 
32
  * **1.1.3**
33
  * bug fix: Fatal error has occurred in PHP4
34
 
2
  Contributors: jim912
3
  Tags: sitemap, post, page, seo, cms
4
  Requires at least: 2.3.1
5
+ Tested up to: 3.3
6
+ Stable tag: 1.1.4
7
 
8
  Auto generator of a customizable and designed sitemap page.
9
 
29
  * Use or not caching sitemap content.
30
 
31
  = Latest change =
32
+ * **1.1.4**
33
+ * Compatible with WordPress 3.3
34
+ * bug fix: Notice error and Deprecated functions and arguments.
35
+
36
  * **1.1.3**
37
  * bug fix: Fatal error has occurred in PHP4
38