Plugin Directory

Changeset 854693


Ignore:
Timestamp:
02/10/2014 12:00:35 PM (12 years ago)
Author:
Shellbot
Message:

Now compatible with PHP 5.4. Option to enter static URL for image link.

Location:
easy-image-display/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • easy-image-display/trunk/readme.txt

    r821130 r854693  
    33Tags: image, gallery, latest image, random image
    44Requires at least: 3.5
    5 Tested up to: 3.8
     5Tested up to: 3.8.1
     6Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T3XBQZNXBEHPC
    67Stable tag: trunk
    78License: GPLv2 or later
     
    2324* Display images at various sizes
    2425* Control how many images are displayed and in how many columns
    25 * Link images to a lightbox, or remove link entirely
     26* Link images to a lightbox, static URL, or remove link entirely
    2627* Uses gallery shortcode so will always fit your theme
    2728
     
    9697please post in [the plugin support forum](http://wordpress.org/support/plugin/easy-image-display) with a link to your site.
    9798
     99= How can I get rid of grey borders around my images? =
     100
     101This border is part of the default gallery CSS generated by WordPress. To override this you can add the following CSS to your
     102theme, 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
     110This margin is part of the default gallery CSS generated by WordPress. To override this you can add the following CSS to your
     111theme, usually in style.css :
     112
     113`.gallery-item {
     114    margin-top: 0px !important;
     115}`
     116
     117
    98118== 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
    99124
    100125= 1.1.0 =
     
    113138== Upgrade Notice ==
    114139
     140= 1.1.1 =
     141* New feature! Link images to static URL.
     142
    115143= 1.1.0 =
    116144* New feature! Include/exclude images based on ID.
  • easy-image-display/trunk/sb-easy-image-display.php

    r803013 r854693  
    44Plugin URI: http://shellbotics.com/wordpress-plugins/easy-image-display/
    55Description: An easy way to display random or latest images on your site.
    6 Version: 1.1.0
     6Version: 1.1.1
    77Author: Shellbot
    88Author URI: http://shellbotics.com
     
    5050   
    5151    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 );
    5353        wp_register_style( 'colorbox-css', plugin_dir_url( __FILE__ ). 'css/colorbox.css' );
    5454
     
    8282            'size'  => 'thumbnail',
    8383            'link' => 'file',
     84            'url' => '',
    8485            'columns' => '3',
    8586            'filter' => 'only',
     87            'ids' => '',
    8688        ), $args ) );
    8789
     
    9294            'size'  => $size,
    9395            'link' => $link, 
     96            'url' => $url,
    9497            'columns' => $columns,
    9598            'filter' => $filter,
    96             'ids' => $args['ids'],
     99            'ids' => $ids,
    97100        );
    98101
     
    110113            'size'  => 'thumbnail',
    111114            'link' => 'file',
     115            'url' => '',
    112116            'columns' => '3',
    113117            'filter' => 'only',
     118            'ids' => '',
    114119        ), $args ) );
    115120
     
    119124            'order' => $order,
    120125            'size'  => $size,
    121             'link' => $link, 
     126            'link' => $link,
     127            'url' => $url,
    122128            'columns' => $columns,
    123129            'filter' => $filter,
    124             'ids' => $args['ids'],
     130            'ids' => $ids,
    125131        );
    126132
     
    138144            'size'  => 'thumbnail',
    139145            'link' => 'file',
     146            'url' => '',
    140147            'columns' => '5',
    141148            'filter' => 'only',
     149            'ids' => '',
    142150        ), $args ) );
    143151
     
    147155            'order' => $order,
    148156            'size'  => $size,
    149             'link' => $link, 
     157            'link' => $link,
     158            'url' => $url,
    150159            'columns' => $columns,
    151160            'filter' => $filter,
    152             'ids' => $args['ids'],
     161            'ids' => $ids,
    153162        );
    154163
     
    183192            $attachments = $this->include_action( $args, $query );
    184193        } elseif( $args['ids'] ) {
    185             $ids = split( ',', $args['ids'] );
     194            $ids = explode( ',', $args['ids'] );
    186195           
    187196            if( strtolower( $args['filter'] ) == 'exclude' ) {
     
    203212                $ids .= $attachment->ID . ', ';
    204213            }
    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'] ) . '"]' );
    206215
    207216        } else {
     
    215224    function include_action( $args, $query ) {
    216225       
    217         $ids = split( ',', $args['ids'] );
     226        $ids = explode( ',', $args['ids'] );
    218227       
    219228        if( count( $ids ) >= $args['num'] ) {
     
    288297        global $post, $wp_locale;
    289298
    290         if ( 'lightbox' == $attr['link'] ) {
     299        if ( isset( $attr['link'] ) && 'lightbox' == $attr['link'] ) {
    291300            $attr['link'] = 'file';
    292301            $lightbox = 1;
     
    296305
    297306        // no link
    298         if ( isset( $attr['link'] ) && "none" == $attr['link']  ) {
     307        if ( isset( $attr['link'] ) && 'none' == $attr['link']  ) {
    299308            $output = preg_replace( array( '/<a[^>]*>/', '/<\/a>/'), '', $output );
    300309        }
    301310       
    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 ) {
    303318            $this->public_js();
    304319        }
  • easy-image-display/trunk/sb-easy-image-widget.php

    r803013 r854693  
    22/**
    33 * Widget Name: Easy Image Display
    4  * Version: 1.1.0
     4 * Version: 1.1.1
    55 */
    66
     
    4545        $instance['columns'] = $new_instance['columns'];
    4646        $instance['link']    = $new_instance['link'];
     47        $instance['url']     = $new_instance['url'];
    4748        $instance['filter']    = $new_instance['filter'];
    4849        $instance['ids']    = $new_instance['ids'];
     
    8182                'Attachment',
    8283                'File',
     84                'URL',
    8385            ),
    8486            'filter' => array(
     
    102104            $defaults = array(
    103105                'title' => esc_html__( 'Latest Image', 'shellbotics' ),
     106                'order' => 'newest',
     107                'size' => 'thumbnail',
    104108                'num' => 1,
    105109                'link' => 'File',
     110                'url' => '',
    106111                'columns' => 1,
    107112                'filter' => 'Only',
     113                'ids' => '',
    108114            );
    109115
     
    176182                </p>
    177183               
     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               
    178190            <!-- Number of columns to display -->
    179191            <p>
     
    197209                </select>
    198210            </p>
    199                 
     211 
    200212            <!-- Image IDs -->
    201213            <p>
     
    223235            'size'    => $instance['size'],
    224236            'link'    => $instance['link'], 
     237            'url'     => $instance['url'],
    225238            'columns' => $instance['columns'],
    226239            'filter'  => $instance['filter'],
Note: See TracChangeset for help on using the changeset viewer.