Changeset 1048157
- Timestamp:
- 12/18/2014 02:09:17 PM (11 years ago)
- Location:
- wp-category-tag-could
- Files:
-
- 1 added
- 12 edited
- 11 copied
-
tags/1.4 (added)
-
tags/1.4/bootstrap.php (copied) (copied from wp-category-tag-could/trunk/bootstrap.php) (1 diff)
-
tags/1.4/classes (copied) (copied from wp-category-tag-could/trunk/classes)
-
tags/1.4/classes/wp-category-tag-cloud.php (modified) (1 diff)
-
tags/1.4/classes/wpctc-widget.php (modified) (12 diffs)
-
tags/1.4/css (copied) (copied from wp-category-tag-could/trunk/css)
-
tags/1.4/javascript (copied) (copied from wp-category-tag-could/trunk/javascript)
-
tags/1.4/javascript/jquery.tagcanvas.min.js (modified) (2 diffs)
-
tags/1.4/javascript/wpctc.tagcanvas.js (modified) (2 diffs)
-
tags/1.4/javascript/wpctc.tagcanvas.min.js (modified) (1 diff)
-
tags/1.4/readme.txt (copied) (copied from wp-category-tag-could/trunk/readme.txt) (2 diffs)
-
tags/1.4/screenshot-1.png (copied) (copied from wp-category-tag-could/trunk/screenshot-1.png)
-
tags/1.4/screenshot-2.gif (copied) (copied from wp-category-tag-could/trunk/screenshot-2.gif)
-
tags/1.4/screenshot-3.png (copied) (copied from wp-category-tag-could/trunk/screenshot-3.png)
-
tags/1.4/screenshot-4.png (copied) (copied from wp-category-tag-could/trunk/screenshot-4.png)
-
tags/1.4/screenshot-5.png (copied) (copied from wp-category-tag-could/trunk/screenshot-5.png)
-
tags/1.4/views (copied) (copied from wp-category-tag-could/trunk/views)
-
trunk/bootstrap.php (modified) (1 diff)
-
trunk/classes/wp-category-tag-cloud.php (modified) (1 diff)
-
trunk/classes/wpctc-widget.php (modified) (12 diffs)
-
trunk/javascript/jquery.tagcanvas.min.js (modified) (2 diffs)
-
trunk/javascript/wpctc.tagcanvas.js (modified) (2 diffs)
-
trunk/javascript/wpctc.tagcanvas.min.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-category-tag-could/tags/1.4/bootstrap.php
r1048156 r1048157 4 4 Plugin URI: https://wordpress.org/plugins/wp-category-tag-could/ 5 5 Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories. 6 Version: 1. 36 Version: 1.4 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-category-tag-could/tags/1.4/classes/wp-category-tag-cloud.php
r1045683 r1048157 12 12 protected $modified_types = array(); 13 13 14 const VERSION = '1. 3';14 const VERSION = '1.4'; 15 15 const PREFIX = 'wpctc_'; 16 16 const DEBUG_MODE = false; -
wp-category-tag-could/tags/1.4/classes/wpctc-widget.php
r1045683 r1048157 162 162 $where = $where . " AND posts.post_type IN ('" . implode("','", $instance['post_type']) . "') "; 163 163 } 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 165 176 $tags = $wpdb->get_results 166 177 (" SELECT DISTINCT tt2.term_id AS tag_id … … 178 189 $exclude = $this->to_int_array($this->get_exclude_array($instance['exclude'])); 179 190 } 180 error_log("exclude=".print_r($instance['exclude'], true));181 error_log("exclude=".print_r($exclude, true));182 191 183 192 $includeTags = ''; … … 215 224 $cloud_args['include'] = $includeTags; 216 225 } 217 218 error_log("cloud_args=".print_r($cloud_args, true));219 226 ?> 220 227 <div … … 228 235 data-tagcloud-color="<?php echo $instance['color']; ?>" 229 236 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"; ?> 230 240 data-cloud-zoom=<?php echo $instance['zoom']; ?> 231 241 <?php echo isset($instance['width']) && is_numeric($instance['width']) && intval($instance['width']) != 0 ? " width='".$instance['width']."'" : ''; ?> … … 356 366 $nofollow = isset($instance['nofollow']) ? $instance['nofollow'] : "0"; 357 367 $post_type = isset($instance['post_type']) ? $instance['post_type'] : array(); 368 $author = isset($instance['author']) ? $instance['author'] : array(); 358 369 $tag_id = isset($instance['tag_id']) ? $instance['tag_id'] : array(); 359 370 $order_by = isset($instance['order_by']) && strlen($instance['order_by']) > 0 ? $instance['order_by'] : 'name'; … … 361 372 $format = isset($instance['format']) && strlen($instance['format']) > 0 ? $instance['format'] : 'flat'; 362 373 $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; 363 376 $taxonomy = isset($instance['taxonomy']) && strlen($instance['taxonomy']) > 0 ? $instance['taxonomy'] : 'post_tag'; 364 377 $width = isset($instance['width']) && is_numeric($instance['width']) ? $instance['width'] : 0; 365 378 $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'; 366 382 $zoom = isset($instance['zoom']) && is_numeric($instance['zoom']) ? $instance['zoom'] : 1; 367 383 $timeout = isset($instance['timeout']) && is_numeric($instance['timeout']) ? $instance['timeout'] : 60; … … 407 423 name="<?php echo $this->get_field_name('exclude'); ?>" type="text" 408 424 value="<?php echo esc_attr($exclude); ?>"/> 425 <small><em><?php _e('comma separated list of term IDs'); ?></em></small> 409 426 </p> 410 427 <p> … … 414 431 value="<?php echo esc_attr($number); ?>"/> 415 432 <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> 416 477 </p> 417 478 <p> … … 594 655 name="<?php echo $this->get_field_name('width'); ?>" type="text" 595 656 value="<?php echo esc_attr($width); ?>"/> 657 <small><em><?php _e('width of the containing canvas in pixels'); ?></em></small> 596 658 </p> 597 659 <p class="canvas-config"> … … 601 663 name="<?php echo $this->get_field_name('height'); ?>" type="text" 602 664 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> 603 690 </p> 604 691 <p class="canvas-config"> … … 733 820 } 734 821 $instance['post_type'] = isset($new_instance['post_type']) ? $new_instance['post_type'] : array(); 822 $instance['author'] = isset($new_instance['author']) ? $new_instance['author'] : array(); 735 823 $instance['category_id'] = isset($new_instance['category_id']) ? $new_instance['category_id'] : array(); 736 824 $instance['child_categories'] = isset($new_instance['child_categories']) ? $new_instance['child_categories'] : "0"; … … 745 833 $instance['format'] = isset($new_instance['format']) && strlen($new_instance['format']) > 0 ? $new_instance['format'] : 'flat'; 746 834 $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; 747 837 $instance['taxonomy'] = isset($new_instance['taxonomy']) && strlen($new_instance['taxonomy']) > 0 ? $new_instance['taxonomy'] : 'post_tag'; 748 838 $instance['width'] = isset($new_instance['width']) && is_numeric($new_instance['width']) ? $new_instance['width'] : 0; 749 839 $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'; 750 843 $instance['zoom'] = isset($new_instance['zoom']) && is_numeric($new_instance['zoom']) ? $new_instance['zoom'] : 1; 751 844 $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 1168 1168 } 1169 1169 this.shuffleTags && ag(aB); 1170 az = 100 * this.radius X;1171 ay = 100 * this.radius Y;1172 j = 100 * this.radius Z;1170 az = 100 * this.radiusx; 1171 ay = 100 * this.radiusy; 1172 j = 100 * this.radiusz; 1173 1173 this.max_radius = q(az, q(ay, j)); 1174 1174 if (this.shapeArgs) { … … 1592 1592 }; 1593 1593 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", radius X: 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}; 1595 1595 for (I in w.options) { 1596 1596 w[I] = w.options[I] -
wp-category-tag-could/tags/1.4/javascript/wpctc.tagcanvas.js
r1044824 r1048157 20 20 $color = $(this).attr('data-tagcloud-color'); 21 21 $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"); 22 25 if ($font == "null") $font=null; 23 26 $(this).tagcanvas({ … … 25 28 textFont: $font, 26 29 textColour: $color, 30 radiusx: $radiusx, 31 radiusy: $radiusy, 32 radiusz: $radiusz, 27 33 maxSpeed: 0.06, 28 34 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);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");$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 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.0.1 7 Stable tag: 1. 37 Stable tag: 1.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 161 161 == Changelog == 162 162 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 163 170 = 1.3 = 164 171 -
wp-category-tag-could/trunk/bootstrap.php
r1045683 r1048157 4 4 Plugin URI: https://wordpress.org/plugins/wp-category-tag-could/ 5 5 Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories. 6 Version: 1. 36 Version: 1.4 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-category-tag-could/trunk/classes/wp-category-tag-cloud.php
r1045683 r1048157 12 12 protected $modified_types = array(); 13 13 14 const VERSION = '1. 3';14 const VERSION = '1.4'; 15 15 const PREFIX = 'wpctc_'; 16 16 const DEBUG_MODE = false; -
wp-category-tag-could/trunk/classes/wpctc-widget.php
r1045683 r1048157 162 162 $where = $where . " AND posts.post_type IN ('" . implode("','", $instance['post_type']) . "') "; 163 163 } 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 165 176 $tags = $wpdb->get_results 166 177 (" SELECT DISTINCT tt2.term_id AS tag_id … … 178 189 $exclude = $this->to_int_array($this->get_exclude_array($instance['exclude'])); 179 190 } 180 error_log("exclude=".print_r($instance['exclude'], true));181 error_log("exclude=".print_r($exclude, true));182 191 183 192 $includeTags = ''; … … 215 224 $cloud_args['include'] = $includeTags; 216 225 } 217 218 error_log("cloud_args=".print_r($cloud_args, true));219 226 ?> 220 227 <div … … 228 235 data-tagcloud-color="<?php echo $instance['color']; ?>" 229 236 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"; ?> 230 240 data-cloud-zoom=<?php echo $instance['zoom']; ?> 231 241 <?php echo isset($instance['width']) && is_numeric($instance['width']) && intval($instance['width']) != 0 ? " width='".$instance['width']."'" : ''; ?> … … 356 366 $nofollow = isset($instance['nofollow']) ? $instance['nofollow'] : "0"; 357 367 $post_type = isset($instance['post_type']) ? $instance['post_type'] : array(); 368 $author = isset($instance['author']) ? $instance['author'] : array(); 358 369 $tag_id = isset($instance['tag_id']) ? $instance['tag_id'] : array(); 359 370 $order_by = isset($instance['order_by']) && strlen($instance['order_by']) > 0 ? $instance['order_by'] : 'name'; … … 361 372 $format = isset($instance['format']) && strlen($instance['format']) > 0 ? $instance['format'] : 'flat'; 362 373 $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; 363 376 $taxonomy = isset($instance['taxonomy']) && strlen($instance['taxonomy']) > 0 ? $instance['taxonomy'] : 'post_tag'; 364 377 $width = isset($instance['width']) && is_numeric($instance['width']) ? $instance['width'] : 0; 365 378 $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'; 366 382 $zoom = isset($instance['zoom']) && is_numeric($instance['zoom']) ? $instance['zoom'] : 1; 367 383 $timeout = isset($instance['timeout']) && is_numeric($instance['timeout']) ? $instance['timeout'] : 60; … … 407 423 name="<?php echo $this->get_field_name('exclude'); ?>" type="text" 408 424 value="<?php echo esc_attr($exclude); ?>"/> 425 <small><em><?php _e('comma separated list of term IDs'); ?></em></small> 409 426 </p> 410 427 <p> … … 414 431 value="<?php echo esc_attr($number); ?>"/> 415 432 <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> 416 477 </p> 417 478 <p> … … 594 655 name="<?php echo $this->get_field_name('width'); ?>" type="text" 595 656 value="<?php echo esc_attr($width); ?>"/> 657 <small><em><?php _e('width of the containing canvas in pixels'); ?></em></small> 596 658 </p> 597 659 <p class="canvas-config"> … … 601 663 name="<?php echo $this->get_field_name('height'); ?>" type="text" 602 664 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> 603 690 </p> 604 691 <p class="canvas-config"> … … 733 820 } 734 821 $instance['post_type'] = isset($new_instance['post_type']) ? $new_instance['post_type'] : array(); 822 $instance['author'] = isset($new_instance['author']) ? $new_instance['author'] : array(); 735 823 $instance['category_id'] = isset($new_instance['category_id']) ? $new_instance['category_id'] : array(); 736 824 $instance['child_categories'] = isset($new_instance['child_categories']) ? $new_instance['child_categories'] : "0"; … … 745 833 $instance['format'] = isset($new_instance['format']) && strlen($new_instance['format']) > 0 ? $new_instance['format'] : 'flat'; 746 834 $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; 747 837 $instance['taxonomy'] = isset($new_instance['taxonomy']) && strlen($new_instance['taxonomy']) > 0 ? $new_instance['taxonomy'] : 'post_tag'; 748 838 $instance['width'] = isset($new_instance['width']) && is_numeric($new_instance['width']) ? $new_instance['width'] : 0; 749 839 $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'; 750 843 $instance['zoom'] = isset($new_instance['zoom']) && is_numeric($new_instance['zoom']) ? $new_instance['zoom'] : 1; 751 844 $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 1168 1168 } 1169 1169 this.shuffleTags && ag(aB); 1170 az = 100 * this.radius X;1171 ay = 100 * this.radius Y;1172 j = 100 * this.radius Z;1170 az = 100 * this.radiusx; 1171 ay = 100 * this.radiusy; 1172 j = 100 * this.radiusz; 1173 1173 this.max_radius = q(az, q(ay, j)); 1174 1174 if (this.shapeArgs) { … … 1592 1592 }; 1593 1593 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", radius X: 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}; 1595 1595 for (I in w.options) { 1596 1596 w[I] = w.options[I] -
wp-category-tag-could/trunk/javascript/wpctc.tagcanvas.js
r1044824 r1048157 20 20 $color = $(this).attr('data-tagcloud-color'); 21 21 $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"); 22 25 if ($font == "null") $font=null; 23 26 $(this).tagcanvas({ … … 25 28 textFont: $font, 26 29 textColour: $color, 30 radiusx: $radiusx, 31 radiusy: $radiusy, 32 radiusz: $radiusz, 27 33 maxSpeed: 0.06, 28 34 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);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");$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 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.0.1 7 Stable tag: 1. 37 Stable tag: 1.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 161 161 == Changelog == 162 162 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 163 170 = 1.3 = 164 171
Note: See TracChangeset
for help on using the changeset viewer.