Plugin Directory

Changeset 1174023


Ignore:
Timestamp:
06/03/2015 11:39:51 PM (11 years ago)
Author:
ronakg
Message:

Added swipebox as another slideshow option

Location:
awesome-flickr-gallery-plugin/trunk
Files:
12 added
4 edited

Legend:

Unmodified
Added
Removed
  • awesome-flickr-gallery-plugin/trunk/README.txt

    r1173938 r1174023  
    55Requires at least: 3.0
    66Tested up to: 4.2.2
    7 Stable tag: 3.3.6
     7Stable tag: 3.5.2
    88License: GPLv2 or later
    99
     
    113113
    114114== Upgrade Notice ==
     115
     116= 3.5.2 =
     117[MAJOR CHANGE] I had to remove the Highslide option from list of slideshows. Apparently it is not compatible with WordPress's set of rules for licensing.
     118[Enhancement] Highslide is replaced with Swipebox. A much better slideshow plugin which also supports touch swipes.
    115119
    116120= 3.3.5 =
     
    282286== Changelog ==
    283287
     288= 3.5.2 =
     289* [MAJOR CHANGE] I had to remove the Highslide option from list of slideshows. Apparently it is not compatible with WordPress's set of rules for licensing.
     290* [Enhancement] Highslide is replaced with Swipebox. A much better slideshow plugin which also supports touch swipes.
     291
    284292= 3.3.5 =
    285293* [Bug Fix] Add support for Flickr API changes related to SSL.
  • awesome-flickr-gallery-plugin/trunk/afg_admin_settings.php

    r912354 r1174023  
    5858    if (get_option('afg_credit_note') == '0') update_option('afg_credit_note', 'off');
    5959    if (!get_option('afg_pagination')) update_option('afg_pagination', 'on');
    60     if (get_option('afg_slideshow_option') == '' || get_option('afg_slideshow_option') == 'highslide') update_option('afg_slideshow_option', 'colorbox');
     60    if (get_option('afg_slideshow_option') == '' || get_option('afg_slideshow_option') == 'highslide') update_option('afg_slideshow_option', 'swipebox');
    6161    if (get_option('afg_custom_css') == '') update_option('afg_custom_css', '/* Start writing your custom CSS here */');
    6262    if (get_option('afg_disable_slideshow')) update_option('afg_slideshow_option', 'disable');
     
    179179    if ($galleries) {
    180180        foreach ($galleries as &$gallery) {
    181             if (!isset($gallery['slideshow_option']))
    182                 $gallery['slideshow_option'] = 'colorbox';
     181            if (!isset($gallery['slideshow_option']) && $gallery['slideshow_option'] == 'highslide')
     182                $gallery['slideshow_option'] = 'swipebox';
    183183        }
    184184        update_option('afg_galleries', $galleries);
    185185    }
    186186    unset($gallery);
    187 
    188187}
    189188
     
    358357                                 <td>Slideshow Behavior</td>
    359358                                 <td><select name='afg_slideshow_option'>
    360                                        <?php echo afg_generate_options($afg_slideshow_map, get_option('afg_slideshow_option', 'colorbox')); ?>
     359                                       <?php echo afg_generate_options($afg_slideshow_map, get_option('afg_slideshow_option', 'swipebox')); ?>
    361360                                 </select></td>
    362361                              </tr>
  • awesome-flickr-gallery-plugin/trunk/afg_libs.php

    r912354 r1174023  
    1919    'default' => 'Default',
    2020    'colorbox' => 'Colorbox',
     21    'swipebox' => 'Swipebox (Touch Enabled)',
    2122    'disable' => 'No Slideshow',
    2223    'flickr' => 'Link to Flickr Photo page',
  • awesome-flickr-gallery-plugin/trunk/index.php

    r1173938 r1174023  
    44   Plugin URI: http://www.ronakg.com/projects/awesome-flickr-gallery-wordpress-plugin/
    55   Description: Awesome Flickr Gallery is a simple, fast and light plugin to create a gallery of your Flickr photos on your WordPress enabled website.  This plugin aims at providing a simple yet customizable way to create stunning Flickr gallery.
    6    Version: 3.3.6
     6   Version: 3.5.2
    77   Author: Ronak Gandhi
    88   Author URI: http://www.ronakg.com
     
    3535}
    3636
     37function afg_enqueue_swipebox_scripts() {
     38    wp_enqueue_script('jquery');
     39    wp_enqueue_script('afg_swipebox_script', BASE_URL . "/swipebox/js/jquery.swipebox.min.js" , array('jquery'));
     40    wp_enqueue_script('afg_swipebox_js', BASE_URL . "/swipebox/myswipebox.js" , array('jquery'));
     41}
     42
    3743function afg_enqueue_cbox_styles() {
    3844    wp_enqueue_style('afg_colorbox_css', BASE_URL . "/colorbox/colorbox.css");
    3945}
    4046
     47function afg_enqueue_swipebox_styles() {
     48    wp_enqueue_style('afg_swipebox_css', BASE_URL . "/swipebox/css/swipebox.min.css");
     49}
     50
    4151function afg_enqueue_styles() {
    4252    wp_enqueue_style('afg_css', BASE_URL . "/afg.css");
     
    4454
    4555$enable_colorbox = get_option('afg_slideshow_option') == 'colorbox';
     56$enable_swipebox = get_option('afg_slideshow_option') == 'swipebox';
    4657
    4758if (!is_admin()) {
     59    global $enable_colorbox, $enable_swipebox;
    4860    /* Short code to load Awesome Flickr Gallery plugin.  Detects the word
    4961     * [AFG_gallery] in posts or pages and loads the gallery.
     
    5870            break;
    5971        }
     72
     73        if ($gallery['slideshow_option'] == 'swipebox') {
     74            $enable_swipebox = true;
     75            break;
     76        }
    6077    }
    6178
     
    6380        add_action('wp_print_scripts', 'afg_enqueue_cbox_scripts');
    6481        add_action('wp_print_styles', 'afg_enqueue_cbox_styles');
     82    }
     83
     84    if ($enable_swipebox) {
     85        add_action('wp_print_scripts', 'afg_enqueue_swipebox_scripts');
     86        add_action('wp_print_styles', 'afg_enqueue_swipebox_styles');
    6587    }
    6688
     
    218240        $photos = array();
    219241        for($i=1; $i<($total_photos/500)+1; $i++) {
     242            $flickr_api = 'photos';
    220243            if ($photoset_id) {
    221244                $flickr_api = 'photoset';
     
    224247            }
    225248            else if ($gallery_id) {
    226                 $flickr_api = 'photos';
    227249                $rsp_obj_total = $pf->galleries_getPhotos($gallery_id, $extras, 500, $i);
    228250                if ($pf->error_code) return afg_error();
    229251            }
    230252            else if ($group_id) {
    231                 $flickr_api = 'photos';
    232253                $rsp_obj_total = $pf->groups_pools_getPhotos($group_id, NULL, NULL, NULL, $extras, 500, $i);
    233254                if ($pf->error_code) return afg_error();
    234255            }
    235256            else if ($tags) {
    236                 $flickr_api = 'photos';
    237257                $rsp_obj_total = $pf->photos_search(array('user_id'=>$user_id, 'tags'=>$tags, 'extras'=>$extras, 'per_page'=>500, 'page'=>$i));
    238258                if ($pf->error_code) return afg_error();
    239259            }
    240260            else if ($popular) {
    241                 $flickr_api = 'photos';
    242261                $rsp_obj_total = $pf->photos_search(array('user_id'=>$user_id, 'sort'=>'interestingness-desc', 'extras'=>$extras, 'per_page'=>500, 'page'=>$i));
    243262                if ($pf->error_code) return afg_error();
    244263            }
    245264            else {
    246                 $flickr_api = 'photos';
    247265                if (get_option('afg_flickr_token')) $rsp_obj_total = $pf->people_getPhotos($user_id, array('extras' => $extras, 'per_page' => 500, 'page' => $i));
    248266                else $rsp_obj_total = $pf->people_getPublicPhotos($user_id, NULL, $extras, 500, $i);
     
    283301            $class = "class='afgcolorbox'";
    284302            $rel = "rel='example4{$id}'";
     303            $click_event = "";
     304        }
     305        else if ($slideshow_option == 'swipebox') {
     306            $class = "class='swipebox'";
     307            //$rel = "rel='gallery-{$id}'";
    285308            $click_event = "";
    286309        }
Note: See TracChangeset for help on using the changeset viewer.