Changeset 1087099
- Timestamp:
- 02/11/2015 12:33:34 PM (10 years ago)
- Location:
- wp-site-mapping
- Files:
-
- 1 added
- 12 edited
- 14 copied
Legend:
- Unmodified
- Added
- Removed
-
wp-site-mapping/tags/0.3/bootstrap.php
r1087098 r1087099 4 4 Plugin URI: https://wordpress.org/plugins/wp-site-mapping/ 5 5 Description: Add one or multiple HTML sitemaps to your site by using a shortcode, calling a PHP function or using a widget with this flexible and easy to use plugin. 6 Version: 0. 2.26 Version: 0.3 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-site-mapping/tags/0.3/classes/wp-site-mapping.php
r973585 r1087099 24 24 * 25 25 */ 26 const VERSION = '0. 2.2';26 const VERSION = '0.3'; 27 27 /** 28 28 * … … 236 236 $instance['options-depth'] = isset($_GET['depth']) ? intval($_GET['depth']) : 10; 237 237 $instance['options-group'] = isset($_GET['group']) ? $_GET['group'] : 'title'; 238 $instance['options-reverse'] = isset($_GET['reverse']) ? intval($_GET['reverse']) : 0; 238 239 $instance['options-link'] = isset($_GET['link']) ? $_GET['link'] : '<a title="%title%" href="%permalink%">%title%</a>'; 239 240 $instance['options-inc-exc'] = isset($_GET['exclude']) ? intval($_GET['exclude']) : 0; … … 263 264 'options-depth' => 'depth', 264 265 'options-group' => 'group', 266 'options-reverse' => 'reverse', 265 267 'options-link' => 'link', 266 268 'options-inc-exc' => 'exclude', … … 286 288 'options-user' => 'aut', 287 289 'options-depth' => 'depth', 290 'options-reverse' => 'reverse', 288 291 'options-group' => 'group', 289 292 'options-link' => 'link', … … 343 346 'depth' => 10, 344 347 'group' => 'title', 348 'reverse' => 0, 345 349 'link' => '<a title="%title%" href="%permalink%">%title%</a>', 346 350 'exclude' => 0, … … 359 363 $instance['options-depth'] = $depth; 360 364 $instance['options-group'] = $group; 365 $instance['options-reverse'] = $reverse; 361 366 $instance['options-link'] = html_entity_decode(html_entity_decode($link)); 362 367 $instance['options-inc-exc'] = $exclude; … … 373 378 $my_posts = $this->get_post_descendants($current_post_id, $exclude, $options_post_id, $options_post_type, $options_author, $order_by, $add_where, $add_join, $options_category, $options_tag); 374 379 $count = count($my_posts); 375 error_log("grouponly=$grouponly");376 380 if ($count > 0 && $grouponly != 1) { 377 381 $site_map .= "<ul id='sitemap_list_$current_post_id' class='sitemap_depth_$depth'>\n"; … … 472 476 473 477 if (!empty($order_by)) { 474 $query .= "ORDER BY $order_by ASC";478 $query .= "ORDER BY $order_by"; 475 479 } 476 480 -
wp-site-mapping/tags/0.3/classes/wpsm-widget.php
r971242 r1087099 37 37 'options-depth' => 10, 38 38 'options-group' => '', 39 'options-reverse' => 0, 39 40 'options-link' => '<a title="%title%" href="%permalink%">%title%</a>', 40 41 'options-inc-exc' => 0, … … 95 96 $instance['options-depth'] = $new_instance['options-depth']; 96 97 $instance['options-group'] = $new_instance['options-group']; 98 $instance['options-reverse'] = $new_instance['options-reverse']; 97 99 $instance['options-link'] = (!empty($new_instance['options-link'])) ? $new_instance['options-link'] : '<a title="%title%" href="%permalink%">%title%</a>'; 98 100 $instance['options-inc-exc'] = $new_instance['options-inc-exc']; -
wp-site-mapping/tags/0.3/javascript/shortcode.js
r973585 r1087099 284 284 $wpsm_group = v.wpsm_group; 285 285 $wpsm_link = v.wpsm_link; 286 $wpsm_reverse = v.wpsm_reverse; 286 287 $wpsm_exclude = v.wpsm_exclude; 287 288 $wpsm_grouponly = v.wpsm_grouponly; … … 298 299 if ($wpsm_link) $templateurl += "&link=" + window.encodeURIComponent($wpsm_link); 299 300 if ($wpsm_exclude) $templateurl += "&exclude=" + window.encodeURIComponent($wpsm_exclude); 301 if ($wpsm_reverse) $templateurl += "&reverse=" + window.encodeURIComponent($wpsm_reverse); 300 302 if ($wpsm_grouponly) $templateurl += "&grouponly=" + window.encodeURIComponent($wpsm_grouponly); 301 303 if ($wpsm_class) $templateurl += "&class=" + window.encodeURIComponent($wpsm_class); … … 333 335 var $exclude = jQuery('.mce-container-body iframe').contents().find('#exclude').prop('checked') ? 1 : 0; 334 336 if ($exclude != null) $code = $code + ' exclude=' + $exclude; 337 var $reverse = jQuery('.mce-container-body iframe').contents().find('#reverse').prop('checked') ? 1 : 0; 338 if ($reverse != null) $code = $code + ' reverse=' + $reverse; 335 339 var $grouponly = jQuery('.mce-container-body iframe').contents().find('#grouponly').prop('checked') ? 1 : 0; 336 340 if ($grouponly != null) $code = $code + ' grouponly=' + $grouponly; … … 384 388 wpsm_group: getAttrNoDecodeNoQuote(title, 'group'), 385 389 wpsm_link: getAttrNoDecode(title, 'link'), 390 wpsm_reverse: getAttrNoDecodeNoQuote(title, 'reverse'), 386 391 wpsm_exclude: getAttrNoDecodeNoQuote(title, 'exclude'), 387 392 wpsm_grouponly: getAttrNoDecodeNoQuote(title, 'grouponly'), -
wp-site-mapping/tags/0.3/readme.txt
r1087098 r1087099 5 5 Requires at least: 3.9 6 6 Tested up to: 3.9.2 7 Stable tag: 0. 2.27 Stable tag: 0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 99 99 == Changelog == 100 100 101 = 0.3 = 102 103 * Support for reverse order sorting 104 101 105 = 0.2.2 = 102 106 -
wp-site-mapping/tags/0.3/views/wpsm-settings/widget-settings-fields.php
r971242 r1087099 33 33 <option value="tag" <?php selected($instance['options-group'], 'tag'); ?>>Tag</option> 34 34 </select> 35 </p> 36 <p> 37 <label 38 for="<?php echo $widget->get_field_id('options-reverse'); ?>"><?php _e('Reverse order:'); ?></label> 39 <input type="checkbox" name="<?php echo $widget->get_field_name('options-reverse'); ?>" 40 id="<?php echo $widget->get_field_id('options-reverse'); ?>" 41 value="1" <?php checked(1, $instance['options-reverse']) ?>/> 35 42 </p> 36 43 <p> -
wp-site-mapping/tags/0.3/views/wpsm-widget/widget.php
r971242 r1087099 1 1 <?php 2 error_log("instance=".print_r($instance, true));3 4 2 $title = apply_filters('widget_title', $instance['title']); 5 3 echo $args['before_widget']; … … 96 94 } 97 95 96 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 97 $order_by = $order_by . " DESC"; 98 } 99 98 100 switch ($group_by) { 99 101 case '': … … 102 104 break; 103 105 case 'author': 104 $allUsers = get_users('orderby=display_name&order=ASC'); 106 $order="ASC"; 107 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 108 $order="DESC"; 109 } 110 $allUsers = get_users('orderby=display_name&order='.$order); 105 111 ?> 106 112 <ul class="sitemap_list_users"> … … 128 134 case 'category': 129 135 $categories = get_terms('category'); 136 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 137 $categories = array_reverse($categories); 138 } 130 139 ?> 131 140 <ul class="sitemap_list_categories"> … … 153 162 case 'tag': 154 163 $tags = get_terms('post_tag'); 164 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 165 $tags = array_reverse($tags); 166 } 155 167 ?> 156 168 <ul class="sitemap_list_tags"> … … 178 190 case 'date': 179 191 $post_dates = WordPress_Site_Mapping::get_instance()->get_post_dates(); 192 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 193 $post_dates = array_reverse($post_dates); 194 } 180 195 ?> 181 196 <ul class="sitemap_list_tags"> -
wp-site-mapping/trunk/bootstrap.php
r973585 r1087099 4 4 Plugin URI: https://wordpress.org/plugins/wp-site-mapping/ 5 5 Description: Add one or multiple HTML sitemaps to your site by using a shortcode, calling a PHP function or using a widget with this flexible and easy to use plugin. 6 Version: 0. 2.26 Version: 0.3 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-site-mapping/trunk/classes/wp-site-mapping.php
r973585 r1087099 24 24 * 25 25 */ 26 const VERSION = '0. 2.2';26 const VERSION = '0.3'; 27 27 /** 28 28 * … … 236 236 $instance['options-depth'] = isset($_GET['depth']) ? intval($_GET['depth']) : 10; 237 237 $instance['options-group'] = isset($_GET['group']) ? $_GET['group'] : 'title'; 238 $instance['options-reverse'] = isset($_GET['reverse']) ? intval($_GET['reverse']) : 0; 238 239 $instance['options-link'] = isset($_GET['link']) ? $_GET['link'] : '<a title="%title%" href="%permalink%">%title%</a>'; 239 240 $instance['options-inc-exc'] = isset($_GET['exclude']) ? intval($_GET['exclude']) : 0; … … 263 264 'options-depth' => 'depth', 264 265 'options-group' => 'group', 266 'options-reverse' => 'reverse', 265 267 'options-link' => 'link', 266 268 'options-inc-exc' => 'exclude', … … 286 288 'options-user' => 'aut', 287 289 'options-depth' => 'depth', 290 'options-reverse' => 'reverse', 288 291 'options-group' => 'group', 289 292 'options-link' => 'link', … … 343 346 'depth' => 10, 344 347 'group' => 'title', 348 'reverse' => 0, 345 349 'link' => '<a title="%title%" href="%permalink%">%title%</a>', 346 350 'exclude' => 0, … … 359 363 $instance['options-depth'] = $depth; 360 364 $instance['options-group'] = $group; 365 $instance['options-reverse'] = $reverse; 361 366 $instance['options-link'] = html_entity_decode(html_entity_decode($link)); 362 367 $instance['options-inc-exc'] = $exclude; … … 373 378 $my_posts = $this->get_post_descendants($current_post_id, $exclude, $options_post_id, $options_post_type, $options_author, $order_by, $add_where, $add_join, $options_category, $options_tag); 374 379 $count = count($my_posts); 375 error_log("grouponly=$grouponly");376 380 if ($count > 0 && $grouponly != 1) { 377 381 $site_map .= "<ul id='sitemap_list_$current_post_id' class='sitemap_depth_$depth'>\n"; … … 472 476 473 477 if (!empty($order_by)) { 474 $query .= "ORDER BY $order_by ASC";478 $query .= "ORDER BY $order_by"; 475 479 } 476 480 -
wp-site-mapping/trunk/classes/wpsm-widget.php
r971242 r1087099 37 37 'options-depth' => 10, 38 38 'options-group' => '', 39 'options-reverse' => 0, 39 40 'options-link' => '<a title="%title%" href="%permalink%">%title%</a>', 40 41 'options-inc-exc' => 0, … … 95 96 $instance['options-depth'] = $new_instance['options-depth']; 96 97 $instance['options-group'] = $new_instance['options-group']; 98 $instance['options-reverse'] = $new_instance['options-reverse']; 97 99 $instance['options-link'] = (!empty($new_instance['options-link'])) ? $new_instance['options-link'] : '<a title="%title%" href="%permalink%">%title%</a>'; 98 100 $instance['options-inc-exc'] = $new_instance['options-inc-exc']; -
wp-site-mapping/trunk/javascript/shortcode.js
r973585 r1087099 284 284 $wpsm_group = v.wpsm_group; 285 285 $wpsm_link = v.wpsm_link; 286 $wpsm_reverse = v.wpsm_reverse; 286 287 $wpsm_exclude = v.wpsm_exclude; 287 288 $wpsm_grouponly = v.wpsm_grouponly; … … 298 299 if ($wpsm_link) $templateurl += "&link=" + window.encodeURIComponent($wpsm_link); 299 300 if ($wpsm_exclude) $templateurl += "&exclude=" + window.encodeURIComponent($wpsm_exclude); 301 if ($wpsm_reverse) $templateurl += "&reverse=" + window.encodeURIComponent($wpsm_reverse); 300 302 if ($wpsm_grouponly) $templateurl += "&grouponly=" + window.encodeURIComponent($wpsm_grouponly); 301 303 if ($wpsm_class) $templateurl += "&class=" + window.encodeURIComponent($wpsm_class); … … 333 335 var $exclude = jQuery('.mce-container-body iframe').contents().find('#exclude').prop('checked') ? 1 : 0; 334 336 if ($exclude != null) $code = $code + ' exclude=' + $exclude; 337 var $reverse = jQuery('.mce-container-body iframe').contents().find('#reverse').prop('checked') ? 1 : 0; 338 if ($reverse != null) $code = $code + ' reverse=' + $reverse; 335 339 var $grouponly = jQuery('.mce-container-body iframe').contents().find('#grouponly').prop('checked') ? 1 : 0; 336 340 if ($grouponly != null) $code = $code + ' grouponly=' + $grouponly; … … 384 388 wpsm_group: getAttrNoDecodeNoQuote(title, 'group'), 385 389 wpsm_link: getAttrNoDecode(title, 'link'), 390 wpsm_reverse: getAttrNoDecodeNoQuote(title, 'reverse'), 386 391 wpsm_exclude: getAttrNoDecodeNoQuote(title, 'exclude'), 387 392 wpsm_grouponly: getAttrNoDecodeNoQuote(title, 'grouponly'), -
wp-site-mapping/trunk/readme.txt
r973585 r1087099 5 5 Requires at least: 3.9 6 6 Tested up to: 3.9.2 7 Stable tag: 0. 2.27 Stable tag: 0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 99 99 == Changelog == 100 100 101 = 0.3 = 102 103 * Support for reverse order sorting 104 101 105 = 0.2.2 = 102 106 -
wp-site-mapping/trunk/views/wpsm-settings/widget-settings-fields.php
r971242 r1087099 33 33 <option value="tag" <?php selected($instance['options-group'], 'tag'); ?>>Tag</option> 34 34 </select> 35 </p> 36 <p> 37 <label 38 for="<?php echo $widget->get_field_id('options-reverse'); ?>"><?php _e('Reverse order:'); ?></label> 39 <input type="checkbox" name="<?php echo $widget->get_field_name('options-reverse'); ?>" 40 id="<?php echo $widget->get_field_id('options-reverse'); ?>" 41 value="1" <?php checked(1, $instance['options-reverse']) ?>/> 35 42 </p> 36 43 <p> -
wp-site-mapping/trunk/views/wpsm-widget/widget.php
r971242 r1087099 1 1 <?php 2 error_log("instance=".print_r($instance, true));3 4 2 $title = apply_filters('widget_title', $instance['title']); 5 3 echo $args['before_widget']; … … 96 94 } 97 95 96 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 97 $order_by = $order_by . " DESC"; 98 } 99 98 100 switch ($group_by) { 99 101 case '': … … 102 104 break; 103 105 case 'author': 104 $allUsers = get_users('orderby=display_name&order=ASC'); 106 $order="ASC"; 107 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 108 $order="DESC"; 109 } 110 $allUsers = get_users('orderby=display_name&order='.$order); 105 111 ?> 106 112 <ul class="sitemap_list_users"> … … 128 134 case 'category': 129 135 $categories = get_terms('category'); 136 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 137 $categories = array_reverse($categories); 138 } 130 139 ?> 131 140 <ul class="sitemap_list_categories"> … … 153 162 case 'tag': 154 163 $tags = get_terms('post_tag'); 164 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 165 $tags = array_reverse($tags); 166 } 155 167 ?> 156 168 <ul class="sitemap_list_tags"> … … 178 190 case 'date': 179 191 $post_dates = WordPress_Site_Mapping::get_instance()->get_post_dates(); 192 if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) { 193 $post_dates = array_reverse($post_dates); 194 } 180 195 ?> 181 196 <ul class="sitemap_list_tags">
Note: See TracChangeset
for help on using the changeset viewer.