Changeset 854693
- Timestamp:
- 02/10/2014 12:00:35 PM (12 years ago)
- Location:
- easy-image-display/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (4 diffs)
-
sb-easy-image-display.php (modified) (13 diffs)
-
sb-easy-image-widget.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-image-display/trunk/readme.txt
r821130 r854693 3 3 Tags: image, gallery, latest image, random image 4 4 Requires at least: 3.5 5 Tested up to: 3.8 5 Tested up to: 3.8.1 6 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T3XBQZNXBEHPC 6 7 Stable tag: trunk 7 8 License: GPLv2 or later … … 23 24 * Display images at various sizes 24 25 * Control how many images are displayed and in how many columns 25 * Link images to a lightbox, or remove link entirely26 * Link images to a lightbox, static URL, or remove link entirely 26 27 * Uses gallery shortcode so will always fit your theme 27 28 … … 96 97 please post in [the plugin support forum](http://wordpress.org/support/plugin/easy-image-display) with a link to your site. 97 98 99 = How can I get rid of grey borders around my images? = 100 101 This border is part of the default gallery CSS generated by WordPress. To override this you can add the following CSS to your 102 theme, usually in style.css : 103 104 `.gallery img { 105 border: 0 !important; 106 }` 107 108 = How can I get rid of the whitespace above my images? = 109 110 This margin is part of the default gallery CSS generated by WordPress. To override this you can add the following CSS to your 111 theme, usually in style.css : 112 113 `.gallery-item { 114 margin-top: 0px !important; 115 }` 116 117 98 118 == Changelog == 119 120 = 1.1.1 = 121 * Fixed compatibility with PHP 5.4 122 * Added option to link images to static URL 123 * Small performance fix 99 124 100 125 = 1.1.0 = … … 113 138 == Upgrade Notice == 114 139 140 = 1.1.1 = 141 * New feature! Link images to static URL. 142 115 143 = 1.1.0 = 116 144 * New feature! Include/exclude images based on ID. -
easy-image-display/trunk/sb-easy-image-display.php
r803013 r854693 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. 06 Version: 1.1.1 7 7 Author: Shellbot 8 8 Author URI: http://shellbotics.com … … 50 50 51 51 function public_scripts() { 52 wp_register_script( 'colorbox', plugin_dir_url( __FILE__ ). 'js/jquery.colorbox-min.js', array( 'jquery' ) );52 wp_register_script( 'colorbox', plugin_dir_url( __FILE__ ). 'js/jquery.colorbox-min.js', array( 'jquery' ), '', true ); 53 53 wp_register_style( 'colorbox-css', plugin_dir_url( __FILE__ ). 'css/colorbox.css' ); 54 54 … … 82 82 'size' => 'thumbnail', 83 83 'link' => 'file', 84 'url' => '', 84 85 'columns' => '3', 85 86 'filter' => 'only', 87 'ids' => '', 86 88 ), $args ) ); 87 89 … … 92 94 'size' => $size, 93 95 'link' => $link, 96 'url' => $url, 94 97 'columns' => $columns, 95 98 'filter' => $filter, 96 'ids' => $ args['ids'],99 'ids' => $ids, 97 100 ); 98 101 … … 110 113 'size' => 'thumbnail', 111 114 'link' => 'file', 115 'url' => '', 112 116 'columns' => '3', 113 117 'filter' => 'only', 118 'ids' => '', 114 119 ), $args ) ); 115 120 … … 119 124 'order' => $order, 120 125 'size' => $size, 121 'link' => $link, 126 'link' => $link, 127 'url' => $url, 122 128 'columns' => $columns, 123 129 'filter' => $filter, 124 'ids' => $ args['ids'],130 'ids' => $ids, 125 131 ); 126 132 … … 138 144 'size' => 'thumbnail', 139 145 'link' => 'file', 146 'url' => '', 140 147 'columns' => '5', 141 148 'filter' => 'only', 149 'ids' => '', 142 150 ), $args ) ); 143 151 … … 147 155 'order' => $order, 148 156 'size' => $size, 149 'link' => $link, 157 'link' => $link, 158 'url' => $url, 150 159 'columns' => $columns, 151 160 'filter' => $filter, 152 'ids' => $ args['ids'],161 'ids' => $ids, 153 162 ); 154 163 … … 183 192 $attachments = $this->include_action( $args, $query ); 184 193 } elseif( $args['ids'] ) { 185 $ids = split( ',', $args['ids'] );194 $ids = explode( ',', $args['ids'] ); 186 195 187 196 if( strtolower( $args['filter'] ) == 'exclude' ) { … … 203 212 $ids .= $attachment->ID . ', '; 204 213 } 205 return do_shortcode( '[gallery columns="' . $args['columns'] . '" ids="' . $ids . '" size="' . strtolower( $args['size'] ) . '" link="' . strtolower( $args['link'] ) . '" ]' );214 return do_shortcode( '[gallery columns="' . $args['columns'] . '" ids="' . $ids . '" size="' . strtolower( $args['size'] ) . '" link="' . strtolower( $args['link'] ) . '" url="' . strtolower( $args['url'] ) . '"]' ); 206 215 207 216 } else { … … 215 224 function include_action( $args, $query ) { 216 225 217 $ids = split( ',', $args['ids'] );226 $ids = explode( ',', $args['ids'] ); 218 227 219 228 if( count( $ids ) >= $args['num'] ) { … … 288 297 global $post, $wp_locale; 289 298 290 if ( 'lightbox' == $attr['link'] ) {299 if ( isset( $attr['link'] ) && 'lightbox' == $attr['link'] ) { 291 300 $attr['link'] = 'file'; 292 301 $lightbox = 1; … … 296 305 297 306 // no link 298 if ( isset( $attr['link'] ) && "none"== $attr['link'] ) {307 if ( isset( $attr['link'] ) && 'none' == $attr['link'] ) { 299 308 $output = preg_replace( array( '/<a[^>]*>/', '/<\/a>/'), '', $output ); 300 309 } 301 310 302 if( 1 == $lightbox ) { 311 //static link 312 if ( isset( $attr['link'] ) && 'url' == $attr['link'] && !empty( $attr['url'] ) ) { 313 $pattern = "/(?<=href=(\"|'))[^\"']+(?=(\"|'))/"; 314 $output = preg_replace( $pattern, $attr['url'], $output ); 315 } 316 317 if( isset( $lightbox ) && 1 == $lightbox ) { 303 318 $this->public_js(); 304 319 } -
easy-image-display/trunk/sb-easy-image-widget.php
r803013 r854693 2 2 /** 3 3 * Widget Name: Easy Image Display 4 * Version: 1.1. 04 * Version: 1.1.1 5 5 */ 6 6 … … 45 45 $instance['columns'] = $new_instance['columns']; 46 46 $instance['link'] = $new_instance['link']; 47 $instance['url'] = $new_instance['url']; 47 48 $instance['filter'] = $new_instance['filter']; 48 49 $instance['ids'] = $new_instance['ids']; … … 81 82 'Attachment', 82 83 'File', 84 'URL', 83 85 ), 84 86 'filter' => array( … … 102 104 $defaults = array( 103 105 'title' => esc_html__( 'Latest Image', 'shellbotics' ), 106 'order' => 'newest', 107 'size' => 'thumbnail', 104 108 'num' => 1, 105 109 'link' => 'File', 110 'url' => '', 106 111 'columns' => 1, 107 112 'filter' => 'Only', 113 'ids' => '', 108 114 ); 109 115 … … 176 182 </p> 177 183 184 <!-- Static URL --> 185 <p> 186 <label for="<?php echo $this->get_field_id( 'url' ); ?>"><?php esc_html_e( 'Static URL', 'shellbotics' ); ?></label> 187 <input id="<?php echo $this->get_field_id( 'url' ); ?>" type="text" name="<?php echo $this->get_field_name( 'url' ); ?>" value="<?php echo $instance['url']; ?>" class="widefat" /> 188 </p> 189 178 190 <!-- Number of columns to display --> 179 191 <p> … … 197 209 </select> 198 210 </p> 199 211 200 212 <!-- Image IDs --> 201 213 <p> … … 223 235 'size' => $instance['size'], 224 236 'link' => $instance['link'], 237 'url' => $instance['url'], 225 238 'columns' => $instance['columns'], 226 239 'filter' => $instance['filter'],
Note: See TracChangeset
for help on using the changeset viewer.