Plugin Directory

Changeset 1048157


Ignore:
Timestamp:
12/18/2014 02:09:17 PM (11 years ago)
Author:
benohead
Message:

tagging version 1.4

Location:
wp-category-tag-could
Files:
1 added
12 edited
11 copied

Legend:

Unmodified
Added
Removed
  • wp-category-tag-could/tags/1.4/bootstrap.php

    r1048156 r1048157  
    44Plugin URI:  https://wordpress.org/plugins/wp-category-tag-could/
    55Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories.
    6 Version:     1.3
     6Version:     1.4
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-category-tag-could/tags/1.4/classes/wp-category-tag-cloud.php

    r1045683 r1048157  
    1212        protected $modified_types = array();
    1313
    14         const VERSION = '1.3';
     14        const VERSION = '1.4';
    1515        const PREFIX = 'wpctc_';
    1616        const DEBUG_MODE = false;
  • wp-category-tag-could/tags/1.4/classes/wpctc-widget.php

    r1045683 r1048157  
    162162            $where = $where . " AND posts.post_type IN ('" . implode("','", $instance['post_type']) . "') ";
    163163        }
    164 
     164        if (isset($instance['author']) && count($instance['author']) > 0) {
     165            $where = $where . " AND posts.post_author IN ('" . implode("','", $instance['author']) . "') ";
     166        }
     167
     168        if (isset($instance['post_age']) && (is_int($instance['post_age']) || ctype_digit($instance['post_age'])) && intval($instance['post_age']) > 0) {
     169            $where = $where . " AND posts.post_date > '".date('Y-m-d', strtotime('-' . intval($instance['post_age']) . ' days'))."'";
     170        }
     171
     172        if (isset($instance['post_count']) && (is_int($instance['post_count']) || ctype_digit($instance['post_count'])) && intval($instance['post_count']) > 0) {
     173            $where = $where . " GROUP BY tag_id HAVING count(distinct posts.ID) >= ".intval($instance['post_count']);
     174        }
     175       
    165176        $tags = $wpdb->get_results
    166177        (" SELECT DISTINCT tt2.term_id AS tag_id
     
    178189            $exclude = $this->to_int_array($this->get_exclude_array($instance['exclude']));
    179190        }
    180         error_log("exclude=".print_r($instance['exclude'], true));
    181         error_log("exclude=".print_r($exclude, true));
    182191
    183192        $includeTags = '';
     
    215224            $cloud_args['include'] = $includeTags;
    216225        }
    217 
    218         error_log("cloud_args=".print_r($cloud_args, true));
    219226        ?>
    220227    <div
     
    228235                    data-tagcloud-color="<?php echo $instance['color']; ?>"
    229236                    data-cloud-font=<?php echo !empty($instance['font']) ? '"'.$instance['font'].'"' : "null"; ?>
     237                    data-cloud-radiusx=<?php echo !empty($instance['radiusx']) ? '"'.$instance['radiusx'].'"' : "1"; ?>
     238                    data-cloud-radiusy=<?php echo !empty($instance['radiusy']) ? '"'.$instance['radiusy'].'"' : "1"; ?>
     239                    data-cloud-radiusz=<?php echo !empty($instance['radiusz']) ? '"'.$instance['radiusz'].'"' : "1"; ?>
    230240                    data-cloud-zoom=<?php echo $instance['zoom']; ?>
    231241                <?php echo isset($instance['width']) && is_numeric($instance['width']) && intval($instance['width']) != 0 ? " width='".$instance['width']."'" : ''; ?>
     
    356366        $nofollow = isset($instance['nofollow']) ? $instance['nofollow'] : "0";
    357367        $post_type = isset($instance['post_type']) ? $instance['post_type'] : array();
     368        $author = isset($instance['author']) ? $instance['author'] : array();
    358369        $tag_id = isset($instance['tag_id']) ? $instance['tag_id'] : array();
    359370        $order_by = isset($instance['order_by']) && strlen($instance['order_by']) > 0 ? $instance['order_by'] : 'name';
     
    361372        $format = isset($instance['format']) && strlen($instance['format']) > 0 ? $instance['format'] : 'flat';
    362373        $number = isset($instance['number']) && (is_int($instance['number']) || ctype_digit($instance['number'])) ? $instance['number'] : 0;
     374        $post_age = isset($instance['post_age']) && (is_int($instance['post_age']) || ctype_digit($instance['post_age'])) ? $instance['post_age'] : 0;
     375        $post_count = isset($instance['post_count']) && (is_int($instance['post_count']) || ctype_digit($instance['post_count'])) ? $instance['post_count'] : 0;
    363376        $taxonomy = isset($instance['taxonomy']) && strlen($instance['taxonomy']) > 0 ? $instance['taxonomy'] : 'post_tag';
    364377        $width = isset($instance['width']) && is_numeric($instance['width']) ? $instance['width'] : 0;
    365378        $height = isset($instance['height']) && is_numeric($instance['height']) ? $instance['height'] : 0;
     379        $radiusx = isset($instance['radiusx']) ? $instance['radiusx'] : '1';
     380        $radiusy = isset($instance['radiusy']) ? $instance['radiusy'] : '1';
     381        $radiusz = isset($instance['radiusz']) ? $instance['radiusz'] : '1';
    366382        $zoom = isset($instance['zoom']) && is_numeric($instance['zoom']) ? $instance['zoom'] : 1;
    367383        $timeout = isset($instance['timeout']) && is_numeric($instance['timeout']) ? $instance['timeout'] : 60;
     
    407423                   name="<?php echo $this->get_field_name('exclude'); ?>" type="text"
    408424                   value="<?php echo esc_attr($exclude); ?>"/>
     425            <small><em><?php _e('comma separated list of term IDs'); ?></em></small>
    409426        </p>
    410427        <p>
     
    414431                   value="<?php echo esc_attr($number); ?>"/>
    415432            <small><em><?php _e('0 means display all'); ?></em></small>
     433        </p>
     434        <p>
     435            <label for="<?php echo $this->get_field_id('post_age'); ?>"><?php _e('Max post age in days:'); ?></label>
     436            <input class="widefat" id="<?php echo $this->get_field_id('post_age'); ?>"
     437                   name="<?php echo $this->get_field_name('post_age'); ?>" type="text"
     438                   value="<?php echo esc_attr($post_age); ?>"/>
     439            <small><em><?php _e('0 means display all'); ?></em></small>
     440        </p>
     441        <p>
     442            <label for="<?php echo $this->get_field_id('post_count'); ?>"><?php _e('Min number of posts:'); ?></label>
     443            <input class="widefat" id="<?php echo $this->get_field_id('post_count'); ?>"
     444                   name="<?php echo $this->get_field_name('post_count'); ?>" type="text"
     445                   value="<?php echo esc_attr($post_count); ?>"/>
     446            <small><em><?php _e('0 returns the same as 1'); ?></em></small>
     447        </p>
     448        <p>
     449            <label for="<?php echo $this->get_field_id('author'); ?>"><?php _e('Post authors:'); ?></label><br/>
     450            <select id="<?php echo $this->get_field_id('author'); ?>"
     451                    name="<?php echo $this->get_field_name('author'); ?>[]" size=3 multiple="multiple"
     452                    class="widefat"
     453                    style="height: auto;">
     454                <?php
     455                $allUsers = get_users('orderby=post_count&order=DESC');
     456                $authors = array();
     457                // Remove subscribers from the list as they won't write any articles
     458                foreach ($allUsers as $currentUser) {
     459                    if (!in_array('subscriber', $currentUser->roles)) {
     460                        $authors[] = $currentUser;
     461                    }
     462                }
     463                if ($authors) {
     464                    foreach ($authors as $aut) {
     465                        $label = esc_html($aut->display_name);
     466                        ?>
     467                        <option value="<?php echo($aut->ID); ?>"
     468                        <?php
     469                        if (in_array($aut->ID, $author)) {
     470                            echo("selected='selected'");
     471                        }
     472                       echo ">$label</option>";
     473                    }
     474                }
     475                ?>
     476            </select>
    416477        </p>
    417478        <p>
     
    594655                   name="<?php echo $this->get_field_name('width'); ?>" type="text"
    595656                   value="<?php echo esc_attr($width); ?>"/>
     657            <small><em><?php _e('width of the containing canvas in pixels'); ?></em></small>
    596658        </p>
    597659        <p class="canvas-config">
     
    601663                   name="<?php echo $this->get_field_name('height'); ?>" type="text"
    602664                   value="<?php echo esc_attr($height); ?>"/>
     665            <small><em><?php _e('height of the containing canvas in pixels'); ?></em></small>
     666        </p>
     667        <p class="canvas-config">
     668            <label
     669                for="<?php echo $this->get_field_id('radiusx'); ?>"><?php _e('Radius X:'); ?></label>
     670            <input class="widefat" id="<?php echo $this->get_field_id('radiusx'); ?>"
     671                   name="<?php echo $this->get_field_name('radiusx'); ?>" type="text"
     672                   value="<?php echo esc_attr($radiusx); ?>"/>
     673            <small><em><?php _e('Initial size of cloud from centre to sides'); ?></em></small>
     674        </p>
     675        <p class="canvas-config">
     676            <label
     677                for="<?php echo $this->get_field_id('radiusy'); ?>"><?php _e('Radius Y:'); ?></label>
     678            <input class="widefat" id="<?php echo $this->get_field_id('radiusy'); ?>"
     679                   name="<?php echo $this->get_field_name('radiusy'); ?>" type="text"
     680                   value="<?php echo esc_attr($radiusy); ?>"/>
     681            <small><em><?php _e('Initial size of cloud from centre to top and bottom'); ?></em></small>
     682        </p>
     683        <p class="canvas-config">
     684            <label
     685                for="<?php echo $this->get_field_id('radiusz'); ?>"><?php _e('Radius Z:'); ?></label>
     686            <input class="widefat" id="<?php echo $this->get_field_id('radiusz'); ?>"
     687                   name="<?php echo $this->get_field_name('radiusz'); ?>" type="text"
     688                   value="<?php echo esc_attr($radiusz); ?>"/>
     689            <small><em><?php _e('Initial size of cloud from centre to front and back'); ?></em></small>
    603690        </p>
    604691        <p class="canvas-config">
     
    733820        }
    734821        $instance['post_type'] = isset($new_instance['post_type']) ? $new_instance['post_type'] : array();
     822        $instance['author'] = isset($new_instance['author']) ? $new_instance['author'] : array();
    735823        $instance['category_id'] = isset($new_instance['category_id']) ? $new_instance['category_id'] : array();
    736824        $instance['child_categories'] = isset($new_instance['child_categories']) ? $new_instance['child_categories'] : "0";
     
    745833        $instance['format'] = isset($new_instance['format']) && strlen($new_instance['format']) > 0 ? $new_instance['format'] : 'flat';
    746834        $instance['number'] = isset($new_instance['number']) && (is_int($new_instance['number']) || ctype_digit($new_instance['number'])) ? $new_instance['number'] : 0;
     835        $instance['post_age'] = isset($new_instance['post_age']) && (is_int($new_instance['post_age']) || ctype_digit($new_instance['post_age'])) ? $new_instance['post_age'] : 0;
     836        $instance['post_count'] = isset($new_instance['post_count']) && (is_int($new_instance['post_count']) || ctype_digit($new_instance['post_count'])) ? $new_instance['post_count'] : 0;
    747837        $instance['taxonomy'] = isset($new_instance['taxonomy']) && strlen($new_instance['taxonomy']) > 0 ? $new_instance['taxonomy'] : 'post_tag';
    748838        $instance['width'] = isset($new_instance['width']) && is_numeric($new_instance['width']) ? $new_instance['width'] : 0;
    749839        $instance['height'] = isset($new_instance['height']) && is_numeric($new_instance['height']) ? $new_instance['height'] : 0;
     840        $instance['radiusx'] = isset($new_instance['radiusx']) ? $new_instance['radiusx'] : '1';
     841        $instance['radiusy'] = isset($new_instance['radiusy']) ? $new_instance['radiusy'] : '1';
     842        $instance['radiusz'] = isset($new_instance['radiusz']) ? $new_instance['radiusz'] : '1';
    750843        $instance['zoom'] = isset($new_instance['zoom']) && is_numeric($new_instance['zoom']) ? $new_instance['zoom'] : 1;
    751844        $instance['timeout'] = isset($new_instance['timeout']) && is_numeric($new_instance['timeout']) ? $new_instance['timeout'] : 60;
  • wp-category-tag-could/tags/1.4/javascript/jquery.tagcanvas.min.js

    r930428 r1048157  
    11681168            }
    11691169            this.shuffleTags && ag(aB);
    1170             az = 100 * this.radiusX;
    1171             ay = 100 * this.radiusY;
    1172             j = 100 * this.radiusZ;
     1170            az = 100 * this.radiusx;
     1171            ay = 100 * this.radiusy;
     1172            j = 100 * this.radiusz;
    11731173            this.max_radius = q(az, q(ay, j));
    11741174            if (this.shapeArgs) {
     
    15921592    };
    15931593    w.tc = {};
    1594     w.options = {z1: 20000, z2: 20000, z0: 0.0002, freezeActive: false, freezeDecel: false, activeCursor: "pointer", pulsateTo: 1, pulsateTime: 3, reverse: false, depth: 0.5, maxSpeed: 0.05, minSpeed: 0, decel: 0.95, interval: 20, minBrightness: 0.1, maxBrightness: 1, outlineColour: "#ffff99", outlineThickness: 2, outlineOffset: 5, outlineMethod: "outline", outlineRadius: 0, textColour: "#ff99ff", textHeight: 15, textFont: "Helvetica, Arial, sans-serif", shadow: "#000", shadowBlur: 0, shadowOffset: [0, 0], initial: null, hideTags: true, zoom: 1, weight: false, weightMode: "size", weightFrom: null, weightSize: 1, weightSizeMin: null, weightSizeMax: null, weightGradient: {0: "#f00", 0.33: "#ff0", 0.66: "#0f0", 1: "#00f"}, txtOpt: true, txtScale: 2, frontSelect: false, wheelZoom: true, zoomMin: 0.3, zoomMax: 3, zoomStep: 0.05, shape: "sphere", lock: null, tooltip: null, tooltipDelay: 300, tooltipClass: "tctooltip", radiusX: 1, radiusY: 1, radiusZ: 1, stretchX: 1, stretchY: 1, offsetX: 0, offsetY: 0, shuffleTags: false, noSelect: false, noMouse: false, imageScale: 1, paused: false, dragControl: false, dragThreshold: 4, centreFunc: aq, splitWidth: 0, animTiming: "Smooth", clickToFront: false, fadeIn: 0, padding: 0, bgColour: null, bgRadius: 0, bgOutline: null, bgOutlineThickness: 0};
     1594    w.options = {z1: 20000, z2: 20000, z0: 0.0002, freezeActive: false, freezeDecel: false, activeCursor: "pointer", pulsateTo: 1, pulsateTime: 3, reverse: false, depth: 0.5, maxSpeed: 0.05, minSpeed: 0, decel: 0.95, interval: 20, minBrightness: 0.1, maxBrightness: 1, outlineColour: "#ffff99", outlineThickness: 2, outlineOffset: 5, outlineMethod: "outline", outlineRadius: 0, textColour: "#ff99ff", textHeight: 15, textFont: "Helvetica, Arial, sans-serif", shadow: "#000", shadowBlur: 0, shadowOffset: [0, 0], initial: null, hideTags: true, zoom: 1, weight: false, weightMode: "size", weightFrom: null, weightSize: 1, weightSizeMin: null, weightSizeMax: null, weightGradient: {0: "#f00", 0.33: "#ff0", 0.66: "#0f0", 1: "#00f"}, txtOpt: true, txtScale: 2, frontSelect: false, wheelZoom: true, zoomMin: 0.3, zoomMax: 3, zoomStep: 0.05, shape: "sphere", lock: null, tooltip: null, tooltipDelay: 300, tooltipClass: "tctooltip", radiusx: 1, radiusy: 1, radiusz: 1, stretchX: 1, stretchY: 1, offsetX: 0, offsetY: 0, shuffleTags: false, noSelect: false, noMouse: false, imageScale: 1, paused: false, dragControl: false, dragThreshold: 4, centreFunc: aq, splitWidth: 0, animTiming: "Smooth", clickToFront: false, fadeIn: 0, padding: 0, bgColour: null, bgRadius: 0, bgOutline: null, bgOutlineThickness: 0};
    15951595    for (I in w.options) {
    15961596        w[I] = w.options[I]
  • wp-category-tag-could/tags/1.4/javascript/wpctc.tagcanvas.js

    r1044824 r1048157  
    2020                $color = $(this).attr('data-tagcloud-color');
    2121                $font = $(this).attr("data-cloud-font");
     22                $radiusx = $(this).attr("data-cloud-radiusx");
     23                $radiusy = $(this).attr("data-cloud-radiusy");
     24                $radiusz = $(this).attr("data-cloud-radiusz");
    2225                if ($font == "null") $font=null;
    2326                $(this).tagcanvas({
     
    2528                    textFont: $font,
    2629                    textColour: $color,
     30                    radiusx: $radiusx,
     31                    radiusy: $radiusy,
     32                    radiusz: $radiusz,
    2733                    maxSpeed: 0.06,
    2834                    minBrightness: 0.1,
  • wp-category-tag-could/tags/1.4/javascript/wpctc.tagcanvas.min.js

    r1044824 r1048157  
    1 function wpctcWrapper($){var wpctc={init:function(){wpctc.prefix="wpctc_";wpctc.templateURL=$("#template-url").val();wpctc.ajaxPostURL=$("#ajax-post-url").val();wpctc.registerEventHandlers();$(".tagcloud-canvas").each(function(){$color=$(this).attr("data-tagcloud-color");$font=$(this).attr("data-cloud-font");if($font=="null"){$font=null;}$(this).tagcanvas({outlineThickness:0,textFont:$font,textColour:$color,maxSpeed:0.06,minBrightness:0.1,depth:0.95,pulsateTo:0.2,pulsateTime:0.75,decel:0.9,reverse:true,fadeIn:800,zoom:parseInt($(this).attr("data-cloud-zoom")),zoomStep:0.05,zoomMax:3,zoomMin:0.3,weight:true},$(this).attr("id")+"_tags");});},registerEventHandlers:function(){}};$(document).ready(wpctc.init);}wpctcWrapper(jQuery);
     1function wpctcWrapper($){var wpctc={init:function(){wpctc.prefix="wpctc_";wpctc.templateURL=$("#template-url").val();wpctc.ajaxPostURL=$("#ajax-post-url").val();wpctc.registerEventHandlers();$(".tagcloud-canvas").each(function(){$color=$(this).attr("data-tagcloud-color");$font=$(this).attr("data-cloud-font");$radiusx=$(this).attr("data-cloud-radiusx");$radiusy=$(this).attr("data-cloud-radiusy");$radiusz=$(this).attr("data-cloud-radiusz");if($font=="null"){$font=null;}$(this).tagcanvas({outlineThickness:0,textFont:$font,textColour:$color,radiusx:$radiusx,radiusy:$radiusy,radiusz:$radiusz,maxSpeed:0.06,minBrightness:0.1,depth:0.95,pulsateTo:0.2,pulsateTime:0.75,decel:0.9,reverse:true,fadeIn:800,zoom:parseInt($(this).attr("data-cloud-zoom")),zoomStep:0.05,zoomMax:3,zoomMin:0.3,weight:true},$(this).attr("id")+"_tags");});},registerEventHandlers:function(){}};$(document).ready(wpctc.init);}wpctcWrapper(jQuery);
  • wp-category-tag-could/tags/1.4/readme.txt

    r1048156 r1048157  
    55Requires at least: 3.0.1
    66Tested up to: 4.0.1
    7 Stable tag: 1.3
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    161161== Changelog ==
    162162
     163= 1.4 =
     164
     165* Filter by post author
     166* Limit to terms with posts written in the last X days (Max post age). 0 means do not limit to newer posts.
     167* Limit to terms with a minimum number of posts. 0 returns the same terms as 1.
     168* Possibility to define the X, Y and Z radius for the 3D cloud.
     169
    163170= 1.3 =
    164171
  • wp-category-tag-could/trunk/bootstrap.php

    r1045683 r1048157  
    44Plugin URI:  https://wordpress.org/plugins/wp-category-tag-could/
    55Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories.
    6 Version:     1.3
     6Version:     1.4
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-category-tag-could/trunk/classes/wp-category-tag-cloud.php

    r1045683 r1048157  
    1212        protected $modified_types = array();
    1313
    14         const VERSION = '1.3';
     14        const VERSION = '1.4';
    1515        const PREFIX = 'wpctc_';
    1616        const DEBUG_MODE = false;
  • wp-category-tag-could/trunk/classes/wpctc-widget.php

    r1045683 r1048157  
    162162            $where = $where . " AND posts.post_type IN ('" . implode("','", $instance['post_type']) . "') ";
    163163        }
    164 
     164        if (isset($instance['author']) && count($instance['author']) > 0) {
     165            $where = $where . " AND posts.post_author IN ('" . implode("','", $instance['author']) . "') ";
     166        }
     167
     168        if (isset($instance['post_age']) && (is_int($instance['post_age']) || ctype_digit($instance['post_age'])) && intval($instance['post_age']) > 0) {
     169            $where = $where . " AND posts.post_date > '".date('Y-m-d', strtotime('-' . intval($instance['post_age']) . ' days'))."'";
     170        }
     171
     172        if (isset($instance['post_count']) && (is_int($instance['post_count']) || ctype_digit($instance['post_count'])) && intval($instance['post_count']) > 0) {
     173            $where = $where . " GROUP BY tag_id HAVING count(distinct posts.ID) >= ".intval($instance['post_count']);
     174        }
     175       
    165176        $tags = $wpdb->get_results
    166177        (" SELECT DISTINCT tt2.term_id AS tag_id
     
    178189            $exclude = $this->to_int_array($this->get_exclude_array($instance['exclude']));
    179190        }
    180         error_log("exclude=".print_r($instance['exclude'], true));
    181         error_log("exclude=".print_r($exclude, true));
    182191
    183192        $includeTags = '';
     
    215224            $cloud_args['include'] = $includeTags;
    216225        }
    217 
    218         error_log("cloud_args=".print_r($cloud_args, true));
    219226        ?>
    220227    <div
     
    228235                    data-tagcloud-color="<?php echo $instance['color']; ?>"
    229236                    data-cloud-font=<?php echo !empty($instance['font']) ? '"'.$instance['font'].'"' : "null"; ?>
     237                    data-cloud-radiusx=<?php echo !empty($instance['radiusx']) ? '"'.$instance['radiusx'].'"' : "1"; ?>
     238                    data-cloud-radiusy=<?php echo !empty($instance['radiusy']) ? '"'.$instance['radiusy'].'"' : "1"; ?>
     239                    data-cloud-radiusz=<?php echo !empty($instance['radiusz']) ? '"'.$instance['radiusz'].'"' : "1"; ?>
    230240                    data-cloud-zoom=<?php echo $instance['zoom']; ?>
    231241                <?php echo isset($instance['width']) && is_numeric($instance['width']) && intval($instance['width']) != 0 ? " width='".$instance['width']."'" : ''; ?>
     
    356366        $nofollow = isset($instance['nofollow']) ? $instance['nofollow'] : "0";
    357367        $post_type = isset($instance['post_type']) ? $instance['post_type'] : array();
     368        $author = isset($instance['author']) ? $instance['author'] : array();
    358369        $tag_id = isset($instance['tag_id']) ? $instance['tag_id'] : array();
    359370        $order_by = isset($instance['order_by']) && strlen($instance['order_by']) > 0 ? $instance['order_by'] : 'name';
     
    361372        $format = isset($instance['format']) && strlen($instance['format']) > 0 ? $instance['format'] : 'flat';
    362373        $number = isset($instance['number']) && (is_int($instance['number']) || ctype_digit($instance['number'])) ? $instance['number'] : 0;
     374        $post_age = isset($instance['post_age']) && (is_int($instance['post_age']) || ctype_digit($instance['post_age'])) ? $instance['post_age'] : 0;
     375        $post_count = isset($instance['post_count']) && (is_int($instance['post_count']) || ctype_digit($instance['post_count'])) ? $instance['post_count'] : 0;
    363376        $taxonomy = isset($instance['taxonomy']) && strlen($instance['taxonomy']) > 0 ? $instance['taxonomy'] : 'post_tag';
    364377        $width = isset($instance['width']) && is_numeric($instance['width']) ? $instance['width'] : 0;
    365378        $height = isset($instance['height']) && is_numeric($instance['height']) ? $instance['height'] : 0;
     379        $radiusx = isset($instance['radiusx']) ? $instance['radiusx'] : '1';
     380        $radiusy = isset($instance['radiusy']) ? $instance['radiusy'] : '1';
     381        $radiusz = isset($instance['radiusz']) ? $instance['radiusz'] : '1';
    366382        $zoom = isset($instance['zoom']) && is_numeric($instance['zoom']) ? $instance['zoom'] : 1;
    367383        $timeout = isset($instance['timeout']) && is_numeric($instance['timeout']) ? $instance['timeout'] : 60;
     
    407423                   name="<?php echo $this->get_field_name('exclude'); ?>" type="text"
    408424                   value="<?php echo esc_attr($exclude); ?>"/>
     425            <small><em><?php _e('comma separated list of term IDs'); ?></em></small>
    409426        </p>
    410427        <p>
     
    414431                   value="<?php echo esc_attr($number); ?>"/>
    415432            <small><em><?php _e('0 means display all'); ?></em></small>
     433        </p>
     434        <p>
     435            <label for="<?php echo $this->get_field_id('post_age'); ?>"><?php _e('Max post age in days:'); ?></label>
     436            <input class="widefat" id="<?php echo $this->get_field_id('post_age'); ?>"
     437                   name="<?php echo $this->get_field_name('post_age'); ?>" type="text"
     438                   value="<?php echo esc_attr($post_age); ?>"/>
     439            <small><em><?php _e('0 means display all'); ?></em></small>
     440        </p>
     441        <p>
     442            <label for="<?php echo $this->get_field_id('post_count'); ?>"><?php _e('Min number of posts:'); ?></label>
     443            <input class="widefat" id="<?php echo $this->get_field_id('post_count'); ?>"
     444                   name="<?php echo $this->get_field_name('post_count'); ?>" type="text"
     445                   value="<?php echo esc_attr($post_count); ?>"/>
     446            <small><em><?php _e('0 returns the same as 1'); ?></em></small>
     447        </p>
     448        <p>
     449            <label for="<?php echo $this->get_field_id('author'); ?>"><?php _e('Post authors:'); ?></label><br/>
     450            <select id="<?php echo $this->get_field_id('author'); ?>"
     451                    name="<?php echo $this->get_field_name('author'); ?>[]" size=3 multiple="multiple"
     452                    class="widefat"
     453                    style="height: auto;">
     454                <?php
     455                $allUsers = get_users('orderby=post_count&order=DESC');
     456                $authors = array();
     457                // Remove subscribers from the list as they won't write any articles
     458                foreach ($allUsers as $currentUser) {
     459                    if (!in_array('subscriber', $currentUser->roles)) {
     460                        $authors[] = $currentUser;
     461                    }
     462                }
     463                if ($authors) {
     464                    foreach ($authors as $aut) {
     465                        $label = esc_html($aut->display_name);
     466                        ?>
     467                        <option value="<?php echo($aut->ID); ?>"
     468                        <?php
     469                        if (in_array($aut->ID, $author)) {
     470                            echo("selected='selected'");
     471                        }
     472                       echo ">$label</option>";
     473                    }
     474                }
     475                ?>
     476            </select>
    416477        </p>
    417478        <p>
     
    594655                   name="<?php echo $this->get_field_name('width'); ?>" type="text"
    595656                   value="<?php echo esc_attr($width); ?>"/>
     657            <small><em><?php _e('width of the containing canvas in pixels'); ?></em></small>
    596658        </p>
    597659        <p class="canvas-config">
     
    601663                   name="<?php echo $this->get_field_name('height'); ?>" type="text"
    602664                   value="<?php echo esc_attr($height); ?>"/>
     665            <small><em><?php _e('height of the containing canvas in pixels'); ?></em></small>
     666        </p>
     667        <p class="canvas-config">
     668            <label
     669                for="<?php echo $this->get_field_id('radiusx'); ?>"><?php _e('Radius X:'); ?></label>
     670            <input class="widefat" id="<?php echo $this->get_field_id('radiusx'); ?>"
     671                   name="<?php echo $this->get_field_name('radiusx'); ?>" type="text"
     672                   value="<?php echo esc_attr($radiusx); ?>"/>
     673            <small><em><?php _e('Initial size of cloud from centre to sides'); ?></em></small>
     674        </p>
     675        <p class="canvas-config">
     676            <label
     677                for="<?php echo $this->get_field_id('radiusy'); ?>"><?php _e('Radius Y:'); ?></label>
     678            <input class="widefat" id="<?php echo $this->get_field_id('radiusy'); ?>"
     679                   name="<?php echo $this->get_field_name('radiusy'); ?>" type="text"
     680                   value="<?php echo esc_attr($radiusy); ?>"/>
     681            <small><em><?php _e('Initial size of cloud from centre to top and bottom'); ?></em></small>
     682        </p>
     683        <p class="canvas-config">
     684            <label
     685                for="<?php echo $this->get_field_id('radiusz'); ?>"><?php _e('Radius Z:'); ?></label>
     686            <input class="widefat" id="<?php echo $this->get_field_id('radiusz'); ?>"
     687                   name="<?php echo $this->get_field_name('radiusz'); ?>" type="text"
     688                   value="<?php echo esc_attr($radiusz); ?>"/>
     689            <small><em><?php _e('Initial size of cloud from centre to front and back'); ?></em></small>
    603690        </p>
    604691        <p class="canvas-config">
     
    733820        }
    734821        $instance['post_type'] = isset($new_instance['post_type']) ? $new_instance['post_type'] : array();
     822        $instance['author'] = isset($new_instance['author']) ? $new_instance['author'] : array();
    735823        $instance['category_id'] = isset($new_instance['category_id']) ? $new_instance['category_id'] : array();
    736824        $instance['child_categories'] = isset($new_instance['child_categories']) ? $new_instance['child_categories'] : "0";
     
    745833        $instance['format'] = isset($new_instance['format']) && strlen($new_instance['format']) > 0 ? $new_instance['format'] : 'flat';
    746834        $instance['number'] = isset($new_instance['number']) && (is_int($new_instance['number']) || ctype_digit($new_instance['number'])) ? $new_instance['number'] : 0;
     835        $instance['post_age'] = isset($new_instance['post_age']) && (is_int($new_instance['post_age']) || ctype_digit($new_instance['post_age'])) ? $new_instance['post_age'] : 0;
     836        $instance['post_count'] = isset($new_instance['post_count']) && (is_int($new_instance['post_count']) || ctype_digit($new_instance['post_count'])) ? $new_instance['post_count'] : 0;
    747837        $instance['taxonomy'] = isset($new_instance['taxonomy']) && strlen($new_instance['taxonomy']) > 0 ? $new_instance['taxonomy'] : 'post_tag';
    748838        $instance['width'] = isset($new_instance['width']) && is_numeric($new_instance['width']) ? $new_instance['width'] : 0;
    749839        $instance['height'] = isset($new_instance['height']) && is_numeric($new_instance['height']) ? $new_instance['height'] : 0;
     840        $instance['radiusx'] = isset($new_instance['radiusx']) ? $new_instance['radiusx'] : '1';
     841        $instance['radiusy'] = isset($new_instance['radiusy']) ? $new_instance['radiusy'] : '1';
     842        $instance['radiusz'] = isset($new_instance['radiusz']) ? $new_instance['radiusz'] : '1';
    750843        $instance['zoom'] = isset($new_instance['zoom']) && is_numeric($new_instance['zoom']) ? $new_instance['zoom'] : 1;
    751844        $instance['timeout'] = isset($new_instance['timeout']) && is_numeric($new_instance['timeout']) ? $new_instance['timeout'] : 60;
  • wp-category-tag-could/trunk/javascript/jquery.tagcanvas.min.js

    r930428 r1048157  
    11681168            }
    11691169            this.shuffleTags && ag(aB);
    1170             az = 100 * this.radiusX;
    1171             ay = 100 * this.radiusY;
    1172             j = 100 * this.radiusZ;
     1170            az = 100 * this.radiusx;
     1171            ay = 100 * this.radiusy;
     1172            j = 100 * this.radiusz;
    11731173            this.max_radius = q(az, q(ay, j));
    11741174            if (this.shapeArgs) {
     
    15921592    };
    15931593    w.tc = {};
    1594     w.options = {z1: 20000, z2: 20000, z0: 0.0002, freezeActive: false, freezeDecel: false, activeCursor: "pointer", pulsateTo: 1, pulsateTime: 3, reverse: false, depth: 0.5, maxSpeed: 0.05, minSpeed: 0, decel: 0.95, interval: 20, minBrightness: 0.1, maxBrightness: 1, outlineColour: "#ffff99", outlineThickness: 2, outlineOffset: 5, outlineMethod: "outline", outlineRadius: 0, textColour: "#ff99ff", textHeight: 15, textFont: "Helvetica, Arial, sans-serif", shadow: "#000", shadowBlur: 0, shadowOffset: [0, 0], initial: null, hideTags: true, zoom: 1, weight: false, weightMode: "size", weightFrom: null, weightSize: 1, weightSizeMin: null, weightSizeMax: null, weightGradient: {0: "#f00", 0.33: "#ff0", 0.66: "#0f0", 1: "#00f"}, txtOpt: true, txtScale: 2, frontSelect: false, wheelZoom: true, zoomMin: 0.3, zoomMax: 3, zoomStep: 0.05, shape: "sphere", lock: null, tooltip: null, tooltipDelay: 300, tooltipClass: "tctooltip", radiusX: 1, radiusY: 1, radiusZ: 1, stretchX: 1, stretchY: 1, offsetX: 0, offsetY: 0, shuffleTags: false, noSelect: false, noMouse: false, imageScale: 1, paused: false, dragControl: false, dragThreshold: 4, centreFunc: aq, splitWidth: 0, animTiming: "Smooth", clickToFront: false, fadeIn: 0, padding: 0, bgColour: null, bgRadius: 0, bgOutline: null, bgOutlineThickness: 0};
     1594    w.options = {z1: 20000, z2: 20000, z0: 0.0002, freezeActive: false, freezeDecel: false, activeCursor: "pointer", pulsateTo: 1, pulsateTime: 3, reverse: false, depth: 0.5, maxSpeed: 0.05, minSpeed: 0, decel: 0.95, interval: 20, minBrightness: 0.1, maxBrightness: 1, outlineColour: "#ffff99", outlineThickness: 2, outlineOffset: 5, outlineMethod: "outline", outlineRadius: 0, textColour: "#ff99ff", textHeight: 15, textFont: "Helvetica, Arial, sans-serif", shadow: "#000", shadowBlur: 0, shadowOffset: [0, 0], initial: null, hideTags: true, zoom: 1, weight: false, weightMode: "size", weightFrom: null, weightSize: 1, weightSizeMin: null, weightSizeMax: null, weightGradient: {0: "#f00", 0.33: "#ff0", 0.66: "#0f0", 1: "#00f"}, txtOpt: true, txtScale: 2, frontSelect: false, wheelZoom: true, zoomMin: 0.3, zoomMax: 3, zoomStep: 0.05, shape: "sphere", lock: null, tooltip: null, tooltipDelay: 300, tooltipClass: "tctooltip", radiusx: 1, radiusy: 1, radiusz: 1, stretchX: 1, stretchY: 1, offsetX: 0, offsetY: 0, shuffleTags: false, noSelect: false, noMouse: false, imageScale: 1, paused: false, dragControl: false, dragThreshold: 4, centreFunc: aq, splitWidth: 0, animTiming: "Smooth", clickToFront: false, fadeIn: 0, padding: 0, bgColour: null, bgRadius: 0, bgOutline: null, bgOutlineThickness: 0};
    15951595    for (I in w.options) {
    15961596        w[I] = w.options[I]
  • wp-category-tag-could/trunk/javascript/wpctc.tagcanvas.js

    r1044824 r1048157  
    2020                $color = $(this).attr('data-tagcloud-color');
    2121                $font = $(this).attr("data-cloud-font");
     22                $radiusx = $(this).attr("data-cloud-radiusx");
     23                $radiusy = $(this).attr("data-cloud-radiusy");
     24                $radiusz = $(this).attr("data-cloud-radiusz");
    2225                if ($font == "null") $font=null;
    2326                $(this).tagcanvas({
     
    2528                    textFont: $font,
    2629                    textColour: $color,
     30                    radiusx: $radiusx,
     31                    radiusy: $radiusy,
     32                    radiusz: $radiusz,
    2733                    maxSpeed: 0.06,
    2834                    minBrightness: 0.1,
  • wp-category-tag-could/trunk/javascript/wpctc.tagcanvas.min.js

    r1044824 r1048157  
    1 function wpctcWrapper($){var wpctc={init:function(){wpctc.prefix="wpctc_";wpctc.templateURL=$("#template-url").val();wpctc.ajaxPostURL=$("#ajax-post-url").val();wpctc.registerEventHandlers();$(".tagcloud-canvas").each(function(){$color=$(this).attr("data-tagcloud-color");$font=$(this).attr("data-cloud-font");if($font=="null"){$font=null;}$(this).tagcanvas({outlineThickness:0,textFont:$font,textColour:$color,maxSpeed:0.06,minBrightness:0.1,depth:0.95,pulsateTo:0.2,pulsateTime:0.75,decel:0.9,reverse:true,fadeIn:800,zoom:parseInt($(this).attr("data-cloud-zoom")),zoomStep:0.05,zoomMax:3,zoomMin:0.3,weight:true},$(this).attr("id")+"_tags");});},registerEventHandlers:function(){}};$(document).ready(wpctc.init);}wpctcWrapper(jQuery);
     1function wpctcWrapper($){var wpctc={init:function(){wpctc.prefix="wpctc_";wpctc.templateURL=$("#template-url").val();wpctc.ajaxPostURL=$("#ajax-post-url").val();wpctc.registerEventHandlers();$(".tagcloud-canvas").each(function(){$color=$(this).attr("data-tagcloud-color");$font=$(this).attr("data-cloud-font");$radiusx=$(this).attr("data-cloud-radiusx");$radiusy=$(this).attr("data-cloud-radiusy");$radiusz=$(this).attr("data-cloud-radiusz");if($font=="null"){$font=null;}$(this).tagcanvas({outlineThickness:0,textFont:$font,textColour:$color,radiusx:$radiusx,radiusy:$radiusy,radiusz:$radiusz,maxSpeed:0.06,minBrightness:0.1,depth:0.95,pulsateTo:0.2,pulsateTime:0.75,decel:0.9,reverse:true,fadeIn:800,zoom:parseInt($(this).attr("data-cloud-zoom")),zoomStep:0.05,zoomMax:3,zoomMin:0.3,weight:true},$(this).attr("id")+"_tags");});},registerEventHandlers:function(){}};$(document).ready(wpctc.init);}wpctcWrapper(jQuery);
  • wp-category-tag-could/trunk/readme.txt

    r1045683 r1048157  
    55Requires at least: 3.0.1
    66Tested up to: 4.0.1
    7 Stable tag: 1.3
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    161161== Changelog ==
    162162
     163= 1.4 =
     164
     165* Filter by post author
     166* Limit to terms with posts written in the last X days (Max post age). 0 means do not limit to newer posts.
     167* Limit to terms with a minimum number of posts. 0 returns the same terms as 1.
     168* Possibility to define the X, Y and Z radius for the 3D cloud.
     169
    163170= 1.3 =
    164171
Note: See TracChangeset for help on using the changeset viewer.