Plugin Directory

Changeset 1087099


Ignore:
Timestamp:
02/11/2015 12:33:34 PM (10 years ago)
Author:
benohead
Message:

tagging version 0.3

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  
    44Plugin URI:  https://wordpress.org/plugins/wp-site-mapping/
    55Description: 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.2
     6Version:     0.3
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-site-mapping/tags/0.3/classes/wp-site-mapping.php

    r973585 r1087099  
    2424         *
    2525         */
    26         const VERSION = '0.2.2';
     26        const VERSION = '0.3';
    2727        /**
    2828         *
     
    236236            $instance['options-depth'] = isset($_GET['depth']) ? intval($_GET['depth']) : 10;
    237237            $instance['options-group'] = isset($_GET['group']) ? $_GET['group'] : 'title';
     238            $instance['options-reverse'] = isset($_GET['reverse']) ? intval($_GET['reverse']) : 0;
    238239            $instance['options-link'] = isset($_GET['link']) ? $_GET['link'] : '<a title="%title%" href="%permalink%">%title%</a>';
    239240            $instance['options-inc-exc'] = isset($_GET['exclude']) ? intval($_GET['exclude']) : 0;
     
    263264                'options-depth' => 'depth',
    264265                'options-group' => 'group',
     266                'options-reverse' => 'reverse',
    265267                'options-link' => 'link',
    266268                'options-inc-exc' => 'exclude',
     
    286288                'options-user' => 'aut',
    287289                'options-depth' => 'depth',
     290                'options-reverse' => 'reverse',
    288291                'options-group' => 'group',
    289292                'options-link' => 'link',
     
    343346                'depth' => 10,
    344347                'group' => 'title',
     348                'reverse' => 0,
    345349                'link' => '<a title="%title%" href="%permalink%">%title%</a>',
    346350                'exclude' => 0,
     
    359363            $instance['options-depth'] = $depth;
    360364            $instance['options-group'] = $group;
     365            $instance['options-reverse'] = $reverse;
    361366            $instance['options-link'] = html_entity_decode(html_entity_decode($link));
    362367            $instance['options-inc-exc'] = $exclude;
     
    373378                $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);
    374379                $count = count($my_posts);
    375                 error_log("grouponly=$grouponly");
    376380                if ($count > 0 && $grouponly != 1) {
    377381                    $site_map .= "<ul id='sitemap_list_$current_post_id' class='sitemap_depth_$depth'>\n";
     
    472476
    473477            if (!empty($order_by)) {
    474                 $query .= "ORDER BY $order_by ASC ";
     478                $query .= "ORDER BY $order_by";
    475479            }
    476480
  • wp-site-mapping/tags/0.3/classes/wpsm-widget.php

    r971242 r1087099  
    3737            'options-depth' => 10,
    3838            'options-group' => '',
     39            'options-reverse' => 0,
    3940            'options-link' => '<a title="%title%" href="%permalink%">%title%</a>',
    4041            'options-inc-exc' => 0,
     
    9596        $instance['options-depth'] = $new_instance['options-depth'];
    9697        $instance['options-group'] = $new_instance['options-group'];
     98        $instance['options-reverse'] = $new_instance['options-reverse'];
    9799        $instance['options-link'] = (!empty($new_instance['options-link'])) ? $new_instance['options-link'] : '<a title="%title%" href="%permalink%">%title%</a>';
    98100        $instance['options-inc-exc'] = $new_instance['options-inc-exc'];
  • wp-site-mapping/tags/0.3/javascript/shortcode.js

    r973585 r1087099  
    284284                    $wpsm_group = v.wpsm_group;
    285285                    $wpsm_link = v.wpsm_link;
     286                    $wpsm_reverse = v.wpsm_reverse;
    286287                    $wpsm_exclude = v.wpsm_exclude;
    287288                    $wpsm_grouponly = v.wpsm_grouponly;
     
    298299                    if ($wpsm_link) $templateurl += "&link=" + window.encodeURIComponent($wpsm_link);
    299300                    if ($wpsm_exclude) $templateurl += "&exclude=" + window.encodeURIComponent($wpsm_exclude);
     301                    if ($wpsm_reverse) $templateurl += "&reverse=" + window.encodeURIComponent($wpsm_reverse);
    300302                    if ($wpsm_grouponly) $templateurl += "&grouponly=" + window.encodeURIComponent($wpsm_grouponly);
    301303                    if ($wpsm_class) $templateurl += "&class=" + window.encodeURIComponent($wpsm_class);
     
    333335                                    var $exclude = jQuery('.mce-container-body iframe').contents().find('#exclude').prop('checked') ? 1 : 0;
    334336                                    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;
    335339                                    var $grouponly = jQuery('.mce-container-body iframe').contents().find('#grouponly').prop('checked') ? 1 : 0;
    336340                                    if ($grouponly != null) $code = $code + ' grouponly=' + $grouponly;
     
    384388                        wpsm_group: getAttrNoDecodeNoQuote(title, 'group'),
    385389                        wpsm_link: getAttrNoDecode(title, 'link'),
     390                        wpsm_reverse: getAttrNoDecodeNoQuote(title, 'reverse'),
    386391                        wpsm_exclude: getAttrNoDecodeNoQuote(title, 'exclude'),
    387392                        wpsm_grouponly: getAttrNoDecodeNoQuote(title, 'grouponly'),
  • wp-site-mapping/tags/0.3/readme.txt

    r1087098 r1087099  
    55Requires at least: 3.9
    66Tested up to: 3.9.2
    7 Stable tag: 0.2.2
     7Stable tag: 0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9999== Changelog ==
    100100
     101= 0.3 =
     102
     103* Support for reverse order sorting
     104
    101105= 0.2.2 =
    102106
  • wp-site-mapping/tags/0.3/views/wpsm-settings/widget-settings-fields.php

    r971242 r1087099  
    3333        <option value="tag" <?php selected($instance['options-group'], 'tag'); ?>>Tag</option>
    3434    </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']) ?>/>
    3542</p>
    3643<p>
  • wp-site-mapping/tags/0.3/views/wpsm-widget/widget.php

    r971242 r1087099  
    11<?php
    2 error_log("instance=".print_r($instance, true));
    3 
    42$title = apply_filters('widget_title', $instance['title']);
    53echo $args['before_widget'];
     
    9694}
    9795
     96if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) {
     97    $order_by = $order_by . " DESC";
     98}
     99
    98100switch ($group_by) {
    99101    case '':
     
    102104        break;
    103105    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);
    105111        ?>
    106112        <ul class="sitemap_list_users">
     
    128134    case 'category':
    129135        $categories = get_terms('category');
     136        if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) {
     137            $categories = array_reverse($categories);
     138        }
    130139        ?>
    131140        <ul class="sitemap_list_categories">
     
    153162    case 'tag':
    154163        $tags = get_terms('post_tag');
     164        if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) {
     165            $tags = array_reverse($tags);
     166        }
    155167        ?>
    156168        <ul class="sitemap_list_tags">
     
    178190    case 'date':
    179191        $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        }
    180195        ?>
    181196        <ul class="sitemap_list_tags">
  • wp-site-mapping/trunk/bootstrap.php

    r973585 r1087099  
    44Plugin URI:  https://wordpress.org/plugins/wp-site-mapping/
    55Description: 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.2
     6Version:     0.3
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-site-mapping/trunk/classes/wp-site-mapping.php

    r973585 r1087099  
    2424         *
    2525         */
    26         const VERSION = '0.2.2';
     26        const VERSION = '0.3';
    2727        /**
    2828         *
     
    236236            $instance['options-depth'] = isset($_GET['depth']) ? intval($_GET['depth']) : 10;
    237237            $instance['options-group'] = isset($_GET['group']) ? $_GET['group'] : 'title';
     238            $instance['options-reverse'] = isset($_GET['reverse']) ? intval($_GET['reverse']) : 0;
    238239            $instance['options-link'] = isset($_GET['link']) ? $_GET['link'] : '<a title="%title%" href="%permalink%">%title%</a>';
    239240            $instance['options-inc-exc'] = isset($_GET['exclude']) ? intval($_GET['exclude']) : 0;
     
    263264                'options-depth' => 'depth',
    264265                'options-group' => 'group',
     266                'options-reverse' => 'reverse',
    265267                'options-link' => 'link',
    266268                'options-inc-exc' => 'exclude',
     
    286288                'options-user' => 'aut',
    287289                'options-depth' => 'depth',
     290                'options-reverse' => 'reverse',
    288291                'options-group' => 'group',
    289292                'options-link' => 'link',
     
    343346                'depth' => 10,
    344347                'group' => 'title',
     348                'reverse' => 0,
    345349                'link' => '<a title="%title%" href="%permalink%">%title%</a>',
    346350                'exclude' => 0,
     
    359363            $instance['options-depth'] = $depth;
    360364            $instance['options-group'] = $group;
     365            $instance['options-reverse'] = $reverse;
    361366            $instance['options-link'] = html_entity_decode(html_entity_decode($link));
    362367            $instance['options-inc-exc'] = $exclude;
     
    373378                $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);
    374379                $count = count($my_posts);
    375                 error_log("grouponly=$grouponly");
    376380                if ($count > 0 && $grouponly != 1) {
    377381                    $site_map .= "<ul id='sitemap_list_$current_post_id' class='sitemap_depth_$depth'>\n";
     
    472476
    473477            if (!empty($order_by)) {
    474                 $query .= "ORDER BY $order_by ASC ";
     478                $query .= "ORDER BY $order_by";
    475479            }
    476480
  • wp-site-mapping/trunk/classes/wpsm-widget.php

    r971242 r1087099  
    3737            'options-depth' => 10,
    3838            'options-group' => '',
     39            'options-reverse' => 0,
    3940            'options-link' => '<a title="%title%" href="%permalink%">%title%</a>',
    4041            'options-inc-exc' => 0,
     
    9596        $instance['options-depth'] = $new_instance['options-depth'];
    9697        $instance['options-group'] = $new_instance['options-group'];
     98        $instance['options-reverse'] = $new_instance['options-reverse'];
    9799        $instance['options-link'] = (!empty($new_instance['options-link'])) ? $new_instance['options-link'] : '<a title="%title%" href="%permalink%">%title%</a>';
    98100        $instance['options-inc-exc'] = $new_instance['options-inc-exc'];
  • wp-site-mapping/trunk/javascript/shortcode.js

    r973585 r1087099  
    284284                    $wpsm_group = v.wpsm_group;
    285285                    $wpsm_link = v.wpsm_link;
     286                    $wpsm_reverse = v.wpsm_reverse;
    286287                    $wpsm_exclude = v.wpsm_exclude;
    287288                    $wpsm_grouponly = v.wpsm_grouponly;
     
    298299                    if ($wpsm_link) $templateurl += "&link=" + window.encodeURIComponent($wpsm_link);
    299300                    if ($wpsm_exclude) $templateurl += "&exclude=" + window.encodeURIComponent($wpsm_exclude);
     301                    if ($wpsm_reverse) $templateurl += "&reverse=" + window.encodeURIComponent($wpsm_reverse);
    300302                    if ($wpsm_grouponly) $templateurl += "&grouponly=" + window.encodeURIComponent($wpsm_grouponly);
    301303                    if ($wpsm_class) $templateurl += "&class=" + window.encodeURIComponent($wpsm_class);
     
    333335                                    var $exclude = jQuery('.mce-container-body iframe').contents().find('#exclude').prop('checked') ? 1 : 0;
    334336                                    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;
    335339                                    var $grouponly = jQuery('.mce-container-body iframe').contents().find('#grouponly').prop('checked') ? 1 : 0;
    336340                                    if ($grouponly != null) $code = $code + ' grouponly=' + $grouponly;
     
    384388                        wpsm_group: getAttrNoDecodeNoQuote(title, 'group'),
    385389                        wpsm_link: getAttrNoDecode(title, 'link'),
     390                        wpsm_reverse: getAttrNoDecodeNoQuote(title, 'reverse'),
    386391                        wpsm_exclude: getAttrNoDecodeNoQuote(title, 'exclude'),
    387392                        wpsm_grouponly: getAttrNoDecodeNoQuote(title, 'grouponly'),
  • wp-site-mapping/trunk/readme.txt

    r973585 r1087099  
    55Requires at least: 3.9
    66Tested up to: 3.9.2
    7 Stable tag: 0.2.2
     7Stable tag: 0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9999== Changelog ==
    100100
     101= 0.3 =
     102
     103* Support for reverse order sorting
     104
    101105= 0.2.2 =
    102106
  • wp-site-mapping/trunk/views/wpsm-settings/widget-settings-fields.php

    r971242 r1087099  
    3333        <option value="tag" <?php selected($instance['options-group'], 'tag'); ?>>Tag</option>
    3434    </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']) ?>/>
    3542</p>
    3643<p>
  • wp-site-mapping/trunk/views/wpsm-widget/widget.php

    r971242 r1087099  
    11<?php
    2 error_log("instance=".print_r($instance, true));
    3 
    42$title = apply_filters('widget_title', $instance['title']);
    53echo $args['before_widget'];
     
    9694}
    9795
     96if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) {
     97    $order_by = $order_by . " DESC";
     98}
     99
    98100switch ($group_by) {
    99101    case '':
     
    102104        break;
    103105    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);
    105111        ?>
    106112        <ul class="sitemap_list_users">
     
    128134    case 'category':
    129135        $categories = get_terms('category');
     136        if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) {
     137            $categories = array_reverse($categories);
     138        }
    130139        ?>
    131140        <ul class="sitemap_list_categories">
     
    153162    case 'tag':
    154163        $tags = get_terms('post_tag');
     164        if (isset($instance['options-reverse']) && $instance['options-reverse'] == 1) {
     165            $tags = array_reverse($tags);
     166        }
    155167        ?>
    156168        <ul class="sitemap_list_tags">
     
    178190    case 'date':
    179191        $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        }
    180195        ?>
    181196        <ul class="sitemap_list_tags">
Note: See TracChangeset for help on using the changeset viewer.