Simple Sitemap – Automatically Generate a Responsive Sitemap - Version 1.5

Version Description

Download this release

Release Info

Developer dgwyer
Plugin Icon Simple Sitemap – Automatically Generate a Responsive Sitemap
Version 1.5
Comparing to
See all releases

Code changes from version 1.41 to 1.5

Files changed (3) hide show
  1. css/ss_style.css +0 -101
  2. readme.txt +10 -2
  3. simple-sitemap.php +64 -63
css/ss_style.css DELETED
@@ -1,101 +0,0 @@
1
- .pagenav {
2
- font-family:Georgia, "Times New Roman", Times, serif;`
3
- /*font-size:14px;*/
4
- font-style:italic;
5
- list-style-type: none;
6
- margin: 0px 0px 0px 10px;
7
- }
8
-
9
- /* ---------------- */
10
- /* Sitemap Page CSS */
11
- /* ---------------- */
12
- #ss_pages {
13
- width: 49%;
14
- }
15
-
16
- .page_author {
17
- color: #111;
18
- }
19
-
20
- #content .page_heading {
21
- margin: 0px 0px 7px 0px;
22
- padding: 0px 0px 4px 0px;
23
- font-size: 19px;
24
- font-style: italic;
25
- border-bottom:1px #ccc solid;
26
- }
27
-
28
- #page_dd_label {
29
- margin-right:5px;
30
- font-size: 0.95em;
31
- }
32
-
33
- /* ---------------- */
34
- /* Sitemap Post CSS */
35
- /* ---------------- */
36
- #ss_posts {
37
- width: 49%;
38
- }
39
-
40
- .ss_sticky {
41
- font-style: italic;
42
- color: #999;
43
- font-size: 0.7em;
44
- }
45
-
46
- #post_dd_label {
47
- margin-right:5px;
48
- font-size: 0.95em;
49
- }
50
-
51
- #post_item {
52
- /*border: 0px red solid;*/
53
- margin:0px 0px 0px 0px;
54
- }
55
-
56
- div.post_item_list ul {
57
- margin-bottom:18px;
58
- }
59
-
60
- #content .post_heading {
61
- margin: 0px 0px 7px 0px;
62
- padding: 0px 0px 4px 0px;
63
- font-size: 19px;
64
- font-style: italic;
65
- border-bottom:1px #ccc solid;
66
- }
67
-
68
- /* ------------------------- */
69
- /* Common to Posts and Pages */
70
- /* ------------------------- */
71
- ul.page_item_list li, ul.post_item_list li {
72
- font-size: 15px;
73
- font-weight: normal;
74
- font-style: normal;
75
- line-height: 1.6em;
76
- /*list-style-type: none;*/
77
- }
78
-
79
- div.post_item_list, div.page_author {
80
- font-size: 16px;
81
- }
82
-
83
- #page_drop_down, #post_drop_down {
84
- margin: 14px 0px 0px 0px;
85
- }
86
-
87
- #ss_content_sep {
88
- float: left;
89
- width: 2%;
90
- background-color: green;
91
- }
92
-
93
- .ss_wrapper {
94
- margin: 10px 0px 0px 0px;
95
- }
96
-
97
- .ss_cat_header a, .ss_author_header a, ss_tag_header a, ss_date_header a, ss_page_date a {
98
- font-size: 17px;
99
- font-style:italic;
100
- margin: 1px 2px 3px 4px;
101
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,13 +4,13 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: sitemap, html, global, sort, shortcode, pages, posts
5
  Requires at least: 2.7
6
  Tested up to: 3.3.2
7
- Stable tag: 1.41
8
 
9
  HTML sitemap to display content as a single linked list of posts and pages, or as groups sorted by taxonomy (via a drop-down box).
10
 
11
  == Description ==
12
 
13
- Update: From version 1.4 you can now exclude pages by ID! This was a commonly requested feature. Also, ALL posts are now listed and are not restricted by the Settings -> Reading value.
14
 
15
  This is probably the easiest way to add a powerful HTML sitemap to your site!
16
 
@@ -67,6 +67,14 @@ The Plugin can also be installed directly from the main WordPress Plugin page.
67
 
68
  == Changelog ==
69
 
 
 
 
 
 
 
 
 
70
  *1.4.1*
71
 
72
  * Minor updates to Plugin options page, and some internal functions.
4
  Tags: sitemap, html, global, sort, shortcode, pages, posts
5
  Requires at least: 2.7
6
  Tested up to: 3.3.2
7
+ Stable tag: 1.5
8
 
9
  HTML sitemap to display content as a single linked list of posts and pages, or as groups sorted by taxonomy (via a drop-down box).
10
 
11
  == Description ==
12
 
13
+ Note: From version 1.4 you can now exclude pages by ID! This was a commonly requested feature. Also, ALL posts are now listed and are not restricted by the Settings -> Reading value.
14
 
15
  This is probably the easiest way to add a powerful HTML sitemap to your site!
16
 
67
 
68
  == Changelog ==
69
 
70
+ *1.5*
71
+
72
+ * Updated for WordPress 3.5.1.
73
+ * Minor CSS bug fixed.
74
+ * ALL Plugin styles affecting the sitemap have been removed to allow the current theme to control the styles. This enables the sitemap to blend in with the current theme, and allows for easy customisation of the CSS as there are plenty of sitemap classes to hook into.
75
+ * All sitemap content is now listed in a single column to allow for additional listings for CPT to be added later.
76
+ * New Plugin options to show/hide posts or pages.
77
+
78
  *1.4.1*
79
 
80
  * Minor updates to Plugin options page, and some internal functions.
simple-sitemap.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Simple Sitemap
4
  Plugin URI: http://www.presscoders.com/plugins/free-plugins/simple-sitemap/
5
  Description: HTML sitemap to display content as a single linked list of posts and pages, or as groups sorted by taxonomy (via a drop-down box).
6
- Version: 1.41
7
  Author: David Gwyer
8
  Author URI: http://www.presscoders.com
9
  */
@@ -25,29 +25,20 @@ Author URI: http://www.presscoders.com
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
- /* Next Plugin release to do:
29
- - Show all the posts in each category not just the maximum allowed in Settings -> Reading.
30
-
31
- */
32
-
33
- /* Future to do:
34
  - Be able to sort ascending/descending in addition to the sort drop down options for each list.
35
- - Have styling (in Plugins options page textarea?) to control sitemap rendering.
36
- - Add all in-line styles to external style sheet.
37
  - Options to display custom post types, with ability to show which custom post types to display or not display, and in what order?
38
- - Check which pages the simple-sitemap css is loaded. Don't really want it showing on pages that are not sitemap pages. It's being loaded on all pages currently?
39
  - Consider adding a drop down in Plugin options to show the page hierchy as it appears in 'Pages' (i.e. the way it works now), or to show it via a defined custom menu hierarchy.
40
- - Include option to show only posts/or pages.
41
  - Add option to remove certain tags, categories, or posts.
42
- - Add option to include CPT posts underneath.
43
- - Add option to show/hide drop down boxes on sitemap page.
44
  - Use the 'prepare' WP feature when querying the db directly.
 
 
45
  */
46
 
47
  /* wpss_ prefix is derived from [W]ord[P]ress [s]imple [s]itemap. */
48
  add_shortcode('simple-sitemap', 'wpss_gen');
49
  add_filter('query_vars', 'parameter_queryvars' );
50
- add_action('wp_print_styles', 'add_my_stylesheet');
51
 
52
  register_activation_hook(__FILE__, 'wpss_add_defaults');
53
  register_uninstall_hook(__FILE__, 'wpss_delete_plugin_options');
@@ -71,7 +62,9 @@ function wpss_add_defaults() {
71
  $arr = array( "drp_pages_default" => "post_title",
72
  "drp_posts_default" => "title",
73
  "chk_default_options_db" => "0",
74
- "rdo_display_order" => "pages_left",
 
 
75
  "txt_page_ids" => ""
76
  );
77
  update_option( 'wpss_options', $arr );
@@ -80,13 +73,7 @@ function wpss_add_defaults() {
80
 
81
  /* Init plugin options to white list our options. */
82
  function wpss_init(){
83
- /* This is primarily to check newly added options have correct initial values. */
84
- $tmp = get_option('wpss_options');
85
- if(!$tmp['rdo_display_order']) /* Check radio buttons have a starting value. */
86
- {
87
- $tmp["rdo_display_order"] = "pages_left";
88
- update_option('wpss_options', $tmp);
89
- }
90
  register_setting( 'wpss_plugin_options', 'wpss_options', 'wpss_validate_options' );
91
  }
92
 
@@ -107,21 +94,18 @@ function wpss_render_form() {
107
  <div class="wrap">
108
  <div class="icon32" id="icon-options-general"><br></div>
109
  <h2>Simple Sitemap Options</h2>
 
 
 
 
 
110
  <div style="background:#eee;border: 1px dashed #ccc;font-size: 13px;margin: 20px 0 10px 0;padding: 5px 0 5px 8px;">To display the Simple Sitemap on a post/page, enter the following <a href="http://codex.wordpress.org/Shortcode_API" target="_blank">shortcode</a>: <b>[simple-sitemap]</b></div>
111
  <form method="post" action="options.php">
112
  <?php settings_fields('wpss_plugin_options'); ?>
113
  <?php $options = get_option('wpss_options'); ?>
114
  <table class="form-table">
115
- <tr valign="top">
116
- <th scope="row">Content Display Order</th>
117
- <td>
118
- <label><input name="wpss_options[rdo_display_order]" type="radio" value="posts_left" <?php checked('posts_left', $options['rdo_display_order']); ?> /> Display <u>Posts</u> on LHS<span style="margin-left:10px;color: #999;">(with pages on the RHS)</span></label><br />
119
- <label><input name="wpss_options[rdo_display_order]" type="radio" value="pages_left" <?php checked('pages_left', $options['rdo_display_order']); ?> /> Display <u>Pages</u> on LHS<span style="margin-left:10px;color: #999;">(with posts on the RHS)</span></label><br />
120
- </td>
121
- </tr>
122
-
123
  <tr>
124
- <th scope="row">Pages Drop-Down Default</th>
125
  <td>
126
  <select style="width:90px;" name='wpss_options[drp_pages_default]'>
127
  <option value='post_title' <?php selected('post_title', $options['drp_pages_default']); ?>>Title</option>
@@ -132,7 +116,7 @@ function wpss_render_form() {
132
  </tr>
133
 
134
  <tr>
135
- <th scope="row">Posts Drop-Down Default</th>
136
  <td>
137
  <select style="width:90px;" name='wpss_options[drp_posts_default]'>
138
  <option value='title' <?php selected('title', $options['drp_posts_default']); ?>>Title</option>
@@ -151,6 +135,27 @@ function wpss_render_form() {
151
  </td>
152
  </tr>
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  <tr><td colspan="2"><div style="margin-top:10px;"></div></td></tr>
155
 
156
  <tr valign="top" style="border-top:#dddddd 1px solid;">
@@ -165,10 +170,6 @@ function wpss_render_form() {
165
  </p>
166
  </form>
167
 
168
- <div style="margin-top:15px;">
169
- <p style="margin-bottom:10px;">If you use this Plugin on your website <b><em>please</em></b> consider making a <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UUFZZU35RZPW8" target="_blank">donation</a> to support continued development. Thanks.&nbsp;&nbsp;:-)</p>
170
- </div>
171
-
172
  <div style="clear:both;">
173
  <p>
174
  <a href="http://www.facebook.com/PressCoders" title="Our Facebook page" target="_blank"><img src="<?php echo plugins_url(); ?>/simple-sitemap/images/facebook.png" /></a><a href="http://www.twitter.com/dgwyer" title="Follow on Twitter" target="_blank"><img src="<?php echo plugins_url(); ?>/simple-sitemap/images/twitter.png" /></a>&nbsp;<input class="button" style="vertical-align:12px;" type="button" value="Visit Our Site" onClick="window.open('http://www.presscoders.com')">&nbsp;<input class="button" style="vertical-align:12px;" type="button" value="Free Responsive Theme!" onClick="window.open('http://www.presscoders.com/designfolio')">
@@ -199,12 +200,6 @@ function wpss_validate_options($input) {
199
  // *** START - Plugin Core Functions ***
200
  // ***************************************
201
 
202
- function add_my_stylesheet() {
203
- $styleSheet = WP_PLUGIN_URL.'/simple-sitemap/css/ss_style.css';
204
- wp_register_style('myStyleSheets', $styleSheet);
205
- wp_enqueue_style( 'myStyleSheets');
206
- }
207
-
208
  function parameter_queryvars( $qvars ) {
209
  $qvars[] = 'pagesort';
210
  $qvars[] = 'postsort';
@@ -306,20 +301,19 @@ function wpss_gen() {
306
  else if($post_params == 'tags') {
307
  $ptg2 = "selected='selected'";
308
  }
 
309
  ?>
 
310
  <div class="ss_wrapper">
311
- <?php
312
- $opt = get_option('wpss_options');
313
- if($opt['rdo_display_order'] == "pages_left") {
314
- $pages_float = "float:left;";
315
- }
316
- else {
317
- $pages_float = "float:right;";
318
- }
319
- ?>
320
- <div id="ss_pages" style="<?php echo $pages_float ?>">
321
  <h2 class='page_heading'>Pages</h2>
322
 
 
 
323
  <div id="page_drop_down">
324
  <form name="page_drop_form" id="page_drop_form">
325
  <span id="page_dd_label">Show pages by:</span>
@@ -330,6 +324,9 @@ function wpss_gen() {
330
  </select>
331
  </form>
332
  </div>
 
 
 
333
  <?php
334
  if(strpos($page_params, 'post_date') !== false) {
335
  echo '<ul class="page_item_list">';
@@ -366,18 +363,16 @@ function wpss_gen() {
366
  }
367
  ?>
368
  </div><!--ss_pages -->
369
- <div id="ss_content_sep"></div>
370
- <?php
371
- $opt = get_option('wpss_options');
372
- if($opt['rdo_display_order'] == "pages_left") {
373
- $posts_float = "float:right;";
374
- }
375
- else {
376
- $posts_float = "float:left;";
377
- }
378
- ?>
379
- <div id="ss_posts" style="<?php echo $posts_float ?>">
380
  <h2 class='post_heading'>Posts</h2>
 
 
 
381
  <div id="post_drop_down">
382
  <form name="post_drop_form" id="post_drop_form">
383
  <span id="post_dd_label">Show posts by:</span>
@@ -390,6 +385,9 @@ function wpss_gen() {
390
  </select>
391
  </form>
392
  </div>
 
 
 
393
  <?php
394
  if(strpos($post_params, 'category') !== false) {
395
  $categories = get_categories();
@@ -512,6 +510,9 @@ function wpss_gen() {
512
  }
513
  ?>
514
  </div><!--ss_posts-->
 
 
 
515
  </div>
516
  <?php
517
 
3
  Plugin Name: Simple Sitemap
4
  Plugin URI: http://www.presscoders.com/plugins/free-plugins/simple-sitemap/
5
  Description: HTML sitemap to display content as a single linked list of posts and pages, or as groups sorted by taxonomy (via a drop-down box).
6
+ Version: 1.5
7
  Author: David Gwyer
8
  Author URI: http://www.presscoders.com
9
  */
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
+ /* @todo:
 
 
 
 
 
29
  - Be able to sort ascending/descending in addition to the sort drop down options for each list.
30
+ - Add all Plugin options page in-line styles to external style sheet.
 
31
  - Options to display custom post types, with ability to show which custom post types to display or not display, and in what order?
 
32
  - Consider adding a drop down in Plugin options to show the page hierchy as it appears in 'Pages' (i.e. the way it works now), or to show it via a defined custom menu hierarchy.
 
33
  - Add option to remove certain tags, categories, or posts.
 
 
34
  - Use the 'prepare' WP feature when querying the db directly.
35
+ - Use translation functions _e(), __() etc.
36
+ - Show all the posts in each category not just the maximum allowed in Settings -> Reading.
37
  */
38
 
39
  /* wpss_ prefix is derived from [W]ord[P]ress [s]imple [s]itemap. */
40
  add_shortcode('simple-sitemap', 'wpss_gen');
41
  add_filter('query_vars', 'parameter_queryvars' );
 
42
 
43
  register_activation_hook(__FILE__, 'wpss_add_defaults');
44
  register_uninstall_hook(__FILE__, 'wpss_delete_plugin_options');
62
  $arr = array( "drp_pages_default" => "post_title",
63
  "drp_posts_default" => "title",
64
  "chk_default_options_db" => "0",
65
+ "chk_show_dropdowns" => "0",
66
+ "chk_show_pages" => "1",
67
+ "chk_show_posts" => "0",
68
  "txt_page_ids" => ""
69
  );
70
  update_option( 'wpss_options', $arr );
73
 
74
  /* Init plugin options to white list our options. */
75
  function wpss_init(){
76
+
 
 
 
 
 
 
77
  register_setting( 'wpss_plugin_options', 'wpss_options', 'wpss_validate_options' );
78
  }
79
 
94
  <div class="wrap">
95
  <div class="icon32" id="icon-options-general"><br></div>
96
  <h2>Simple Sitemap Options</h2>
97
+
98
+ <div style="margin-top:15px;">
99
+ <p style="margin-bottom:10px;">Note: This is a FREE Plugin. If you use it on your website <b>please</b> consider making a <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UUFZZU35RZPW8" target="_blank">donation</a> to support continued development.</p>
100
+ </div>
101
+
102
  <div style="background:#eee;border: 1px dashed #ccc;font-size: 13px;margin: 20px 0 10px 0;padding: 5px 0 5px 8px;">To display the Simple Sitemap on a post/page, enter the following <a href="http://codex.wordpress.org/Shortcode_API" target="_blank">shortcode</a>: <b>[simple-sitemap]</b></div>
103
  <form method="post" action="options.php">
104
  <?php settings_fields('wpss_plugin_options'); ?>
105
  <?php $options = get_option('wpss_options'); ?>
106
  <table class="form-table">
 
 
 
 
 
 
 
 
107
  <tr>
108
+ <th scope="row">Pages Default List Type</th>
109
  <td>
110
  <select style="width:90px;" name='wpss_options[drp_pages_default]'>
111
  <option value='post_title' <?php selected('post_title', $options['drp_pages_default']); ?>>Title</option>
116
  </tr>
117
 
118
  <tr>
119
+ <th scope="row">Posts Default List Type</th>
120
  <td>
121
  <select style="width:90px;" name='wpss_options[drp_posts_default]'>
122
  <option value='title' <?php selected('title', $options['drp_posts_default']); ?>>Title</option>
135
  </td>
136
  </tr>
137
 
138
+ <tr>
139
+ <th scope="row">Sitemap Drop Down Boxes</th>
140
+ <td>
141
+ <label><input name="wpss_options[chk_show_dropdowns]" type="checkbox" value="1" <?php if (isset($options['chk_show_dropdowns'])) { checked('1', $options['chk_show_dropdowns']); } ?> /> Display drop down boxes on front end sitemap?</label>
142
+ </td>
143
+ </tr>
144
+
145
+ <tr>
146
+ <th scope="row">Show Pages</th>
147
+ <td>
148
+ <label><input name="wpss_options[chk_show_pages]" type="checkbox" value="1" <?php if (isset($options['chk_show_pages'])) { checked('1', $options['chk_show_pages']); } ?> /> Display pages on front end sitemap?</label>
149
+ </td>
150
+ </tr>
151
+
152
+ <tr>
153
+ <th scope="row">Show Posts</th>
154
+ <td>
155
+ <label><input name="wpss_options[chk_show_posts]" type="checkbox" value="1" <?php if (isset($options['chk_show_posts'])) { checked('1', $options['chk_show_posts']); } ?> /> Display posts on front end sitemap?</label>
156
+ </td>
157
+ </tr>
158
+
159
  <tr><td colspan="2"><div style="margin-top:10px;"></div></td></tr>
160
 
161
  <tr valign="top" style="border-top:#dddddd 1px solid;">
170
  </p>
171
  </form>
172
 
 
 
 
 
173
  <div style="clear:both;">
174
  <p>
175
  <a href="http://www.facebook.com/PressCoders" title="Our Facebook page" target="_blank"><img src="<?php echo plugins_url(); ?>/simple-sitemap/images/facebook.png" /></a><a href="http://www.twitter.com/dgwyer" title="Follow on Twitter" target="_blank"><img src="<?php echo plugins_url(); ?>/simple-sitemap/images/twitter.png" /></a>&nbsp;<input class="button" style="vertical-align:12px;" type="button" value="Visit Our Site" onClick="window.open('http://www.presscoders.com')">&nbsp;<input class="button" style="vertical-align:12px;" type="button" value="Free Responsive Theme!" onClick="window.open('http://www.presscoders.com/designfolio')">
200
  // *** START - Plugin Core Functions ***
201
  // ***************************************
202
 
 
 
 
 
 
 
203
  function parameter_queryvars( $qvars ) {
204
  $qvars[] = 'pagesort';
205
  $qvars[] = 'postsort';
301
  else if($post_params == 'tags') {
302
  $ptg2 = "selected='selected'";
303
  }
304
+
305
  ?>
306
+
307
  <div class="ss_wrapper">
308
+
309
+ <?php if(isset($opt['chk_show_pages']) && $opt['chk_show_pages']) : ?>
310
+
311
+ <div id="ss_pages">
312
+
 
 
 
 
 
313
  <h2 class='page_heading'>Pages</h2>
314
 
315
+ <?php if(isset($opt['chk_show_dropdowns']) && $opt['chk_show_dropdowns']) : ?>
316
+
317
  <div id="page_drop_down">
318
  <form name="page_drop_form" id="page_drop_form">
319
  <span id="page_dd_label">Show pages by:</span>
324
  </select>
325
  </form>
326
  </div>
327
+
328
+ <?php endif; ?>
329
+
330
  <?php
331
  if(strpos($page_params, 'post_date') !== false) {
332
  echo '<ul class="page_item_list">';
363
  }
364
  ?>
365
  </div><!--ss_pages -->
366
+
367
+ <?php endif; ?>
368
+
369
+ <?php if(isset($opt['chk_show_posts']) && $opt['chk_show_posts']) : ?>
370
+
371
+ <div id="ss_posts">
 
 
 
 
 
372
  <h2 class='post_heading'>Posts</h2>
373
+
374
+ <?php if(isset($opt['chk_show_dropdowns']) && $opt['chk_show_dropdowns']) : ?>
375
+
376
  <div id="post_drop_down">
377
  <form name="post_drop_form" id="post_drop_form">
378
  <span id="post_dd_label">Show posts by:</span>
385
  </select>
386
  </form>
387
  </div>
388
+
389
+ <?php endif; ?>
390
+
391
  <?php
392
  if(strpos($post_params, 'category') !== false) {
393
  $categories = get_categories();
510
  }
511
  ?>
512
  </div><!--ss_posts-->
513
+
514
+ <?php endif; ?>
515
+
516
  </div>
517
  <?php
518