Instagram Slider Widget - Version 1.0.2

Version Description

  • Compatibility for php version older than 5.3
  • css stlying fix for thumbnail layout
  • Randomise Images
Download this release

Release Info

Developer jetonr
Plugin Icon 128x128 Instagram Slider Widget
Version 1.0.2
Comparing to
See all releases

Version 1.0.2

css/instag-slider.css ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Flexislider Default Settings */
2
+ .pllexislider { margin: 0; padding: 0; }
3
+ .pllexislider .slides > li {display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */
4
+ .pllexislider .slides img {width: 100%; display: block;}
5
+ .pllexislider .slides:after { display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
6
+ .flex-pauseplay span { text-transform: capitalize; }
7
+ .pllexislider, .pllexislider .slides li, .pllexislider .slides > li > a { height: 100%; }
8
+
9
+ /* no list style */
10
+ .instag .no-bullet, .pllexislider .no-bullet { list-style:none; padding: 0; margin:0; }
11
+
12
+ /* Flexi Slider Template */
13
+ .pllexislider { margin: 0; position: relative; }
14
+ .flex-viewport { max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -o-transition: all 1s ease; transition: all 1s ease; }
15
+ .loading .flex-viewport { max-height: 300px; }
16
+ .pllexislider .slides { zoom: 1; }
17
+
18
+ /* Thumbnails Template */
19
+ .instag ul.thumbnails > li { margin:0 auto; display: inline-block; *display:inline; float: none; width:24% !important; }
20
+ .instag ul.thumbnails img { width: 100%; }
21
+
22
+ /* Control Nav */
23
+ .pllexislider .flex-control-nav { z-index:2; position: absolute; top: 0.8em; right:0.8em; text-align: center; }
24
+ .pllexislider .flex-control-nav li { margin: 0 3px; display: inline-block; zoom: 1; *display: inline; }
25
+ .pllexislider .flex-control-paging li a { width: 13px; border: none; height: 13px; display: block; background: #fff; background: rgba(255,255,255,255,0.5); cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.3); -moz-box-shadow: inset 0 0 2px rgba(0,0,0,0.3); -o-box-shadow: inset 0 0 2px rgba(0,0,0,0.3); box-shadow: inset 0 0 2px rgba(0,0,0,0.3); }
26
+ .pllexislider .flex-control-paging li a:hover { background: #fff; background: rgba(255,255,255,0.7); }
27
+ .pllexislider .flex-control-paging li a.flex-active { background: #fff; background: rgba(255,255,255,0.9); cursor: default; }
28
+
29
+ /* Description and Time */
30
+ .pllexislider ul li .instadescription p { margin-top:5px; margin-bottom: 5px; display: block; }
31
+ .pllexislider ul li .instatime { margin-top:5px; width: 40%; float:right; text-align: right; }
32
+
inc/functions.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ if ( ! function_exists( 'instag_images_data' ) ) :
5
+ /**
6
+ * Stores the fetched data from instagram in WordPress DB using transients
7
+ *
8
+ * @return array of localy saved instagram data
9
+ */
10
+ function instag_images_data( $username, $cache_hours, $nr_images ) {
11
+
12
+ $opt_name = 'jr_insta_'.md5( $username );
13
+ $instaData = get_transient( $opt_name );
14
+ $user_opt = get_option( $opt_name );
15
+
16
+ if (
17
+ false === $instaData
18
+ || $user_opt['username'] != $username
19
+ || $user_opt['cache_hours'] != $cache_hours
20
+ || $user_opt['nr_images'] != $nr_images
21
+ )
22
+ {
23
+ $instaData = array();
24
+ $insta_url = 'http://instagram.com/';
25
+ $user_profile = $insta_url.$username;
26
+ $json = wp_remote_get( $user_profile, array( 'sslverify' => false, 'timeout'=> 60 ) );
27
+ $user_options = compact('username', 'cache_hours', 'nr_images');
28
+ update_option($opt_name, $user_options);
29
+ if ( $json['response']['code'] == 200 ) {
30
+
31
+ $json = $json['body'];
32
+ $json = strstr( $json, '{"entry_data"' );
33
+
34
+ // Compatibility for version of php where strstr() doesnt accept third parameter
35
+ if ( version_compare( phpversion(), '5.3.10', '<' ) ) {
36
+ $json = substr( $json, 0, strpos($json, '</script>' ) );
37
+ } else {
38
+ $json = strstr( $json, '</script>', true );
39
+ }
40
+
41
+ $json = rtrim( $json, ';' );
42
+ ( $results = json_decode( $json, true ) ) && json_last_error() == JSON_ERROR_NONE;
43
+
44
+ if ( ( $results ) && is_array( $results ) ) {
45
+ foreach( $results['entry_data']['UserProfile'][0]['userMedia'] as $current => $result ) {
46
+
47
+ if( $current >= $nr_images ) break;
48
+ $caption = $result['caption'];
49
+ $image = $result['images']['standard_resolution'];
50
+ $id = $result['id'];
51
+ $image = $image['url'];
52
+ $link = $result['link'];
53
+ $created_time = $caption['created_time'];
54
+ $text = utf8_4byte_to_3byte($caption['text']);
55
+
56
+ $filename_data= explode('.',$image);
57
+
58
+ if ( is_array( $filename_data ) ) {
59
+
60
+ $fileformat = end( $filename_data );
61
+
62
+ if ( $fileformat !== false ){
63
+
64
+ $image = download_insta_image( $image, md5( $id ) . '.' . $fileformat );
65
+ array_push( $instaData, array(
66
+ 'id' => $id,
67
+ 'user_name' => $username,
68
+ 'user_url' => $user_profile,
69
+ 'created_time'=> $created_time,
70
+ 'text' => $text,
71
+ 'image' => $image,
72
+ 'link' => $link
73
+ ));
74
+
75
+ } // end -> if $fileformat !== false
76
+
77
+ } // end -> is_array( $filename_data )
78
+
79
+ } // end -> foreach
80
+
81
+ } // end -> ( $results ) && is_array( $results ) )
82
+
83
+ } // end -> $json['response']['code'] === 200 )
84
+
85
+ if ( $instaData ) {
86
+ set_transient( $opt_name, $instaData, $cache_hours * 60 * 60 );
87
+ } // end -> true $instaData
88
+
89
+ } // end -> false === $instaData
90
+
91
+ return $instaData;
92
+ }
93
+ endif; // insta_images
94
+
95
+ if ( ! function_exists( 'download_insta_image' ) ) :
96
+ /**
97
+ * Save Instagram images to upload folder and ads to media.
98
+ * If the upload fails it returns the remote image url.
99
+ *
100
+ * @return url to image
101
+ */
102
+ function download_insta_image( $url , $file ){
103
+
104
+ $local_file = JR_INSTAGWP_UPLOAD_PATH . $file;
105
+
106
+ if ( file_exists( $local_file ) ) {
107
+ return JR_INSTAGWP_UPLODAD_URL . $file;
108
+ }
109
+
110
+ $get = wp_remote_get( $url, array( 'sslverify' => false ) );
111
+ $body = wp_remote_retrieve_body( $get );
112
+ $upload = wp_upload_bits( $file, '', $body );
113
+
114
+ if ( $upload ) {
115
+ return $upload['url'];
116
+ }
117
+
118
+ return $url;
119
+ }
120
+ endif; // download_insta_image
121
+
122
+ if ( ! function_exists( 'utf8_4byte_to_3byte' ) ) :
123
+ /**
124
+ * Sanitize 4-byte UTF8 chars; no full utf8mb4 support in drupal7+mysql stack.
125
+ * This solution runs in O(n) time BUT assumes that all incoming input is
126
+ * strictly UTF8.
127
+ *
128
+ * @return the sanitized input
129
+ */
130
+ function utf8_4byte_to_3byte($input) {
131
+
132
+ if (!empty($input)) {
133
+ $utf8_2byte = 0xC0 /*1100 0000*/; $utf8_2byte_bmask = 0xE0 /*1110 0000*/;
134
+ $utf8_3byte = 0xE0 /*1110 0000*/; $utf8_3byte_bmask = 0XF0 /*1111 0000*/;
135
+ $utf8_4byte = 0xF0 /*1111 0000*/; $utf8_4byte_bmask = 0xF8 /*1111 1000*/;
136
+
137
+ $sanitized = "";
138
+ $len = strlen($input);
139
+ for ($i = 0; $i < $len; ++$i) {
140
+ $mb_char = $input[$i]; // Potentially a multibyte sequence
141
+ $byte = ord($mb_char);
142
+ if (($byte & $utf8_2byte_bmask) == $utf8_2byte) {
143
+ $mb_char .= $input[++$i];
144
+ }
145
+ else if (($byte & $utf8_3byte_bmask) == $utf8_3byte) {
146
+ $mb_char .= $input[++$i];
147
+ $mb_char .= $input[++$i];
148
+ }
149
+ else if (($byte & $utf8_4byte_bmask) == $utf8_4byte) {
150
+ // Replace with ? to avoid MySQL exception
151
+ $mb_char = '?';
152
+ $i += 3;
153
+ }
154
+
155
+ $sanitized .= $mb_char;
156
+ }
157
+
158
+ $input= $sanitized;
159
+ }
160
+
161
+ return $input;
162
+ }
163
+ endif; // utf8_4byte_to_3byte
164
+
165
+ if ( ! function_exists( 'instag_templates' ) ) :
166
+ /**
167
+ * Helper Function to insert Templates for widget
168
+ *
169
+ * @include file templates
170
+ */
171
+ function instag_templates( $template, $data_arr ){
172
+
173
+ $filename = JR_INSTAGWP_PATH_TEMPLATE . $template . '.php';
174
+
175
+ if(file_exists( $filename )){
176
+
177
+ include $filename;
178
+
179
+ } else {
180
+
181
+ echo __( sprintf('Template not found<br>%s' , $filename), 'example' );
182
+ }
183
+ }
184
+ endif; // instag_templates
instaram_slider.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Instagram Slider Widget
4
+ Plugin URI: http://jrwebstudio.com/instagram-slider/
5
+ Version: 1.0.2
6
+ Description: Instagram Slider Widget is a responsive slider widget that shows 20 latest images from a public instagram user.
7
+ Author: jetonr
8
+ Author URI: http://jrwebstudio.com/
9
+ License: GPLv2 or later
10
+ */
11
+
12
+ /* Define Constants for this widget */
13
+ define('JR_INSTAGWP_PATH_BASE' , dirname(__FILE__) . DIRECTORY_SEPARATOR);
14
+ define('JR_INSTAGWP_PATH_TEMPLATE' , JR_INSTAGWP_PATH_BASE . 'templates/');
15
+ define('JR_INSTAGWP_PATH_INC' , JR_INSTAGWP_PATH_BASE . 'inc/');
16
+ define('JR_INSTAGWP_URL' , plugins_url( '/' , __FILE__ ));
17
+ define('JR_INSTAGWP_WP_VERSION' , get_bloginfo('version'));
18
+ define('JR_INSTAGWP_WP_MIN_VERSION' , 3.5);
19
+
20
+ $upload_dir = wp_upload_dir();
21
+ define('JR_INSTAGWP_UPLOAD_PATH' , $upload_dir['path'] . '/');
22
+ define('JR_INSTAGWP_UPLODAD_URL' , $upload_dir['baseurl'] . $upload_dir['subdir'] . '/');
23
+
24
+ // Require functions need for this widget
25
+ require_once ( JR_INSTAGWP_PATH_INC . 'functions.php' );
26
+
27
+ /* Enqueue Frontend Plugin Styles & Scripts */
28
+ function jr_insta_slider_enqueue() {
29
+
30
+ // Register and enqueue Styles
31
+ wp_enqueue_style( 'instag-slider', JR_INSTAGWP_URL . 'css/instag-slider.css' );
32
+
33
+ // Register and enqueue Scripts
34
+ wp_enqueue_script(
35
+ 'jquery-flexi-slider',
36
+ JR_INSTAGWP_URL . 'js/jquery.flexslider-min.js',
37
+ array( 'jquery' ),
38
+ false,
39
+ true
40
+ );
41
+
42
+ }
43
+ add_action( 'wp_enqueue_scripts', 'jr_insta_slider_enqueue' );
44
+
45
+ /* Register widget on windgets init */
46
+ add_action( 'widgets_init', 'jr_insta_slider_register' );
47
+ function jr_insta_slider_register() {
48
+ register_widget( 'JR_InstagramSlider' );
49
+ }
50
+
51
+ class JR_InstagramSlider extends WP_Widget {
52
+
53
+ public function __construct() {
54
+ parent::__construct(
55
+ 'jr_insta_slider', //-----> Widget ID
56
+ __( 'Instagram Slider', 'jrinstaslider' ), //--> Widget Name
57
+ array( //-----> Widget Options Array
58
+ 'classname' => 'jr-insta-slider',
59
+ 'description' => __( 'A widget that displays a slider with instagram images ', 'jrinstaslider' ),
60
+ )
61
+ );
62
+ }
63
+
64
+ function widget( $args, $instance ) {
65
+ extract( $args );
66
+
67
+ //Our variables from the widget settings.
68
+ $title = apply_filters('widget_title', $instance['title'] );
69
+ $username = $instance['username'];
70
+ $randomise = isset( $instance['randomise'] ) ? 'on' : 'off';
71
+ $images_nr = $instance['images_number'];
72
+ $refresh_hour = $instance['refresh_hour'];
73
+ $template = $instance['template'];
74
+
75
+ echo $before_widget;
76
+
77
+ // Display the widget title
78
+ if ( $title ) {
79
+ echo $before_title . $title . $after_title;
80
+ }
81
+ // Get instagram data
82
+ $insta_data = instag_images_data($username, $refresh_hour, $images_nr );
83
+
84
+ // Randomise Images
85
+ if ( "on" == $randomise ) {
86
+ shuffle( $insta_data );
87
+ }
88
+
89
+ //include the template based on user choice
90
+ instag_templates( $template, $insta_data );
91
+
92
+ echo $after_widget;
93
+ }
94
+
95
+ //Update the widget
96
+
97
+ function update( $new_instance, $old_instance ) {
98
+ $instance = $old_instance;
99
+
100
+ //Strip tags from title and name to remove HTML
101
+ $instance['title'] = strip_tags( $new_instance['title'] );
102
+ $instance['username'] = $new_instance['username'];
103
+ $instance['template'] = $new_instance['template'];
104
+ $instance['randomise'] = $new_instance['randomise'];
105
+ $instance['images_number'] = $new_instance['images_number'];
106
+ $instance['refresh_hour'] = $new_instance['refresh_hour'];
107
+
108
+ return $instance;
109
+ }
110
+
111
+
112
+ function form( $instance ) {
113
+
114
+ //Set up some default widget settings.
115
+ $defaults = array( 'title' => __('Instagram Slider', 'jrinstaslider'), 'username' => __('', 'jrinstaslider'), 'images_number' => 5, 'refresh_hour' => 5, 'template' => 'slider' );
116
+ $instance = wp_parse_args( (array) $instance, $defaults ); ?>
117
+
118
+ <p>
119
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'jrinstaslider'); ?></label>
120
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
121
+ </p>
122
+ <p>
123
+ <label for="<?php echo $this->get_field_id( 'username' ); ?>"><?php _e('Instagram Username:', 'jrinstaslider'); ?></label>
124
+ <input class="widefat" id="<?php echo $this->get_field_id( 'username' ); ?>" name="<?php echo $this->get_field_name( 'username' ); ?>" value="<?php echo $instance['username']; ?>" />
125
+ </p>
126
+ <p>
127
+ <label for="<?php echo $this->get_field_id( 'template' ); ?>"><?php _e( 'Images Layout', 'jrinstaslider' ); ?>
128
+ <select class="widefat" name="<?php echo $this->get_field_name( 'template' ); ?>">
129
+ <option value="slider" <?php echo ($instance['template'] == 'slider') ? ' selected="selected"' : ''; ?>><?php _e('Slider', 'jrinstaslider'); ?></option>
130
+ <option value="thumbs" <?php echo ($instance['template'] == 'thumbs') ? ' selected="selected"' : ''; ?>><?php _e('Thumbnails', 'jrinstaslider'); ?></option>
131
+ </select>
132
+ </label>
133
+ </p>
134
+ <p>
135
+ <label for="<?php echo $this->get_field_id( 'randomise' ); ?>"><?php _e( 'Randomise Images:', 'jrinstaslider' ); ?></label>
136
+ <input class="widefat" id="<?php echo $this->get_field_id( 'randomise' ); ?>" name="<?php echo $this->get_field_name( 'randomise' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['randomise'] ); ?> />
137
+ </p>
138
+ <p>
139
+ <label for="<?php echo $this->get_field_id( 'images_number' ); ?>"><?php _e('Number of Images to Show:', 'jrinstaslider'); ?>
140
+ <input class="small-text" id="<?php echo $this->get_field_id( 'images_number' ); ?>" name="<?php echo $this->get_field_name( 'images_number' ); ?>" value="<?php echo $instance['images_number']; ?>" />
141
+ <small><?php _e('( max 20 )', 'jrinstaslider'); ?></small>
142
+ </label>
143
+ </p>
144
+ <p>
145
+ <label for="<?php echo $this->get_field_id( 'refresh_hour' ); ?>"><?php _e('Check for new images every:', 'jrinstaslider'); ?>
146
+ <input class="small-text" id="<?php echo $this->get_field_id( 'refresh_hour' ); ?>" name="<?php echo $this->get_field_name( 'refresh_hour' ); ?>" value="<?php echo $instance['refresh_hour']; ?>" />
147
+ <small><?php _e('hours', 'jrinstaslider'); ?></small>
148
+ </label>
149
+ </p>
150
+
151
+ <?php
152
+ }
153
+ }
js/jquery.flexslider-min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*
2
+ * jQuery FlexSlider v2.2
3
+ * Copyright 2012 WooThemes
4
+ * Contributing Author: Tyler Smith
5
+ */
6
+ (function(e){e.pllexislider=function(t,n){var r=e(t);r.vars=e.extend({},e.pllexislider.defaults,n);var i=r.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,o=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,u="click touchend MSPointerUp",a="",f,l=r.vars.direction==="vertical",c=r.vars.reverse,h=r.vars.itemWidth>0,p=r.vars.animation==="fade",d=r.vars.asNavFor!=="",v={},m=true;e.data(t,"pllexislider",r);v={init:function(){r.animating=false;r.currentSlide=parseInt(r.vars.startAt?r.vars.startAt:0);if(isNaN(r.currentSlide))r.currentSlide=0;r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides.length;r.syncExists=e(r.vars.sync).length>0;if(r.vars.animation==="slide")r.vars.animation="swing";r.prop=l?"top":"marginLeft";r.args={};r.manualPause=false;r.stopped=false;r.started=false;r.startTimeout=null;r.transitions=!r.vars.video&&!p&&r.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t){if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("Perspective","").toLowerCase();r.prop="-"+r.pfx+"-transform";return true}}return false}();if(r.vars.controlsContainer!=="")r.controlsContainer=e(r.vars.controlsContainer).length>0&&e(r.vars.controlsContainer);if(r.vars.manualControls!=="")r.manualControls=e(r.vars.manualControls).length>0&&e(r.vars.manualControls);if(r.vars.randomize){r.slides.sort(function(){return Math.round(Math.random())-.5});r.container.empty().append(r.slides)}r.doMath();r.setup("init");if(r.vars.controlNav)v.controlNav.setup();if(r.vars.directionNav)v.directionNav.setup();if(r.vars.keyboard&&(e(r.containerSelector).length===1||r.vars.multipleKeyboard)){e(document).bind("keyup",function(e){var t=e.keyCode;if(!r.animating&&(t===39||t===37)){var n=t===39?r.getTarget("next"):t===37?r.getTarget("prev"):false;r.flexAnimate(n,r.vars.pauseOnAction)}})}if(r.vars.mousewheel){r.bind("mousewheel",function(e,t,n,i){e.preventDefault();var s=t<0?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(s,r.vars.pauseOnAction)})}if(r.vars.pausePlay)v.pausePlay.setup();if(r.vars.slideshow&&r.vars.pauseInvisible)v.pauseInvisible.init();if(r.vars.slideshow){if(r.vars.pauseOnHover){r.hover(function(){if(!r.manualPlay&&!r.manualPause)r.pause()},function(){if(!r.manualPause&&!r.manualPlay&&!r.stopped)r.play()})}if(!r.vars.pauseInvisible||!v.pauseInvisible.isHidden()){r.vars.initDelay>0?r.startTimeout=setTimeout(r.play,r.vars.initDelay):r.play()}}if(d)v.asNav.setup();if(o&&r.vars.touch)v.touch();if(!p||p&&r.vars.smoothHeight)e(window).bind("resize orientationchange focus",v.resize);r.find("img").attr("draggable","false");setTimeout(function(){r.vars.start(r)},200)},asNav:{setup:function(){r.asNav=true;r.animatingTo=Math.floor(r.currentSlide/r.move);r.currentItem=r.currentSlide;r.slides.removeClass(i+"active-slide").eq(r.currentItem).addClass(i+"active-slide");if(!s){r.slides.click(function(t){t.preventDefault();var n=e(this),s=n.index();var o=n.offset().left-e(r).scrollLeft();if(o<=0&&n.hasClass(i+"active-slide")){r.flexAnimate(r.getTarget("prev"),true)}else if(!e(r.vars.asNavFor).data("pllexislider").animating&&!n.hasClass(i+"active-slide")){r.direction=r.currentItem<s?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction,false,true,true)}})}else{t._slider=r;r.slides.each(function(){var t=this;t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",function(e){e.preventDefault();if(e.currentTarget._gesture)e.currentTarget._gesture.addPointer(e.pointerId)},false);t.addEventListener("MSGestureTap",function(t){t.preventDefault();var n=e(this),i=n.index();if(!e(r.vars.asNavFor).data("pllexislider").animating&&!n.hasClass("active")){r.direction=r.currentItem<i?"next":"prev";r.flexAnimate(i,r.vars.pauseOnAction,false,true,true)}})})}}},controlNav:{setup:function(){if(!r.manualControls){v.controlNav.setupPaging()}else{v.controlNav.setupManual()}},setupPaging:function(){var t=r.vars.controlNav==="thumbnails"?"control-thumbs":"control-paging",n=1,s,o;r.controlNavScaffold=e('<ol class="'+i+"control-nav "+i+t+'"></ol>');if(r.pagingCount>1){for(var f=0;f<r.pagingCount;f++){o=r.slides.eq(f);s=r.vars.controlNav==="thumbnails"?'<img src="'+o.attr("data-thumb")+'"/>':"<a>"+n+"</a>";if("thumbnails"===r.vars.controlNav&&true===r.vars.thumbCaptions){var l=o.attr("data-thumbcaption");if(""!=l&&undefined!=l)s+='<span class="'+i+'caption">'+l+"</span>"}r.controlNavScaffold.append("<li>"+s+"</li>");n++}}r.controlsContainer?e(r.controlsContainer).append(r.controlNavScaffold):r.append(r.controlNavScaffold);v.controlNav.set();v.controlNav.active();r.controlNavScaffold.delegate("a, img",u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){r.direction=s>r.currentSlide?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction)}}if(a===""){a=t.type}v.setToClearWatchedEvent()})},setupManual:function(){r.controlNav=r.manualControls;v.controlNav.active();r.controlNav.bind(u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){s>r.currentSlide?r.direction="next":r.direction="prev";r.flexAnimate(s,r.vars.pauseOnAction)}}if(a===""){a=t.type}v.setToClearWatchedEvent()})},set:function(){var t=r.vars.controlNav==="thumbnails"?"img":"a";r.controlNav=e("."+i+"control-nav li "+t,r.controlsContainer?r.controlsContainer:r)},active:function(){r.controlNav.removeClass(i+"active").eq(r.animatingTo).addClass(i+"active")},update:function(t,n){if(r.pagingCount>1&&t==="add"){r.controlNavScaffold.append(e("<li><a>"+r.count+"</a></li>"))}else if(r.pagingCount===1){r.controlNavScaffold.find("li").remove()}else{r.controlNav.eq(n).closest("li").remove()}v.controlNav.set();r.pagingCount>1&&r.pagingCount!==r.controlNav.length?r.update(n,t):v.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+i+'direction-nav"><li><a class="'+i+'prev" href="#">'+r.vars.prevText+'</a></li><li><a class="'+i+'next" href="#">'+r.vars.nextText+"</a></li></ul>");if(r.controlsContainer){e(r.controlsContainer).append(t);r.directionNav=e("."+i+"direction-nav li a",r.controlsContainer)}else{r.append(t);r.directionNav=e("."+i+"direction-nav li a",r)}v.directionNav.update();r.directionNav.bind(u,function(t){t.preventDefault();var n;if(a===""||a===t.type){n=e(this).hasClass(i+"next")?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(n,r.vars.pauseOnAction)}if(a===""){a=t.type}v.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";if(r.pagingCount===1){r.directionNav.addClass(e).attr("tabindex","-1")}else if(!r.vars.animationLoop){if(r.animatingTo===0){r.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1")}else if(r.animatingTo===r.last){r.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1")}else{r.directionNav.removeClass(e).removeAttr("tabindex")}}else{r.directionNav.removeClass(e).removeAttr("tabindex")}}},pausePlay:{setup:function(){var t=e('<div class="'+i+'pauseplay"><a></a></div>');if(r.controlsContainer){r.controlsContainer.append(t);r.pausePlay=e("."+i+"pauseplay a",r.controlsContainer)}else{r.append(t);r.pausePlay=e("."+i+"pauseplay a",r)}v.pausePlay.update(r.vars.slideshow?i+"pause":i+"play");r.pausePlay.bind(u,function(t){t.preventDefault();if(a===""||a===t.type){if(e(this).hasClass(i+"pause")){r.manualPause=true;r.manualPlay=false;r.pause()}else{r.manualPause=false;r.manualPlay=true;r.play()}}if(a===""){a=t.type}v.setToClearWatchedEvent()})},update:function(e){e==="play"?r.pausePlay.removeClass(i+"pause").addClass(i+"play").html(r.vars.playText):r.pausePlay.removeClass(i+"play").addClass(i+"pause").html(r.vars.pauseText)}},touch:function(){var e,n,i,o,u,a,f=false,d=0,v=0,m=0;if(!s){t.addEventListener("touchstart",g,false);function g(s){if(r.animating){s.preventDefault()}else if(window.navigator.msPointerEnabled||s.touches.length===1){r.pause();o=l?r.h:r.w;a=Number(new Date);d=s.touches[0].pageX;v=s.touches[0].pageY;i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o;e=l?v:d;n=l?d:v;t.addEventListener("touchmove",y,false);t.addEventListener("touchend",b,false)}}function y(t){d=t.touches[0].pageX;v=t.touches[0].pageY;u=l?e-v:e-d;f=l?Math.abs(u)<Math.abs(d-n):Math.abs(u)<Math.abs(v-n);var s=500;if(!f||Number(new Date)-a>s){t.preventDefault();if(!p&&r.transitions){if(!r.vars.animationLoop){u=u/(r.currentSlide===0&&u<0||r.currentSlide===r.last&&u>0?Math.abs(u)/o+2:1)}r.setProps(i+u,"setTouch")}}}function b(s){t.removeEventListener("touchmove",y,false);if(r.animatingTo===r.currentSlide&&!f&&!(u===null)){var l=c?-u:u,h=l>0?r.getTarget("next"):r.getTarget("prev");if(r.canAdvance(h)&&(Number(new Date)-a<550&&Math.abs(l)>50||Math.abs(l)>o/2)){r.flexAnimate(h,r.vars.pauseOnAction)}else{if(!p)r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,true)}}t.removeEventListener("touchend",b,false);e=null;n=null;u=null;i=null}}else{t.style.msTouchAction="none";t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",w,false);t._slider=r;t.addEventListener("MSGestureChange",E,false);t.addEventListener("MSGestureEnd",S,false);function w(e){e.stopPropagation();if(r.animating){e.preventDefault()}else{r.pause();t._gesture.addPointer(e.pointerId);m=0;o=l?r.h:r.w;a=Number(new Date);i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o}}function E(e){e.stopPropagation();var n=e.target._slider;if(!n){return}var r=-e.translationX,s=-e.translationY;m=m+(l?s:r);u=m;f=l?Math.abs(m)<Math.abs(-r):Math.abs(m)<Math.abs(-s);if(e.detail===e.MSGESTURE_FLAG_INERTIA){setImmediate(function(){t._gesture.stop()});return}if(!f||Number(new Date)-a>500){e.preventDefault();if(!p&&n.transitions){if(!n.vars.animationLoop){u=m/(n.currentSlide===0&&m<0||n.currentSlide===n.last&&m>0?Math.abs(m)/o+2:1)}n.setProps(i+u,"setTouch")}}}function S(t){t.stopPropagation();var r=t.target._slider;if(!r){return}if(r.animatingTo===r.currentSlide&&!f&&!(u===null)){var s=c?-u:u,l=s>0?r.getTarget("next"):r.getTarget("prev");if(r.canAdvance(l)&&(Number(new Date)-a<550&&Math.abs(s)>50||Math.abs(s)>o/2)){r.flexAnimate(l,r.vars.pauseOnAction)}else{if(!p)r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,true)}}e=null;n=null;u=null;i=null;m=0}}},resize:function(){if(!r.animating&&r.is(":visible")){if(!h)r.doMath();if(p){v.smoothHeight()}else if(h){r.slides.width(r.computedW);r.update(r.pagingCount);r.setProps()}else if(l){r.viewport.height(r.h);r.setProps(r.h,"setTotal")}else{if(r.vars.smoothHeight)v.smoothHeight();r.newSlides.width(r.computedW);r.setProps(r.computedW,"setTotal")}}},smoothHeight:function(e){if(!l||p){var t=p?r:r.viewport;e?t.animate({height:r.slides.eq(r.animatingTo).height()},e):t.height(r.slides.eq(r.animatingTo).height())}},sync:function(t){var n=e(r.vars.sync).data("pllexislider"),i=r.animatingTo;switch(t){case"animate":n.flexAnimate(i,r.vars.pauseOnAction,false,true);break;case"play":if(!n.playing&&!n.asNav){n.play()}break;case"pause":n.pause();break}},pauseInvisible:{visProp:null,init:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++){if(e[t]+"Hidden"in document)v.pauseInvisible.visProp=e[t]+"Hidden"}if(v.pauseInvisible.visProp){var n=v.pauseInvisible.visProp.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(n,function(){if(v.pauseInvisible.isHidden()){if(r.startTimeout)clearTimeout(r.startTimeout);else r.pause()}else{if(r.started)r.play();else r.vars.initDelay>0?setTimeout(r.play,r.vars.initDelay):r.play()}})}},isHidden:function(){return document[v.pauseInvisible.visProp]||false}},setToClearWatchedEvent:function(){clearTimeout(f);f=setTimeout(function(){a=""},3e3)}};r.flexAnimate=function(t,n,s,u,a){if(!r.vars.animationLoop&&t!==r.currentSlide){r.direction=t>r.currentSlide?"next":"prev"}if(d&&r.pagingCount===1)r.direction=r.currentItem<t?"next":"prev";if(!r.animating&&(r.canAdvance(t,a)||s)&&r.is(":visible")){if(d&&u){var f=e(r.vars.asNavFor).data("pllexislider");r.atEnd=t===0||t===r.count-1;f.flexAnimate(t,true,false,true,a);r.direction=r.currentItem<t?"next":"prev";f.direction=r.direction;if(Math.ceil((t+1)/r.visible)-1!==r.currentSlide&&t!==0){r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");t=Math.floor(t/r.visible)}else{r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");return false}}r.animating=true;r.animatingTo=t;if(n)r.pause();r.vars.before(r);if(r.syncExists&&!a)v.sync("animate");if(r.vars.controlNav)v.controlNav.active();if(!h)r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");r.atEnd=t===0||t===r.last;if(r.vars.directionNav)v.directionNav.update();if(t===r.last){r.vars.end(r);if(!r.vars.animationLoop)r.pause()}if(!p){var m=l?r.slides.filter(":first").height():r.computedW,g,y,b;if(h){g=r.vars.itemMargin;b=(r.itemW+g)*r.move*r.animatingTo;y=b>r.limit&&r.visible!==1?r.limit:b}else if(r.currentSlide===0&&t===r.count-1&&r.vars.animationLoop&&r.direction!=="next"){y=c?(r.count+r.cloneOffset)*m:0}else if(r.currentSlide===r.last&&t===0&&r.vars.animationLoop&&r.direction!=="prev"){y=c?0:(r.count+1)*m}else{y=c?(r.count-1-t+r.cloneOffset)*m:(t+r.cloneOffset)*m}r.setProps(y,"",r.vars.animationSpeed);if(r.transitions){if(!r.vars.animationLoop||!r.atEnd){r.animating=false;r.currentSlide=r.animatingTo}r.container.unbind("webkitTransitionEnd transitionend");r.container.bind("webkitTransitionEnd transitionend",function(){r.wrapup(m)})}else{r.container.animate(r.args,r.vars.animationSpeed,r.vars.easing,function(){r.wrapup(m)})}}else{if(!o){r.slides.eq(r.currentSlide).css({zIndex:1}).animate({opacity:0},r.vars.animationSpeed,r.vars.easing);r.slides.eq(t).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing,r.wrapup)}else{r.slides.eq(r.currentSlide).css({opacity:0,zIndex:1});r.slides.eq(t).css({opacity:1,zIndex:2});r.wrapup(m)}}if(r.vars.smoothHeight)v.smoothHeight(r.vars.animationSpeed)}};r.wrapup=function(e){if(!p&&!h){if(r.currentSlide===0&&r.animatingTo===r.last&&r.vars.animationLoop){r.setProps(e,"jumpEnd")}else if(r.currentSlide===r.last&&r.animatingTo===0&&r.vars.animationLoop){r.setProps(e,"jumpStart")}}r.animating=false;r.currentSlide=r.animatingTo;r.vars.after(r)};r.animateSlides=function(){if(!r.animating&&m)r.flexAnimate(r.getTarget("next"))};r.pause=function(){clearInterval(r.animatedSlides);r.animatedSlides=null;r.playing=false;if(r.vars.pausePlay)v.pausePlay.update("play");if(r.syncExists)v.sync("pause")};r.play=function(){if(r.playing)clearInterval(r.animatedSlides);r.animatedSlides=r.animatedSlides||setInterval(r.animateSlides,r.vars.slideshowSpeed);r.started=r.playing=true;if(r.vars.pausePlay)v.pausePlay.update("pause");if(r.syncExists)v.sync("play")};r.stop=function(){r.pause();r.stopped=true};r.canAdvance=function(e,t){var n=d?r.pagingCount-1:r.last;return t?true:d&&r.currentItem===r.count-1&&e===0&&r.direction==="prev"?true:d&&r.currentItem===0&&e===r.pagingCount-1&&r.direction!=="next"?false:e===r.currentSlide&&!d?false:r.vars.animationLoop?true:r.atEnd&&r.currentSlide===0&&e===n&&r.direction!=="next"?false:r.atEnd&&r.currentSlide===n&&e===0&&r.direction==="next"?false:true};r.getTarget=function(e){r.direction=e;if(e==="next"){return r.currentSlide===r.last?0:r.currentSlide+1}else{return r.currentSlide===0?r.last:r.currentSlide-1}};r.setProps=function(e,t,n){var i=function(){var n=e?e:(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo,i=function(){if(h){return t==="setTouch"?e:c&&r.animatingTo===r.last?0:c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:r.animatingTo===r.last?r.limit:n}else{switch(t){case"setTotal":return c?(r.count-1-r.currentSlide+r.cloneOffset)*e:(r.currentSlide+r.cloneOffset)*e;case"setTouch":return c?e:e;case"jumpEnd":return c?e:r.count*e;case"jumpStart":return c?r.count*e:e;default:return e}}}();return i*-1+"px"}();if(r.transitions){i=l?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)";n=n!==undefined?n/1e3+"s":"0s";r.container.css("-"+r.pfx+"-transition-duration",n)}r.args[r.prop]=i;if(r.transitions||n===undefined)r.container.css(r.args)};r.setup=function(t){if(!p){var n,s;if(t==="init"){r.viewport=e('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(r).append(r.container);r.cloneCount=0;r.cloneOffset=0;if(c){s=e.makeArray(r.slides).reverse();r.slides=e(s);r.container.empty().append(r.slides)}}if(r.vars.animationLoop&&!h){r.cloneCount=2;r.cloneOffset=1;if(t!=="init")r.container.find(".clone").remove();r.container.append(r.slides.first().clone().addClass("clone").attr("aria-hidden","true")).prepend(r.slides.last().clone().addClass("clone").attr("aria-hidden","true"))}r.newSlides=e(r.vars.selector,r);n=c?r.count-1-r.currentSlide+r.cloneOffset:r.currentSlide+r.cloneOffset;if(l&&!h){r.container.height((r.count+r.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){r.newSlides.css({display:"block"});r.doMath();r.viewport.height(r.h);r.setProps(n*r.h,"init")},t==="init"?100:0)}else{r.container.width((r.count+r.cloneCount)*200+"%");r.setProps(n*r.computedW,"init");setTimeout(function(){r.doMath();r.newSlides.css({width:r.computedW,"float":"left",display:"block"});if(r.vars.smoothHeight)v.smoothHeight()},t==="init"?100:0)}}else{r.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"});if(t==="init"){if(!o){r.slides.css({opacity:0,display:"block",zIndex:1}).eq(r.currentSlide).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing)}else{r.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+r.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(r.currentSlide).css({opacity:1,zIndex:2})}}if(r.vars.smoothHeight)v.smoothHeight()}if(!h)r.slides.removeClass(i+"active-slide").eq(r.currentSlide).addClass(i+"active-slide")};r.doMath=function(){var e=r.slides.first(),t=r.vars.itemMargin,n=r.vars.minItems,i=r.vars.maxItems;r.w=r.viewport===undefined?r.width():r.viewport.width();r.h=e.height();r.boxPadding=e.outerWidth()-e.width();if(h){r.itemT=r.vars.itemWidth+t;r.minW=n?n*r.itemT:r.w;r.maxW=i?i*r.itemT-t:r.w;r.itemW=r.minW>r.w?(r.w-t*(n-1))/n:r.maxW<r.w?(r.w-t*(i-1))/i:r.vars.itemWidth>r.w?r.w:r.vars.itemWidth;r.visible=Math.floor(r.w/r.itemW);r.move=r.vars.move>0&&r.vars.move<r.visible?r.vars.move:r.visible;r.pagingCount=Math.ceil((r.count-r.visible)/r.move+1);r.last=r.pagingCount-1;r.limit=r.pagingCount===1?0:r.vars.itemWidth>r.w?r.itemW*(r.count-1)+t*(r.count-1):(r.itemW+t)*r.count-r.w-t}else{r.itemW=r.w;r.pagingCount=r.count;r.last=r.count-1}r.computedW=r.itemW-r.boxPadding};r.update=function(e,t){r.doMath();if(!h){if(e<r.currentSlide){r.currentSlide+=1}else if(e<=r.currentSlide&&e!==0){r.currentSlide-=1}r.animatingTo=r.currentSlide}if(r.vars.controlNav&&!r.manualControls){if(t==="add"&&!h||r.pagingCount>r.controlNav.length){v.controlNav.update("add")}else if(t==="remove"&&!h||r.pagingCount<r.controlNav.length){if(h&&r.currentSlide>r.last){r.currentSlide-=1;r.animatingTo-=1}v.controlNav.update("remove",r.last)}}if(r.vars.directionNav)v.directionNav.update()};r.addSlide=function(t,n){var i=e(t);r.count+=1;r.last=r.count-1;if(l&&c){n!==undefined?r.slides.eq(r.count-n).after(i):r.container.prepend(i)}else{n!==undefined?r.slides.eq(n).before(i):r.container.append(i)}r.update(n,"add");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.added(r)};r.removeSlide=function(t){var n=isNaN(t)?r.slides.index(e(t)):t;r.count-=1;r.last=r.count-1;if(isNaN(t)){e(t,r.slides).remove()}else{l&&c?r.slides.eq(r.last).remove():r.slides.eq(t).remove()}r.doMath();r.update(n,"remove");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.removed(r)};v.init()};e(window).blur(function(e){focused=false}).focus(function(e){focused=true});e.pllexislider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:false,animationLoop:true,smoothHeight:false,startAt:0,slideshow:true,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:false,thumbCaptions:false,pauseOnAction:true,pauseOnHover:false,pauseInvisible:true,useCSS:true,touch:true,video:false,controlNav:true,directionNav:true,prevText:"Previous",nextText:"Next",keyboard:true,multipleKeyboard:false,mousewheel:false,pausePlay:false,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:true,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};e.fn.pllexislider=function(t){if(t===undefined)t={};if(typeof t==="object"){return this.each(function(){var n=e(this),r=t.selector?t.selector:".slides > li",i=n.find(r);if(i.length===1&&t.allowOneSlide===true||i.length===0){i.fadeIn(400);if(t.start)t.start(n)}else if(n.data("pllexislider")===undefined){new e.pllexislider(this,t)}})}else{var n=e(this).data("pllexislider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"stop":n.stop();break;case"next":n.flexAnimate(n.getTarget("next"),true);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),true);break;default:if(typeof t==="number")n.flexAnimate(t,true)}}}})(jQuery)
readme.txt ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Instagram Slider Widget ===
2
+ Contributors: jetonr
3
+ Tags: instagram, slider, widget, images
4
+ Donate link: http://goo.gl/RZiu34
5
+ Requires at least: 3.5
6
+ Tested up to: 3.8.1
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Instagram Slider Widget is a responsive slider widget that shows 20 latest images from a public instagram user.
11
+
12
+ == Description ==
13
+ * Instagram Slider Widget is a responsive slider widget that shows 20 latest images from a public instagram user.
14
+ = Features =
15
+ * Images are stored in your wordpress upload folder.
16
+ * Display Images in Slider or Thumbnails
17
+ * No Api Key Needed
18
+ * Option to Randomise order of instagram images
19
+ * For more info visit http://jrwebstudio.com/
20
+
21
+ == Installation ==
22
+ 1. Upload `instagram-slider-widget` to the `/wp-content/plugins/` directory
23
+ 2. Activate the plugin through the \'Plugins\' menu in WordPress
24
+ 3. Go to Appearance > Widgets and drag \'Instagram Slider Widget\' to your sidebar
25
+ 4. Update the settings in the widget: Instagram Username, Images Layout, Number of Images to show, Check for new images hours
26
+
27
+ == Screenshots ==
28
+ 1. Frontend Widget Slider
29
+ 2. Frontend Widget Thumbs
30
+ 3. Backend Configuration
31
+
32
+ == Changelog ==
33
+ = 1.0.2 =
34
+ * Compatibility for php version older than 5.3
35
+ * css stlying fix for thumbnail layout
36
+ * Randomise Images
37
+
38
+ = 1.0.1 =
39
+ * Removed preg_match
40
+ * Using exact array index
41
+ * Bug Fixes
42
+
43
+ = 1.0 =
44
+ * First Realease
45
+
46
+ == Rate the Plugin ==
47
+ * If you liked this plugin. Please rate it
templates/slider.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ jQuery(document).ready(function($) {
3
+ $('.pllexislider').pllexislider({
4
+ animation: "slide",
5
+ directionNav: false,
6
+ });
7
+ });
8
+ </script>
9
+ <div class="pllexislider">
10
+ <ul class="no-bullet slides">
11
+ <?php
12
+ if ( isset($data_arr) && is_array($data_arr) ) {
13
+ foreach ($data_arr as $data) {
14
+ foreach ( $data as $k => $v) {
15
+ $$k = $v;
16
+ }
17
+ echo '<li>'. "\n";
18
+ echo '<a target="_blank" href="'.$link.'"><img src="'.$image.'" alt="'.$text.'"></a>' . "\n";
19
+ if ( $created_time ) {
20
+ echo '<div class="instatime">'. human_time_diff( $created_time ) . ' ago</div>' . "\n";
21
+ }
22
+ echo '<div class="instadescription">' . "\n";
23
+ echo '<p>by <a href="'. $user_url .'">'. $user_name .'</a></p>' . "\n";
24
+ if ($text) {
25
+ echo '<p>'.$text.'</p>' . "\n";
26
+ }
27
+ echo '</div>' . "\n";
28
+ echo '</li>' . "\n";
29
+
30
+ }
31
+ }
32
+ ?>
33
+ </ul>
34
+ </div>
templates/thumbs.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="instag">
3
+ <ul class="thumbnails no-bullet">
4
+ <?php
5
+ if ( isset($data_arr) && is_array($data_arr) ) {
6
+ foreach ($data_arr as $data) {
7
+ foreach ( $data as $k => $v) {
8
+ $$k = $v;
9
+ }
10
+ echo '<li>'. "\n";
11
+ echo '<a target="_blank" href="'.$link.'"><img src="'.$image.'" alt="'.$text.'"></a>' . "\n";
12
+ echo '</li>' . "\n";
13
+ }
14
+ }
15
+ ?>
16
+ </ul>
17
+ </div>