Changeset 961977
- Timestamp:
- 08/07/2014 07:54:25 PM (12 years ago)
- Location:
- easy-image-display/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (4 diffs)
-
sb-easy-image-display.php (modified) (6 diffs)
-
sb-easy-image-widget.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-image-display/trunk/readme.txt
r854693 r961977 3 3 Tags: image, gallery, latest image, random image 4 4 Requires at least: 3.5 5 Tested up to: 3. 8.15 Tested up to: 3.9.2 6 6 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T3XBQZNXBEHPC 7 7 Stable tag: trunk … … 20 20 Current features include: 21 21 22 * Newest, oldest, random and custom sorting options 22 23 * Include/exclude images based on ID 23 24 * Widget, shortcode and template tag for maximum flexibility … … 115 116 }` 116 117 118 = How does the custom sorting option work? = 119 120 This option will only take effect when filter is set to "only", as that is the only time when every image ID is specified 121 and can therefore be ordered correctly. 122 117 123 118 124 == Changelog == 125 126 = 1.2.0 = 127 * Added option to specify range of image IDs 128 * Added custom sorting option 129 * Various performance fixes 119 130 120 131 = 1.1.1 = … … 138 149 == Upgrade Notice == 139 150 151 = 1.2.0 = 152 * New feature! Specify a range of image IDs. 153 * New feature! Custom sorting option. 154 140 155 = 1.1.1 = 141 156 * New feature! Link images to static URL. -
easy-image-display/trunk/sb-easy-image-display.php
r854693 r961977 4 4 Plugin URI: http://shellbotics.com/wordpress-plugins/easy-image-display/ 5 5 Description: An easy way to display random or latest images on your site. 6 Version: 1. 1.16 Version: 1.2.0 7 7 Author: Shellbot 8 8 Author URI: http://shellbotics.com … … 57 57 } 58 58 59 function public_js( ) {59 function public_js( $gallery_id = '' ) { 60 60 echo '<script type="text/javascript"> 61 61 jQuery(document).ready(function() { 62 jQuery(" .gallerya").colorbox({62 jQuery("#' . $gallery_id . ' a").colorbox({ 63 63 maxWidth: "80%", 64 64 maxHeight: "80%", … … 187 187 $query['order'] = 'ASC'; 188 188 break; 189 case 'custom': 190 $query['orderby'] = 'post__in'; 191 $query['order'] = 'ASC'; 192 break; 189 193 }; 190 194 191 195 if( $args['ids'] && strtolower( $args['filter'] ) == 'include' ) { 196 192 197 $attachments = $this->include_action( $args, $query ); 198 193 199 } elseif( $args['ids'] ) { 194 $ids = explode( ',', $args['ids'] ); 200 201 if( false != strpos( $args['ids'], '-' ) ) { //IDs include a range 202 203 $temp_ids = explode( ',', $args['ids'] ); 204 $ids = array(); 205 206 foreach ($temp_ids as $k => $v) { 207 208 // Is there a dash? 209 $dash = strpos($v, '-'); 210 if ($dash) { 211 $from = intval(substr($v, 0, $dash)); 212 $to = intval(substr($v, $dash + 1)); 213 214 for ($i = $from; $i <= $to; $i ++) { 215 $ids[] = "$i"; 216 } 217 } 218 else { // No, just insert next in the array 219 $ids[] = "$v"; 220 } 221 } 222 223 } else { //no ranges, straighforward explode 224 $ids = explode( ',', $args['ids'] ); 225 } 195 226 196 227 if( strtolower( $args['filter'] ) == 'exclude' ) { … … 200 231 $query['post__in'] = $ids; 201 232 } 202 233 203 234 $attachments = get_posts( $query ); 204 235 } else { … … 303 334 304 335 $output = gallery_shortcode($attr); 336 337 //find gallery ID 338 $pattern = '/gallery-[0-9]/'; 339 preg_match($pattern, $output, $matches); 340 $gallery_id = $matches[0]; 305 341 306 342 // no link … … 316 352 317 353 if( isset( $lightbox ) && 1 == $lightbox ) { 318 $this->public_js( );354 $this->public_js( $gallery_id ); 319 355 } 320 356 -
easy-image-display/trunk/sb-easy-image-widget.php
r854693 r961977 2 2 /** 3 3 * Widget Name: Easy Image Display 4 * Version: 1. 1.14 * Version: 1.2.0 5 5 */ 6 6 … … 70 70 'Oldest', 71 71 'Random', 72 'Custom', 72 73 ), 73 74 'sizes' => array(
Note: See TracChangeset
for help on using the changeset viewer.