Version Description
- Code rewritten and optimized
- Code Ready for localization
- Javascript errors fixed
- Compatibility fix for Beaver Builder
Download this release
Release Info
Developer | mediabeta |
Plugin | Enjoy Instagram feed on website with WordPress Widget and Shortcode |
Version | 4.0.0 |
Comparing to | |
See all releases |
Code changes from version 3.2 to 4.0.0
- {css → assets/css}/enjoyinstagram_settings.css +1 -5
- {css → assets/css}/grid_demo.css +0 -0
- {css → assets/css}/grid_fallback.css +0 -0
- {css → assets/css}/grid_style.css +0 -0
- {css → assets/css}/owl.carousel.css +15 -4
- {css → assets/css}/owl.theme.css +0 -0
- {css → assets/css}/owl.transitions.css +0 -0
- {css → assets/css}/swipebox.css +0 -0
- assets/fonts/codropsicons/codropsicons.eot +0 -0
- assets/fonts/codropsicons/codropsicons.svg +24 -0
- assets/fonts/codropsicons/codropsicons.ttf +0 -0
- assets/fonts/codropsicons/codropsicons.woff +0 -0
- assets/fonts/codropsicons/license.txt +6 -0
- assets/fonts/icons/icons.eot +0 -0
- assets/fonts/icons/icons.svg +11 -0
- assets/fonts/icons/icons.ttf +0 -0
- assets/fonts/icons/icons.woff +0 -0
- {images → assets/images}/buymeacoffee.png +0 -0
- {images → assets/images}/enjoyinstagram.png +0 -0
- {js → assets/js}/ios-orientationchange-fix.js +0 -0
- assets/js/ios-orientationchange-fix.min.js +1 -0
- {js → assets/js}/jquery.gridrotator.js +102 -83
- assets/js/jquery.gridrotator.min.js +1 -0
- {js → assets/js}/jquery.swipebox.js +22 -30
- assets/js/jquery.swipebox.min.js +1 -0
- js/modernizr.custom.26633.js → assets/js/modernizr.custom.26633.min.js +0 -0
- {js → assets/js}/owl.carousel.js +0 -0
- assets/js/owl.carousel.min.js +1 -0
- enjoyinstagram.php +27 -693
- images/AjaxLoader.gif +0 -0
- images/ImageAttribution.txt +0 -2
- images/Instagram-icon.png +0 -0
- images/Thumbs.db +0 -0
- images/bg.jpg +0 -0
- images/carousel.png +0 -0
- images/grabbing.png +0 -0
- images/griglia.png +0 -0
- images/icons.png +0 -0
- images/icons.svg +0 -1
- images/light.png +0 -0
- images/loader.gif +0 -0
- images/loading.gif +0 -0
- img/gift2016.jpg +0 -0
- img/gift2016_dashboard.jpg +0 -0
- img/icons.png +0 -0
- img/icons.svg +0 -1
- img/loader.gif +0 -0
- includes/class.enjoyinstagram-activation.php +46 -0
- includes/class.enjoyinstagram-admin.php +298 -0
- includes/class.enjoyinstagram-api-connection.php +384 -0
- includes/class.enjoyinstagram-shortcodes.php +293 -0
- includes/functions.enjoyinstagram.php +121 -0
- {tinymce → includes/tinymce}/editor_plugin.js +0 -0
- {tinymce → includes/tinymce}/enjoyinstagramtinymce.js +0 -0
- {images → includes/tinymce}/icon_enjoyinstagram.png +0 -0
- tinymce/window.php → includes/tinymce/shortcode-tinymce-window.php +24 -16
- includes/tinymce/tinymce.php +103 -0
- includes/widgets/widgets.php +124 -0
- includes/widgets/widgets_grid.php +117 -0
- index.php +2 -0
- js/jquery.gridrotator copia.js +0 -756
- js/shortcode_button.js +0 -41
- languages/enjoyinstagram.pot +238 -0
- library/autenticazione.php +0 -93
- library/enjoyinstagram_shortcode.php +0 -101
- library/enjoyinstagram_shortcode_grid.php +0 -106
- library/enjoyinstagram_shortcode_grid_widget.php +0 -112
- library/enjoyinstagram_shortcode_widget.php +0 -82
- library/impostazioni_shortcode.php +0 -169
- library/instagram.class.php +0 -569
- library/profile_auth.php +0 -30
- library/shortcode_button.php +0 -30
- library/widgets.php +0 -116
- library/widgets_grid.php +0 -116
- plugin-options/options.php +36 -0
- readme.txt +172 -144
- templates/admin/enjoyinstagram-advanced-settings.php +190 -0
- templates/admin/enjoyinstagram-general-settings.php +59 -0
- templates/admin/settings.php +79 -0
- templates/shortcodes/carousel-widget.php +53 -0
- templates/shortcodes/carousel.php +61 -0
- templates/shortcodes/grid-widget.php +59 -0
- templates/shortcodes/grid.php +63 -0
- tinymce/ajax.php +0 -23
- tinymce/icon_enjoyinstagram.png +0 -0
- tinymce/tinymce.php +0 -82
{css → assets/css}/enjoyinstagram_settings.css
RENAMED
@@ -70,15 +70,11 @@
|
|
70 |
margin-bottom:12px;
|
71 |
|
72 |
}
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
|
78 |
.desc {
|
79 |
padding: 15px;
|
80 |
}
|
81 |
-
.
|
82 |
font-size:1rem;
|
83 |
}
|
84 |
.ei_settings_float_block{
|
70 |
margin-bottom:12px;
|
71 |
|
72 |
}
|
|
|
|
|
|
|
|
|
73 |
|
74 |
.desc {
|
75 |
padding: 15px;
|
76 |
}
|
77 |
+
.highlighted {
|
78 |
font-size:1rem;
|
79 |
}
|
80 |
.ei_settings_float_block{
|
{css → assets/css}/grid_demo.css
RENAMED
File without changes
|
{css → assets/css}/grid_fallback.css
RENAMED
File without changes
|
{css → assets/css}/grid_style.css
RENAMED
File without changes
|
{css → assets/css}/owl.carousel.css
RENAMED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*
|
2 |
* Core Owl Carousel CSS File
|
3 |
* v1.3.2
|
4 |
*/
|
@@ -36,7 +36,7 @@
|
|
36 |
-o-transition: height 500ms ease-in-out;
|
37 |
transition: height 500ms ease-in-out;
|
38 |
}
|
39 |
-
|
40 |
.owl-carousel .owl-item{
|
41 |
float: left;
|
42 |
}
|
@@ -54,7 +54,7 @@
|
|
54 |
}
|
55 |
|
56 |
/* mouse grab icon */
|
57 |
-
.grabbing {
|
58 |
cursor:url(grabbing.png) 8 8, move;
|
59 |
}
|
60 |
|
@@ -71,4 +71,15 @@
|
|
71 |
|
72 |
.owl-wrapper {
|
73 |
text-align:center;
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
* Core Owl Carousel CSS File
|
3 |
* v1.3.2
|
4 |
*/
|
36 |
-o-transition: height 500ms ease-in-out;
|
37 |
transition: height 500ms ease-in-out;
|
38 |
}
|
39 |
+
|
40 |
.owl-carousel .owl-item{
|
41 |
float: left;
|
42 |
}
|
54 |
}
|
55 |
|
56 |
/* mouse grab icon */
|
57 |
+
.grabbing {
|
58 |
cursor:url(grabbing.png) 8 8, move;
|
59 |
}
|
60 |
|
71 |
|
72 |
.owl-wrapper {
|
73 |
text-align:center;
|
74 |
+
}
|
75 |
+
|
76 |
+
.enjoy-instagram-carousel .box a {
|
77 |
+
display: block;
|
78 |
+
box-shadow: none;
|
79 |
+
}
|
80 |
+
.enjoy-instagram-carousel .box a img {
|
81 |
+
width: 100%;
|
82 |
+
height: auto;
|
83 |
+
box-shadow: none;
|
84 |
+
opacity: 0;
|
85 |
+
}
|
{css → assets/css}/owl.theme.css
RENAMED
File without changes
|
{css → assets/css}/owl.transitions.css
RENAMED
File without changes
|
{css → assets/css}/swipebox.css
RENAMED
File without changes
|
assets/fonts/codropsicons/codropsicons.eot
ADDED
Binary file
|
assets/fonts/codropsicons/codropsicons.svg
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>
|
5 |
+
This is a custom SVG font generated by IcoMoon.
|
6 |
+
<iconset grid="14"></iconset>
|
7 |
+
</metadata>
|
8 |
+
<defs>
|
9 |
+
<font id="codropsicons" horiz-adv-x="448" >
|
10 |
+
<font-face units-per-em="448" ascent="384" descent="-64" />
|
11 |
+
<missing-glyph horiz-adv-x="448" />
|
12 |
+
<glyph unicode="" d="M 221.657,359.485 ,m0.00,0.00,c 0.00,0.00 -132.984-182.838 -132.205-286.236 0.515-68.522 61.089-123.688 135.314-123.218 74.202,0.479 133.943,56.421 133.428,124.943 C 357.414,178.368 221.657,359.485 221.657,359.485 z" />
|
13 |
+
<glyph unicode="" d="M 384.00,160.00l0.00-32.00 q0.00-13.25 -8.125-22.625t-21.125-9.375l-176.00,0.00 l 73.25-73.50q 9.50-9.00 9.50-22.50t-9.50-22.50l-18.75-19.00q-9.25-9.25 -22.50-9.25q-13.00,0.00 -22.75,9.25l-162.75,163.00q-9.25,9.25 -9.25,22.50q0.00,13.00 9.25,22.75l 162.75,162.50q 9.50,9.50 22.75,9.50q 13.00,0.00 22.50-9.50l 18.75-18.50q 9.50-9.50 9.50-22.75t-9.50-22.75l-73.25-73.25l 176.00,0.00 q 13.00,0.00 21.125-9.375 t 8.125-22.625z" horiz-adv-x="384" />
|
14 |
+
<glyph unicode="" d="M 407.273-23.273c0.00,0.00-325.818,0.00-366.545,0.00s-40.727,40.727-40.727,40.727l0.00,142.545 l 101.818,183.273l 244.364,0.00 l 101.818-183.273c0.00,0.00,0.00-101.818,0.00-142.545S 407.273-23.273, 407.273-23.273z M 325.818,302.545L 122.182,302.545
|
15 |
+
l-71.273-142.545L 142.545,160.00 c0.00,0.00, 40.727,0.00, 40.727-40.727l0.00-20.364 l 81.455,0.00 l0.00,20.364 c0.00,0.00,0.00,40.727, 40.727,40.727l 91.636,0.00 L 325.818,302.545z M 407.273,119.273l-96.911,0.00 C 307.532,113.917, 305.455,107.503, 305.455,98.909c0.00-40.727-40.727-40.727-40.727-40.727L 183.273,58.182 c0.00,0.00-40.727,0.00-40.727,40.727
|
16 |
+
c0.00,8.593-2.077,15.008-4.908,20.364L 40.727,119.273 l0.00-101.818 l 366.545,0.00 L 407.273,119.273 z M 132.364,221.091l 183.273,0.00 L 325.818,200.727L 122.182,200.727 L 132.364,221.091z M 152.727,261.818l 142.545,0.00 L 305.455,241.455L 142.545,241.455 L 152.727,261.818z" />
|
17 |
+
<glyph unicode="" d="M 368.00,144.00q0.00-13.50 -9.25-22.75l-162.75-162.75q-9.75-9.25 -22.75-9.25q-12.75,0.00 -22.50,9.25l-18.75,18.75q-9.50,9.50 -9.50,22.75t 9.50,22.75l 73.25,73.25l-176.00,0.00 q-13.00,0.00 -21.125,9.375t-8.125,22.625l0.00,32.00 q0.00,13.25 8.125,22.625t 21.125,9.375l 176.00,0.00 l-73.25,73.50q-9.50,9.00 -9.50,22.50t 9.50,22.50l 18.75,18.75q 9.50,9.50 22.50,9.50q 13.25,0.00 22.75-9.50l 162.75-162.75q 9.25-8.75 9.25-22.50z" horiz-adv-x="384" />
|
18 |
+
<glyph unicode="" d="M 224.00-64.00C 100.291-64.00,0.00,36.291,0.00,160.00S 100.291,384.00, 224.00,384.00s 224.00-100.291, 224.00-224.00S 347.709-64.00, 224.00-64.00z
|
19 |
+
M 224.00,343.273c-101.228,0.00-183.273-82.045-183.273-183.273s 82.045-183.273, 183.273-183.273s 183.273,82.045, 183.273,183.273S 325.228,343.273, 224.00,343.273z M 244.364,122.164C 244.364,111.005, 244.364,98.909, 244.364,98.909l-40.727,0.00 c0.00,0.00,0.00,29.466,0.00,40.727
|
20 |
+
s 9.123,20.364, 20.364,20.364l0.00,0.00c 22.481,0.00, 40.727,18.246, 40.727,40.727s-18.246,40.727-40.727,40.727S 183.273,223.209, 183.273,200.727c0.00-7.453, 2.138-14.356, 5.641-20.364L 145.437,180.364 C 143.727,186.90, 142.545,193.661, 142.545,200.727
|
21 |
+
c0.00,44.983, 36.471,81.455, 81.455,81.455s 81.455-36.471, 81.455-81.455C 305.455,162.831, 279.45,131.247, 244.364,122.164z M 244.364,37.818l-40.727,0.00 l0.00,40.727 l 40.727,0.00 L 244.364,37.818 z" />
|
22 |
+
<glyph unicode=" " horiz-adv-x="224" />
|
23 |
+
<glyph class="hidden" unicode="" d="M0,384L 448 -64L0 -64 z" horiz-adv-x="0" />
|
24 |
+
</font></defs></svg>
|
assets/fonts/codropsicons/codropsicons.ttf
ADDED
Binary file
|
assets/fonts/codropsicons/codropsicons.woff
ADDED
Binary file
|
assets/fonts/codropsicons/license.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Icon Set: Font Awesome -- http://fortawesome.github.com/Font-Awesome/
|
2 |
+
License: SIL -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
|
3 |
+
|
4 |
+
|
5 |
+
Icon Set: Eco Ico -- http://dribbble.com/shots/665585-Eco-Ico
|
6 |
+
License: CC0 -- http://creativecommons.org/publicdomain/zero/1.0/
|
assets/fonts/icons/icons.eot
ADDED
Binary file
|
assets/fonts/icons/icons.svg
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>Generated by IcoMoon</metadata>
|
5 |
+
<defs>
|
6 |
+
<font id="icons" horiz-adv-x="1024">
|
7 |
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8 |
+
<missing-glyph horiz-adv-x="1024" />
|
9 |
+
<glyph unicode=" " d="" horiz-adv-x="512" />
|
10 |
+
<glyph unicode="" d="M512 896c-141.384 0-269.376-57.32-362.032-149.978l-149.968 149.978v-384h384l-143.532 143.522c69.496 69.492 165.492 112.478 271.532 112.478 212.068 0 384-171.924 384-384 0-114.696-50.292-217.636-130.018-288l84.666-96c106.302 93.816 173.352 231.076 173.352 384 0 282.77-229.23 512-512 512z" />
|
11 |
+
</font></defs></svg>
|
assets/fonts/icons/icons.ttf
ADDED
Binary file
|
assets/fonts/icons/icons.woff
ADDED
Binary file
|
{images → assets/images}/buymeacoffee.png
RENAMED
File without changes
|
{images → assets/images}/enjoyinstagram.png
RENAMED
File without changes
|
{js → assets/js}/ios-orientationchange-fix.js
RENAMED
File without changes
|
assets/js/ios-orientationchange-fix.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){var e=navigator.userAgent;if(/iPhone|iPad|iPod/.test(navigator.platform)&&/OS [1-5]_[0-9_]* like Mac OS X/i.test(e)&&e.indexOf("AppleWebKit")>-1){var i=t.document;if(i.querySelector){var n,a,o,r,c=i.querySelector("meta[name=viewport]"),s=c&&c.getAttribute("content"),u=s+",maximum-scale=1",m=s+",maximum-scale=10",d=!0;c&&(t.addEventListener("orientationchange",v,!1),t.addEventListener("devicemotion",function(e){r=e.accelerationIncludingGravity,n=Math.abs(r.x),a=Math.abs(r.y),o=Math.abs(r.z),t.orientation&&180!==t.orientation||!(n>7||(o>6&&a<8||o<8&&a>6)&&n>5)?d||v():d&&(c.setAttribute("content",u),d=!1)},!1))}}function v(){c.setAttribute("content",m),d=!0}}(this);
|
{js → assets/js}/jquery.gridrotator.js
RENAMED
@@ -4,12 +4,12 @@
|
|
4 |
*
|
5 |
* Licensed under the MIT license.
|
6 |
* http://www.opensource.org/licenses/mit-license.php
|
7 |
-
*
|
8 |
* Copyright 2012, Codrops
|
9 |
* http://www.codrops.com
|
10 |
*/
|
11 |
;( function( $, window, undefined ) {
|
12 |
-
|
13 |
'use strict';
|
14 |
|
15 |
/*
|
@@ -76,7 +76,7 @@
|
|
76 |
|
77 |
// otherwise loop over all the known prefixes until we find one
|
78 |
for (var i = 0; i < prefixes.length; i++){
|
79 |
-
if ((prefixes[i] + 'Hidden') in document)
|
80 |
return prefixes[i] + 'Hidden';
|
81 |
}
|
82 |
|
@@ -99,7 +99,7 @@
|
|
99 |
Modernizr = window.Modernizr;
|
100 |
|
101 |
$.GridRotator = function( options, element ) {
|
102 |
-
|
103 |
this.$el = $( element );
|
104 |
if( Modernizr.backgroundsize ) {
|
105 |
|
@@ -108,14 +108,14 @@
|
|
108 |
this._init( options );
|
109 |
|
110 |
}
|
111 |
-
|
112 |
};
|
113 |
|
114 |
// the options
|
115 |
$.GridRotator.defaults = {
|
116 |
// number of rows
|
117 |
rows : 4,
|
118 |
-
// number of columns
|
119 |
columns : 10,
|
120 |
w1024 : { rows : 3, columns : 8 },
|
121 |
w768 : {rows : 3,columns : 7 },
|
@@ -131,12 +131,12 @@
|
|
131 |
// prevent user to click the items
|
132 |
preventClick : true,
|
133 |
// animation type
|
134 |
-
// showHide || fadeInOut ||
|
135 |
-
// slideLeft || slideRight || slideTop || slideBottom ||
|
136 |
-
// rotateBottom || rotateLeft || rotateRight || rotateTop ||
|
137 |
// scale ||
|
138 |
// rotate3d ||
|
139 |
-
// rotateLeftScale || rotateRightScale || rotateTopScale || rotateBottomScale ||
|
140 |
// random
|
141 |
animType : 'random',
|
142 |
// animation speed
|
@@ -164,7 +164,7 @@
|
|
164 |
$.GridRotator.prototype = {
|
165 |
|
166 |
_init : function( options ) {
|
167 |
-
|
168 |
// options
|
169 |
this.options = $.extend( true, {}, $.GridRotator.defaults, options );
|
170 |
// cache some elements + variables
|
@@ -191,19 +191,19 @@
|
|
191 |
// all animation types for the random option
|
192 |
this.animTypes = this.supportTransforms3D ? [
|
193 |
'fadeInOut',
|
194 |
-
'slideLeft',
|
195 |
-
'slideRight',
|
196 |
-
'slideTop',
|
197 |
-
'slideBottom',
|
198 |
-
'rotateLeft',
|
199 |
-
'rotateRight',
|
200 |
-
'rotateTop',
|
201 |
-
'rotateBottom',
|
202 |
-
'scale',
|
203 |
-
'rotate3d',
|
204 |
-
'rotateLeftScale',
|
205 |
-
'rotateRightScale',
|
206 |
-
'rotateTopScale',
|
207 |
'rotateBottomScale' ] :
|
208 |
[ 'fadeInOut', 'slideLeft', 'slideRight', 'slideTop', 'slideBottom' ];
|
209 |
|
@@ -220,6 +220,8 @@
|
|
220 |
|
221 |
// the <ul> where the items are placed
|
222 |
this.$list = this.$el.children( 'ul' );
|
|
|
|
|
223 |
// remove images and add background-image to anchors
|
224 |
// preload the images before
|
225 |
var loaded = 0,
|
@@ -247,7 +249,16 @@
|
|
247 |
$( '<img/>' ).load( function() {
|
248 |
|
249 |
++loaded;
|
250 |
-
$img.parent().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
252 |
/*This conditional block should be moved out to remove redundancy =)*/
|
253 |
if( loaded + subbed === count ) {
|
@@ -277,16 +288,16 @@
|
|
277 |
|
278 |
// If something is wrong with the image…
|
279 |
$( '<img/>' ).error( function() {
|
280 |
-
|
281 |
++subbed;
|
282 |
-
|
283 |
// Are there any substitute images?
|
284 |
if( self.options.subImg ) {
|
285 |
|
286 |
$img.parent().css( 'background-image', 'url(' + self.options.subImg + ')' );
|
287 |
|
288 |
}
|
289 |
-
|
290 |
else {
|
291 |
|
292 |
var color = Math.floor(Math.random() * 3)
|
@@ -322,9 +333,9 @@
|
|
322 |
|
323 |
} ).attr( 'src', src );
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
} );
|
328 |
|
329 |
},
|
330 |
_layout : function( callback ) {
|
@@ -337,7 +348,7 @@
|
|
337 |
// reset
|
338 |
this.$list.empty();
|
339 |
this.$items = this.$itemsCache.clone().appendTo( this.$list );
|
340 |
-
|
341 |
var $outItems = this.$items.filter( ':gt(' + ( this.showTotal - 1 ) + ')' ),
|
342 |
$outAItems = $outItems.children( 'a' );
|
343 |
|
@@ -395,7 +406,7 @@
|
|
395 |
// container's width
|
396 |
var c_w = this.$el.width();
|
397 |
|
398 |
-
// we will choose the number of rows/columns according to the container's width and the values set in the plugin options
|
399 |
switch( true ) {
|
400 |
case ( c_w < 240 ) : this.rows = this.options.w240.rows; this.columns = this.options.w240.columns; break;
|
401 |
case ( c_w < 320 ) : this.rows = this.options.w320.rows; this.columns = this.options.w320.columns; break;
|
@@ -419,7 +430,7 @@
|
|
419 |
|
420 |
// use the property name to generate the prefixed event name
|
421 |
var visProp = getHiddenProp();
|
422 |
-
|
423 |
// HTML5 PageVisibility API
|
424 |
// http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
|
425 |
// by Joe Marini (@joemarini)
|
@@ -431,7 +442,7 @@
|
|
431 |
}
|
432 |
|
433 |
if( !Modernizr.touch && this.options.onhover ) {
|
434 |
-
|
435 |
self.$items.on( 'mouseenter.gridrotator', function() {
|
436 |
|
437 |
var $item = $( this );
|
@@ -477,7 +488,7 @@
|
|
477 |
switch( animType ) {
|
478 |
|
479 |
case 'showHide' :
|
480 |
-
|
481 |
speed = 0;
|
482 |
endOutProp.opacity = 0;
|
483 |
break;
|
@@ -488,35 +499,35 @@
|
|
488 |
break;
|
489 |
|
490 |
case 'slideLeft' :
|
491 |
-
|
492 |
startInProp.left = $out.width();
|
493 |
endInProp.left = 0;
|
494 |
endOutProp.left = -$out.width();
|
495 |
break;
|
496 |
|
497 |
case 'slideRight' :
|
498 |
-
|
499 |
startInProp.left = -$out.width();
|
500 |
endInProp.left = 0;
|
501 |
endOutProp.left = $out.width();
|
502 |
break;
|
503 |
|
504 |
case 'slideTop' :
|
505 |
-
|
506 |
startInProp.top = $out.height();
|
507 |
endInProp.top = 0;
|
508 |
endOutProp.top = -$out.height();
|
509 |
break;
|
510 |
|
511 |
case 'slideBottom' :
|
512 |
-
|
513 |
startInProp.top = -$out.height();
|
514 |
endInProp.top = 0;
|
515 |
endOutProp.top = $out.height();
|
516 |
break;
|
517 |
|
518 |
case 'rotateLeft' :
|
519 |
-
|
520 |
speed = this.options.animSpeed / 2;
|
521 |
startInProp.transform = 'rotateY(90deg)';
|
522 |
endInProp.transform = 'rotateY(0deg)';
|
@@ -525,7 +536,7 @@
|
|
525 |
break;
|
526 |
|
527 |
case 'rotateRight' :
|
528 |
-
|
529 |
speed = this.options.animSpeed / 2;
|
530 |
startInProp.transform = 'rotateY(-90deg)';
|
531 |
endInProp.transform = 'rotateY(0deg)';
|
@@ -534,7 +545,7 @@
|
|
534 |
break;
|
535 |
|
536 |
case 'rotateTop' :
|
537 |
-
|
538 |
speed = this.options.animSpeed / 2;
|
539 |
startInProp.transform= 'rotateX(90deg)';
|
540 |
endInProp.transform = 'rotateX(0deg)';
|
@@ -543,7 +554,7 @@
|
|
543 |
break;
|
544 |
|
545 |
case 'rotateBottom' :
|
546 |
-
|
547 |
speed = this.options.animSpeed / 2;
|
548 |
startInProp.transform = 'rotateX(-90deg)';
|
549 |
endInProp.transform = 'rotateX(0deg)';
|
@@ -552,7 +563,7 @@
|
|
552 |
break;
|
553 |
|
554 |
case 'scale' :
|
555 |
-
|
556 |
speed = this.options.animSpeed / 2;
|
557 |
startInProp.transform = 'scale(0)';
|
558 |
startOutProp.transform = 'scale(1)';
|
@@ -562,9 +573,9 @@
|
|
562 |
break;
|
563 |
|
564 |
case 'rotateLeftScale' :
|
565 |
-
|
566 |
startOutProp.transform = 'scale(1)';
|
567 |
-
speed = this.options.animSpeed / 2;
|
568 |
startInProp.transform = 'scale(0.3) rotateY(90deg)';
|
569 |
endInProp.transform = 'scale(1) rotateY(0deg)';
|
570 |
delay = speed;
|
@@ -572,7 +583,7 @@
|
|
572 |
break;
|
573 |
|
574 |
case 'rotateRightScale' :
|
575 |
-
|
576 |
startOutProp.transform = 'scale(1)';
|
577 |
speed = this.options.animSpeed / 2;
|
578 |
startInProp.transform = 'scale(0.3) rotateY(-90deg)';
|
@@ -582,7 +593,7 @@
|
|
582 |
break;
|
583 |
|
584 |
case 'rotateTopScale' :
|
585 |
-
|
586 |
startOutProp.transform = 'scale(1)';
|
587 |
speed = this.options.animSpeed / 2;
|
588 |
startInProp.transform = 'scale(0.3) rotateX(90deg)';
|
@@ -592,7 +603,7 @@
|
|
592 |
break;
|
593 |
|
594 |
case 'rotateBottomScale' :
|
595 |
-
|
596 |
startOutProp.transform = 'scale(1)';
|
597 |
speed = this.options.animSpeed / 2;
|
598 |
startInProp.transform = 'scale(0.3) rotateX(-90deg)';
|
@@ -602,7 +613,7 @@
|
|
602 |
break;
|
603 |
|
604 |
case 'rotate3d' :
|
605 |
-
|
606 |
speed = this.options.animSpeed / 2;
|
607 |
startInProp.transform = 'rotate3d( 1, 1, 0, 90deg )';
|
608 |
endInProp.transform = 'rotate3d( 1, 1, 0, 0deg )';
|
@@ -616,7 +627,7 @@
|
|
616 |
startInProp : startInProp,
|
617 |
startOutProp : startOutProp,
|
618 |
endInProp : endInProp,
|
619 |
-
endOutProp : endOutProp,
|
620 |
delay : delay,
|
621 |
animSpeed : speed != undefined ? speed : this.options.animSpeed
|
622 |
};
|
@@ -632,7 +643,7 @@
|
|
632 |
this.playtimeout = setTimeout( function() {
|
633 |
|
634 |
var step = self.options.step, max= self.options.maxStep, min = 1;
|
635 |
-
|
636 |
if( max > self.showTotal ) {
|
637 |
max = self.showTotal;
|
638 |
}
|
@@ -648,7 +659,7 @@
|
|
648 |
var $out = self.$items.eq( randArr[ i ] );
|
649 |
|
650 |
// if element is active, which means it is currently animating,
|
651 |
-
// then we need to get different positions..
|
652 |
if( $out.data( 'active' ) || $out.data( 'nochange' ) ) {
|
653 |
|
654 |
// one of the items is active, call again..
|
@@ -686,7 +697,7 @@
|
|
686 |
|
687 |
// save element that went out
|
688 |
this.outItems.push( $outA.clone().css( 'transition', 'none' ) );
|
689 |
-
|
690 |
// prepend in element
|
691 |
$inA.css( newElProp ).prependTo( $out );
|
692 |
|
@@ -694,7 +705,7 @@
|
|
694 |
|
695 |
$inA.css( animProp.startInProp );
|
696 |
$outA.css( animProp.startOutProp );
|
697 |
-
|
698 |
this._setTransition( $inA, 'all', animProp.animSpeed, animProp.delay, this.options.animEasingIn );
|
699 |
this._setTransition( $outA, 'all', animProp.animSpeed, 0, this.options.animEasingOut );
|
700 |
|
@@ -702,13 +713,13 @@
|
|
702 |
|
703 |
var $el = $( this ),
|
704 |
t = animProp.animSpeed === self.options.animSpeed && isEmpty( animProp.endInProp ) ? animProp.animSpeed : 0;
|
705 |
-
|
706 |
setTimeout( function() {
|
707 |
-
|
708 |
if( self.supportTransitions ) {
|
709 |
$el.off( self.transEndEventName );
|
710 |
}
|
711 |
-
|
712 |
$el.next().remove();
|
713 |
$el.parent().data( 'active', false );
|
714 |
|
@@ -717,6 +728,14 @@
|
|
717 |
}, animProp.animSpeed === 0 || isEmpty( animProp.endInProp ) );
|
718 |
this._applyTransition( $outA, animProp.endOutProp, animProp.animSpeed );
|
719 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
},
|
721 |
_getRandom : function( cnt, limit ) {
|
722 |
|
@@ -725,7 +744,7 @@
|
|
725 |
for( var i = 0; i < limit; ++i ) {
|
726 |
randArray.push( i )
|
727 |
}
|
728 |
-
|
729 |
return randArray.shuffle().slice( 0, cnt );
|
730 |
|
731 |
},
|
@@ -747,7 +766,7 @@
|
|
747 |
el.on( self.transEndEventName, fncomplete );
|
748 |
|
749 |
if( force ) {
|
750 |
-
fncomplete.call( el );
|
751 |
}
|
752 |
|
753 |
}
|
@@ -760,68 +779,68 @@
|
|
760 |
}
|
761 |
|
762 |
};
|
763 |
-
|
764 |
var logError = function( message ) {
|
765 |
|
766 |
if ( window.console ) {
|
767 |
|
768 |
window.console.error( message );
|
769 |
-
|
770 |
}
|
771 |
|
772 |
};
|
773 |
-
|
774 |
$.fn.gridrotator = function( options ) {
|
775 |
|
776 |
var instance = $.data( this, 'gridrotator' );
|
777 |
-
|
778 |
if ( typeof options === 'string' ) {
|
779 |
-
|
780 |
var args = Array.prototype.slice.call( arguments, 1 );
|
781 |
-
|
782 |
this.each(function() {
|
783 |
-
|
784 |
if ( !instance ) {
|
785 |
|
786 |
logError( "cannot call methods on gridrotator prior to initialization; " +
|
787 |
"attempted to call method '" + options + "'" );
|
788 |
return;
|
789 |
-
|
790 |
}
|
791 |
-
|
792 |
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
793 |
|
794 |
logError( "no such method '" + options + "' for gridrotator instance" );
|
795 |
return;
|
796 |
-
|
797 |
}
|
798 |
-
|
799 |
instance[ options ].apply( instance, args );
|
800 |
-
|
801 |
});
|
802 |
-
|
803 |
-
}
|
804 |
else {
|
805 |
-
|
806 |
this.each(function() {
|
807 |
-
|
808 |
if ( instance ) {
|
809 |
|
810 |
instance._init();
|
811 |
-
|
812 |
}
|
813 |
else {
|
814 |
|
815 |
instance = $.data( this, 'gridrotator', new $.GridRotator( options, this ) );
|
816 |
-
|
817 |
}
|
818 |
|
819 |
});
|
820 |
-
|
821 |
}
|
822 |
-
|
823 |
return instance;
|
824 |
-
|
825 |
};
|
826 |
-
|
827 |
} )( jQuery, window );
|
4 |
*
|
5 |
* Licensed under the MIT license.
|
6 |
* http://www.opensource.org/licenses/mit-license.php
|
7 |
+
*
|
8 |
* Copyright 2012, Codrops
|
9 |
* http://www.codrops.com
|
10 |
*/
|
11 |
;( function( $, window, undefined ) {
|
12 |
+
|
13 |
'use strict';
|
14 |
|
15 |
/*
|
76 |
|
77 |
// otherwise loop over all the known prefixes until we find one
|
78 |
for (var i = 0; i < prefixes.length; i++){
|
79 |
+
if ((prefixes[i] + 'Hidden') in document)
|
80 |
return prefixes[i] + 'Hidden';
|
81 |
}
|
82 |
|
99 |
Modernizr = window.Modernizr;
|
100 |
|
101 |
$.GridRotator = function( options, element ) {
|
102 |
+
|
103 |
this.$el = $( element );
|
104 |
if( Modernizr.backgroundsize ) {
|
105 |
|
108 |
this._init( options );
|
109 |
|
110 |
}
|
111 |
+
|
112 |
};
|
113 |
|
114 |
// the options
|
115 |
$.GridRotator.defaults = {
|
116 |
// number of rows
|
117 |
rows : 4,
|
118 |
+
// number of columns
|
119 |
columns : 10,
|
120 |
w1024 : { rows : 3, columns : 8 },
|
121 |
w768 : {rows : 3,columns : 7 },
|
131 |
// prevent user to click the items
|
132 |
preventClick : true,
|
133 |
// animation type
|
134 |
+
// showHide || fadeInOut ||
|
135 |
+
// slideLeft || slideRight || slideTop || slideBottom ||
|
136 |
+
// rotateBottom || rotateLeft || rotateRight || rotateTop ||
|
137 |
// scale ||
|
138 |
// rotate3d ||
|
139 |
+
// rotateLeftScale || rotateRightScale || rotateTopScale || rotateBottomScale ||
|
140 |
// random
|
141 |
animType : 'random',
|
142 |
// animation speed
|
164 |
$.GridRotator.prototype = {
|
165 |
|
166 |
_init : function( options ) {
|
167 |
+
|
168 |
// options
|
169 |
this.options = $.extend( true, {}, $.GridRotator.defaults, options );
|
170 |
// cache some elements + variables
|
191 |
// all animation types for the random option
|
192 |
this.animTypes = this.supportTransforms3D ? [
|
193 |
'fadeInOut',
|
194 |
+
'slideLeft',
|
195 |
+
'slideRight',
|
196 |
+
'slideTop',
|
197 |
+
'slideBottom',
|
198 |
+
'rotateLeft',
|
199 |
+
'rotateRight',
|
200 |
+
'rotateTop',
|
201 |
+
'rotateBottom',
|
202 |
+
'scale',
|
203 |
+
'rotate3d',
|
204 |
+
'rotateLeftScale',
|
205 |
+
'rotateRightScale',
|
206 |
+
'rotateTopScale',
|
207 |
'rotateBottomScale' ] :
|
208 |
[ 'fadeInOut', 'slideLeft', 'slideRight', 'slideTop', 'slideBottom' ];
|
209 |
|
220 |
|
221 |
// the <ul> where the items are placed
|
222 |
this.$list = this.$el.children( 'ul' );
|
223 |
+
//added to fix DIVI theme page builder visualization
|
224 |
+
this.$list.css("padding-left","0");
|
225 |
// remove images and add background-image to anchors
|
226 |
// preload the images before
|
227 |
var loaded = 0,
|
249 |
$( '<img/>' ).load( function() {
|
250 |
|
251 |
++loaded;
|
252 |
+
var video = $img.parent().attr('data-video');
|
253 |
+
if(video==="yes"){
|
254 |
+
$img.parent().parent().css( 'background-image', 'url(' + GridRotator.pluginsUrl + '/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/img/play_overlay.png' + ')' );
|
255 |
+
$img.parent().parent().css( 'background-size', 'cover');
|
256 |
+
$img.parent().css( 'background-image', 'url(' + src + ')' );
|
257 |
+
$img.parent().css( 'opacity', '0.45');
|
258 |
+
console.log($img.parent().attr('href'));
|
259 |
+
}else{
|
260 |
+
$img.parent().css( 'background-image', 'url(' + src + ')' );
|
261 |
+
}
|
262 |
|
263 |
/*This conditional block should be moved out to remove redundancy =)*/
|
264 |
if( loaded + subbed === count ) {
|
288 |
|
289 |
// If something is wrong with the image…
|
290 |
$( '<img/>' ).error( function() {
|
291 |
+
|
292 |
++subbed;
|
293 |
+
|
294 |
// Are there any substitute images?
|
295 |
if( self.options.subImg ) {
|
296 |
|
297 |
$img.parent().css( 'background-image', 'url(' + self.options.subImg + ')' );
|
298 |
|
299 |
}
|
300 |
+
|
301 |
else {
|
302 |
|
303 |
var color = Math.floor(Math.random() * 3)
|
333 |
|
334 |
} ).attr( 'src', src );
|
335 |
|
336 |
+
|
337 |
+
|
338 |
+
} );
|
339 |
|
340 |
},
|
341 |
_layout : function( callback ) {
|
348 |
// reset
|
349 |
this.$list.empty();
|
350 |
this.$items = this.$itemsCache.clone().appendTo( this.$list );
|
351 |
+
|
352 |
var $outItems = this.$items.filter( ':gt(' + ( this.showTotal - 1 ) + ')' ),
|
353 |
$outAItems = $outItems.children( 'a' );
|
354 |
|
406 |
// container's width
|
407 |
var c_w = this.$el.width();
|
408 |
|
409 |
+
// we will choose the number of rows/columns according to the container's width and the values set in the plugin options
|
410 |
switch( true ) {
|
411 |
case ( c_w < 240 ) : this.rows = this.options.w240.rows; this.columns = this.options.w240.columns; break;
|
412 |
case ( c_w < 320 ) : this.rows = this.options.w320.rows; this.columns = this.options.w320.columns; break;
|
430 |
|
431 |
// use the property name to generate the prefixed event name
|
432 |
var visProp = getHiddenProp();
|
433 |
+
|
434 |
// HTML5 PageVisibility API
|
435 |
// http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
|
436 |
// by Joe Marini (@joemarini)
|
442 |
}
|
443 |
|
444 |
if( !Modernizr.touch && this.options.onhover ) {
|
445 |
+
|
446 |
self.$items.on( 'mouseenter.gridrotator', function() {
|
447 |
|
448 |
var $item = $( this );
|
488 |
switch( animType ) {
|
489 |
|
490 |
case 'showHide' :
|
491 |
+
|
492 |
speed = 0;
|
493 |
endOutProp.opacity = 0;
|
494 |
break;
|
499 |
break;
|
500 |
|
501 |
case 'slideLeft' :
|
502 |
+
|
503 |
startInProp.left = $out.width();
|
504 |
endInProp.left = 0;
|
505 |
endOutProp.left = -$out.width();
|
506 |
break;
|
507 |
|
508 |
case 'slideRight' :
|
509 |
+
|
510 |
startInProp.left = -$out.width();
|
511 |
endInProp.left = 0;
|
512 |
endOutProp.left = $out.width();
|
513 |
break;
|
514 |
|
515 |
case 'slideTop' :
|
516 |
+
|
517 |
startInProp.top = $out.height();
|
518 |
endInProp.top = 0;
|
519 |
endOutProp.top = -$out.height();
|
520 |
break;
|
521 |
|
522 |
case 'slideBottom' :
|
523 |
+
|
524 |
startInProp.top = -$out.height();
|
525 |
endInProp.top = 0;
|
526 |
endOutProp.top = $out.height();
|
527 |
break;
|
528 |
|
529 |
case 'rotateLeft' :
|
530 |
+
|
531 |
speed = this.options.animSpeed / 2;
|
532 |
startInProp.transform = 'rotateY(90deg)';
|
533 |
endInProp.transform = 'rotateY(0deg)';
|
536 |
break;
|
537 |
|
538 |
case 'rotateRight' :
|
539 |
+
|
540 |
speed = this.options.animSpeed / 2;
|
541 |
startInProp.transform = 'rotateY(-90deg)';
|
542 |
endInProp.transform = 'rotateY(0deg)';
|
545 |
break;
|
546 |
|
547 |
case 'rotateTop' :
|
548 |
+
|
549 |
speed = this.options.animSpeed / 2;
|
550 |
startInProp.transform= 'rotateX(90deg)';
|
551 |
endInProp.transform = 'rotateX(0deg)';
|
554 |
break;
|
555 |
|
556 |
case 'rotateBottom' :
|
557 |
+
|
558 |
speed = this.options.animSpeed / 2;
|
559 |
startInProp.transform = 'rotateX(-90deg)';
|
560 |
endInProp.transform = 'rotateX(0deg)';
|
563 |
break;
|
564 |
|
565 |
case 'scale' :
|
566 |
+
|
567 |
speed = this.options.animSpeed / 2;
|
568 |
startInProp.transform = 'scale(0)';
|
569 |
startOutProp.transform = 'scale(1)';
|
573 |
break;
|
574 |
|
575 |
case 'rotateLeftScale' :
|
576 |
+
|
577 |
startOutProp.transform = 'scale(1)';
|
578 |
+
speed = this.options.animSpeed / 2;
|
579 |
startInProp.transform = 'scale(0.3) rotateY(90deg)';
|
580 |
endInProp.transform = 'scale(1) rotateY(0deg)';
|
581 |
delay = speed;
|
583 |
break;
|
584 |
|
585 |
case 'rotateRightScale' :
|
586 |
+
|
587 |
startOutProp.transform = 'scale(1)';
|
588 |
speed = this.options.animSpeed / 2;
|
589 |
startInProp.transform = 'scale(0.3) rotateY(-90deg)';
|
593 |
break;
|
594 |
|
595 |
case 'rotateTopScale' :
|
596 |
+
|
597 |
startOutProp.transform = 'scale(1)';
|
598 |
speed = this.options.animSpeed / 2;
|
599 |
startInProp.transform = 'scale(0.3) rotateX(90deg)';
|
603 |
break;
|
604 |
|
605 |
case 'rotateBottomScale' :
|
606 |
+
|
607 |
startOutProp.transform = 'scale(1)';
|
608 |
speed = this.options.animSpeed / 2;
|
609 |
startInProp.transform = 'scale(0.3) rotateX(-90deg)';
|
613 |
break;
|
614 |
|
615 |
case 'rotate3d' :
|
616 |
+
|
617 |
speed = this.options.animSpeed / 2;
|
618 |
startInProp.transform = 'rotate3d( 1, 1, 0, 90deg )';
|
619 |
endInProp.transform = 'rotate3d( 1, 1, 0, 0deg )';
|
627 |
startInProp : startInProp,
|
628 |
startOutProp : startOutProp,
|
629 |
endInProp : endInProp,
|
630 |
+
endOutProp : endOutProp,
|
631 |
delay : delay,
|
632 |
animSpeed : speed != undefined ? speed : this.options.animSpeed
|
633 |
};
|
643 |
this.playtimeout = setTimeout( function() {
|
644 |
|
645 |
var step = self.options.step, max= self.options.maxStep, min = 1;
|
646 |
+
|
647 |
if( max > self.showTotal ) {
|
648 |
max = self.showTotal;
|
649 |
}
|
659 |
var $out = self.$items.eq( randArr[ i ] );
|
660 |
|
661 |
// if element is active, which means it is currently animating,
|
662 |
+
// then we need to get different positions..
|
663 |
if( $out.data( 'active' ) || $out.data( 'nochange' ) ) {
|
664 |
|
665 |
// one of the items is active, call again..
|
697 |
|
698 |
// save element that went out
|
699 |
this.outItems.push( $outA.clone().css( 'transition', 'none' ) );
|
700 |
+
|
701 |
// prepend in element
|
702 |
$inA.css( newElProp ).prependTo( $out );
|
703 |
|
705 |
|
706 |
$inA.css( animProp.startInProp );
|
707 |
$outA.css( animProp.startOutProp );
|
708 |
+
|
709 |
this._setTransition( $inA, 'all', animProp.animSpeed, animProp.delay, this.options.animEasingIn );
|
710 |
this._setTransition( $outA, 'all', animProp.animSpeed, 0, this.options.animEasingOut );
|
711 |
|
713 |
|
714 |
var $el = $( this ),
|
715 |
t = animProp.animSpeed === self.options.animSpeed && isEmpty( animProp.endInProp ) ? animProp.animSpeed : 0;
|
716 |
+
|
717 |
setTimeout( function() {
|
718 |
+
|
719 |
if( self.supportTransitions ) {
|
720 |
$el.off( self.transEndEventName );
|
721 |
}
|
722 |
+
|
723 |
$el.next().remove();
|
724 |
$el.parent().data( 'active', false );
|
725 |
|
728 |
}, animProp.animSpeed === 0 || isEmpty( animProp.endInProp ) );
|
729 |
this._applyTransition( $outA, animProp.endOutProp, animProp.animSpeed );
|
730 |
|
731 |
+
var video = $inA.attr('data-video');
|
732 |
+
var bg = $inA.attr('style');
|
733 |
+
if(video==="yes"){
|
734 |
+
$inA.parent().css( 'background-image', 'url(' + GridRotator.pluginsUrl + '/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/img/play_overlay.png' + ')' );
|
735 |
+
$inA.parent().css( 'background-size', 'cover' );
|
736 |
+
$inA.css( 'opacity', '0.45');
|
737 |
+
}
|
738 |
+
|
739 |
},
|
740 |
_getRandom : function( cnt, limit ) {
|
741 |
|
744 |
for( var i = 0; i < limit; ++i ) {
|
745 |
randArray.push( i )
|
746 |
}
|
747 |
+
|
748 |
return randArray.shuffle().slice( 0, cnt );
|
749 |
|
750 |
},
|
766 |
el.on( self.transEndEventName, fncomplete );
|
767 |
|
768 |
if( force ) {
|
769 |
+
fncomplete.call( el );
|
770 |
}
|
771 |
|
772 |
}
|
779 |
}
|
780 |
|
781 |
};
|
782 |
+
|
783 |
var logError = function( message ) {
|
784 |
|
785 |
if ( window.console ) {
|
786 |
|
787 |
window.console.error( message );
|
788 |
+
|
789 |
}
|
790 |
|
791 |
};
|
792 |
+
|
793 |
$.fn.gridrotator = function( options ) {
|
794 |
|
795 |
var instance = $.data( this, 'gridrotator' );
|
796 |
+
|
797 |
if ( typeof options === 'string' ) {
|
798 |
+
|
799 |
var args = Array.prototype.slice.call( arguments, 1 );
|
800 |
+
|
801 |
this.each(function() {
|
802 |
+
|
803 |
if ( !instance ) {
|
804 |
|
805 |
logError( "cannot call methods on gridrotator prior to initialization; " +
|
806 |
"attempted to call method '" + options + "'" );
|
807 |
return;
|
808 |
+
|
809 |
}
|
810 |
+
|
811 |
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
812 |
|
813 |
logError( "no such method '" + options + "' for gridrotator instance" );
|
814 |
return;
|
815 |
+
|
816 |
}
|
817 |
+
|
818 |
instance[ options ].apply( instance, args );
|
819 |
+
|
820 |
});
|
821 |
+
|
822 |
+
}
|
823 |
else {
|
824 |
+
|
825 |
this.each(function() {
|
826 |
+
|
827 |
if ( instance ) {
|
828 |
|
829 |
instance._init();
|
830 |
+
|
831 |
}
|
832 |
else {
|
833 |
|
834 |
instance = $.data( this, 'gridrotator', new $.GridRotator( options, this ) );
|
835 |
+
|
836 |
}
|
837 |
|
838 |
});
|
839 |
+
|
840 |
}
|
841 |
+
|
842 |
return instance;
|
843 |
+
|
844 |
};
|
845 |
+
|
846 |
} )( jQuery, window );
|
assets/js/jquery.gridrotator.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t,e,s){"use strict";var o,i,a=t.event;function n(){var t=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var e=0;e<t.length;e++)if(t[e]+"Hidden"in document)return t[e]+"Hidden";return null}function r(t){return 0===Object.keys(t).length}o=a.special.debouncedresize={setup:function(){t(this).on("resize",o.handler)},teardown:function(){t(this).off("resize",o.handler)},handler:function(t,e){var s=this,n=arguments,r=function(){t.type="debouncedresize",a.dispatch.apply(s,n)};i&&clearTimeout(i),e?r():i=setTimeout(r,o.threshold)},threshold:100},Array.prototype.shuffle=function(){for(var t,e,s=this.length;s--;)t=Math.floor(Math.random()*s),e=this[s],this[s]=this[t],this[t]=e;return this};var h=t(e),l=e.Modernizr;t.GridRotator=function(e,s){if(this.$el=t(s),l.backgroundsize){this.$el.addClass("ri-grid-loading"),this._init(e)}},t.GridRotator.defaults={rows:4,columns:10,w1024:{rows:3,columns:8},w768:{rows:3,columns:7},w480:{rows:3,columns:5},w320:{rows:2,columns:4},w240:{rows:2,columns:3},step:"random",maxStep:3,preventClick:!0,animType:"random",animSpeed:800,animEasingOut:"linear",animEasingIn:"linear",interval:3e3,slideshow:!0,onhover:!1,nochange:[],onDraw:function(){},heightToWidthRatio:1,subImg:!1},t.GridRotator.prototype={_init:function(e){this.options=t.extend(!0,{},t.GridRotator.defaults,e),this._config()},_config:function(){var e=this;this.supportTransitions=l.csstransitions,this.supportTransforms3D=l.csstransforms3d,this.transEndEventName={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"}[l.prefixed("transition")]+".gridrotator",this.animTypes=this.supportTransforms3D?["fadeInOut","slideLeft","slideRight","slideTop","slideBottom","rotateLeft","rotateRight","rotateTop","rotateBottom","scale","rotate3d","rotateLeftScale","rotateRightScale","rotateTopScale","rotateBottomScale"]:["fadeInOut","slideLeft","slideRight","slideTop","slideBottom"],this.animType=this.options.animType,"random"===this.animType||this.supportTransforms3D||-1!==t.inArray(this.animType,this.animTypes)||"showHide"===this.animType||(this.animType="fadeInOut"),this.animTypesTotal=this.animTypes.length,this.$list=this.$el.children("ul"),this.$list.css("padding-left","0");var s=0,o=0,i=this.$list.find("img"),a=i.length,n=["#D92727","#FFE433","#0DB8B5"];e.options.subImg&&t("<img/>").error(function(){e.options.subImg=!1}).attr("src",e.options.subImg),i.each(function(){var r=t(this),h=r.attr("src");t("<img/>").load(function(){++s,"yes"===r.parent().attr("data-video")?(r.parent().parent().css("background-image","url("+GridRotator.pluginsUrl+"/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/img/play_overlay.png)"),r.parent().parent().css("background-size","cover"),r.parent().css("background-image","url("+h+")"),r.parent().css("opacity","0.45"),console.log(r.parent().attr("href"))):r.parent().css("background-image","url("+h+")"),s+o===a&&(i.remove(),e.$el.removeClass("ri-grid-loading"),e.$items=e.$list.children("li"),e.$itemsCache=e.$items.clone(),e.itemsTotal=e.$items.length,e.outItems=[],e._layout(function(){e._initEvents()}),e._start())}).attr("src",h),t("<img/>").error(function(){if(++o,e.options.subImg)r.parent().css("background-image","url("+e.options.subImg+")");else{var t=Math.floor(3*Math.random());r.parent().css("background",n[t])}s+o===a&&(i.remove(),e.$el.removeClass("ri-grid-loading"),e.$items=e.$list.children("li"),e.$itemsCache=e.$items.clone(),e.itemsTotal=e.$items.length,e.outItems=[],e._layout(function(){e._initEvents()}),e._start())}).attr("src",h)})},_layout:function(e){var s=this;this._setGridDim(),this.$list.empty(),this.$items=this.$itemsCache.clone().appendTo(this.$list);var o=this.$items.filter(":gt("+(this.showTotal-1)+")"),i=o.children("a");this.outItems.length=0,i.each(function(e){s.outItems.push(t(this))}),o.remove();for(var a=document.defaultView?parseInt(document.defaultView.getComputedStyle(this.$el.get(0),null).width):this.$el.width(),n=Math.floor(a/this.columns),r=a-this.columns*Math.floor(n),h=0;h<this.rows;++h)for(var l=0;l<this.columns;++l){var c=this.columns*h+l,d=this.$items.eq(c);d.css({width:l<Math.floor(r)?n+1:n,height:Math.floor(n*this.options.heightToWidthRatio)}),-1!==t.inArray(c,this.options.nochange)&&d.addClass("ri-nochange").data("nochange",!0)}this.options.preventClick&&this.$items.children().css("cursor","default").on("click.gridrotator",!1),e&&e.call(),this.options.onDraw.call(this)},_setGridDim:function(){var t=this.$el.width();switch(!0){case t<240:this.rows=this.options.w240.rows,this.columns=this.options.w240.columns;break;case t<320:this.rows=this.options.w320.rows,this.columns=this.options.w320.columns;break;case t<480:this.rows=this.options.w480.rows,this.columns=this.options.w480.columns;break;case t<768:this.rows=this.options.w768.rows,this.columns=this.options.w768.columns;break;case t<1024:this.rows=this.options.w1024.rows,this.columns=this.options.w1024.columns;break;default:this.rows=this.options.rows,this.columns=this.options.columns}this.showTotal=this.rows*this.columns},_initEvents:function(){var e=this;h.on("debouncedresize.gridrotator",function(){e._layout()});var s=n();if(s){var o=s.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(o,function(){e._visChange()})}!l.touch&&this.options.onhover&&e.$items.on("mouseenter.gridrotator",function(){var s=t(this);s.data("active")||s.data("hovered")||s.data("nochange")||(s.data("hovered",!0),e._replace(s))}).on("mouseleave.gridrotator",function(){t(this).data("hovered",!1)})},_visChange:function(){var t;(t=n())&&document[t]?clearTimeout(this.playtimeout):this._start()},_start:function(){this.showTotal<this.itemsTotal&&this.options.slideshow&&this._showNext()},_getAnimType:function(){return"random"===this.animType?this.animTypes[Math.floor(Math.random()*this.animTypesTotal)]:this.animType},_getAnimProperties:function(t){var e,s={},o={},i={},a={},n=0;switch(this._getAnimType()){case"showHide":e=0,a.opacity=0;break;case"fadeInOut":a.opacity=0;break;case"slideLeft":s.left=t.width(),i.left=0,a.left=-t.width();break;case"slideRight":s.left=-t.width(),i.left=0,a.left=t.width();break;case"slideTop":s.top=t.height(),i.top=0,a.top=-t.height();break;case"slideBottom":s.top=-t.height(),i.top=0,a.top=t.height();break;case"rotateLeft":e=this.options.animSpeed/2,s.transform="rotateY(90deg)",i.transform="rotateY(0deg)",n=e,a.transform="rotateY(-90deg)";break;case"rotateRight":e=this.options.animSpeed/2,s.transform="rotateY(-90deg)",i.transform="rotateY(0deg)",n=e,a.transform="rotateY(90deg)";break;case"rotateTop":e=this.options.animSpeed/2,s.transform="rotateX(90deg)",i.transform="rotateX(0deg)",n=e,a.transform="rotateX(-90deg)";break;case"rotateBottom":e=this.options.animSpeed/2,s.transform="rotateX(-90deg)",i.transform="rotateX(0deg)",n=e,a.transform="rotateX(90deg)";break;case"scale":e=this.options.animSpeed/2,s.transform="scale(0)",o.transform="scale(1)",i.transform="scale(1)",n=e,a.transform="scale(0)";break;case"rotateLeftScale":o.transform="scale(1)",e=this.options.animSpeed/2,s.transform="scale(0.3) rotateY(90deg)",i.transform="scale(1) rotateY(0deg)",n=e,a.transform="scale(0.3) rotateY(-90deg)";break;case"rotateRightScale":o.transform="scale(1)",e=this.options.animSpeed/2,s.transform="scale(0.3) rotateY(-90deg)",i.transform="scale(1) rotateY(0deg)",n=e,a.transform="scale(0.3) rotateY(90deg)";break;case"rotateTopScale":o.transform="scale(1)",e=this.options.animSpeed/2,s.transform="scale(0.3) rotateX(90deg)",i.transform="scale(1) rotateX(0deg)",n=e,a.transform="scale(0.3) rotateX(-90deg)";break;case"rotateBottomScale":o.transform="scale(1)",e=this.options.animSpeed/2,s.transform="scale(0.3) rotateX(-90deg)",i.transform="scale(1) rotateX(0deg)",n=e,a.transform="scale(0.3) rotateX(90deg)";break;case"rotate3d":e=this.options.animSpeed/2,s.transform="rotate3d( 1, 1, 0, 90deg )",i.transform="rotate3d( 1, 1, 0, 0deg )",n=e,a.transform="rotate3d( 1, 1, 0, -90deg )"}return{startInProp:s,startOutProp:o,endInProp:i,endOutProp:a,delay:n,animSpeed:null!=e?e:this.options.animSpeed}},_showNext:function(t){var e=this;clearTimeout(this.playtimeout),this.playtimeout=setTimeout(function(){var t=e.options.step,s=e.options.maxStep;s>e.showTotal&&(s=e.showTotal);for(var o="random"===t?Math.floor(Math.random()*s+1):Math.min(Math.abs(t),s),i=e._getRandom(o,e.showTotal),a=0;a<o;++a){var n=e.$items.eq(i[a]);if(n.data("active")||n.data("nochange"))return e._showNext(1),!1;e._replace(n)}e._showNext()},t||Math.max(Math.abs(this.options.interval),300))},_replace:function(e){e.data("active",!0);var s=this,o=e.children("a:last"),i={width:o.width(),height:o.height()};e.data("active",!0);var a=this.outItems.shift();this.outItems.push(o.clone().css("transition","none")),a.css(i).prependTo(e);var n=this._getAnimProperties(o);a.css(n.startInProp),o.css(n.startOutProp),this._setTransition(a,"all",n.animSpeed,n.delay,this.options.animEasingIn),this._setTransition(o,"all",n.animSpeed,0,this.options.animEasingOut),this._applyTransition(a,n.endInProp,n.animSpeed,function(){var e=t(this),o=n.animSpeed===s.options.animSpeed&&r(n.endInProp)?n.animSpeed:0;setTimeout(function(){s.supportTransitions&&e.off(s.transEndEventName),e.next().remove(),e.parent().data("active",!1)},o)},0===n.animSpeed||r(n.endInProp)),this._applyTransition(o,n.endOutProp,n.animSpeed);var h=a.attr("data-video");a.attr("style");"yes"===h&&(a.parent().css("background-image","url("+GridRotator.pluginsUrl+"/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/img/play_overlay.png)"),a.parent().css("background-size","cover"),a.css("opacity","0.45"))},_getRandom:function(t,e){for(var s=[],o=0;o<e;++o)s.push(o);return s.shuffle().slice(0,t)},_setTransition:function(t,e,s,o,i){setTimeout(function(){t.css("transition",e+" "+s+"ms "+o+"ms "+i)},25)},_applyTransition:function(e,s,o,i,a){var n=this;setTimeout(function(){t.fn.applyStyle=n.supportTransitions?t.fn.css:t.fn.animate,i&&n.supportTransitions&&(e.on(n.transEndEventName,i),a&&i.call(e)),i=i||function(){return!1},e.stop().applyStyle(s,t.extend(!0,[],{duration:o+"ms",complete:i}))},25)}};var c=function(t){e.console&&e.console.error(t)};t.fn.gridrotator=function(e){var s=t.data(this,"gridrotator");if("string"==typeof e){var o=Array.prototype.slice.call(arguments,1);this.each(function(){s?t.isFunction(s[e])&&"_"!==e.charAt(0)?s[e].apply(s,o):c("no such method '"+e+"' for gridrotator instance"):c("cannot call methods on gridrotator prior to initialization; attempted to call method '"+e+"'")})}else this.each(function(){s?s._init():s=t.data(this,"gridrotator",new t.GridRotator(e,this))});return s}}(jQuery,window);
|
{js → assets/js}/jquery.swipebox.js
RENAMED
@@ -718,7 +718,7 @@
|
|
718 |
isVideo : function ( src ) {
|
719 |
|
720 |
if ( src ) {
|
721 |
-
if ( src.match( /
|
722 |
return true;
|
723 |
}
|
724 |
|
@@ -763,37 +763,29 @@
|
|
763 |
/**
|
764 |
* Get video iframe code from URL
|
765 |
*/
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
'autoplay' : ( plugin.settings.autoplayVideos ? '1' : '0' ),
|
778 |
-
'v' : ''
|
779 |
-
});
|
780 |
-
iframe = '<iframe width="560" height="315" src="//' + youtubeUrl[1] + '/embed/' + youtubeUrl[2] + '?' + qs + '" frameborder="0" allowfullscreen></iframe>';
|
781 |
-
|
782 |
-
} else if ( vimeoUrl ) {
|
783 |
-
qs = ui.parseUri( url, {
|
784 |
-
'autoplay' : ( plugin.settings.autoplayVideos ? '1' : '0' ),
|
785 |
-
'byline' : '0',
|
786 |
-
'portrait' : '0',
|
787 |
-
'color': plugin.settings.vimeoColor
|
788 |
-
});
|
789 |
-
iframe = '<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?' + qs + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
790 |
|
791 |
-
|
792 |
-
iframe = '<iframe width="560" height="315" src="' + url + '" frameborder="0" allowfullscreen></iframe>';
|
793 |
-
}
|
794 |
|
795 |
-
|
796 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
797 |
|
798 |
/**
|
799 |
* Load image
|
718 |
isVideo : function ( src ) {
|
719 |
|
720 |
if ( src ) {
|
721 |
+
if ( src.match( /youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/) || src.match( /vimeo\.com\/([0-9]*)/ ) || src.match( /youtu\.be\/([a-zA-Z0-9\-_]+)/ ) || src.match( /mp4/ )) {
|
722 |
return true;
|
723 |
}
|
724 |
|
763 |
/**
|
764 |
* Get video iframe code from URL
|
765 |
*/
|
766 |
+
getVideo : function( url ) {
|
767 |
+
var iframe = '',
|
768 |
+
youtubeUrl = url.match( /watch\?v=([a-zA-Z0-9\-_]+)/ ),
|
769 |
+
youtubeShortUrl = url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/),
|
770 |
+
vimeoUrl = url.match( /vimeo\.com\/([0-9]*)/ );
|
771 |
+
instagramUrl = url.match(/cdninstagram\.com\/([a-zA-Z0-9\-_\-.\--]+)\/([a-zA-Z0-9\-_\-.\--]+)/);
|
772 |
+
if ( youtubeUrl || youtubeShortUrl) {
|
773 |
+
if ( youtubeShortUrl ) {
|
774 |
+
youtubeUrl = youtubeShortUrl;
|
775 |
+
}
|
776 |
+
iframe = '<iframe width="560" height="315" src="//www.youtube.com/embed/' + youtubeUrl[1] + '" frameborder="0" allowfullscreen></iframe>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
777 |
|
778 |
+
} else if ( vimeoUrl ) {
|
|
|
|
|
779 |
|
780 |
+
iframe = '<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?byline=0&portrait=0&color='+plugin.settings.vimeoColor+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
781 |
+
|
782 |
+
}else if ( instagramUrl ) {
|
783 |
+
|
784 |
+
iframe = '<video id="inst_video" controls allowfullscreen> <source src=' + url + '> Your browser does not support HTML5 video</video>';
|
785 |
+
}
|
786 |
+
|
787 |
+
return '<div class="swipebox-video-container" style="max-width:' + plugin.settings.videomaxWidth + 'px"><div class="swipebox-video;">'+iframe+'</div></div>';
|
788 |
+
},
|
789 |
|
790 |
/**
|
791 |
* Load image
|
assets/js/jquery.swipebox.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e,t,i,s){i.swipebox=function(o,a){var n,r,l={useCSS:!0,useSVG:!0,initialIndexOnArray:0,removeBarsOnMobile:!0,hideCloseButtonOnMobile:!1,hideBarsDelay:3e3,videoMaxWidth:1140,vimeoColor:"cccccc",beforeOpen:null,afterOpen:null,afterClose:null,loopAtEnd:!1,autoplayVideos:!1,queryStringData:{},toggleClassOnLoad:""},d=this,p=[],c=o.selector,b=i(c),u=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i),h=null!==u||t.createTouch!==s||"ontouchstart"in e||"onmsgesturechange"in e||navigator.msMaxTouchPoints,m=!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,g=e.innerWidth?e.innerWidth:i(e).width(),w=e.innerHeight?e.innerHeight:i(e).height(),f=0;d.settings={},i.swipebox.close=function(){n.closeSlide()},i.swipebox.extend=function(){return n},d.init=function(){d.settings=i.extend({},l,a),i.isArray(o)?(p=o,n.target=i(e),n.init(d.settings.initialIndexOnArray)):i(t).on("click",c,function(e){if("slide current"===e.target.parentNode.className)return!1;var t,s,a;i.isArray(o)||(n.destroy(),r=i(c),n.actions()),p=[],a||(s="data-rel",a=i(this).attr(s)),a||(s="rel",a=i(this).attr(s)),(r=a&&""!==a&&"nofollow"!==a?b.filter("["+s+'="'+a+'"]'):i(c)).each(function(){var e=null,t=null;i(this).attr("title")&&(e=i(this).attr("title")),i(this).attr("href")&&(t=i(this).attr("href")),p.push({href:t,title:e})}),t=r.index(i(this)),e.preventDefault(),e.stopPropagation(),n.target=i(e.target),n.init(t)})},n={init:function(e){d.settings.beforeOpen&&d.settings.beforeOpen(),this.target.trigger("swipebox-start"),i.swipebox.isOpen=!0,this.build(),this.openSlide(e),this.openMedia(e),this.preloadMedia(e+1),this.preloadMedia(e-1),d.settings.afterOpen&&d.settings.afterOpen()},build:function(){var e,t=this;i("body").append('<div id="swipebox-overlay">\t\t\t\t\t<div id="swipebox-container">\t\t\t\t\t\t<div id="swipebox-slider"></div>\t\t\t\t\t\t<div id="swipebox-top-bar">\t\t\t\t\t\t\t<div id="swipebox-title"></div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="swipebox-bottom-bar">\t\t\t\t\t\t\t<div id="swipebox-arrows">\t\t\t\t\t\t\t\t<a id="swipebox-prev"></a>\t\t\t\t\t\t\t\t<a id="swipebox-next"></a>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<a id="swipebox-close"></a>\t\t\t\t\t</div>\t\t\t</div>'),m&&!0===d.settings.useSVG&&(e=(e=i("#swipebox-close").css("background-image")).replace("png","svg"),i("#swipebox-prev, #swipebox-next, #swipebox-close").css({"background-image":e})),u&&d.settings.removeBarsOnMobile&&i("#swipebox-bottom-bar, #swipebox-top-bar").remove(),i.each(p,function(){i("#swipebox-slider").append('<div class="slide"></div>')}),t.setDim(),t.actions(),h&&t.gesture(),t.keyboard(),t.animBars(),t.resize()},setDim:function(){var t,s,o;"onorientationchange"in e?e.addEventListener("orientationchange",function(){0===e.orientation?(t=g,s=w):90!==e.orientation&&-90!==e.orientation||(t=w,s=g)},!1):(t=e.innerWidth?e.innerWidth:i(e).width(),s=e.innerHeight?e.innerHeight:i(e).height()),o={width:t,height:s},i("#swipebox-overlay").css(o)},resize:function(){var t=this;i(e).resize(function(){t.setDim()}).resize()},supportTransition:function(){var e,i="transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" ");for(e=0;e<i.length;e++)if(t.createElement("div").style[i[e]]!==s)return i[e];return!1},doCssTrans:function(){if(d.settings.useCSS&&this.supportTransition())return!0},gesture:function(){var e,t,s,o,a,n,r=this,l=!1,d=!1,c={},b={},u=i("#swipebox-top-bar, #swipebox-bottom-bar"),h=i("#swipebox-slider");u.addClass("visible-bars"),r.setTimeout(),i("body").bind("touchstart",function(r){return i(this).addClass("touching"),e=i("#swipebox-slider .slide").index(i("#swipebox-slider .slide.current")),b=r.originalEvent.targetTouches[0],c.pageX=r.originalEvent.targetTouches[0].pageX,c.pageY=r.originalEvent.targetTouches[0].pageY,i("#swipebox-slider").css({"-webkit-transform":"translate3d("+f+"%, 0, 0)",transform:"translate3d("+f+"%, 0, 0)"}),i(".touching").bind("touchmove",function(r){if(r.preventDefault(),r.stopPropagation(),b=r.originalEvent.targetTouches[0],!d&&(a=s,s=b.pageY-c.pageY,Math.abs(s)>=50||l)){var u=.75-Math.abs(s)/h.height();h.css({top:s+"px"}),h.css({opacity:u}),l=!0}o=t,t=b.pageX-c.pageX,n=100*t/g,!d&&!l&&Math.abs(t)>=10&&(i("#swipebox-slider").css({"-webkit-transition":"",transition:""}),d=!0),d&&(0<t?0===e?i("#swipebox-overlay").addClass("leftSpringTouch"):(i("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"),i("#swipebox-slider").css({"-webkit-transform":"translate3d("+(f+n)+"%, 0, 0)",transform:"translate3d("+(f+n)+"%, 0, 0)"})):0>t&&(p.length===e+1?i("#swipebox-overlay").addClass("rightSpringTouch"):(i("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"),i("#swipebox-slider").css({"-webkit-transform":"translate3d("+(f+n)+"%, 0, 0)",transform:"translate3d("+(f+n)+"%, 0, 0)"}))))}),!1}).bind("touchend",function(e){if(e.preventDefault(),e.stopPropagation(),i("#swipebox-slider").css({"-webkit-transition":"-webkit-transform 0.4s ease",transition:"transform 0.4s ease"}),s=b.pageY-c.pageY,t=b.pageX-c.pageX,n=100*t/g,l)if(l=!1,Math.abs(s)>=100&&Math.abs(s)>Math.abs(a)){var p=s>0?h.height():-h.height();h.animate({top:p+"px",opacity:0},300,function(){r.closeSlide()})}else h.animate({top:0,opacity:1},300);else d?(d=!1,t>=10&&t>=o?r.getPrev():t<=-10&&t<=o&&r.getNext()):u.hasClass("visible-bars")?(r.clearTimeout(),r.hideBars()):(r.showBars(),r.setTimeout());i("#swipebox-slider").css({"-webkit-transform":"translate3d("+f+"%, 0, 0)",transform:"translate3d("+f+"%, 0, 0)"}),i("#swipebox-overlay").removeClass("leftSpringTouch").removeClass("rightSpringTouch"),i(".touching").off("touchmove").removeClass("touching")})},setTimeout:function(){if(d.settings.hideBarsDelay>0){var t=this;t.clearTimeout(),t.timeout=e.setTimeout(function(){t.hideBars()},d.settings.hideBarsDelay)}},clearTimeout:function(){e.clearTimeout(this.timeout),this.timeout=null},showBars:function(){var e=i("#swipebox-top-bar, #swipebox-bottom-bar");this.doCssTrans()?e.addClass("visible-bars"):(i("#swipebox-top-bar").animate({top:0},500),i("#swipebox-bottom-bar").animate({bottom:0},500),setTimeout(function(){e.addClass("visible-bars")},1e3))},hideBars:function(){var e=i("#swipebox-top-bar, #swipebox-bottom-bar");this.doCssTrans()?e.removeClass("visible-bars"):(i("#swipebox-top-bar").animate({top:"-50px"},500),i("#swipebox-bottom-bar").animate({bottom:"-50px"},500),setTimeout(function(){e.removeClass("visible-bars")},1e3))},animBars:function(){var e=this,t=i("#swipebox-top-bar, #swipebox-bottom-bar");t.addClass("visible-bars"),e.setTimeout(),i("#swipebox-slider").click(function(){t.hasClass("visible-bars")||(e.showBars(),e.setTimeout())}),i("#swipebox-bottom-bar").hover(function(){e.showBars(),t.addClass("visible-bars"),e.clearTimeout()},function(){d.settings.hideBarsDelay>0&&(t.removeClass("visible-bars"),e.setTimeout())})},keyboard:function(){var t=this;i(e).bind("keyup",function(e){e.preventDefault(),e.stopPropagation(),37===e.keyCode?t.getPrev():39===e.keyCode?t.getNext():27===e.keyCode&&t.closeSlide()})},actions:function(){var e=this,t="touchend click";p.length<2?(i("#swipebox-bottom-bar").hide(),s===p[1]&&i("#swipebox-top-bar").hide()):(i("#swipebox-prev").bind(t,function(t){t.preventDefault(),t.stopPropagation(),e.getPrev(),e.setTimeout()}),i("#swipebox-next").bind(t,function(t){t.preventDefault(),t.stopPropagation(),e.getNext(),e.setTimeout()})),i("#swipebox-close").bind(t,function(){e.closeSlide()})},setSlide:function(e,t){t=t||!1;var s=i("#swipebox-slider");f=100*-e,this.doCssTrans()?s.css({"-webkit-transform":"translate3d("+100*-e+"%, 0, 0)",transform:"translate3d("+100*-e+"%, 0, 0)"}):s.animate({left:100*-e+"%"}),i("#swipebox-slider .slide").removeClass("current"),i("#swipebox-slider .slide").eq(e).addClass("current"),this.setTitle(e),t&&s.fadeIn(),i("#swipebox-prev, #swipebox-next").removeClass("disabled"),0===e?i("#swipebox-prev").addClass("disabled"):e===p.length-1&&!0!==d.settings.loopAtEnd&&i("#swipebox-next").addClass("disabled")},openSlide:function(t){i("html").addClass("swipebox-html"),h?(i("html").addClass("swipebox-touch"),d.settings.hideCloseButtonOnMobile&&i("html").addClass("swipebox-no-close-button")):i("html").addClass("swipebox-no-touch"),i(e).trigger("resize"),this.setSlide(t,!0)},preloadMedia:function(e){var t=this,i=null;p[e]!==s&&(i=p[e].href),t.isVideo(i)?t.openMedia(e):setTimeout(function(){t.openMedia(e)},1e3)},openMedia:function(e){var t,o;if(p[e]!==s&&(t=p[e].href),e<0||e>=p.length)return!1;o=i("#swipebox-slider .slide").eq(e),this.isVideo(t)?o.html(this.getVideo(t)):(o.addClass("slide-loading"),this.loadMedia(t,function(){o.removeClass("slide-loading"),o.html(this)}))},setTitle:function(e){var t=null;i("#swipebox-title").empty(),p[e]!==s&&(t=p[e].title),t?(i("#swipebox-top-bar").show(),i("#swipebox-title").append(t)):i("#swipebox-top-bar").hide()},isVideo:function(e){if(e){if(e.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/)||e.match(/vimeo\.com\/([0-9]*)/)||e.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||e.match(/mp4/))return!0;if(e.toLowerCase().indexOf("swipeboxvideo=1")>=0)return!0}},parseUri:function(e,s){var o=t.createElement("a"),a={};return o.href=decodeURIComponent(e),a=JSON.parse('{"'+o.search.toLowerCase().replace("?","").replace(/&/g,'","').replace(/=/g,'":"')+'"}'),i.isPlainObject(s)&&(a=i.extend(a,s,d.settings.queryStringData)),i.map(a,function(e,t){if(e&&e>"")return encodeURIComponent(t)+"="+encodeURIComponent(e)}).join("&")},getVideo:function(e){var t="",i=e.match(/watch\?v=([a-zA-Z0-9\-_]+)/),s=e.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/),o=e.match(/vimeo\.com\/([0-9]*)/);return instagramUrl=e.match(/cdninstagram\.com\/([a-zA-Z0-9\-_\-.\--]+)\/([a-zA-Z0-9\-_\-.\--]+)/),i||s?(s&&(i=s),t='<iframe width="560" height="315" src="//www.youtube.com/embed/'+i[1]+'" frameborder="0" allowfullscreen></iframe>'):o?t='<iframe width="560" height="315" src="//player.vimeo.com/video/'+o[1]+"?byline=0&portrait=0&color="+d.settings.vimeoColor+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>':instagramUrl&&(t='<video id="inst_video" controls allowfullscreen> <source src='+e+"> Your browser does not support HTML5 video</video>"),'<div class="swipebox-video-container" style="max-width:'+d.settings.videomaxWidth+'px"><div class="swipebox-video;">'+t+"</div></div>"},loadMedia:function(e,t){if(0===e.trim().indexOf("#"))t.call(i("<div>",{class:"swipebox-inline-container"}).append(i(e).clone().toggleClass(d.settings.toggleClassOnLoad)));else if(!this.isVideo(e)){var s=i("<img>").on("load",function(){t.call(s)});s.attr("src",e)}},getNext:function(){var e,t=this,s=i("#swipebox-slider .slide").index(i("#swipebox-slider .slide.current"));s+1<p.length?(e=i("#swipebox-slider .slide").eq(s).contents().find("iframe").attr("src"),i("#swipebox-slider .slide").eq(s).contents().find("iframe").attr("src",e),s++,t.setSlide(s),t.preloadMedia(s+1)):!0===d.settings.loopAtEnd?(e=i("#swipebox-slider .slide").eq(s).contents().find("iframe").attr("src"),i("#swipebox-slider .slide").eq(s).contents().find("iframe").attr("src",e),s=0,t.preloadMedia(s),t.setSlide(s),t.preloadMedia(s+1)):(i("#swipebox-overlay").addClass("rightSpring"),setTimeout(function(){i("#swipebox-overlay").removeClass("rightSpring")},500))},getPrev:function(){var e,t=i("#swipebox-slider .slide").index(i("#swipebox-slider .slide.current"));t>0?(e=i("#swipebox-slider .slide").eq(t).contents().find("iframe").attr("src"),i("#swipebox-slider .slide").eq(t).contents().find("iframe").attr("src",e),t--,this.setSlide(t),this.preloadMedia(t-1)):(i("#swipebox-overlay").addClass("leftSpring"),setTimeout(function(){i("#swipebox-overlay").removeClass("leftSpring")},500))},closeSlide:function(){i("html").removeClass("swipebox-html"),i("html").removeClass("swipebox-touch"),i(e).trigger("resize"),this.destroy()},destroy:function(){i(e).unbind("keyup"),i("body").unbind("touchstart"),i("body").unbind("touchmove"),i("body").unbind("touchend"),i("#swipebox-slider").unbind(),i("#swipebox-overlay").remove(),i.isArray(o)||o.removeData("_swipebox"),this.target&&this.target.trigger("swipebox-destroy"),i.swipebox.isOpen=!1,d.settings.afterClose&&d.settings.afterClose()}},d.init()},i.fn.swipebox=function(e){if(!i.data(this,"_swipebox")){var t=new i.swipebox(this,e);this.data("_swipebox",t)}return this.data("_swipebox")}}(window,document,jQuery);
|
js/modernizr.custom.26633.js → assets/js/modernizr.custom.26633.min.js
RENAMED
File without changes
|
{js → assets/js}/owl.carousel.js
RENAMED
File without changes
|
assets/js/owl.carousel.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
"function"!=typeof Object.create&&(Object.create=function(t){function e(){}return e.prototype=t,new e}),function(t,e,o){var i={init:function(e,o){var i=this;i.$elem=t(o),i.options=t.extend({},t.fn.owlCarousel.options,i.$elem.data(),e),i.userOptions=e,i.loadContent()},loadContent:function(){var e,o=this;"function"==typeof o.options.beforeInit&&o.options.beforeInit.apply(this,[o.$elem]),"string"==typeof o.options.jsonPath?(e=o.options.jsonPath,t.getJSON(e,function(t){var e,i="";if("function"==typeof o.options.jsonSuccess)o.options.jsonSuccess.apply(this,[t]);else{for(e in t.owl)t.owl.hasOwnProperty(e)&&(i+=t.owl[e].item);o.$elem.html(i)}o.logIn()})):o.logIn()},logIn:function(){var t=this;t.$elem.data("owl-originalStyles",t.$elem.attr("style")).data("owl-originalClasses",t.$elem.attr("class")),t.$elem.css({opacity:0}),t.orignalItems=t.options.items,t.checkBrowser(),t.wrapperWidth=0,t.checkVisible=null,t.setVars()},setVars:function(){var t=this;if(0===t.$elem.children().length)return!1;t.baseClass(),t.eventTypes(),t.$userItems=t.$elem.children(),t.itemsAmount=t.$userItems.length,t.wrapItems(),t.$owlItems=t.$elem.find(".owl-item"),t.$owlWrapper=t.$elem.find(".owl-wrapper"),t.playDirection="next",t.prevItem=0,t.prevArr=[0],t.currentItem=0,t.customEvents(),t.onStartup()},onStartup:function(){var t=this;t.updateItems(),t.calculateAll(),t.buildControls(),t.updateControls(),t.response(),t.moveEvents(),t.stopOnHover(),t.owlStatus(),!1!==t.options.transitionStyle&&t.transitionTypes(t.options.transitionStyle),!0===t.options.autoPlay&&(t.options.autoPlay=5e3),t.play(),t.$elem.find(".owl-wrapper").css("display","block"),t.$elem.is(":visible")?t.$elem.css("opacity",1):t.watchVisibility(),t.onstartup=!1,t.eachMoveUpdate(),"function"==typeof t.options.afterInit&&t.options.afterInit.apply(this,[t.$elem])},eachMoveUpdate:function(){var t=this;!0===t.options.lazyLoad&&t.lazyLoad(),!0===t.options.autoHeight&&t.autoHeight(),t.onVisibleItems(),"function"==typeof t.options.afterAction&&t.options.afterAction.apply(this,[t.$elem])},updateVars:function(){var t=this;"function"==typeof t.options.beforeUpdate&&t.options.beforeUpdate.apply(this,[t.$elem]),t.watchVisibility(),t.updateItems(),t.calculateAll(),t.updatePosition(),t.updateControls(),t.eachMoveUpdate(),"function"==typeof t.options.afterUpdate&&t.options.afterUpdate.apply(this,[t.$elem])},reload:function(){var t=this;e.setTimeout(function(){t.updateVars()},0)},watchVisibility:function(){var t=this;if(!1!==t.$elem.is(":visible"))return!1;t.$elem.css({opacity:0}),e.clearInterval(t.autoPlayInterval),e.clearInterval(t.checkVisible),t.checkVisible=e.setInterval(function(){t.$elem.is(":visible")&&(t.reload(),t.$elem.animate({opacity:1},200),e.clearInterval(t.checkVisible))},500)},wrapItems:function(){var t=this;t.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>'),t.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">'),t.wrapperOuter=t.$elem.find(".owl-wrapper-outer")},baseClass:function(){var t=this,e=t.$elem.hasClass(t.options.baseClass),o=t.$elem.hasClass(t.options.theme);e||t.$elem.addClass(t.options.baseClass),o||t.$elem.addClass(t.options.theme)},updateItems:function(){var e,o,i=this;if(!1===i.options.responsive)return!1;if(!0===i.options.singleItem)return i.options.items=i.orignalItems=1,i.options.itemsCustom=!1,i.options.itemsDesktop=!1,i.options.itemsDesktopSmall=!1,i.options.itemsTablet=!1,i.options.itemsTabletSmall=!1,i.options.itemsMobile=!1,!1;if((e=t(i.options.responsiveBaseWidth).width())>(i.options.itemsDesktop[0]||i.orignalItems)&&(i.options.items=i.orignalItems),!1!==i.options.itemsCustom)for(i.options.itemsCustom.sort(function(t,e){return t[0]-e[0]}),o=0;o<i.options.itemsCustom.length;o+=1)i.options.itemsCustom[o][0]<=e&&(i.options.items=i.options.itemsCustom[o][1]);else e<=i.options.itemsDesktop[0]&&!1!==i.options.itemsDesktop&&(i.options.items=i.options.itemsDesktop[1]),e<=i.options.itemsDesktopSmall[0]&&!1!==i.options.itemsDesktopSmall&&(i.options.items=i.options.itemsDesktopSmall[1]),e<=i.options.itemsTablet[0]&&!1!==i.options.itemsTablet&&(i.options.items=i.options.itemsTablet[1]),e<=i.options.itemsTabletSmall[0]&&!1!==i.options.itemsTabletSmall&&(i.options.items=i.options.itemsTabletSmall[1]),e<=i.options.itemsMobile[0]&&!1!==i.options.itemsMobile&&(i.options.items=i.options.itemsMobile[1]);i.options.items>i.itemsAmount&&!0===i.options.itemsScaleUp&&(i.options.items=i.itemsAmount)},response:function(){var o,i,s=this;if(!0!==s.options.responsive)return!1;i=t(e).width(),s.resizer=function(){t(e).width()!==i&&(!1!==s.options.autoPlay&&e.clearInterval(s.autoPlayInterval),e.clearTimeout(o),o=e.setTimeout(function(){i=t(e).width(),s.updateVars()},s.options.responsiveRefreshRate))},t(e).resize(s.resizer)},updatePosition:function(){var t=this;t.jumpTo(t.currentItem),!1!==t.options.autoPlay&&t.checkAp()},appendItemsSizes:function(){var e=this,o=0,i=e.itemsAmount-e.options.items;e.$owlItems.each(function(s){var n=t(this);n.css({width:e.itemWidth}).data("owl-item",Number(s)),s%e.options.items!=0&&s!==i||s>i||(o+=1),n.data("owl-roundPages",o)})},appendWrapperSizes:function(){var t=this,e=t.$owlItems.length*t.itemWidth;t.$owlWrapper.css({width:2*e,left:0}),t.appendItemsSizes()},calculateAll:function(){var t=this;t.calculateWidth(),t.appendWrapperSizes(),t.loops(),t.max()},calculateWidth:function(){var t=this;t.itemWidth=Math.round(t.$elem.width()/t.options.items)},max:function(){var t=this,e=-1*(t.itemsAmount*t.itemWidth-t.options.items*t.itemWidth);return t.options.items>t.itemsAmount?(t.maximumItem=0,e=0,t.maximumPixels=0):(t.maximumItem=t.itemsAmount-t.options.items,t.maximumPixels=e),e},min:function(){return 0},loops:function(){var e,o,i=this,s=0,n=0;for(i.positionsInArray=[0],i.pagesInArray=[],e=0;e<i.itemsAmount;e+=1)n+=i.itemWidth,i.positionsInArray.push(-n),!0===i.options.scrollPerPage&&(o=t(i.$owlItems[e]).data("owl-roundPages"))!==s&&(i.pagesInArray[s]=i.positionsInArray[e],s=o)},buildControls:function(){var e=this;!0!==e.options.navigation&&!0!==e.options.pagination||(e.owlControls=t('<div class="owl-controls"/>').toggleClass("clickable",!e.browser.isTouch).appendTo(e.$elem)),!0===e.options.pagination&&e.buildPagination(),!0===e.options.navigation&&e.buildButtons()},buildButtons:function(){var e=this,o=t('<div class="owl-buttons"/>');e.owlControls.append(o),e.buttonPrev=t("<div/>",{class:"owl-prev",html:e.options.navigationText[0]||""}),e.buttonNext=t("<div/>",{class:"owl-next",html:e.options.navigationText[1]||""}),o.append(e.buttonPrev).append(e.buttonNext),o.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(t){t.preventDefault()}),o.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(o){o.preventDefault(),t(this).hasClass("owl-next")?e.next():e.prev()})},buildPagination:function(){var e=this;e.paginationWrapper=t('<div class="owl-pagination"/>'),e.owlControls.append(e.paginationWrapper),e.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(o){o.preventDefault(),Number(t(this).data("owl-page"))!==e.currentItem&&e.goTo(Number(t(this).data("owl-page")),!0)})},updatePagination:function(){var e,o,i,s,n,a,r=this;if(!1===r.options.pagination)return!1;for(r.paginationWrapper.html(""),e=0,o=r.itemsAmount-r.itemsAmount%r.options.items,s=0;s<r.itemsAmount;s+=1)s%r.options.items==0&&(e+=1,o===s&&(i=r.itemsAmount-r.options.items),n=t("<div/>",{class:"owl-page"}),a=t("<span></span>",{text:!0===r.options.paginationNumbers?e:"",class:!0===r.options.paginationNumbers?"owl-numbers":""}),n.append(a),n.data("owl-page",o===s?i:s),n.data("owl-roundPages",e),r.paginationWrapper.append(n));r.checkPagination()},checkPagination:function(){var e=this;if(!1===e.options.pagination)return!1;e.paginationWrapper.find(".owl-page").each(function(){t(this).data("owl-roundPages")===t(e.$owlItems[e.currentItem]).data("owl-roundPages")&&(e.paginationWrapper.find(".owl-page").removeClass("active"),t(this).addClass("active"))})},checkNavigation:function(){var t=this;if(!1===t.options.navigation)return!1;!1===t.options.rewindNav&&(0===t.currentItem&&0===t.maximumItem?(t.buttonPrev.addClass("disabled"),t.buttonNext.addClass("disabled")):0===t.currentItem&&0!==t.maximumItem?(t.buttonPrev.addClass("disabled"),t.buttonNext.removeClass("disabled")):t.currentItem===t.maximumItem?(t.buttonPrev.removeClass("disabled"),t.buttonNext.addClass("disabled")):0!==t.currentItem&&t.currentItem!==t.maximumItem&&(t.buttonPrev.removeClass("disabled"),t.buttonNext.removeClass("disabled")))},updateControls:function(){var t=this;t.updatePagination(),t.checkNavigation(),t.owlControls&&(t.options.items>=t.itemsAmount?t.owlControls.hide():t.owlControls.show())},destroyControls:function(){this.owlControls&&this.owlControls.remove()},next:function(t){var e=this;if(e.isTransition)return!1;if(e.currentItem+=!0===e.options.scrollPerPage?e.options.items:1,e.currentItem>e.maximumItem+(!0===e.options.scrollPerPage?e.options.items-1:0)){if(!0!==e.options.rewindNav)return e.currentItem=e.maximumItem,!1;e.currentItem=0,t="rewind"}e.goTo(e.currentItem,t)},prev:function(t){var e=this;if(e.isTransition)return!1;if(!0===e.options.scrollPerPage&&e.currentItem>0&&e.currentItem<e.options.items?e.currentItem=0:e.currentItem-=!0===e.options.scrollPerPage?e.options.items:1,e.currentItem<0){if(!0!==e.options.rewindNav)return e.currentItem=0,!1;e.currentItem=e.maximumItem,t="rewind"}e.goTo(e.currentItem,t)},goTo:function(t,o,i){var s,n=this;return!n.isTransition&&("function"==typeof n.options.beforeMove&&n.options.beforeMove.apply(this,[n.$elem]),t>=n.maximumItem?t=n.maximumItem:t<=0&&(t=0),n.currentItem=n.owl.currentItem=t,!1!==n.options.transitionStyle&&"drag"!==i&&1===n.options.items&&!0===n.browser.support3d?(n.swapSpeed(0),!0===n.browser.support3d?n.transition3d(n.positionsInArray[t]):n.css2slide(n.positionsInArray[t],1),n.afterGo(),n.singleItemTransition(),!1):(s=n.positionsInArray[t],!0===n.browser.support3d?(n.isCss3Finish=!1,!0===o?(n.swapSpeed("paginationSpeed"),e.setTimeout(function(){n.isCss3Finish=!0},n.options.paginationSpeed)):"rewind"===o?(n.swapSpeed(n.options.rewindSpeed),e.setTimeout(function(){n.isCss3Finish=!0},n.options.rewindSpeed)):(n.swapSpeed("slideSpeed"),e.setTimeout(function(){n.isCss3Finish=!0},n.options.slideSpeed)),n.transition3d(s)):!0===o?n.css2slide(s,n.options.paginationSpeed):"rewind"===o?n.css2slide(s,n.options.rewindSpeed):n.css2slide(s,n.options.slideSpeed),void n.afterGo()))},jumpTo:function(t){var e=this;"function"==typeof e.options.beforeMove&&e.options.beforeMove.apply(this,[e.$elem]),t>=e.maximumItem||-1===t?t=e.maximumItem:t<=0&&(t=0),e.swapSpeed(0),!0===e.browser.support3d?e.transition3d(e.positionsInArray[t]):e.css2slide(e.positionsInArray[t],1),e.currentItem=e.owl.currentItem=t,e.afterGo()},afterGo:function(){var t=this;t.prevArr.push(t.currentItem),t.prevItem=t.owl.prevItem=t.prevArr[t.prevArr.length-2],t.prevArr.shift(0),t.prevItem!==t.currentItem&&(t.checkPagination(),t.checkNavigation(),t.eachMoveUpdate(),!1!==t.options.autoPlay&&t.checkAp()),"function"==typeof t.options.afterMove&&t.prevItem!==t.currentItem&&t.options.afterMove.apply(this,[t.$elem])},stop:function(){this.apStatus="stop",e.clearInterval(this.autoPlayInterval)},checkAp:function(){"stop"!==this.apStatus&&this.play()},play:function(){var t=this;if(t.apStatus="play",!1===t.options.autoPlay)return!1;e.clearInterval(t.autoPlayInterval),t.autoPlayInterval=e.setInterval(function(){t.next(!0)},t.options.autoPlay)},swapSpeed:function(t){var e=this;"slideSpeed"===t?e.$owlWrapper.css(e.addCssSpeed(e.options.slideSpeed)):"paginationSpeed"===t?e.$owlWrapper.css(e.addCssSpeed(e.options.paginationSpeed)):"string"!=typeof t&&e.$owlWrapper.css(e.addCssSpeed(t))},addCssSpeed:function(t){return{"-webkit-transition":"all "+t+"ms ease","-moz-transition":"all "+t+"ms ease","-o-transition":"all "+t+"ms ease",transition:"all "+t+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(t){return{"-webkit-transform":"translate3d("+t+"px, 0px, 0px)","-moz-transform":"translate3d("+t+"px, 0px, 0px)","-o-transform":"translate3d("+t+"px, 0px, 0px)","-ms-transform":"translate3d("+t+"px, 0px, 0px)",transform:"translate3d("+t+"px, 0px,0px)"}},transition3d:function(t){this.$owlWrapper.css(this.doTranslate(t))},css2move:function(t){this.$owlWrapper.css({left:t})},css2slide:function(t,e){var o=this;o.isCssFinish=!1,o.$owlWrapper.stop(!0,!0).animate({left:t},{duration:e||o.options.slideSpeed,complete:function(){o.isCssFinish=!0}})},checkBrowser:function(){var t,i,s,n,a="translate3d(0px, 0px, 0px)",r=o.createElement("div");r.style.cssText=" -moz-transform:"+a+"; -ms-transform:"+a+"; -o-transform:"+a+"; -webkit-transform:"+a+"; transform:"+a,t=/translate3d\(0px, 0px, 0px\)/g,s=null!==(i=r.style.cssText.match(t))&&1===i.length,n="ontouchstart"in e||e.navigator.msMaxTouchPoints,this.browser={support3d:s,isTouch:n}},moveEvents:function(){!1===this.options.mouseDrag&&!1===this.options.touchDrag||(this.gestures(),this.disabledEvents())},eventTypes:function(){var t=this,e=["s","e","x"];t.ev_types={},!0===t.options.mouseDrag&&!0===t.options.touchDrag?e=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:!1===t.options.mouseDrag&&!0===t.options.touchDrag?e=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:!0===t.options.mouseDrag&&!1===t.options.touchDrag&&(e=["mousedown.owl","mousemove.owl","mouseup.owl"]),t.ev_types.start=e[0],t.ev_types.move=e[1],t.ev_types.end=e[2]},disabledEvents:function(){this.$elem.on("dragstart.owl",function(t){t.preventDefault()}),this.$elem.on("mousedown.disableTextSelect",function(e){return t(e.target).is("input, textarea, select, option")})},gestures:function(){var i=this,s={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};function n(t){if(void 0!==t.touches)return{x:t.touches[0].pageX,y:t.touches[0].pageY};if(void 0===t.touches){if(void 0!==t.pageX)return{x:t.pageX,y:t.pageY};if(void 0===t.pageX)return{x:t.clientX,y:t.clientY}}}function a(e){"on"===e?(t(o).on(i.ev_types.move,r),t(o).on(i.ev_types.end,l)):"off"===e&&(t(o).off(i.ev_types.move),t(o).off(i.ev_types.end))}function r(a){var r,l,p=a.originalEvent||a||e.event;i.newPosX=n(p).x-s.offsetX,i.newPosY=n(p).y-s.offsetY,i.newRelativeX=i.newPosX-s.relativePos,"function"==typeof i.options.startDragging&&!0!==s.dragging&&0!==i.newRelativeX&&(s.dragging=!0,i.options.startDragging.apply(i,[i.$elem])),(i.newRelativeX>8||i.newRelativeX<-8)&&!0===i.browser.isTouch&&(void 0!==p.preventDefault?p.preventDefault():p.returnValue=!1,s.sliding=!0),(i.newPosY>10||i.newPosY<-10)&&!1===s.sliding&&t(o).off("touchmove.owl"),r=function(){return i.newRelativeX/5},l=function(){return i.maximumPixels+i.newRelativeX/5},i.newPosX=Math.max(Math.min(i.newPosX,r()),l()),!0===i.browser.support3d?i.transition3d(i.newPosX):i.css2move(i.newPosX)}function l(o){var n,r,l,p=o.originalEvent||o||e.event;p.target=p.target||p.srcElement,s.dragging=!1,!0!==i.browser.isTouch&&i.$owlWrapper.removeClass("grabbing"),i.newRelativeX<0?i.dragDirection=i.owl.dragDirection="left":i.dragDirection=i.owl.dragDirection="right",0!==i.newRelativeX&&(n=i.getNewPosition(),i.goTo(n,!1,"drag"),s.targetElement===p.target&&!0!==i.browser.isTouch&&(t(p.target).on("click.disable",function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t(e.target).off("click.disable")}),l=(r=t._data(p.target,"events").click).pop(),r.splice(0,0,l))),a("off")}i.isCssFinish=!0,i.$elem.on(i.ev_types.start,".owl-wrapper",function(o){var r,l=o.originalEvent||o||e.event;if(3===l.which)return!1;if(!(i.itemsAmount<=i.options.items)){if(!1===i.isCssFinish&&!i.options.dragBeforeAnimFinish)return!1;if(!1===i.isCss3Finish&&!i.options.dragBeforeAnimFinish)return!1;!1!==i.options.autoPlay&&e.clearInterval(i.autoPlayInterval),!0===i.browser.isTouch||i.$owlWrapper.hasClass("grabbing")||i.$owlWrapper.addClass("grabbing"),i.newPosX=0,i.newRelativeX=0,t(this).css(i.removeTransition()),r=t(this).position(),s.relativePos=r.left,s.offsetX=n(l).x-r.left,s.offsetY=n(l).y-r.top,a("on"),s.sliding=!1,s.targetElement=l.target||l.srcElement}})},getNewPosition:function(){var t=this,e=t.closestItem();return e>t.maximumItem?(t.currentItem=t.maximumItem,e=t.maximumItem):t.newPosX>=0&&(e=0,t.currentItem=0),e},closestItem:function(){var e=this,o=!0===e.options.scrollPerPage?e.pagesInArray:e.positionsInArray,i=e.newPosX,s=null;return t.each(o,function(n,a){i-e.itemWidth/20>o[n+1]&&i-e.itemWidth/20<a&&"left"===e.moveDirection()?(s=a,!0===e.options.scrollPerPage?e.currentItem=t.inArray(s,e.positionsInArray):e.currentItem=n):i+e.itemWidth/20<a&&i+e.itemWidth/20>(o[n+1]||o[n]-e.itemWidth)&&"right"===e.moveDirection()&&(!0===e.options.scrollPerPage?(s=o[n+1]||o[o.length-1],e.currentItem=t.inArray(s,e.positionsInArray)):(s=o[n+1],e.currentItem=n+1))}),e.currentItem},moveDirection:function(){var t;return this.newRelativeX<0?(t="right",this.playDirection="next"):(t="left",this.playDirection="prev"),t},customEvents:function(){var t=this;t.$elem.on("owl.next",function(){t.next()}),t.$elem.on("owl.prev",function(){t.prev()}),t.$elem.on("owl.play",function(e,o){t.options.autoPlay=o,t.play(),t.hoverStatus="play"}),t.$elem.on("owl.stop",function(){t.stop(),t.hoverStatus="stop"}),t.$elem.on("owl.goTo",function(e,o){t.goTo(o)}),t.$elem.on("owl.jumpTo",function(e,o){t.jumpTo(o)})},stopOnHover:function(){var t=this;!0===t.options.stopOnHover&&!0!==t.browser.isTouch&&!1!==t.options.autoPlay&&(t.$elem.on("mouseover",function(){t.stop()}),t.$elem.on("mouseout",function(){"stop"!==t.hoverStatus&&t.play()}))},lazyLoad:function(){var e,o,i,s,n=this;if(!1===n.options.lazyLoad)return!1;for(e=0;e<n.itemsAmount;e+=1)"loaded"!==(o=t(n.$owlItems[e])).data("owl-loaded")&&(i=o.data("owl-item"),"string"==typeof(s=o.find(".lazyOwl")).data("src")?(void 0===o.data("owl-loaded")&&(s.hide(),o.addClass("loading").data("owl-loaded","checked")),(!0!==n.options.lazyFollow||i>=n.currentItem)&&i<n.currentItem+n.options.items&&s.length&&n.lazyPreload(o,s)):o.data("owl-loaded","loaded"))},lazyPreload:function(t,o){var i,s=this,n=0;function a(){t.data("owl-loaded","loaded").removeClass("loading"),o.removeAttr("data-src"),"fade"===s.options.lazyEffect?o.fadeIn(400):o.show(),"function"==typeof s.options.afterLazyLoad&&s.options.afterLazyLoad.apply(this,[s.$elem])}"DIV"===o.prop("tagName")?(o.css("background-image","url("+o.data("src")+")"),i=!0):o[0].src=o.data("src"),function t(){n+=1,s.completeImg(o.get(0))||!0===i?a():n<=100?e.setTimeout(t,100):a()}()},autoHeight:function(){var o,i=this,s=t(i.$owlItems[i.currentItem]).find("img");function n(){var o=t(i.$owlItems[i.currentItem]).height();i.wrapperOuter.css("height",o+"px"),i.wrapperOuter.hasClass("autoHeight")||e.setTimeout(function(){i.wrapperOuter.addClass("autoHeight")},0)}void 0!==s.get(0)?(o=0,function t(){o+=1,i.completeImg(s.get(0))?n():o<=100?e.setTimeout(t,100):i.wrapperOuter.css("height","")}()):n()},completeImg:function(t){return!!t.complete&&("undefined"===typeof t.naturalWidth||0!==t.naturalWidth)},onVisibleItems:function(){var e,o=this;for(!0===o.options.addClassActive&&o.$owlItems.removeClass("active"),o.visibleItems=[],e=o.currentItem;e<o.currentItem+o.options.items;e+=1)o.visibleItems.push(e),!0===o.options.addClassActive&&t(o.$owlItems[e]).addClass("active");o.owl.visibleItems=o.visibleItems},transitionTypes:function(t){this.outClass="owl-"+t+"-out",this.inClass="owl-"+t+"-in"},singleItemTransition:function(){var t,e=this,o=e.outClass,i=e.inClass,s=e.$owlItems.eq(e.currentItem),n=e.$owlItems.eq(e.prevItem),a=Math.abs(e.positionsInArray[e.currentItem])+e.positionsInArray[e.prevItem],r=Math.abs(e.positionsInArray[e.currentItem])+e.itemWidth/2,l="webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend";e.isTransition=!0,e.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":r+"px","-moz-perspective-origin":r+"px","perspective-origin":r+"px"}),n.css((t=a,{position:"relative",left:t+"px"})).addClass(o).on(l,function(){e.endPrev=!0,n.off(l),e.clearTransStyle(n,o)}),s.addClass(i).on(l,function(){e.endCurrent=!0,s.off(l),e.clearTransStyle(s,i)})},clearTransStyle:function(t,e){var o=this;t.css({position:"",left:""}).removeClass(e),o.endPrev&&o.endCurrent&&(o.$owlWrapper.removeClass("owl-origin"),o.endPrev=!1,o.endCurrent=!1,o.isTransition=!1)},owlStatus:function(){var t=this;t.owl={userOptions:t.userOptions,baseElement:t.$elem,userItems:t.$userItems,owlItems:t.$owlItems,currentItem:t.currentItem,prevItem:t.prevItem,visibleItems:t.visibleItems,isTouch:t.browser.isTouch,browser:t.browser,dragDirection:t.dragDirection}},clearEvents:function(){this.$elem.off(".owl owl mousedown.disableTextSelect"),t(o).off(".owl owl"),t(e).off("resize",this.resizer)},unWrap:function(){var t=this;0!==t.$elem.children().length&&(t.$owlWrapper.unwrap(),t.$userItems.unwrap().unwrap(),t.owlControls&&t.owlControls.remove()),t.clearEvents(),t.$elem.attr("style",t.$elem.data("owl-originalStyles")||"").attr("class",t.$elem.data("owl-originalClasses"))},destroy:function(){this.stop(),e.clearInterval(this.checkVisible),this.unWrap(),this.$elem.removeData()},reinit:function(e){var o=t.extend({},this.userOptions,e);this.unWrap(),this.init(o,this.$elem)},addItem:function(t,e){var o,i=this;return!!t&&(0===i.$elem.children().length?(i.$elem.append(t),i.setVars(),!1):(i.unWrap(),(o=void 0===e||-1===e?-1:e)>=i.$userItems.length||-1===o?i.$userItems.eq(-1).after(t):i.$userItems.eq(o).before(t),void i.setVars()))},removeItem:function(t){var e;if(0===this.$elem.children().length)return!1;e=void 0===t||-1===t?-1:t,this.unWrap(),this.$userItems.eq(e).remove(),this.setVars()}};t.fn.owlCarousel=function(e){return this.each(function(){if(!0===t(this).data("owl-init"))return!1;t(this).data("owl-init",!0);var o=Object.create(i);o.init(e,this),t.data(this,"owlCarousel",o)})},t.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1e3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:e,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}}(jQuery,window,document);
|
enjoyinstagram.php
CHANGED
@@ -3,706 +3,40 @@
|
|
3 |
Plugin Name: Enjoy Plugin for Instagram
|
4 |
Plugin URI: http://www.mediabeta.com/enjoy-instagram/
|
5 |
Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
|
6 |
-
Version:
|
7 |
-
Author:
|
8 |
Author URI: http://www.mediabeta.com/team/
|
9 |
*/
|
10 |
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
private $plugin_options_key = 'enjoyinstagram_plugin_options';
|
17 |
-
private $plugin_settings_tabs = array();
|
18 |
-
|
19 |
-
function __construct() {
|
20 |
-
add_action( 'init', array( &$this, 'load_settings' ) );
|
21 |
-
add_action( 'admin_init', array( &$this, 'register_enjoyinstagram_client_id' ) );
|
22 |
-
add_action( 'admin_init', array( &$this, 'register_advanced_settings' ) );
|
23 |
-
add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
|
24 |
-
}
|
25 |
-
|
26 |
-
function load_settings() {
|
27 |
-
$this->general_settings = (array) get_option( $this->enjoyinstagram_general_settings_key );
|
28 |
-
$this->advanced_settings = (array) get_option( $this->advanced_settings_key );
|
29 |
-
$this->general_settings = array_merge( array(
|
30 |
-
'general_option' => 'General value'
|
31 |
-
), $this->general_settings );
|
32 |
-
|
33 |
-
$this->advanced_settings = array_merge( array(
|
34 |
-
'advanced_option' => 'Advanced value'
|
35 |
-
), $this->advanced_settings );
|
36 |
-
}
|
37 |
-
|
38 |
-
function register_enjoyinstagram_client_id() {
|
39 |
-
$this->plugin_settings_tabs[$this->enjoyinstagram_general_settings_key] = 'Profile';
|
40 |
-
|
41 |
-
register_setting( $this->enjoyinstagram_general_settings_key, $this->enjoyinstagram_general_settings_key );
|
42 |
-
add_settings_section( 'section_general', 'General Plugin Settings', array( &$this, 'section_general_desc' ), $this->enjoyinstagram_general_settings_key );
|
43 |
-
add_settings_field( 'general_option', 'A General Option', array( &$this, 'field_general_option' ), $this->enjoyinstagram_general_settings_key, 'section_general' );
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
function register_advanced_settings() {
|
48 |
-
$this->plugin_settings_tabs[$this->advanced_settings_key] = 'Settings';
|
49 |
-
|
50 |
-
register_setting( $this->advanced_settings_key, $this->advanced_settings_key );
|
51 |
-
add_settings_section( 'section_advanced', 'Advanced Plugin Settings', array( &$this, 'section_advanced_desc' ), $this->advanced_settings_key );
|
52 |
-
add_settings_field( 'advanced_option', 'An Advanced Option', array( &$this, 'field_advanced_option' ), $this->advanced_settings_key, 'section_advanced' );
|
53 |
-
}
|
54 |
-
|
55 |
-
|
56 |
-
function section_general_desc() { echo 'Instagram Settings'; }
|
57 |
-
function section_advanced_desc() { echo 'Manage Enjoy Plugin for Instagram.'; }
|
58 |
-
|
59 |
-
|
60 |
-
function field_general_option() {
|
61 |
-
?>
|
62 |
-
<input type="text" name="<?php echo $this->enjoyinstagram_general_settings_key; ?>[general_option]" value="<?php echo esc_attr( $this->general_settings['general_option'] ); ?>" /><?php
|
63 |
-
}
|
64 |
-
|
65 |
-
|
66 |
-
function field_advanced_option() { ?>
|
67 |
-
<input type="text" name="<?php echo $this->advanced_settings_key; ?>[advanced_option]" value="<?php echo esc_attr( $this->advanced_settings['advanced_option'] ); ?>" />
|
68 |
-
<?php
|
69 |
-
}
|
70 |
-
|
71 |
-
|
72 |
-
function add_admin_menus() {
|
73 |
-
add_options_page( 'Enjoy Plugin for Instagram', 'Enjoy Plugin for Instagram', 'manage_options', $this->plugin_options_key, array( &$this, 'enjoyinstagram_options_page' ) );
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
function enjoyinstagram_options_page() {
|
78 |
-
$tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->enjoyinstagram_general_settings_key;?>
|
79 |
-
<div class="wrap">
|
80 |
-
<h2><div class="ei_block">
|
81 |
-
<div class="ei_left_block">
|
82 |
-
<div class="ei_hard_block">
|
83 |
-
<?php echo '<img src="' . plugins_url( 'images/enjoyinstagram.png' , __FILE__ ) . '" > '; ?>
|
84 |
-
</div>
|
85 |
-
|
86 |
-
<div class="ei_twitter_block">
|
87 |
-
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.mediabeta.com/enjoy-instagram/" data-text="I've just installed Enjoy Plugin for Instagram for wordpress. Awesome!" data-hashtags="wordpress">Tweet</a>
|
88 |
-
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
|
89 |
-
</script>
|
90 |
-
</div>
|
91 |
-
|
92 |
-
<div id="fb-root"></div>
|
93 |
-
<script>(function(d, s, id) {
|
94 |
-
var js, fjs = d.getElementsByTagName(s)[0];
|
95 |
-
if (d.getElementById(id)) return;
|
96 |
-
js = d.createElement(s); js.id = id;
|
97 |
-
js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&appId=359330984151581&version=v2.0";
|
98 |
-
fjs.parentNode.insertBefore(js, fjs);
|
99 |
-
}(document, 'script', 'facebook-jssdk'));</script>
|
100 |
-
<div class="ei_facebook_block">
|
101 |
-
<div class="fb-like" data-href="http://www.mediabeta.com/enjoy-instagram/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true">
|
102 |
-
</div>
|
103 |
-
</div>
|
104 |
-
</div>
|
105 |
-
|
106 |
-
<div id="buy_me_a_coffee" style="background:url(<?php echo plugins_url( 'images/buymeacoffee.png' , __FILE__ ) ; ?>)#fff no-repeat; ">
|
107 |
-
|
108 |
-
<div class="pad_coffee">
|
109 |
-
<span class="coffee_title">Buy me a coffee!</span>
|
110 |
-
<p><span>If you liked our work please consider to make a kind donation through Paypal.</span></p>
|
111 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
112 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
113 |
-
<input type="hidden" name="hosted_button_id" value="8MXZ37DWHAX46">
|
114 |
-
<input type="image" src="https://www.paypalobjects.com/en_US/IT/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
115 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
|
116 |
-
</form>
|
117 |
-
</div>
|
118 |
-
</div>
|
119 |
-
</div>
|
120 |
-
<div class="ei_block">
|
121 |
-
|
122 |
-
|
123 |
-
<div id="premium_release">
|
124 |
-
|
125 |
-
<div class="pad_premium_release">
|
126 |
-
<span class="coffee_title">Premium Version is <a href="http://www.mediabeta.com/enjoy-instagram-premium/">HERE</a> !</span>
|
127 |
-
<p><span style="color:#900; font-weight: bold;">Enjoy Plugin for Instagram Premium</span> is the only plugin that allows you to <span style="color:#900; font-weight: bold;">moderate</span> the pictures and choose which show.<br />
|
128 |
-
Discover now all the features and innovations, <a href="http://www.mediabeta.com/enjoy-instagram-premium/">CLICK HERE</a></p>
|
129 |
-
|
130 |
-
</div>
|
131 |
-
|
132 |
-
</div>
|
133 |
-
<?php /*
|
134 |
-
<div class="promo_enjoy">
|
135 |
-
<a target="_blank" href="http://www.mediabetaprojects.com/enjoy-instagram-premium/"><img src="<?php echo plugins_url('/img/gift2016.jpg',__FILE__); ?>" /></a>
|
136 |
-
</div> */ ?>
|
137 |
-
</div>
|
138 |
-
</h2>
|
139 |
-
|
140 |
-
|
141 |
-
<?php $this->plugin_options_tabs(); ?>
|
142 |
-
<?php
|
143 |
-
if($tab == 'enjoyinstagram_general_settings') {
|
144 |
-
|
145 |
-
if(isset($_GET['access_token']) && $_GET['access_token']!=''){
|
146 |
-
|
147 |
-
$user = array();
|
148 |
-
$user = get_user_info($_GET['access_token']);
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
$enjoyinstagram_user_id = $user['data']['id'];
|
154 |
-
$enjoyinstagram_user_username = replace4byte($user['data']['username']);
|
155 |
-
$enjoyinstagram_user_profile_picture = $user['data']['profile_picture'];
|
156 |
-
$enjoyinstagram_user_fullname = replace4byte($user['data']['full_name']);
|
157 |
-
$enjoyinstagram_user_website = $user['data']['website'];
|
158 |
-
$enjoyinstagram_user_bio = replace4byte($user['data']['bio']);
|
159 |
-
$enjoyinstagram_access_token = $_GET['access_token'];
|
160 |
-
|
161 |
-
update_option( 'enjoyinstagram_user_id', $enjoyinstagram_user_id );
|
162 |
-
update_option( 'enjoyinstagram_user_username', $enjoyinstagram_user_username );
|
163 |
-
update_option( 'enjoyinstagram_user_profile_picture', $enjoyinstagram_user_profile_picture );
|
164 |
-
update_option( 'enjoyinstagram_user_fullname', $enjoyinstagram_user_fullname );
|
165 |
-
update_option( 'enjoyinstagram_user_website', $enjoyinstagram_user_website );
|
166 |
-
update_option( 'enjoyinstagram_user_bio', $enjoyinstagram_user_bio );
|
167 |
-
update_option( 'enjoyinstagram_access_token', $enjoyinstagram_access_token );
|
168 |
-
|
169 |
-
|
170 |
-
// get accee token fine
|
171 |
-
include('library/profile_auth.php');
|
172 |
-
|
173 |
-
}
|
174 |
-
else{
|
175 |
-
|
176 |
-
if(!(get_option('enjoyinstagram_access_token'))){
|
177 |
-
include('library/autenticazione.php');
|
178 |
-
} else {
|
179 |
-
include('library/profile_auth.php');
|
180 |
-
}
|
181 |
-
|
182 |
-
}
|
183 |
-
}else if($tab == 'enjoyinstagram_advanced_settings'){
|
184 |
-
include('library/impostazioni_shortcode.php');
|
185 |
-
} ?>
|
186 |
-
</div>
|
187 |
-
<?php
|
188 |
-
}
|
189 |
-
|
190 |
-
function plugin_options_tabs() {
|
191 |
-
$current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->enjoyinstagram_general_settings_key;
|
192 |
-
|
193 |
-
screen_icon();
|
194 |
-
echo '<h2 class="nav-tab-wrapper">';
|
195 |
-
foreach ( $this->plugin_settings_tabs as $tab_key => $tab_caption ) {
|
196 |
-
$active = $current_tab == $tab_key ? 'nav-tab-active' : '';
|
197 |
-
echo '<a class="nav-tab ' . $active . '" href="?page=' . $this->plugin_options_key . '&tab=' . $tab_key . '">' . $tab_caption . '</a>';
|
198 |
-
}
|
199 |
-
echo '</h2>';
|
200 |
-
}
|
201 |
-
};
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
function get_user_info($access_token){
|
207 |
-
$url = 'https://api.instagram.com/v1/users/self/?access_token='.$access_token;
|
208 |
-
try {
|
209 |
-
$curl_connection = curl_init($url);
|
210 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
211 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
212 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
213 |
-
|
214 |
-
//Data are stored in $data
|
215 |
-
$data = json_decode(curl_exec($curl_connection), true);
|
216 |
-
curl_close($curl_connection);
|
217 |
-
return $data;
|
218 |
-
} catch(Exception $e) {
|
219 |
-
return $e->getMessage();
|
220 |
-
}
|
221 |
-
|
222 |
-
}
|
223 |
-
function get_hash($hashtag,$count){
|
224 |
-
|
225 |
-
|
226 |
-
$access_token = get_option('enjoyinstagram_access_token');
|
227 |
-
|
228 |
-
|
229 |
-
$url = 'https://api.instagram.com/v1/tags/' . $hashtag . '/media/recent?count=' . $count . '&access_token=' . $access_token;
|
230 |
-
try {
|
231 |
-
$curl_connection = curl_init($url);
|
232 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
233 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
234 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
235 |
-
|
236 |
-
//Data are stored in $data
|
237 |
-
$result = json_decode(curl_exec($curl_connection), true);
|
238 |
-
curl_close($curl_connection);
|
239 |
-
return $result;
|
240 |
-
} catch (Exception $e) {
|
241 |
-
return $e->getMessage();
|
242 |
-
}
|
243 |
-
|
244 |
-
}
|
245 |
-
function get_hash_code($hashtag,$count){
|
246 |
-
|
247 |
-
$access_token = get_option('enjoyinstagram_access_token');
|
248 |
-
|
249 |
-
|
250 |
-
$url = 'https://api.instagram.com/v1/tags/' . $hashtag . '/media/recent?count=' . $count . '&access_token=' . $access_token;
|
251 |
-
try {
|
252 |
-
$curl_connection = curl_init($url);
|
253 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
254 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
255 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
256 |
-
|
257 |
-
//Data are stored in $data
|
258 |
-
$result = json_decode(curl_exec($curl_connection), true);
|
259 |
-
$code = $result['meta']['code'];
|
260 |
-
curl_close($curl_connection);
|
261 |
-
return $code;
|
262 |
-
} catch (Exception $e) {
|
263 |
-
return $e->getMessage();
|
264 |
-
}
|
265 |
-
|
266 |
-
}
|
267 |
-
function get_user($user,$count){
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
$access_token = get_option('enjoyinstagram_access_token');
|
272 |
-
|
273 |
-
|
274 |
-
$url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$access_token;
|
275 |
-
try {
|
276 |
-
$curl_connection = curl_init($url);
|
277 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
278 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
279 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
280 |
-
|
281 |
-
//Data are stored in $data
|
282 |
-
$result = json_decode(curl_exec($curl_connection), true);
|
283 |
-
curl_close($curl_connection);
|
284 |
-
return $result;
|
285 |
-
} catch(Exception $e) {
|
286 |
-
return $e->getMessage();
|
287 |
-
}
|
288 |
-
|
289 |
-
}
|
290 |
-
function get_user_code($user,$count){
|
291 |
-
|
292 |
-
$access_token = get_option('enjoyinstagram_access_token');
|
293 |
-
|
294 |
-
|
295 |
-
$url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$access_token;
|
296 |
-
try {
|
297 |
-
$curl_connection = curl_init($url);
|
298 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
299 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
300 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
301 |
-
|
302 |
-
//Data are stored in $data
|
303 |
-
$result = json_decode(curl_exec($curl_connection), true);
|
304 |
-
$code = $result['meta']['code'];
|
305 |
-
curl_close($curl_connection);
|
306 |
-
return $code;
|
307 |
-
} catch(Exception $e) {
|
308 |
-
return $e->getMessage();
|
309 |
-
}
|
310 |
-
|
311 |
-
}
|
312 |
-
function get_media($user,$media){
|
313 |
-
|
314 |
-
$access_token = get_option('enjoyinstagram_access_token');
|
315 |
-
|
316 |
-
|
317 |
-
$url = 'https://api.instagram.com/v1/media/'.$media.'?access_token='.$access_token;
|
318 |
-
try {
|
319 |
-
$curl_connection = curl_init($url);
|
320 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
321 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
322 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
323 |
-
|
324 |
-
//Data are stored in $data
|
325 |
-
$result = json_decode(curl_exec($curl_connection), true);
|
326 |
-
curl_close($curl_connection);
|
327 |
-
return $result;
|
328 |
-
} catch(Exception $e) {
|
329 |
-
return $e->getMessage();
|
330 |
-
}
|
331 |
-
|
332 |
-
}
|
333 |
-
function get_likes($user,$count){
|
334 |
-
$access_token = get_option('enjoyinstagram_access_token');
|
335 |
-
$url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$access_token;
|
336 |
-
try {
|
337 |
-
$curl_connection = curl_init($url);
|
338 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
339 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
340 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
341 |
-
|
342 |
-
//Data are stored in $data
|
343 |
-
$result = json_decode(curl_exec($curl_connection), true);
|
344 |
-
curl_close($curl_connection);
|
345 |
-
return $result;
|
346 |
-
} catch(Exception $e) {
|
347 |
-
return $e->getMessage();
|
348 |
-
}
|
349 |
-
}
|
350 |
-
function get_likes_code($user,$count){
|
351 |
-
$access_token = get_option('enjoyinstagram_access_token');
|
352 |
-
$url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$access_token;
|
353 |
-
try {
|
354 |
-
$curl_connection = curl_init($url);
|
355 |
-
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
|
356 |
-
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
357 |
-
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
358 |
-
|
359 |
-
//Data are stored in $data
|
360 |
-
$result = json_decode(curl_exec($curl_connection), true);
|
361 |
-
$code = $result['meta']['code'];
|
362 |
-
curl_close($curl_connection);
|
363 |
-
return $code;
|
364 |
-
} catch(Exception $e) {
|
365 |
-
return $e->getMessage();
|
366 |
-
}
|
367 |
-
}
|
368 |
-
function replace4byte($string) {
|
369 |
-
return preg_replace('%(?:
|
370 |
-
\xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
|
371 |
-
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
|
372 |
-
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
|
373 |
-
)%xs', '', $string);
|
374 |
-
}
|
375 |
-
|
376 |
-
// Initialize the plugin
|
377 |
-
add_action( 'plugins_loaded', create_function( '', '$Settings_enjoyinstagram_Plugin = new Settings_enjoyinstagram_Plugin;' ) );
|
378 |
-
|
379 |
-
|
380 |
-
function enjoyinstagram_default_option()
|
381 |
-
{
|
382 |
-
add_option('enjoyinstagram_client_id', '');
|
383 |
-
add_option('enjoyinstagram_client_secret', '');
|
384 |
-
add_option('enjoyinstagram_client_code', '');
|
385 |
-
add_option('enjoyinstagram_user_instagram', '');
|
386 |
-
add_option('enjoyinstagram_user_id', '');
|
387 |
-
add_option('enjoyinstagram_user_username', '');
|
388 |
-
add_option('enjoyinstagram_user_profile_picture', '');
|
389 |
-
add_option('enjoyinstagram_user_fullname', '');
|
390 |
-
add_option('enjoyinstagram_user_website', '');
|
391 |
-
add_option('enjoyinstagram_user_bio', '');
|
392 |
-
add_option('enjoyinstagram_access_token', '');
|
393 |
-
add_option('enjoyinstagram_carousel_items_number', 4);
|
394 |
-
add_option('enjoyinstagram_carousel_navigation', 'false');
|
395 |
-
add_option('enjoyinstagram_grid_rows', '2');
|
396 |
-
add_option('enjoyinstagram_grid_cols', '5');
|
397 |
-
add_option('enjoyinstagram_hashtag', '');
|
398 |
-
add_option('enjoyinstagram_user_or_hashtag', 'user');
|
399 |
-
}
|
400 |
-
|
401 |
-
register_activation_hook( __FILE__, 'enjoyinstagram_default_option');
|
402 |
-
|
403 |
-
function enjoyinstagram_register_options_group_auth()
|
404 |
-
{
|
405 |
-
register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_client_id');
|
406 |
-
register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_client_secret');
|
407 |
-
register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_client_code');
|
408 |
-
register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_user_instagram');
|
409 |
-
}
|
410 |
-
|
411 |
-
add_action ('admin_init', 'enjoyinstagram_register_options_group_auth');
|
412 |
-
|
413 |
-
function enjoyinstagram_register_options_group()
|
414 |
-
{
|
415 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_client_id');
|
416 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_instagram');
|
417 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_id');
|
418 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_username');
|
419 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_profile_picture');
|
420 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_fullname');
|
421 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_website');
|
422 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_bio');
|
423 |
-
register_setting('enjoyinstagram_options_group', 'enjoyinstagram_access_token');
|
424 |
-
}
|
425 |
-
|
426 |
-
add_action ('admin_init', 'enjoyinstagram_register_options_group');
|
427 |
-
|
428 |
-
function enjoyinstagram_register_options_carousel()
|
429 |
-
{
|
430 |
-
register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_carousel_items_number');
|
431 |
-
register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_carousel_navigation');
|
432 |
-
register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_grid_cols');
|
433 |
-
register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_grid_rows');
|
434 |
-
register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_hashtag');
|
435 |
-
register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_user_or_hashtag');
|
436 |
-
|
437 |
-
}
|
438 |
-
|
439 |
-
add_action ('admin_init', 'enjoyinstagram_register_options_carousel');
|
440 |
-
|
441 |
-
function aggiungi_script_instafeed_owl() {
|
442 |
-
|
443 |
-
if(!is_admin()) {
|
444 |
-
|
445 |
-
wp_register_script('owl', plugins_url('/js/owl.carousel.js',__FILE__),'jquery','');
|
446 |
-
wp_register_script('swipebox', plugins_url('/js/jquery.swipebox.js',__FILE__),'jquery','');
|
447 |
-
wp_register_script('gridrotator', plugins_url('/js/jquery.gridrotator.js',__FILE__),'jquery','');
|
448 |
-
wp_register_script('modernizr.custom.26633', plugins_url('/js/modernizr.custom.26633.js',__FILE__),'jquery','');
|
449 |
-
wp_register_script('orientationchange', plugins_url('/js/ios-orientationchange-fix.js',__FILE__),'jquery','');
|
450 |
-
|
451 |
-
wp_register_style( 'owl_style', plugins_url('/css/owl.carousel.css',__FILE__) );
|
452 |
-
wp_register_style( 'owl_style_2', plugins_url('/css/owl.theme.css',__FILE__) );
|
453 |
-
wp_register_style( 'owl_style_3', plugins_url('/css/owl.transitions.css',__FILE__) );
|
454 |
-
wp_register_style( 'swipebox_css', plugins_url('/css/swipebox.css',__FILE__) );
|
455 |
-
wp_register_style( 'grid_fallback', plugins_url('/css/grid_fallback.css',__FILE__) );
|
456 |
-
wp_register_style( 'grid_style', plugins_url('/css/grid_style.css',__FILE__) );
|
457 |
-
|
458 |
-
wp_enqueue_script( 'jquery' ); // include jQuery
|
459 |
-
wp_enqueue_script('owl');
|
460 |
-
wp_enqueue_script('swipebox');
|
461 |
-
wp_enqueue_script('modernizr.custom.26633');
|
462 |
-
wp_enqueue_script('gridrotator');
|
463 |
-
wp_enqueue_script('orientationchange');
|
464 |
-
wp_enqueue_style( 'owl_style' );
|
465 |
-
wp_enqueue_style( 'owl_style_2' );
|
466 |
-
wp_enqueue_style( 'owl_style_3' );
|
467 |
-
wp_enqueue_style( 'swipebox_css' );
|
468 |
-
wp_enqueue_style( 'grid_fallback' );
|
469 |
-
wp_enqueue_style( 'grid_style' );
|
470 |
-
}
|
471 |
-
}
|
472 |
-
|
473 |
-
add_action( 'wp_enqueue_scripts', 'aggiungi_script_instafeed_owl' );
|
474 |
-
|
475 |
-
function aggiungi_script_in_admin(){
|
476 |
-
wp_register_style( 'enjoyinstagram_settings', plugins_url('/css/enjoyinstagram_settings.css',__FILE__) );
|
477 |
-
wp_enqueue_style( 'enjoyinstagram_settings' );
|
478 |
-
}
|
479 |
-
|
480 |
-
add_action( 'admin_enqueue_scripts', 'aggiungi_script_in_admin' );
|
481 |
-
add_action( 'admin_head', 'aggiungo_javascript_in_pannello_amministrazione' );
|
482 |
-
|
483 |
-
function aggiungo_javascript_in_pannello_amministrazione() {
|
484 |
-
?>
|
485 |
-
<script type="text/javascript">
|
486 |
-
|
487 |
-
|
488 |
-
function post_to_url(path, method) {
|
489 |
-
method = method || "get";
|
490 |
-
var params = new Array();
|
491 |
-
var client_id = 'cac0b53396ee466293d81c8fb86835fe';
|
492 |
-
var client_secret = 'this_is_secret';
|
493 |
-
params['client_id'] = client_id;
|
494 |
-
params['redirect_uri'] = 'http://www.mediabetaprojects.com/put_access_token.php?url_redirect=<?php echo admin_url('options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_general_settings'); ?>';
|
495 |
-
params['response_type'] = 'token';
|
496 |
-
params['scope']='public_content';
|
497 |
-
|
498 |
-
var form = document.createElement("form");
|
499 |
-
form.setAttribute("method", method);
|
500 |
-
form.setAttribute("action", path);
|
501 |
-
|
502 |
-
for(var key in params) {
|
503 |
-
if(params.hasOwnProperty(key)) {
|
504 |
-
var hiddenField = document.createElement("input");
|
505 |
-
hiddenField.setAttribute("type", "hidden");
|
506 |
-
hiddenField.setAttribute("name", key);
|
507 |
-
hiddenField.setAttribute("value", params[key]);
|
508 |
-
|
509 |
-
form.appendChild(hiddenField);
|
510 |
-
}
|
511 |
-
}
|
512 |
-
|
513 |
-
|
514 |
-
document.body.appendChild(form);
|
515 |
-
form.submit();
|
516 |
-
|
517 |
-
}
|
518 |
-
|
519 |
-
|
520 |
-
</script>
|
521 |
-
<?php
|
522 |
-
}
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
function funzioni_in_head() {
|
527 |
-
?>
|
528 |
-
<script type="text/javascript">
|
529 |
-
jQuery(function($) {
|
530 |
-
$(".swipebox_grid").swipebox({
|
531 |
-
hideBarsDelay : 0
|
532 |
-
});
|
533 |
-
|
534 |
-
});
|
535 |
-
|
536 |
-
jQuery(function(){
|
537 |
-
/*
|
538 |
-
jQuery(document.body)
|
539 |
-
.on('click touchend','#swipebox-slider .current img', function(e){
|
540 |
-
jQuery('#swipebox-next').click();
|
541 |
-
return false;
|
542 |
-
})
|
543 |
-
.on('click touchend','#swipebox-slider .current', function(e){
|
544 |
-
jQuery('#swipebox-close').trigger('click');
|
545 |
-
});
|
546 |
-
*/
|
547 |
-
});
|
548 |
-
|
549 |
-
</script>
|
550 |
-
<?php
|
551 |
-
}
|
552 |
-
|
553 |
-
|
554 |
-
add_action('wp_head', 'funzioni_in_head');
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
function enjoyinstagram_plugin_settings_link($links) {
|
559 |
-
$settings_link = '<a href="options-general.php?page=enjoyinstagram_plugin_options">' . __( 'Settings' ) . '</a>';
|
560 |
-
$widgets_link = '<a href="widgets.php">' . __( 'Widgets' ) . '</a>';
|
561 |
-
$premium_link = '<a href="http://www.mediabeta.com/enjoy-instagram-premium/">' . __( 'Premium Version' ) . '</a>';
|
562 |
-
array_push($links, $settings_link);
|
563 |
-
array_push($links, $widgets_link);
|
564 |
-
array_push($links, $premium_link);
|
565 |
-
return $links;
|
566 |
-
}
|
567 |
-
|
568 |
-
$plugin = plugin_basename(__FILE__);
|
569 |
-
add_filter("plugin_action_links_$plugin", 'enjoyinstagram_plugin_settings_link');
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
add_action( 'admin_footer', 'add_option_client_ajax' );
|
576 |
-
|
577 |
-
function add_option_client_ajax() {
|
578 |
-
?>
|
579 |
-
<script type="text/javascript" >
|
580 |
-
|
581 |
-
jQuery('#button_autorizza_instagram').click(function() {
|
582 |
-
var client_id = 'cac0b53396ee466293d81c8fb86835fe';
|
583 |
-
var client_secret = 'this_is_secret';
|
584 |
-
var data = {
|
585 |
-
action: 'user_option_ajax',
|
586 |
-
client_id_value: client_id,
|
587 |
-
client_secret_value: client_secret
|
588 |
-
};
|
589 |
-
|
590 |
-
|
591 |
-
jQuery.post(ajaxurl, data, function(response) {
|
592 |
-
post_to_url('https://api.instagram.com/oauth/authorize/','get');
|
593 |
-
});
|
594 |
-
});
|
595 |
-
</script>
|
596 |
-
<?php
|
597 |
-
}
|
598 |
-
|
599 |
-
add_action( 'wp_ajax_user_option_ajax', 'user_option_ajax_callback' );
|
600 |
-
|
601 |
-
function user_option_ajax_callback() {
|
602 |
-
global $wpdb;
|
603 |
-
|
604 |
-
$client_id = $_POST['client_id_value'];
|
605 |
-
$client_secret = $_POST['client_secret_value'];
|
606 |
-
echo $client_id."<br />".$client_secret;
|
607 |
-
update_option( 'enjoyinstagram_client_id', $client_id );
|
608 |
-
update_option( 'enjoyinstagram_client_secret', $client_secret );
|
609 |
-
|
610 |
-
die();
|
611 |
-
}
|
612 |
-
|
613 |
-
|
614 |
-
add_action( 'admin_footer', 'logout_client_ajax' );
|
615 |
-
|
616 |
-
function logout_client_ajax() {
|
617 |
-
?>
|
618 |
-
<script type="text/javascript" >
|
619 |
-
|
620 |
-
jQuery('#button_logout').click(function() {
|
621 |
-
var data = {
|
622 |
-
action: 'user_logout_ajax'
|
623 |
-
};
|
624 |
-
|
625 |
-
|
626 |
-
jQuery.post(ajaxurl, data, function(response) {
|
627 |
-
location.href = '<?php echo get_admin_url(); ?>options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_general_settings';
|
628 |
-
});
|
629 |
-
});
|
630 |
-
</script>
|
631 |
-
<?php
|
632 |
-
}
|
633 |
-
|
634 |
-
add_action( 'wp_ajax_user_logout_ajax', 'user_logout_ajax_callback' );
|
635 |
-
|
636 |
-
function user_logout_ajax_callback() {
|
637 |
-
global $wpdb;
|
638 |
-
|
639 |
-
update_option('enjoyinstagram_user_id','');
|
640 |
-
update_option('enjoyinstagram_user_username','');
|
641 |
-
update_option('enjoyinstagram_user_profile_picture','');
|
642 |
-
update_option('enjoyinstagram_user_fullname','');
|
643 |
-
update_option('enjoyinstagram_user_website','');
|
644 |
-
update_option('enjoyinstagram_user_bio','');
|
645 |
-
update_option('enjoyinstagram_access_token','');
|
646 |
-
|
647 |
-
die();
|
648 |
}
|
649 |
|
650 |
-
|
651 |
-
|
652 |
-
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
|
653 |
-
return true;
|
654 |
-
}
|
655 |
-
}
|
656 |
-
/*
|
657 |
-
add_action('admin_notices', 'banner_admin_notice');
|
658 |
-
function banner_admin_notice() {
|
659 |
-
global $current_user ;
|
660 |
-
$user_id = $current_user->ID;
|
661 |
-
if ( ! get_user_meta($user_id, 'ignore_enjoy_notice') ) {
|
662 |
-
echo '<div style="padding: 20px;border:1px solid #ccc;background: #fff;margin-top: 20px;"><div class="promo_enjoy">
|
663 |
-
<a target="_blank" href="http://www.mediabetaprojects.com/enjoy-instagram-premium/"><img src="'.plugins_url('/img/gift2016.jpg',__FILE__).'" /></a>
|
664 |
-
</div>';
|
665 |
-
printf(__('It not interesting to me | <a href="%1$s">Hide Notice</a>'), '?ignore_enjoy=0');
|
666 |
-
echo '</div>';
|
667 |
-
}
|
668 |
-
}
|
669 |
-
*/
|
670 |
-
add_action('admin_init', 'ignore_enjoy');
|
671 |
-
|
672 |
-
function ignore_enjoy() {
|
673 |
-
global $current_user;
|
674 |
-
$user_id = $current_user->ID;
|
675 |
-
/* If user clicks to ignore the notice, add that to their user meta */
|
676 |
-
if ( isset($_GET['ignore_enjoy']) && '0' == $_GET['ignore_enjoy'] ) {
|
677 |
-
add_user_meta($user_id, 'ignore_enjoy_notice', 'true', true);
|
678 |
-
}
|
679 |
-
}
|
680 |
-
|
681 |
-
/*
|
682 |
-
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
|
683 |
-
|
684 |
-
function my_custom_dashboard_widgets() {
|
685 |
-
global $wp_meta_boxes;
|
686 |
-
|
687 |
-
wp_add_dashboard_widget('custom_help_widget', 'Enjoy Instagram', 'custom_dashboard_help');
|
688 |
-
}
|
689 |
-
|
690 |
-
function custom_dashboard_help() {
|
691 |
-
echo '<div class="promo_enjoy">
|
692 |
-
<a href="http://www.mediabetaprojects.com/enjoy-instagram-premium/" target="_blank"><img src="'.plugins_url('/img/gift2016_dashboard.jpg',__FILE__).'" style="width:100%;"/></a>
|
693 |
-
</div>'
|
694 |
-
;
|
695 |
-
}
|
696 |
-
*/
|
697 |
|
|
|
|
|
698 |
|
699 |
-
|
700 |
-
require_once ('tinymce/ajax.php');
|
701 |
|
702 |
-
|
703 |
-
require_once('
|
704 |
-
require_once('
|
705 |
-
require_once('
|
706 |
-
|
|
|
|
|
707 |
|
708 |
-
|
|
|
|
|
|
|
|
|
|
3 |
Plugin Name: Enjoy Plugin for Instagram
|
4 |
Plugin URI: http://www.mediabeta.com/enjoy-instagram/
|
5 |
Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
|
6 |
+
Version: 4.0.0
|
7 |
+
Author: Mediabeta Srl
|
8 |
Author URI: http://www.mediabeta.com/team/
|
9 |
*/
|
10 |
|
11 |
+
! defined( 'ENJOYINSTAGRAM_VERSION' ) && define( 'ENJOYINSTAGRAM_VERSION', '4.0.0' );
|
12 |
+
! defined( 'ENJOYINSTAGRAM_FILE' ) && define( 'ENJOYINSTAGRAM_FILE', __FILE__ );
|
13 |
+
! defined( 'ENJOYINSTAGRAM_URL' ) && define( 'ENJOYINSTAGRAM_URL', plugin_dir_url( __FILE__ ) );
|
14 |
+
! defined( 'ENJOYINSTAGRAM_DIR' ) && define( 'ENJOYINSTAGRAM_DIR', plugin_dir_path( __FILE__ ) );
|
15 |
+
! defined( 'ENJOYINSTAGRAM_ASSETS_URL' ) && define( 'ENJOYINSTAGRAM_ASSETS_URL', ENJOYINSTAGRAM_URL . 'assets' );
|
16 |
+
! defined( 'ENJOYINSTAGRAM_TEMPLATE_PATH' ) && define( 'ENJOYINSTAGRAM_TEMPLATE_PATH', ENJOYINSTAGRAM_DIR . 'templates' );
|
17 |
|
18 |
+
function enjoyinstagram_require_activation_class(){
|
19 |
+
require_once('includes/class.enjoyinstagram-activation.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
|
22 |
+
register_activation_hook( __FILE__, 'enjoyinstagram_require_activation_class' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
add_action( 'plugins_loaded', 'enjoyinstagram_init_plugin' );
|
25 |
+
function enjoyinstagram_init_plugin(){
|
26 |
|
27 |
+
load_plugin_textdomain( 'enjoyinstagram', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
|
|
|
28 |
|
29 |
+
// common file
|
30 |
+
require_once( 'includes/functions.enjoyinstagram.php' );
|
31 |
+
require_once( 'includes/class.enjoyinstagram-api-connection.php' );
|
32 |
+
require_once( 'includes/class.enjoyinstagram-shortcodes.php' );
|
33 |
+
// widgets
|
34 |
+
require_once( 'includes/widgets/widgets.php' );
|
35 |
+
require_once( 'includes/widgets/widgets_grid.php' );
|
36 |
|
37 |
+
// require admin class
|
38 |
+
if( is_admin() ) {
|
39 |
+
include_once( 'includes/tinymce/tinymce.php' );
|
40 |
+
require_once( 'includes/class.enjoyinstagram-admin.php' );
|
41 |
+
}
|
42 |
+
}
|
images/AjaxLoader.gif
DELETED
Binary file
|
images/ImageAttribution.txt
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
Images by Sherman Geronimo-Tan: http://www.flickr.com/people/smanography/
|
2 |
-
http://creativecommons.org/licenses/by/2.0/deed.en
|
|
|
|
images/Instagram-icon.png
DELETED
Binary file
|
images/Thumbs.db
DELETED
Binary file
|
images/bg.jpg
DELETED
Binary file
|
images/carousel.png
DELETED
Binary file
|
images/grabbing.png
DELETED
Binary file
|
images/griglia.png
DELETED
Binary file
|
images/icons.png
DELETED
Binary file
|
images/icons.svg
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="120" height="24" viewBox="0 0 120 24" fill="#ffffff" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M 17.384,17.705q0.00,0.536 -0.375,0.911l-1.821,1.821q-0.375,0.375 -0.911,0.375t-0.911-0.375l-3.938-3.938l-3.938,3.938q-0.375,0.375 -0.911,0.375t-0.911-0.375l-1.821-1.821q-0.375-0.375 -0.375-0.911t 0.375-0.911l 3.938-3.938l-3.938-3.938q-0.375-0.375 -0.375-0.911t 0.375-0.911l 1.821-1.821q 0.375-0.375 0.911-0.375t 0.911,0.375l 3.938,3.938l 3.938-3.938q 0.375-0.375 0.911-0.375t 0.911,0.375l 1.821,1.821q 0.375,0.375 0.375,0.911 t-0.375,0.911l-3.938,3.938l 3.938,3.938q 0.375,0.375 0.375,0.911zM 57.938,21.067l-8.732-8.719q-0.496-0.496 -0.496-1.212t 0.496-1.212l 8.732-8.719q 0.496-0.496 1.212-0.496t 1.212,0.496l 1.004,1.004q 0.496,0.496 0.496,1.212t-0.496,1.212l-6.509,6.509l 6.509,6.496q 0.496,0.509 0.496,1.219t-0.496,1.205l-1.004,1.004q-0.496,0.496 -1.212,0.496t-1.212-0.496zM 110.719,11.143q0.00,0.696 -0.496,1.219l-8.732,8.719q-0.496,0.496 -1.205,0.496t-1.205-0.496l-1.018-1.004q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 6.509-6.509l-6.509-6.496q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 1.018-1.004q 0.482-0.509 1.205-0.509t 1.205,0.509l 8.732,8.719q 0.496,0.496 0.496,1.205z"></path></svg>
|
|
images/light.png
DELETED
Binary file
|
images/loader.gif
DELETED
Binary file
|
images/loading.gif
DELETED
Binary file
|
img/gift2016.jpg
DELETED
Binary file
|
img/gift2016_dashboard.jpg
DELETED
Binary file
|
img/icons.png
DELETED
Binary file
|
img/icons.svg
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="120" height="24" viewBox="0 0 120 24" fill="#ffffff" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M 17.384,17.705q0.00,0.536 -0.375,0.911l-1.821,1.821q-0.375,0.375 -0.911,0.375t-0.911-0.375l-3.938-3.938l-3.938,3.938q-0.375,0.375 -0.911,0.375t-0.911-0.375l-1.821-1.821q-0.375-0.375 -0.375-0.911t 0.375-0.911l 3.938-3.938l-3.938-3.938q-0.375-0.375 -0.375-0.911t 0.375-0.911l 1.821-1.821q 0.375-0.375 0.911-0.375t 0.911,0.375l 3.938,3.938l 3.938-3.938q 0.375-0.375 0.911-0.375t 0.911,0.375l 1.821,1.821q 0.375,0.375 0.375,0.911 t-0.375,0.911l-3.938,3.938l 3.938,3.938q 0.375,0.375 0.375,0.911zM 57.938,21.067l-8.732-8.719q-0.496-0.496 -0.496-1.212t 0.496-1.212l 8.732-8.719q 0.496-0.496 1.212-0.496t 1.212,0.496l 1.004,1.004q 0.496,0.496 0.496,1.212t-0.496,1.212l-6.509,6.509l 6.509,6.496q 0.496,0.509 0.496,1.219t-0.496,1.205l-1.004,1.004q-0.496,0.496 -1.212,0.496t-1.212-0.496zM 110.719,11.143q0.00,0.696 -0.496,1.219l-8.732,8.719q-0.496,0.496 -1.205,0.496t-1.205-0.496l-1.018-1.004q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 6.509-6.509l-6.509-6.496q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 1.018-1.004q 0.482-0.509 1.205-0.509t 1.205,0.509l 8.732,8.719q 0.496,0.496 0.496,1.205z"></path></svg>
|
|
img/loader.gif
DELETED
Binary file
|
includes/class.enjoyinstagram-activation.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This class handles activation actions
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // exit if call directly
|
8 |
+
}
|
9 |
+
|
10 |
+
final class EnjoyInstagram_Activation {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Construct
|
14 |
+
*
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function __construct(){
|
18 |
+
$this->add_default_settings();
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Add default plugin settings
|
23 |
+
*
|
24 |
+
* @since 9.0.0
|
25 |
+
* @return void
|
26 |
+
*/
|
27 |
+
public function add_default_settings(){
|
28 |
+
|
29 |
+
$plugin_options = array();
|
30 |
+
if( file_exists( ENJOYINSTAGRAM_DIR . 'plugin-options/options.php' ) ) {
|
31 |
+
$plugin_options = include( ENJOYINSTAGRAM_DIR . 'plugin-options/options.php' );
|
32 |
+
}
|
33 |
+
|
34 |
+
if( empty( $plugin_options ) ) {
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
foreach( $plugin_options as $options ){
|
39 |
+
foreach( $options as $option_id => $default_value ) {
|
40 |
+
add_option( $option_id, $default_value );
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
new EnjoyInstagram_Activation();
|
includes/class.enjoyinstagram-admin.php
ADDED
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This class handles all admin actions
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // exit if call directly
|
8 |
+
}
|
9 |
+
|
10 |
+
class EnjoyInstagram_Admin {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Single plugin instance
|
14 |
+
* @since 9.0.0
|
15 |
+
* @var \EnjoyInstagram_Admin
|
16 |
+
*/
|
17 |
+
protected static $instance;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Plugin options page name
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected $_options_page = 'enjoyinstagram_plugin_options';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Plugin options page name
|
27 |
+
* @var array
|
28 |
+
*/
|
29 |
+
protected $_tabs = [];
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Plugin options page name
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
protected $_plugin_options = [];
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Returns single instance of the class
|
39 |
+
*
|
40 |
+
* @return \EnjoyInstagram_Admin
|
41 |
+
* @since 1.0.0
|
42 |
+
*/
|
43 |
+
public static function get_instance(){
|
44 |
+
if( is_null( self::$instance ) ){
|
45 |
+
self::$instance = new self();
|
46 |
+
}
|
47 |
+
|
48 |
+
return self::$instance;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Construct
|
53 |
+
*
|
54 |
+
* @return void
|
55 |
+
*/
|
56 |
+
private function __construct(){
|
57 |
+
$this->init();
|
58 |
+
add_action( 'admin_menu', array( $this, 'add_admin_menus' ) );
|
59 |
+
// register default options group
|
60 |
+
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
61 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_styles_scripts' ) );
|
62 |
+
add_filter( 'plugin_action_links_'.plugin_basename( ENJOYINSTAGRAM_DIR . '/' . basename( ENJOYINSTAGRAM_FILE ) ), array( $this, 'settings_link' ) );
|
63 |
+
// add/remove user
|
64 |
+
add_action( 'admin_init', array( $this, 'add_user' ), 1 );
|
65 |
+
add_action( 'admin_init', array( $this, 'remove_user' ), 1 );
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Init admin class variables
|
70 |
+
*
|
71 |
+
* @since 9.0.0
|
72 |
+
* @return void
|
73 |
+
*/
|
74 |
+
protected function init(){
|
75 |
+
// init tabs
|
76 |
+
$this->_tabs = apply_filters( 'enjoyinstagram_plugin_admin_tabs', array(
|
77 |
+
'enjoyinstagram_general_settings' => __( 'Profile', 'enjoyinstagram' ),
|
78 |
+
'enjoyinstagram_advanced_settings' => __( 'Settings', 'enjoyinstagram' )
|
79 |
+
) );
|
80 |
+
|
81 |
+
if( file_exists( ENJOYINSTAGRAM_DIR . 'plugin-options/options.php' ) ) {
|
82 |
+
$this->_plugin_options = include( ENJOYINSTAGRAM_DIR . 'plugin-options/options.php' );
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Build an admin url
|
88 |
+
*
|
89 |
+
* @param string $tab
|
90 |
+
* @param array $params
|
91 |
+
* @since 9.0.0
|
92 |
+
* @author Francesco Licandro
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
public function build_admin_url( $tab, $params = array() ){
|
96 |
+
$params_string = '';
|
97 |
+
foreach( $params as $key => $value ) {
|
98 |
+
$params_string .= '&'.$key.'='.$value;
|
99 |
+
}
|
100 |
+
|
101 |
+
return admin_url("options-general.php?page={$this->_options_page}&tab={$tab}{$params_string}");
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Enqueue plugin styles and scripts
|
106 |
+
*
|
107 |
+
* @since 9.0.0
|
108 |
+
* @return void
|
109 |
+
*/
|
110 |
+
public function admin_styles_scripts(){
|
111 |
+
wp_register_style( 'enjoyinstagram_settings', ENJOYINSTAGRAM_ASSETS_URL . '/css/enjoyinstagram_settings.css', array(), ENJOYINSTAGRAM_VERSION );
|
112 |
+
|
113 |
+
if( isset( $_GET['page'] ) && $_GET['page'] == $this->_options_page ) {
|
114 |
+
wp_enqueue_style( 'enjoyinstagram_settings' );
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Add admin menu under Settings
|
120 |
+
*
|
121 |
+
* @since 9.0.0
|
122 |
+
* @return void
|
123 |
+
*/
|
124 |
+
public function add_admin_menus() {
|
125 |
+
add_options_page(
|
126 |
+
__( 'Enjoy Plugin for Instagram', 'enjoyinstagram' ),
|
127 |
+
__( 'Enjoy Plugin for Instagram', 'enjoyinstagram' ),
|
128 |
+
'manage_options',
|
129 |
+
$this->_options_page,
|
130 |
+
array( $this, 'output_options_page' ) );
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Add plugin settings link
|
135 |
+
*
|
136 |
+
* @since 9.0.0
|
137 |
+
* @param string $links
|
138 |
+
* @return string
|
139 |
+
*/
|
140 |
+
public function settings_link( $links ){
|
141 |
+
$links[] = '<a href="options-general.php?page=' .$this->_options_page.'">' . __( 'Settings', 'enjoyinstagram' ) . '</a>';
|
142 |
+
$links[] = '<a href="widgets.php">' . __( 'Widgets', 'enjoyinstagram' ) . '</a>';
|
143 |
+
$links[] = '<a href="http://www.mediabeta.com/enjoy-instagram/">' . __( 'Premium Version', 'enjoyinstagram' ) . '</a>';
|
144 |
+
|
145 |
+
return $links;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Register settings
|
150 |
+
*
|
151 |
+
* @since 9.0.0
|
152 |
+
* @return void
|
153 |
+
*/
|
154 |
+
public function register_settings(){
|
155 |
+
if( empty( $this->_plugin_options ) ) {
|
156 |
+
return;
|
157 |
+
}
|
158 |
+
|
159 |
+
foreach( $this->_plugin_options as $group => $options ) {
|
160 |
+
foreach( $options as $option_id => $default ) {
|
161 |
+
register_setting( $group, $option_id );
|
162 |
+
}
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Get plugin admin tabs
|
168 |
+
*
|
169 |
+
* @sine 9.0.0
|
170 |
+
* @return array
|
171 |
+
*/
|
172 |
+
public function get_tabs(){
|
173 |
+
return $this->_tabs;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Get current active tab or return the first one
|
178 |
+
*
|
179 |
+
* @since 9.0.0
|
180 |
+
* @return string
|
181 |
+
*/
|
182 |
+
public function get_active_tab(){
|
183 |
+
if( ! is_array( $this->_tabs ) ){
|
184 |
+
return '';
|
185 |
+
}
|
186 |
+
|
187 |
+
$c = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
|
188 |
+
reset( $this->_tabs );
|
189 |
+
return isset( $this->_tabs[ $c ] ) ? $c : key( $this->_tabs );
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Get admin tab url
|
194 |
+
*
|
195 |
+
* @since 9.0.0
|
196 |
+
* @param string $tab
|
197 |
+
* @return string
|
198 |
+
*/
|
199 |
+
public function get_tab_url( $tab ){
|
200 |
+
return add_query_arg( array( 'page' => $this->_options_page, 'tab' => $tab ), admin_url( 'options-general.php' ) );
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Output plugin options page
|
205 |
+
*
|
206 |
+
* @since 9.0.0
|
207 |
+
* @return void
|
208 |
+
*/
|
209 |
+
public function output_options_page(){
|
210 |
+
$tabs = $this->get_tabs();
|
211 |
+
$active_tab = $this->get_active_tab();
|
212 |
+
|
213 |
+
include( ENJOYINSTAGRAM_TEMPLATE_PATH . '/admin/settings.php' );
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Manage Instagram response and add a new user
|
218 |
+
*
|
219 |
+
* @since 9.0.0
|
220 |
+
* @author Francesco Licandro
|
221 |
+
* @return void
|
222 |
+
*/
|
223 |
+
public function add_user(){
|
224 |
+
if( ! isset( $_GET['access_token'] ) || ! isset( $_GET['page'] ) || $_GET['page'] != $this->_options_page ){
|
225 |
+
return;
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
$user = EnjoyInstagram_Api_Connection()->get_user_info( $_GET['access_token'] );
|
231 |
+
if( empty( $user ) ) {
|
232 |
+
return;
|
233 |
+
}
|
234 |
+
|
235 |
+
update_option( 'enjoyinstagram_user_id', $user['data']['id'] );
|
236 |
+
update_option( 'enjoyinstagram_user_username', enjoyinstagram_replace4byte($user['data']['username']));
|
237 |
+
update_option( 'enjoyinstagram_user_profile_picture', $user['data']['profile_picture'] );
|
238 |
+
update_option( 'enjoyinstagram_user_fullname', enjoyinstagram_replace4byte($user['data']['full_name']));
|
239 |
+
update_option( 'enjoyinstagram_user_website', $user['data']['website'] );
|
240 |
+
update_option( 'enjoyinstagram_user_bio', enjoyinstagram_replace4byte($user['data']['bio']));
|
241 |
+
update_option( 'enjoyinstagram_access_token', $_GET['access_token'] );
|
242 |
+
|
243 |
+
// redirect to main settings page
|
244 |
+
wp_redirect( $this->build_admin_url( 'enjoyinstagram_general_settings' ) );
|
245 |
+
exit;
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Remove and user from plugin
|
250 |
+
*
|
251 |
+
* @since 9.0.0
|
252 |
+
* @author Francesco Licandro
|
253 |
+
* @return void
|
254 |
+
*/
|
255 |
+
public function remove_user(){
|
256 |
+
|
257 |
+
if( ! isset( $_REQUEST['action'] ) || $_REQUEST['action'] != 'enjoyinstagram_remove_user' ){
|
258 |
+
return;
|
259 |
+
}
|
260 |
+
|
261 |
+
update_option( 'enjoyinstagram_user_id', '' );
|
262 |
+
update_option( 'enjoyinstagram_user_username', '' );
|
263 |
+
update_option( 'enjoyinstagram_user_profile_picture', '' );
|
264 |
+
update_option( 'enjoyinstagram_user_fullname', '' );
|
265 |
+
update_option( 'enjoyinstagram_user_website', '' );
|
266 |
+
update_option( 'enjoyinstagram_user_bio', '' );
|
267 |
+
update_option( 'enjoyinstagram_access_token', '' );
|
268 |
+
|
269 |
+
// redirect to main settings page
|
270 |
+
wp_redirect( $this->build_admin_url( 'enjoyinstagram_general_settings' ) );
|
271 |
+
exit;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Get Instagram login url
|
276 |
+
*
|
277 |
+
* @since 9.0.0
|
278 |
+
* @author Francesco Licandro
|
279 |
+
* @return string
|
280 |
+
*/
|
281 |
+
public function get_instagram_login_url(){
|
282 |
+
$return_url = admin_url("options-general.php?page={$this->_options_page}");
|
283 |
+
$state_url = admin_url("options-general.php?page-{$this->_options_page}");
|
284 |
+
return "https://instagram.com/oauth/authorize/?client_id=cac0b53396ee466293d81c8fb86835fe&scope=public_content&redirect_uri=http://www.mediabetaprojects.com/put_access_token.php&response_type=token&state={$state_url}";
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Unique access to instance of EnjoyInstagram_Admin class
|
290 |
+
*
|
291 |
+
* @return \EnjoyInstagram_Admin
|
292 |
+
* @since 9.0.0
|
293 |
+
*/
|
294 |
+
function EnjoyInstagram_Admin() {
|
295 |
+
return EnjoyInstagram_Admin::get_instance();
|
296 |
+
}
|
297 |
+
|
298 |
+
EnjoyInstagram_Admin();
|
includes/class.enjoyinstagram-api-connection.php
ADDED
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This class handles Instagram API connection
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // exit if call directly
|
8 |
+
}
|
9 |
+
|
10 |
+
class EnjoyInstagram_Api_Connection {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Single plugin instance
|
14 |
+
* @since 9.0.0
|
15 |
+
* @var \EnjoyInstagram_Api_Connection
|
16 |
+
*/
|
17 |
+
protected static $instance;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Users array
|
21 |
+
* @var array
|
22 |
+
*/
|
23 |
+
public $users = array();
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Returns single instance of the class
|
27 |
+
*
|
28 |
+
* @return \EnjoyInstagram_Api_Connection
|
29 |
+
* @since 1.0.0
|
30 |
+
*/
|
31 |
+
public static function get_instance(){
|
32 |
+
if( is_null( self::$instance ) ){
|
33 |
+
self::$instance = new self();
|
34 |
+
}
|
35 |
+
|
36 |
+
return self::$instance;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Construct
|
41 |
+
*
|
42 |
+
* @return void
|
43 |
+
*/
|
44 |
+
private function __construct(){
|
45 |
+
$this->users = get_option('enjoy_instagram_options', array());
|
46 |
+
$this->users = array_filter( $this->users );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Handle curl connection to API
|
51 |
+
*
|
52 |
+
* @since 9.0.0
|
53 |
+
* @param string $api_url
|
54 |
+
* @return mixed
|
55 |
+
* @author Francesco Licandro
|
56 |
+
*/
|
57 |
+
private function _curl_connect( $api_url ){
|
58 |
+
try {
|
59 |
+
$connection_c = curl_init(); // initializing
|
60 |
+
curl_setopt( $connection_c, CURLOPT_URL, $api_url ); // API URL to connect
|
61 |
+
curl_setopt( $connection_c, CURLOPT_RETURNTRANSFER, true ); // return the result, do not print
|
62 |
+
curl_setopt( $connection_c, CURLOPT_TIMEOUT, 30 );
|
63 |
+
curl_setopt($connection_c, CURLOPT_SSL_VERIFYPEER, false);
|
64 |
+
$json_return = curl_exec( $connection_c ); // connect and get json data
|
65 |
+
curl_close( $connection_c ); // close connection
|
66 |
+
return json_decode( $json_return, true ); // decode and return
|
67 |
+
}
|
68 |
+
catch( Exception $e ) {
|
69 |
+
return array();
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Get data
|
75 |
+
*
|
76 |
+
* @since 9.0.0
|
77 |
+
* @author Francesco Licandro
|
78 |
+
* @param string $url
|
79 |
+
* @param integer $count
|
80 |
+
* @param array $hashtags
|
81 |
+
* @return array
|
82 |
+
*/
|
83 |
+
private function _get_data( $url, $count, $hashtags ) {
|
84 |
+
|
85 |
+
$result = $this->_curl_connect( $url );
|
86 |
+
$res = $result;
|
87 |
+
$res['data'] = array(); // reset data
|
88 |
+
$hashtags = array_filter( $hashtags ); // be sure to remove empty values
|
89 |
+
|
90 |
+
if( ! isset( $result['data'] ) ) {
|
91 |
+
return $res;
|
92 |
+
}
|
93 |
+
|
94 |
+
foreach( $result['data'] as $post ) {
|
95 |
+
if( ! empty( $hashtags ) ){
|
96 |
+
foreach( $hashtags as $hash ){
|
97 |
+
if( in_array( $hash, $post["tags"] ) && ! in_array( $post, $res['data'] ) ){
|
98 |
+
array_push( $res['data'], $post );
|
99 |
+
}
|
100 |
+
}
|
101 |
+
} else{
|
102 |
+
array_push( $res['data'], $post );
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
if( $count >= 33 && isset( $result['pagination']['next_url'] ) ){
|
107 |
+
for( $i=1; $i<($count/33); $i++ ){
|
108 |
+
$result = $this->_curl_connect( $result['pagination']['next_url'] );
|
109 |
+
if( ! is_null($result['data']) ){
|
110 |
+
foreach( $result['data'] as $post ) {
|
111 |
+
if( count( $res['data'] ) == $count ) {
|
112 |
+
break;
|
113 |
+
}
|
114 |
+
|
115 |
+
if( ! empty( $hashtags ) ){
|
116 |
+
foreach( $hashtags as $hash ){
|
117 |
+
if( in_array( $hash, $post["tags"] ) && ! in_array( $post, $res['data'] ) ){
|
118 |
+
array_push( $res['data'], $post );
|
119 |
+
}
|
120 |
+
}
|
121 |
+
} else {
|
122 |
+
array_push( $res['data'], $post );
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
return $res;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Get access token for given user
|
134 |
+
*
|
135 |
+
* @since 9.0.0
|
136 |
+
* @param string $user
|
137 |
+
* @return string
|
138 |
+
* @author Francesco Licandro
|
139 |
+
*/
|
140 |
+
public function get_user_access_token( $user ) {
|
141 |
+
return isset( $this->users[$user]['access_token'] ) ? $this->users[$user]['access_token'] : '';
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Get user info
|
146 |
+
*
|
147 |
+
* @since 9.0.0
|
148 |
+
* @param string $user
|
149 |
+
* @param string $access_token
|
150 |
+
* @author Francesco Licandro
|
151 |
+
* @return array
|
152 |
+
*/
|
153 |
+
public function get_user_info( $access_token = '', $user = '' ){
|
154 |
+
if( ! $access_token && ! $user ) {
|
155 |
+
return array();
|
156 |
+
}
|
157 |
+
|
158 |
+
// get access token if missing
|
159 |
+
! $access_token && $access_token = $this->get_user_access_token( $user );
|
160 |
+
|
161 |
+
$url = 'https://api.instagram.com/v1/users/self/?access_token='.$access_token;
|
162 |
+
return $this->_curl_connect( $url );
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Get user by name
|
167 |
+
*
|
168 |
+
* @param $user
|
169 |
+
* @param integer $count
|
170 |
+
* @param $account_name
|
171 |
+
* @param string $hashtag
|
172 |
+
* @return array|boolean
|
173 |
+
*/
|
174 |
+
public function get_user_by_name( $user, $count, $account_name, $hashtag = '' ){
|
175 |
+
if( ! $user ) {
|
176 |
+
// get first
|
177 |
+
reset( $this->users );
|
178 |
+
$user = key( $this->users );
|
179 |
+
}
|
180 |
+
$access_token = $this->get_user_access_token( $user );
|
181 |
+
if( ! $access_token ) {
|
182 |
+
return false;
|
183 |
+
}
|
184 |
+
|
185 |
+
$user_name = strtolower( $account_name ); // sanitization
|
186 |
+
$user_id = '';
|
187 |
+
$url = "https://api.instagram.com/v1/users/search?q=".$user_name."&access_token=".$access_token;
|
188 |
+
$json = $this->_curl_connect( $url );
|
189 |
+
if( empty( $json ) || ! isset( $json['data'] ) ) {
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
|
193 |
+
foreach( $json['data'] as $user ) {
|
194 |
+
if($user['username'] == $user_name) {
|
195 |
+
$user_id = $user['id'];
|
196 |
+
}
|
197 |
+
}
|
198 |
+
if( ! $user_id ) {
|
199 |
+
return false;
|
200 |
+
}
|
201 |
+
|
202 |
+
$hashtags = explode(',', $hashtag);
|
203 |
+
$url = 'https://api.instagram.com/v1/users/'.$user_id.'/media/recent?count='.$count.'&access_token='.$access_token;
|
204 |
+
return $this->_get_data( $url, $count, $hashtags );
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Get user
|
209 |
+
*
|
210 |
+
* @since 9.0.0
|
211 |
+
* @author Francesco Licandro
|
212 |
+
* @param string $user
|
213 |
+
* @param integer $count
|
214 |
+
* @param string $hashtag
|
215 |
+
* @return array|boolean
|
216 |
+
*/
|
217 |
+
public function get_user( $user, $count, $hashtag = "" ){
|
218 |
+
$access_token = $this->get_user_access_token( $user );
|
219 |
+
$hashtags = explode( ',', $hashtag );
|
220 |
+
$url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$access_token;
|
221 |
+
|
222 |
+
return $this->_get_data( $url, $count, $hashtags );
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Get user code
|
227 |
+
*
|
228 |
+
* @since 9.0.0
|
229 |
+
* @author Francesco Licandro
|
230 |
+
* @param string $user
|
231 |
+
* @param integer $count
|
232 |
+
* @return string
|
233 |
+
*/
|
234 |
+
public function get_user_code( $user, $count ){
|
235 |
+
if( ! $user ) {
|
236 |
+
// get first
|
237 |
+
reset( $this->users );
|
238 |
+
$user = key( $this->users );
|
239 |
+
}
|
240 |
+
$access_token = $this->get_user_access_token( $user );
|
241 |
+
$url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$access_token;
|
242 |
+
$result = $this->_curl_connect( $url );
|
243 |
+
|
244 |
+
return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Get a media
|
249 |
+
*
|
250 |
+
* @since 9.0.0
|
251 |
+
* @author Francesco Licandro
|
252 |
+
* @param string $user
|
253 |
+
* @param string $media
|
254 |
+
* @return array
|
255 |
+
*/
|
256 |
+
public function get_media( $user, $media ){
|
257 |
+
|
258 |
+
if( ! $user ) {
|
259 |
+
// get first
|
260 |
+
reset( $this->users );
|
261 |
+
$user = key( $this->users );
|
262 |
+
}
|
263 |
+
$access_token = $this->get_user_access_token( $user );
|
264 |
+
$url = 'https://api.instagram.com/v1/media/'.$media.'?access_token='.$access_token;
|
265 |
+
return $this->_curl_connect( $url );
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Get likes
|
270 |
+
*
|
271 |
+
* @since 9.0.0
|
272 |
+
* @author Francesco Licandro
|
273 |
+
* @param string $user
|
274 |
+
* @param integer $count
|
275 |
+
* @return array
|
276 |
+
*/
|
277 |
+
public function get_likes( $user, $count ){
|
278 |
+
$access_token = $this->get_user_access_token( $user );
|
279 |
+
$url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$access_token;
|
280 |
+
|
281 |
+
return $this->_get_data( $url, $count, array() );
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Get likes code
|
286 |
+
*
|
287 |
+
* @since 9.0.0
|
288 |
+
* @author Francesco Licandro
|
289 |
+
* @param string $user
|
290 |
+
* @param string $count
|
291 |
+
* @return string
|
292 |
+
*/
|
293 |
+
public function get_likes_code($user,$count){
|
294 |
+
$access_token = $this->get_user_access_token( $user );
|
295 |
+
$url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$access_token;
|
296 |
+
$result = $this->_curl_connect( $url );
|
297 |
+
|
298 |
+
return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
|
299 |
+
}
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Get hash
|
303 |
+
*
|
304 |
+
* @author Francesco Licandro
|
305 |
+
* @since 9.0.0
|
306 |
+
* @param string $hashtag
|
307 |
+
* @param string $count
|
308 |
+
* @return array
|
309 |
+
*/
|
310 |
+
public function get_hash( $hashtag, $count ){
|
311 |
+
// get first
|
312 |
+
reset( $this->users );
|
313 |
+
$first_key = key( $this->users );
|
314 |
+
$access_token = $this->get_user_access_token( $first_key );
|
315 |
+
$hashtags = explode("%2C", $hashtag);
|
316 |
+
$result = array();
|
317 |
+
$res['data'] = array();
|
318 |
+
$ht = '';
|
319 |
+
$i = 0;
|
320 |
+
|
321 |
+
while( sizeof( $res['data'] ) < $count ){
|
322 |
+
if( $i && ( ! isset( $result[$ht][$i-1]['pagination']['next_url']) ) ) {
|
323 |
+
break;
|
324 |
+
}
|
325 |
+
foreach( $hashtags as $ht ){
|
326 |
+
|
327 |
+
if( $i ){
|
328 |
+
$url = $result[$ht][$i-1]['pagination']['next_url'];
|
329 |
+
} else {
|
330 |
+
$url = 'https://api.instagram.com/v1/tags/'.$ht.'/media/recent?count='.$count.'&access_token='.$access_token;
|
331 |
+
}
|
332 |
+
|
333 |
+
$result[$ht][$i] = $this->_curl_connect( $url );
|
334 |
+
if ( is_null( $result[$ht][$i] ) ){
|
335 |
+
if( ( $key = array_search( $ht, $hashtags ) ) !== false ) {
|
336 |
+
unset( $hashtags[$key] );
|
337 |
+
}
|
338 |
+
} else {
|
339 |
+
foreach( $result[$ht][$i]['data'] as $post ) {
|
340 |
+
array_push( $res['data'], $post );
|
341 |
+
}
|
342 |
+
}
|
343 |
+
}
|
344 |
+
$i++;
|
345 |
+
}
|
346 |
+
|
347 |
+
if( empty( $res['data'] ) ) {
|
348 |
+
return array();
|
349 |
+
}
|
350 |
+
|
351 |
+
enjoyinstagram_shuffle_assoc( $res['data'] );
|
352 |
+
$res['data'] = array_slice( $res['data'], 0, $count );
|
353 |
+
|
354 |
+
return $res;
|
355 |
+
}
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Get hash code
|
359 |
+
*
|
360 |
+
* @param string $hashtag
|
361 |
+
* @param string $count
|
362 |
+
* @return string
|
363 |
+
*/
|
364 |
+
public function get_hash_code( $hashtag, $count ){
|
365 |
+
|
366 |
+
reset( $this->users );
|
367 |
+
$first_key = key( $this->users );
|
368 |
+
$access_token = $this->get_user_access_token( $first_key );
|
369 |
+
$url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?count='.$count.'&access_token='.$access_token;
|
370 |
+
$result = $this->_curl_connect( $url );
|
371 |
+
|
372 |
+
return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
|
373 |
+
}
|
374 |
+
}
|
375 |
+
|
376 |
+
/**
|
377 |
+
* Unique access to instance of EnjoyInstagram_Api_Connection class
|
378 |
+
*
|
379 |
+
* @return \EnjoyInstagram_Api_Connection
|
380 |
+
* @since 9.0.0
|
381 |
+
*/
|
382 |
+
function EnjoyInstagram_Api_Connection() {
|
383 |
+
return EnjoyInstagram_Api_Connection::get_instance();
|
384 |
+
}
|
includes/class.enjoyinstagram-shortcodes.php
ADDED
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This class handles plugin shortcodes
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // exit if call directly
|
8 |
+
}
|
9 |
+
|
10 |
+
class EnjoyInstagram_Shortcodes {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Single plugin instance
|
14 |
+
* @since 9.0.0
|
15 |
+
* @var \EnjoyInstagram_Shortcodes
|
16 |
+
*/
|
17 |
+
protected static $instance;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Shortcode index
|
21 |
+
* @since 9.0.0
|
22 |
+
* @var integer
|
23 |
+
*/
|
24 |
+
public static $index = 1;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @since 9.0.0
|
28 |
+
* @var boolean
|
29 |
+
*/
|
30 |
+
public $enqueued = false;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Returns single instance of the class
|
34 |
+
*
|
35 |
+
* @return \EnjoyInstagram_Shortcodes
|
36 |
+
* @since 1.0.0
|
37 |
+
*/
|
38 |
+
public static function get_instance(){
|
39 |
+
if( is_null( self::$instance ) ){
|
40 |
+
self::$instance = new self();
|
41 |
+
}
|
42 |
+
return self::$instance;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Construct
|
47 |
+
*
|
48 |
+
* @return void
|
49 |
+
*/
|
50 |
+
public function __construct(){
|
51 |
+
// register common scripts
|
52 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ), 5 );
|
53 |
+
add_action( 'wp_head', array( $this, 'functions_in_head' ) );
|
54 |
+
if( ! is_admin() ){
|
55 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 15 );
|
56 |
+
}
|
57 |
+
|
58 |
+
add_shortcode( 'enjoyinstagram_mb', array( $this, 'carousel_shortcode' ) );
|
59 |
+
add_shortcode( 'enjoyinstagram_mb_grid', array( $this, 'grid_shortcode' ) );
|
60 |
+
add_shortcode( 'enjoyinstagram_mb_widget', array( $this, 'carousel_shortcode_widget' ) );
|
61 |
+
add_shortcode( 'enjoyinstagram_mb_grid_widget', array( $this, 'grid_shortcode_widget' ) );
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Register common scripts
|
66 |
+
*
|
67 |
+
* @since 9.0.0
|
68 |
+
* @author Francesco Licandro
|
69 |
+
*/
|
70 |
+
public function register_scripts(){
|
71 |
+
wp_register_script('owl', ENJOYINSTAGRAM_ASSETS_URL . '/js/owl.carousel.min.js', array('jquery'), ENJOYINSTAGRAM_VERSION );
|
72 |
+
wp_register_script('swipebox', ENJOYINSTAGRAM_ASSETS_URL . '/js/jquery.swipebox.min.js', array('jquery'), ENJOYINSTAGRAM_VERSION );
|
73 |
+
wp_register_script('gridrotator', ENJOYINSTAGRAM_ASSETS_URL . '/js/jquery.gridrotator.min.js', array('jquery'), ENJOYINSTAGRAM_VERSION );
|
74 |
+
wp_register_script('modernizr.custom.26633', ENJOYINSTAGRAM_ASSETS_URL . '/js/modernizr.custom.26633.min.js', array('jquery'), ENJOYINSTAGRAM_VERSION );
|
75 |
+
wp_register_script('orientationchange', ENJOYINSTAGRAM_ASSETS_URL . '/js/ios-orientationchange-fix.min.js', array('jquery'), ENJOYINSTAGRAM_VERSION );
|
76 |
+
|
77 |
+
wp_register_style('owl_style', ENJOYINSTAGRAM_ASSETS_URL . '/css/owl.carousel.css' );
|
78 |
+
wp_register_style('owl_style_2', ENJOYINSTAGRAM_ASSETS_URL . '/css/owl.theme.css' );
|
79 |
+
wp_register_style('owl_style_3', ENJOYINSTAGRAM_ASSETS_URL . '/css/owl.transitions.css' );
|
80 |
+
wp_register_style('swipebox_css', ENJOYINSTAGRAM_ASSETS_URL . '/css/swipebox.css' );
|
81 |
+
wp_register_style('grid_fallback', ENJOYINSTAGRAM_ASSETS_URL . '/css/grid_fallback.css' );
|
82 |
+
wp_register_style('grid_style', ENJOYINSTAGRAM_ASSETS_URL . '/css/grid_style.css' );
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Enqueue scripts ans styles
|
87 |
+
*
|
88 |
+
* @since 9.0.0
|
89 |
+
* @author Francesco Licandro
|
90 |
+
*/
|
91 |
+
public function enqueue_scripts(){
|
92 |
+
|
93 |
+
if( $this->enqueued ) {
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
wp_enqueue_script('modernizr.custom.26633');
|
97 |
+
wp_enqueue_script('gridrotator');
|
98 |
+
wp_localize_script('gridrotator', 'GridRotator', array('pluginsUrl' => plugins_url(),));
|
99 |
+
wp_enqueue_script('owl');
|
100 |
+
wp_enqueue_script('swipebox');
|
101 |
+
wp_enqueue_script('orientationchange');
|
102 |
+
wp_enqueue_style( 'owl_style' );
|
103 |
+
wp_enqueue_style( 'owl_style_2' );
|
104 |
+
wp_enqueue_style( 'owl_style_3' );
|
105 |
+
wp_enqueue_style( 'swipebox_css' );
|
106 |
+
wp_enqueue_style( 'grid_fallback' );
|
107 |
+
wp_enqueue_style( 'grid_style' );
|
108 |
+
|
109 |
+
$this->enqueued = true;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* JS functions in head
|
114 |
+
*
|
115 |
+
* @since 9.0.0
|
116 |
+
*/
|
117 |
+
public function functions_in_head(){
|
118 |
+
?>
|
119 |
+
<script type="text/javascript">
|
120 |
+
jQuery(function($) {
|
121 |
+
$(".swipebox_grid").swipebox({
|
122 |
+
hideBarsDelay : 0
|
123 |
+
});
|
124 |
+
|
125 |
+
});
|
126 |
+
</script>
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Get shortcode data
|
132 |
+
*
|
133 |
+
* @since 9.0.0
|
134 |
+
* @author Francesco Licandro
|
135 |
+
* @param string $type
|
136 |
+
* @return array
|
137 |
+
*/
|
138 |
+
protected function _get_shortcode_data( $type = '' ){
|
139 |
+
$data = array();
|
140 |
+
! $type && $type = get_option('enjoyinstagram_user_or_hashtag');
|
141 |
+
if( $type == 'hashtag' ){
|
142 |
+
$result = EnjoyInstagram_Api_Connection()->get_hash( urlencode( get_option('enjoyinstagram_hashtag') ), 20 );
|
143 |
+
} else {
|
144 |
+
$result = EnjoyInstagram_Api_Connection()->get_user( urlencode( get_option('enjoyinstagram_user_username') ), 20 );
|
145 |
+
}
|
146 |
+
|
147 |
+
if( isset( $result['data'] ) ) {
|
148 |
+
$data = $result['data'];
|
149 |
+
foreach( $data as $key => &$entry ) {
|
150 |
+
$entry = enjoyinstagram_format_entry_before_print( $entry );
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
return $data;
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Carousel shortcode callback
|
159 |
+
*
|
160 |
+
* @since 4.0.0
|
161 |
+
* @author Francesco Licandro
|
162 |
+
* @param array $atts
|
163 |
+
* @return string
|
164 |
+
*/
|
165 |
+
public function carousel_shortcode( $atts ){
|
166 |
+
extract( shortcode_atts( array(
|
167 |
+
'n' => '4'
|
168 |
+
), $atts ) );
|
169 |
+
|
170 |
+
$client = get_option( 'enjoyinstagram_access_token', '' );
|
171 |
+
if( ! $client || is_null( $client ) ) {
|
172 |
+
return '';
|
173 |
+
}
|
174 |
+
|
175 |
+
$items_num = get_option('enjoyinstagram_carousel_items_number');
|
176 |
+
$nav = get_option('enjoyinstagram_carousel_navigation');
|
177 |
+
$result = $this->_get_shortcode_data();
|
178 |
+
if( empty( $result ) ) {
|
179 |
+
return '';
|
180 |
+
}
|
181 |
+
$i = self::$index;
|
182 |
+
self::$index++;
|
183 |
+
|
184 |
+
ob_start();
|
185 |
+
include( ENJOYINSTAGRAM_TEMPLATE_PATH . '/shortcodes/carousel.php' );
|
186 |
+
return ob_get_clean();
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Grid shortcode callback
|
191 |
+
*
|
192 |
+
* @since 4.0.0
|
193 |
+
* @author Francesco Licandro
|
194 |
+
* @param array $atts
|
195 |
+
* @return string
|
196 |
+
*/
|
197 |
+
public function grid_shortcode( $atts ) {
|
198 |
+
extract( shortcode_atts( array(
|
199 |
+
'rows' => get_option('enjoyinstagram_grid_rows'),
|
200 |
+
'cols' => get_option('enjoyinstagram_grid_cols')
|
201 |
+
), $atts ) );
|
202 |
+
|
203 |
+
$client = get_option( 'enjoyinstagram_access_token', '' );
|
204 |
+
if( ! $client || is_null( $client ) ) {
|
205 |
+
return '';
|
206 |
+
}
|
207 |
+
|
208 |
+
$result = $this->_get_shortcode_data();
|
209 |
+
if( empty( $result ) ) {
|
210 |
+
return '';
|
211 |
+
}
|
212 |
+
$i = self::$index;
|
213 |
+
self::$index++;
|
214 |
+
|
215 |
+
ob_start();
|
216 |
+
include( ENJOYINSTAGRAM_TEMPLATE_PATH . '/shortcodes/grid.php' );
|
217 |
+
return ob_get_clean();
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Carousel shortcode widget callback
|
222 |
+
*
|
223 |
+
* @since 4.0.0
|
224 |
+
* @author Francesco Licandro
|
225 |
+
* @param array $atts
|
226 |
+
* @return string
|
227 |
+
*/
|
228 |
+
public function carousel_shortcode_widget( $atts ) {
|
229 |
+
extract(shortcode_atts(array(
|
230 |
+
'n' => '4',
|
231 |
+
'id' => 'owl',
|
232 |
+
'n_y_n' => 'false',
|
233 |
+
'u_or_h' => 'user'
|
234 |
+
), $atts));
|
235 |
+
|
236 |
+
$client = get_option( 'enjoyinstagram_access_token', '' );
|
237 |
+
if( ! $client || is_null( $client ) ) {
|
238 |
+
return '';
|
239 |
+
}
|
240 |
+
|
241 |
+
$result = $this->_get_shortcode_data( $u_or_h );
|
242 |
+
if( empty( $result ) ) {
|
243 |
+
return '';
|
244 |
+
}
|
245 |
+
|
246 |
+
ob_start();
|
247 |
+
include( ENJOYINSTAGRAM_TEMPLATE_PATH . '/shortcodes/carousel-widget.php' );
|
248 |
+
return ob_get_clean();
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Grid shortcode widget callback
|
253 |
+
*
|
254 |
+
* @since 4.0.0
|
255 |
+
* @author Francesco Licandro
|
256 |
+
* @param array $atts
|
257 |
+
* @return string
|
258 |
+
*/
|
259 |
+
public function grid_shortcode_widget( $atts ) {
|
260 |
+
extract( shortcode_atts( array(
|
261 |
+
'id' => 'rigrid_default',
|
262 |
+
'n_c' => '6',
|
263 |
+
'n_r' => '2',
|
264 |
+
'u_or_h' => 'user'
|
265 |
+
), $atts ) );
|
266 |
+
|
267 |
+
$client = get_option( 'enjoyinstagram_access_token', '' );
|
268 |
+
if( ! $client || is_null( $client ) ) {
|
269 |
+
return '';
|
270 |
+
}
|
271 |
+
|
272 |
+
$result = $this->_get_shortcode_data( $u_or_h );
|
273 |
+
if( empty( $result ) ) {
|
274 |
+
return '';
|
275 |
+
}
|
276 |
+
|
277 |
+
ob_start();
|
278 |
+
include( ENJOYINSTAGRAM_TEMPLATE_PATH . '/shortcodes/grid-widget.php' );
|
279 |
+
return ob_get_clean();
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Unique access to instance of EnjoyInstagram_Shortcodes class
|
285 |
+
*
|
286 |
+
* @return \EnjoyInstagram_Shortcodes
|
287 |
+
* @since 9.0.0
|
288 |
+
*/
|
289 |
+
function EnjoyInstagram_Shortcodes() {
|
290 |
+
return EnjoyInstagram_Shortcodes::get_instance();
|
291 |
+
}
|
292 |
+
|
293 |
+
EnjoyInstagram_Shortcodes();
|
includes/functions.enjoyinstagram.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Common functions for plugin Enjoy Instagram
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // exit if call directly
|
8 |
+
}
|
9 |
+
|
10 |
+
if( ! function_exists( 'enjoyinstagram_shuffle_assoc' ) ) {
|
11 |
+
function enjoyinstagram_shuffle_assoc(&$array) {
|
12 |
+
if( empty($array) ) {
|
13 |
+
return false;
|
14 |
+
}
|
15 |
+
|
16 |
+
$keys = array_keys($array);
|
17 |
+
shuffle($keys);
|
18 |
+
foreach($keys as $key) {
|
19 |
+
$new[$key] = $array[$key];
|
20 |
+
}
|
21 |
+
$array = $new;
|
22 |
+
return true;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
if( ! function_exists( 'enjoyinstagram_replace4byte' ) ){
|
27 |
+
/**
|
28 |
+
* @param $string
|
29 |
+
* @return null|string|string[]
|
30 |
+
*/
|
31 |
+
function enjoyinstagram_replace4byte($string) {
|
32 |
+
return preg_replace('%(?:
|
33 |
+
\xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
|
34 |
+
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
|
35 |
+
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
|
36 |
+
)%xs', '', $string);
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
if( ! function_exists( 'enjoyinstagram_isHttps' ) ) {
|
41 |
+
/**
|
42 |
+
* Check HTTPS
|
43 |
+
*
|
44 |
+
* @return bool
|
45 |
+
*/
|
46 |
+
function enjoyinstagram_isHttps() {
|
47 |
+
return ! empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] != 'off';
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
if( ! function_exists( 'enjoyinstagram_format_entry_before_print' ) ) {
|
52 |
+
/**
|
53 |
+
* Format an entry before print
|
54 |
+
*
|
55 |
+
* @since 9.0.0
|
56 |
+
* @author Francesco Licandro
|
57 |
+
* @param array $entry
|
58 |
+
* @return array
|
59 |
+
*/
|
60 |
+
function enjoyinstagram_format_entry_before_print( $entry ) {
|
61 |
+
$entry['caption']['text'] = ! empty( $entry['caption'] ) ? str_replace("\"",""",$entry['caption']['text']) : '';
|
62 |
+
if( enjoyinstagram_isHttps() ) {
|
63 |
+
$thumb_url = isset( $entry['images']['thumbnail'] ) ? $entry['images']['thumbnail']['url'] : $entry['images']['standard_resolution']['url'];
|
64 |
+
$entry['images']['thumbnail']['url'] = str_replace('http://', 'https://', $thumb_url );
|
65 |
+
$entry['images']['standard_resolution']['url'] = str_replace('http://', 'https://', $entry['images']['standard_resolution']['url']);
|
66 |
+
}
|
67 |
+
|
68 |
+
return $entry;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
/************************************
|
73 |
+
* RETROCOMPATIBILITY
|
74 |
+
***********************************/
|
75 |
+
function get_user_info($access_token){
|
76 |
+
return EnjoyInstagram_Api_Connection()->get_user_info( $access_token );
|
77 |
+
}
|
78 |
+
//ANDREA NEW FUNC
|
79 |
+
function get_user_by_name($user,$count, $account_name, $hashtag = ""){
|
80 |
+
return EnjoyInstagram_Api_Connection()->get_user_by_name( $user,$count, $account_name, $hashtag = "" );
|
81 |
+
}
|
82 |
+
|
83 |
+
function get_hash($hashtag,$count){
|
84 |
+
return EnjoyInstagram_Api_Connection()->get_hash( $hashtag,$count );
|
85 |
+
}
|
86 |
+
|
87 |
+
function get_hash_code($hashtag,$count){
|
88 |
+
return EnjoyInstagram_Api_Connection()->get_hash_code( $hashtag,$count );
|
89 |
+
}
|
90 |
+
|
91 |
+
function get_user($user,$count, $hashtag = ""){
|
92 |
+
return EnjoyInstagram_Api_Connection()->get_user( $user,$count, $hashtag );
|
93 |
+
}
|
94 |
+
|
95 |
+
function get_user_code($user,$count){
|
96 |
+
return EnjoyInstagram_Api_Connection()->get_user_code( $user,$count );
|
97 |
+
}
|
98 |
+
|
99 |
+
function get_media($user,$media){
|
100 |
+
return EnjoyInstagram_Api_Connection()->get_media( $user,$media );
|
101 |
+
}
|
102 |
+
|
103 |
+
function get_likes($user,$count){
|
104 |
+
return EnjoyInstagram_Api_Connection()->get_likes( $user,$count );
|
105 |
+
}
|
106 |
+
|
107 |
+
function get_likes_code($user,$count){
|
108 |
+
return EnjoyInstagram_Api_Connection()->get_likes_code( $user,$count );
|
109 |
+
}
|
110 |
+
|
111 |
+
function replace4byte($string) {
|
112 |
+
return enjoyinstagram_replace4byte( $string );
|
113 |
+
}
|
114 |
+
|
115 |
+
function isHttps() {
|
116 |
+
return enjoyinstagram_isHttps();
|
117 |
+
}
|
118 |
+
|
119 |
+
function defer_parsing_of_js ( $url ) {
|
120 |
+
return enjoyinstagram_defer_parsing_of_js( $url );
|
121 |
+
}
|
{tinymce → includes/tinymce}/editor_plugin.js
RENAMED
File without changes
|
{tinymce → includes/tinymce}/enjoyinstagramtinymce.js
RENAMED
File without changes
|
{images → includes/tinymce}/icon_enjoyinstagram.png
RENAMED
File without changes
|
tinymce/window.php → includes/tinymce/shortcode-tinymce-window.php
RENAMED
@@ -1,4 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
wp_enqueue_script('jquery-ui-core');
|
3 |
wp_enqueue_script('jquery-ui-widget');
|
4 |
wp_enqueue_script('jquery-ui-position');
|
@@ -8,12 +16,10 @@ global $wp_scripts;
|
|
8 |
|
9 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
10 |
<head>
|
11 |
-
<title
|
12 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
13 |
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
14 |
-
|
15 |
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
16 |
-
|
17 |
<script language="javascript" type="text/javascript" src="<?php echo plugins_url('enjoyinstagramtinymce.js',__FILE__); ?>"></script>
|
18 |
<base target="_self" />
|
19 |
<?php wp_print_scripts(); ?>
|
@@ -23,26 +29,28 @@ global $wp_scripts;
|
|
23 |
<form name="enjoyinstagram" action="#">
|
24 |
<table border="0" cellpadding="4" cellspacing="0" style="margin:0 auto;">
|
25 |
<tr>
|
26 |
-
<td colspan="2"
|
27 |
-
|
|
|
28 |
<td colspan="2" style="height:100px;">
|
29 |
-
<input type="radio" name="newshortcode" id="id_shortcode_carousel" value="enjoyinstagram_mb" checked/>
|
|
|
30 |
<br />
|
31 |
-
<input type="radio" name="newshortcode" id="id_shortcode_grid" value="enjoyinstagram_mb_grid"/>
|
|
|
32 |
</td>
|
33 |
-
|
34 |
-
|
35 |
-
<tr>
|
36 |
<td style="text-align:center;">
|
37 |
-
<input type="submit" id="insert" name="insert" value="<?php _e("Insert", 'enjoyinstagram'); ?>"
|
38 |
-
|
39 |
</td>
|
40 |
<td style="text-align:center;">
|
41 |
-
|
42 |
-
|
43 |
</td>
|
44 |
-
|
45 |
</table>
|
46 |
</form>
|
47 |
</body>
|
48 |
-
</html>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Add enjoyinstagram shortcode window on tinyMCE
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // exit if call directly
|
8 |
+
}
|
9 |
+
|
10 |
wp_enqueue_script('jquery-ui-core');
|
11 |
wp_enqueue_script('jquery-ui-widget');
|
12 |
wp_enqueue_script('jquery-ui-position');
|
16 |
|
17 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
18 |
<head>
|
19 |
+
<title><?php _e( 'EnjoyInstagram', 'enjoyinstagram' ); ?></title>
|
20 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
21 |
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
|
|
22 |
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
|
|
|
23 |
<script language="javascript" type="text/javascript" src="<?php echo plugins_url('enjoyinstagramtinymce.js',__FILE__); ?>"></script>
|
24 |
<base target="_self" />
|
25 |
<?php wp_print_scripts(); ?>
|
29 |
<form name="enjoyinstagram" action="#">
|
30 |
<table border="0" cellpadding="4" cellspacing="0" style="margin:0 auto;">
|
31 |
<tr>
|
32 |
+
<td colspan="2"><?php _e( 'Insert Enjoy Plugin for Instagram Shortcode', 'enjoyinstagram' ); ?></td>
|
33 |
+
</tr>
|
34 |
+
<tr>
|
35 |
<td colspan="2" style="height:100px;">
|
36 |
+
<input type="radio" name="newshortcode" id="id_shortcode_carousel" value="enjoyinstagram_mb" checked/>
|
37 |
+
<label for="id_shortcode_carousel" ><?php _e( 'Carousel View', 'enjoyinstagram' ); ?></label>
|
38 |
<br />
|
39 |
+
<input type="radio" name="newshortcode" id="id_shortcode_grid" value="enjoyinstagram_mb_grid"/>
|
40 |
+
<label for="id_shortcode_grid" ><?php _e( 'Grid View', 'enjoyinstagram' ); ?></label>
|
41 |
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
|
|
44 |
<td style="text-align:center;">
|
45 |
+
<input type="submit" id="insert" name="insert" value="<?php _e("Insert", 'enjoyinstagram'); ?>"
|
46 |
+
onClick="insertenjoyinstagramshortcode();" />
|
47 |
</td>
|
48 |
<td style="text-align:center;">
|
49 |
+
<input type="button" id="cancel" name="cancel" value="<?php _e("Cancel", 'enjoyinstagram'); ?>"
|
50 |
+
onClick="tinyMCEPopup.close();" />
|
51 |
</td>
|
52 |
+
</tr>
|
53 |
</table>
|
54 |
</form>
|
55 |
</body>
|
56 |
+
</html>
|
includes/tinymce/tinymce.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class TinyMCE button handler
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // exit if call directly
|
8 |
+
}
|
9 |
+
|
10 |
+
final class tinymce_enjoyinstagram_button {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @var string
|
14 |
+
*/
|
15 |
+
public $pluginname = 'enjoyinstagram';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var int
|
19 |
+
*/
|
20 |
+
public $internalVersion = 200;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* the constructor
|
24 |
+
*
|
25 |
+
* @return void
|
26 |
+
*/
|
27 |
+
public function __construct() {
|
28 |
+
// Modify the version when tinyMCE plugins are changed.
|
29 |
+
add_filter( 'tiny_mce_version', array( $this, 'change_tinymce_version' ) );
|
30 |
+
// init process for button control
|
31 |
+
add_action( 'init', array( $this, 'addbuttons' ) );
|
32 |
+
// AJAX action
|
33 |
+
add_action( 'wp_ajax_enjoyinstagram_tinymce', array( $this, 'ajax_tinymce' ) );
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Add plugin button filters
|
38 |
+
*
|
39 |
+
* @return void
|
40 |
+
*/
|
41 |
+
public function addbuttons() {
|
42 |
+
// Don't bother doing this stuff if the current user lacks permissions
|
43 |
+
if( ! current_user_can('edit_posts') || ! current_user_can('edit_pages')
|
44 |
+
|| get_user_option( 'rich_editing' ) != 'true' ) {
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
|
48 |
+
add_filter( 'mce_external_plugins', array( $this, 'add_tinymce_plugin' ), 5 );
|
49 |
+
add_filter( 'mce_buttons', array( $this, 'register_button' ), 5 );
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Regiter the plugin button
|
54 |
+
*
|
55 |
+
* @param array $buttons
|
56 |
+
* @return array
|
57 |
+
*/
|
58 |
+
public function register_button( $buttons ) {
|
59 |
+
array_push( $buttons, 'separator', $this->pluginname );
|
60 |
+
return $buttons;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Add plugin
|
65 |
+
*
|
66 |
+
* @return $plugin_array
|
67 |
+
*/
|
68 |
+
public function add_tinymce_plugin($plugin_array) {
|
69 |
+
$plugin_array[$this->pluginname] = plugins_url( 'editor_plugin.js', __FILE__ );
|
70 |
+
return $plugin_array;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Force system to clear cache.
|
75 |
+
* A different version will rebuild the cache
|
76 |
+
*
|
77 |
+
* @param integer $version
|
78 |
+
* @return integer
|
79 |
+
*/
|
80 |
+
public function change_tinymce_version( $version ) {
|
81 |
+
$version = $version + $this->internalVersion;
|
82 |
+
return $version;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Call TinyMCE window content via admin-ajax
|
87 |
+
*
|
88 |
+
* @since 1.7.0
|
89 |
+
* @return void
|
90 |
+
*/
|
91 |
+
public function ajax_tinymce() {
|
92 |
+
if( ! current_user_can('edit_pages') || ! current_user_can('edit_posts') ) {
|
93 |
+
wp_die( __( 'You are not allowed to be here', 'enjoyinstagram' ) );
|
94 |
+
}
|
95 |
+
|
96 |
+
include_once( 'shortcode-tinymce-window.php');
|
97 |
+
die();
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
101 |
+
|
102 |
+
// Call it now
|
103 |
+
$tinymce_button = new tinymce_enjoyinstagram_button();
|
includes/widgets/widgets.php
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Slider_Widget
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
class Slider_Widget extends WP_Widget {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Slider_Widget constructor.
|
14 |
+
*
|
15 |
+
* @since 9.0.0
|
16 |
+
* @author Francesco Licandro
|
17 |
+
*/
|
18 |
+
public function __construct() {
|
19 |
+
parent::__construct(
|
20 |
+
'Slider_Widget', // Base ID
|
21 |
+
__('EnjoyInstagram - Carousel', 'enjoyinstagram'), // Name
|
22 |
+
array( 'description' => __( 'EnjoyInstagram Widget for Carousel View', 'enjoyinstagram' ), ) // Args
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Widget callback
|
28 |
+
*
|
29 |
+
* @param array $args
|
30 |
+
* @param array $instance
|
31 |
+
*/
|
32 |
+
public function widget( $args, $instance ) {
|
33 |
+
$title = apply_filters( 'widget_title', $instance['title'] );
|
34 |
+
$number_images_in_slide = apply_filters( 'widget_content', $instance['number_images_in_slide'] );
|
35 |
+
$navigation_y_n = apply_filters( 'widget_content', $instance['navigation_y_n'] );
|
36 |
+
$user_or_hashtag = apply_filters( 'widget_content', $instance['user_or_hashtag'] );
|
37 |
+
|
38 |
+
|
39 |
+
echo $args['before_widget'];
|
40 |
+
if ( ! empty( $title ) ){
|
41 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
42 |
+
}
|
43 |
+
echo do_shortcode('[enjoyinstagram_mb_widget n="'.$number_images_in_slide.'" id="'.$args['widget_id'].'" n_y_n="'.$navigation_y_n.'" u_or_h="'.$user_or_hashtag.'"]');
|
44 |
+
echo $args['after_widget'];
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Admin widget
|
49 |
+
*
|
50 |
+
* @param array $instance
|
51 |
+
* @return string|void
|
52 |
+
*/
|
53 |
+
public function form( $instance ) {
|
54 |
+
|
55 |
+
$title = isset( $instance['title'] ) ? $instance['title'] : __( 'EnjoyInstagram', 'enjoyinstagram' );
|
56 |
+
$instance = wp_parse_args( (array) $instance, array(
|
57 |
+
'number_images_in_slide' => '4',
|
58 |
+
'navigation_y_n' => 'false',
|
59 |
+
'user_or_hashtag' => 'user'
|
60 |
+
) );
|
61 |
+
?>
|
62 |
+
|
63 |
+
<p>
|
64 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _ex( 'Title:', 'option label', 'enjoyinstagram' ); ?></label>
|
65 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
|
66 |
+
</p>
|
67 |
+
<p>
|
68 |
+
<label for="<?php echo $this->get_field_id( 'number_images_in_slide' ); ?>">
|
69 |
+
<?php _ex( 'Images displayed at a time', 'option label', 'enjoyinstagram' ); ?>:
|
70 |
+
</label><br />
|
71 |
+
<select name="<?php echo $this->get_field_name( 'number_images_in_slide' ); ?>" id="<?php echo $this->get_field_id( 'number_images_in_slide' ); ?>">
|
72 |
+
<?php for ($i = 1; $i <= 10; $i++) : ?>
|
73 |
+
<option value="<?php echo $i ?>" <?php selected($i, $instance['number_images_in_slide']); ?>>
|
74 |
+
<?php echo " " . $i; ?>
|
75 |
+
</option>
|
76 |
+
<?php endfor; ?>
|
77 |
+
</select>
|
78 |
+
</p>
|
79 |
+
<p>
|
80 |
+
<label for="<?php echo $this->get_field_id( 'navigation_y_n' ); ?>">
|
81 |
+
<?php _ex( 'Navigation buttons', 'option label', 'enjoyinstagram' ); ?>:
|
82 |
+
</label><br />
|
83 |
+
<select name="<?php echo $this->get_field_name( 'navigation_y_n' ); ?>" id="<?php echo $this->get_field_id( 'navigation_y_n' ); ?>">
|
84 |
+
<option value="true" <?php selected( 'true', $instance['navigation_y_n'] ); ?>>
|
85 |
+
<?php _e( 'Yes', 'enjoyinstagram' ); ?>
|
86 |
+
</option>
|
87 |
+
<option value="false" <?php selected( 'false', $instance['navigation_y_n'] ); ?>>
|
88 |
+
<?php _e( 'No', 'enjoyinstagram' ); ?>
|
89 |
+
</option>
|
90 |
+
</select>
|
91 |
+
</p>
|
92 |
+
<p>
|
93 |
+
<?php _e( 'Show pics', 'enjoyinstagram' ); ?>: <br />
|
94 |
+
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag' ); ?>" <?php checked( 'user', $instance['user_or_hashtag'] ); ?> value="user">
|
95 |
+
<?php _e( 'of Your Profile', 'enjoyinstagram' ); ?><br>
|
96 |
+
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag' ); ?>" <?php checked( 'hashtag', $instance['user_or_hashtag'] ); ?> value="hashtag">
|
97 |
+
<?php _e( 'by Hashtag', 'enjoyinstagram' ); ?><br>
|
98 |
+
</p>
|
99 |
+
<?php
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Update widget options
|
104 |
+
*
|
105 |
+
* @param array $new_instance
|
106 |
+
* @param array $old_instance
|
107 |
+
* @return array
|
108 |
+
*/
|
109 |
+
public function update( $new_instance, $old_instance ) {
|
110 |
+
$instance = array();
|
111 |
+
$instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : '';
|
112 |
+
$instance['number_images_in_slide'] = ( ! empty( $new_instance['number_images_in_slide'] ) ) ? strip_tags( $new_instance['number_images_in_slide'] ) : '';
|
113 |
+
$instance['navigation_y_n'] = ( ! empty( $new_instance['navigation_y_n'] ) ) ? strip_tags( $new_instance['navigation_y_n'] ) : '';
|
114 |
+
$instance['user_or_hashtag'] = ( ! empty( $new_instance['user_or_hashtag'] ) ) ? strip_tags( $new_instance['user_or_hashtag'] ) : '';
|
115 |
+
|
116 |
+
return $instance;
|
117 |
+
}
|
118 |
+
|
119 |
+
}
|
120 |
+
|
121 |
+
function register_Slider_Widget() {
|
122 |
+
register_widget( 'Slider_Widget' );
|
123 |
+
}
|
124 |
+
add_action( 'widgets_init', 'register_Slider_Widget' );
|
includes/widgets/widgets_grid.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Grid_Widget
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
class Grid_Widget extends WP_Widget {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Grid_Widget constructor.
|
15 |
+
*
|
16 |
+
* @since 9.0.0
|
17 |
+
* @author Francesco Licandro
|
18 |
+
*/
|
19 |
+
public function __construct() {
|
20 |
+
parent::__construct(
|
21 |
+
'Grid_Widget', // Base ID
|
22 |
+
__('EnjoyInstagram - Grid', 'enjoyinstagram'), // Name
|
23 |
+
array( 'description' => __( 'EnjoyInstagram Widget for Grid View', 'enjoyinstagram' ), ) // Args
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Widget callback
|
29 |
+
*
|
30 |
+
* @param array $args
|
31 |
+
* @param array $instance
|
32 |
+
*/
|
33 |
+
public function widget( $args, $instance ) {
|
34 |
+
$title = apply_filters( 'widget_title', $instance['title'] );
|
35 |
+
$number_cols_in_grid = apply_filters( 'widget_content', $instance['number_cols_in_grid'] );
|
36 |
+
$number_rows_in_grid = apply_filters( 'widget_content', $instance['number_rows_in_grid'] );
|
37 |
+
$user_or_hashtag_in_grid = apply_filters( 'widget_content', $instance['user_or_hashtag_in_grid'] );
|
38 |
+
|
39 |
+
echo $args['before_widget'];
|
40 |
+
if ( ! empty( $title ) ) {
|
41 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
42 |
+
}
|
43 |
+
echo do_shortcode('[enjoyinstagram_mb_grid_widget id="'.$args['widget_id'].'" n_c="'.$number_cols_in_grid.'" n_r="'.$number_rows_in_grid.'" u_or_h="'.$user_or_hashtag_in_grid.'"]');
|
44 |
+
echo $args['after_widget'];
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Admin widget
|
49 |
+
*
|
50 |
+
* @param array $instance
|
51 |
+
* @return string|void
|
52 |
+
*/
|
53 |
+
public function form( $instance ) {
|
54 |
+
|
55 |
+
$title = isset( $instance['title'] ) ? $instance['title'] : __( 'EnjoyInstagram', 'enjoyinstagram' );
|
56 |
+
$instance = wp_parse_args( (array) $instance, array(
|
57 |
+
'number_cols_in_grid' => '4',
|
58 |
+
'number_rows_in_grid' => '2',
|
59 |
+
'user_or_hashtag_in_grid' => 'user'
|
60 |
+
) );
|
61 |
+
|
62 |
+
?>
|
63 |
+
<p>
|
64 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _ex( 'Title:', 'option label', 'enjoyinstagram' ); ?></label>
|
65 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
|
66 |
+
</p>
|
67 |
+
<p>
|
68 |
+
<label for="<?php echo $this->get_field_id( 'number_cols_in_grid' ); ?>">
|
69 |
+
<?php _ex( 'Number of Columns', 'option label', 'enjoyinstagram' ); ?>:
|
70 |
+
</label><br>
|
71 |
+
<select name="<?php echo $this->get_field_name( 'number_cols_in_grid' ); ?>" id="<?php echo $this->get_field_id( 'number_cols_in_grid' ); ?>">
|
72 |
+
<?php for ($i = 1; $i <= 10; $i++) : ?>
|
73 |
+
<option value="<?php echo $i ?>" <?php selected($i, $instance['number_cols_in_grid']); ?>>
|
74 |
+
<?php echo " " . $i; ?>
|
75 |
+
</option>
|
76 |
+
<?php endfor; ?>
|
77 |
+
</select>
|
78 |
+
</p>
|
79 |
+
<p>
|
80 |
+
<label for="<?php echo $this->get_field_id( 'number_rows_in_grid' ); ?>">
|
81 |
+
<?php _ex( 'Number of Rows', 'option label', 'enjoyinstagram' ); ?>:
|
82 |
+
</label><br>
|
83 |
+
<select name="<?php echo $this->get_field_name( 'number_rows_in_grid' ); ?>" id="<?php echo $this->get_field_id( 'number_rows_in_grid' ); ?>">
|
84 |
+
<?php for ($i = 1; $i <= 10; $i++) : ?>
|
85 |
+
<option value="<?php echo $i ?>" <?php selected($i, $instance['number_rows_in_grid']); ?>>
|
86 |
+
<?php echo " " . $i; ?>
|
87 |
+
</option>
|
88 |
+
<?php endfor; ?>
|
89 |
+
</select>
|
90 |
+
</p>
|
91 |
+
<p>
|
92 |
+
<?php _e( 'Show pics', 'enjoyinstagram' ); ?>: <br />
|
93 |
+
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag_in_grid' ); ?>" <?php checked( 'user', $instance['user_or_hashtag_in_grid'] ); ?> value="user">
|
94 |
+
<?php _e( 'of Your Profile', 'enjoyinstagram' ); ?><br>
|
95 |
+
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag_in_grid' ); ?>" <?php checked( 'hashtag', $instance['user_or_hashtag_in_grid'] ); ?> value="hashtag">
|
96 |
+
<?php _e( 'by Hashtag', 'enjoyinstagram' ); ?><br>
|
97 |
+
</p>
|
98 |
+
<?php
|
99 |
+
}
|
100 |
+
|
101 |
+
|
102 |
+
public function update( $new_instance, $old_instance ) {
|
103 |
+
$instance = array();
|
104 |
+
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
|
105 |
+
$instance['number_cols_in_grid'] = ( ! empty( $new_instance['number_cols_in_grid'] ) ) ? strip_tags( $new_instance['number_cols_in_grid'] ) : '';
|
106 |
+
$instance['number_rows_in_grid'] = ( ! empty( $new_instance['number_rows_in_grid'] ) ) ? strip_tags( $new_instance['number_rows_in_grid'] ) : '';
|
107 |
+
$instance['user_or_hashtag_in_grid'] = ( ! empty( $new_instance['user_or_hashtag_in_grid'] ) ) ? strip_tags( $new_instance['user_or_hashtag_in_grid'] ) : '';
|
108 |
+
|
109 |
+
return $instance;
|
110 |
+
}
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
function register_Grid_Widget() {
|
115 |
+
register_widget( 'Grid_Widget' );
|
116 |
+
}
|
117 |
+
add_action( 'widgets_init', 'register_Grid_Widget' );
|
index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
# Silence is golden.
|
js/jquery.gridrotator copia.js
DELETED
@@ -1,756 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* jquery.gridrotator.js v1.1.0
|
3 |
-
* http://www.codrops.com
|
4 |
-
*
|
5 |
-
* Licensed under the MIT license.
|
6 |
-
* http://www.opensource.org/licenses/mit-license.php
|
7 |
-
*
|
8 |
-
* Copyright 2012, Codrops
|
9 |
-
* http://www.codrops.com
|
10 |
-
*/
|
11 |
-
;( function( $, window, undefined ) {
|
12 |
-
|
13 |
-
'use strict';
|
14 |
-
|
15 |
-
/*
|
16 |
-
* debouncedresize: special jQuery event that happens once after a window resize
|
17 |
-
*
|
18 |
-
* latest version and complete README available on Github:
|
19 |
-
* https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js
|
20 |
-
*
|
21 |
-
* Copyright 2011 @louis_remi
|
22 |
-
* Licensed under the MIT license.
|
23 |
-
*/
|
24 |
-
var $event = $.event,
|
25 |
-
$special,
|
26 |
-
resizeTimeout;
|
27 |
-
|
28 |
-
$special = $event.special.debouncedresize = {
|
29 |
-
setup: function() {
|
30 |
-
$( this ).on( "resize", $special.handler );
|
31 |
-
},
|
32 |
-
teardown: function() {
|
33 |
-
$( this ).off( "resize", $special.handler );
|
34 |
-
},
|
35 |
-
handler: function( event, execAsap ) {
|
36 |
-
// Save the context
|
37 |
-
var context = this,
|
38 |
-
args = arguments,
|
39 |
-
dispatch = function() {
|
40 |
-
// set correct event type
|
41 |
-
event.type = "debouncedresize";
|
42 |
-
$event.dispatch.apply( context, args );
|
43 |
-
};
|
44 |
-
|
45 |
-
if ( resizeTimeout ) {
|
46 |
-
clearTimeout( resizeTimeout );
|
47 |
-
}
|
48 |
-
|
49 |
-
execAsap ?
|
50 |
-
dispatch() :
|
51 |
-
resizeTimeout = setTimeout( dispatch, $special.threshold );
|
52 |
-
},
|
53 |
-
threshold: 100
|
54 |
-
};
|
55 |
-
|
56 |
-
// http://www.hardcode.nl/subcategory_1/article_317-array-shuffle-function
|
57 |
-
Array.prototype.shuffle = function() {
|
58 |
-
var i=this.length,p,t;
|
59 |
-
while (i--) {
|
60 |
-
p = Math.floor(Math.random()*i);
|
61 |
-
t = this[i];
|
62 |
-
this[i]=this[p];
|
63 |
-
this[p]=t;
|
64 |
-
}
|
65 |
-
return this;
|
66 |
-
};
|
67 |
-
|
68 |
-
// HTML5 PageVisibility API
|
69 |
-
// http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
|
70 |
-
// by Joe Marini (@joemarini)
|
71 |
-
function getHiddenProp(){
|
72 |
-
var prefixes = ['webkit','moz','ms','o'];
|
73 |
-
|
74 |
-
// if 'hidden' is natively supported just return it
|
75 |
-
if ('hidden' in document) return 'hidden';
|
76 |
-
|
77 |
-
// otherwise loop over all the known prefixes until we find one
|
78 |
-
for (var i = 0; i < prefixes.length; i++){
|
79 |
-
if ((prefixes[i] + 'Hidden') in document)
|
80 |
-
return prefixes[i] + 'Hidden';
|
81 |
-
}
|
82 |
-
|
83 |
-
// otherwise it's not supported
|
84 |
-
return null;
|
85 |
-
}
|
86 |
-
function isHidden() {
|
87 |
-
var prop = getHiddenProp();
|
88 |
-
if (!prop) return false;
|
89 |
-
|
90 |
-
return document[prop];
|
91 |
-
}
|
92 |
-
|
93 |
-
function isEmpty( obj ) {
|
94 |
-
return Object.keys(obj).length === 0;
|
95 |
-
}
|
96 |
-
|
97 |
-
// global
|
98 |
-
var $window = $( window ),
|
99 |
-
Modernizr = window.Modernizr;
|
100 |
-
|
101 |
-
$.GridRotator = function( options, element ) {
|
102 |
-
|
103 |
-
this.$el = $( element );
|
104 |
-
if( Modernizr.backgroundsize ) {
|
105 |
-
|
106 |
-
var self = this;
|
107 |
-
this.$el.addClass( 'ri-grid-loading' );
|
108 |
-
this._init( options );
|
109 |
-
|
110 |
-
}
|
111 |
-
|
112 |
-
};
|
113 |
-
|
114 |
-
// the options
|
115 |
-
$.GridRotator.defaults = {
|
116 |
-
// number of rows
|
117 |
-
rows : 4,
|
118 |
-
// number of columns
|
119 |
-
columns : 10,
|
120 |
-
w1024 : { rows : 3, columns : 8 },
|
121 |
-
w768 : {rows : 3,columns : 7 },
|
122 |
-
w480 : {rows : 3,columns : 5 },
|
123 |
-
w320 : {rows : 2,columns : 4 },
|
124 |
-
w240 : {rows : 2,columns : 3 },
|
125 |
-
// step: number of items that are replaced at the same time
|
126 |
-
// random || [some number]
|
127 |
-
// note: for performance issues, the number "can't" be > options.maxStep
|
128 |
-
step : 'random',
|
129 |
-
// change it as you wish..
|
130 |
-
maxStep : 3,
|
131 |
-
// prevent user to click the items
|
132 |
-
preventClick : true,
|
133 |
-
// animation type
|
134 |
-
// showHide || fadeInOut ||
|
135 |
-
// slideLeft || slideRight || slideTop || slideBottom ||
|
136 |
-
// rotateBottom || rotateLeft || rotateRight || rotateTop ||
|
137 |
-
// scale ||
|
138 |
-
// rotate3d ||
|
139 |
-
// rotateLeftScale || rotateRightScale || rotateTopScale || rotateBottomScale ||
|
140 |
-
// random
|
141 |
-
animType : 'random',
|
142 |
-
// animation speed
|
143 |
-
animSpeed : 800,
|
144 |
-
// animation easings
|
145 |
-
animEasingOut : 'linear',
|
146 |
-
animEasingIn: 'linear',
|
147 |
-
// the item(s) will be replaced every 3 seconds
|
148 |
-
// note: for performance issues, the time "can't" be < 300 ms
|
149 |
-
interval : 3000,
|
150 |
-
// if false the animations will not start
|
151 |
-
// use false if onhover is true for example
|
152 |
-
slideshow : true,
|
153 |
-
// if true the items will switch when hovered
|
154 |
-
onhover : false,
|
155 |
-
// ids of elements that shouldn't change
|
156 |
-
nochange : []
|
157 |
-
};
|
158 |
-
|
159 |
-
$.GridRotator.prototype = {
|
160 |
-
|
161 |
-
_init : function( options ) {
|
162 |
-
|
163 |
-
// options
|
164 |
-
this.options = $.extend( true, {}, $.GridRotator.defaults, options );
|
165 |
-
// cache some elements + variables
|
166 |
-
this._config();
|
167 |
-
|
168 |
-
},
|
169 |
-
_config : function() {
|
170 |
-
|
171 |
-
var self = this,
|
172 |
-
transEndEventNames = {
|
173 |
-
'WebkitTransition' : 'webkitTransitionEnd',
|
174 |
-
'MozTransition' : 'transitionend',
|
175 |
-
'OTransition' : 'oTransitionEnd',
|
176 |
-
'msTransition' : 'MSTransitionEnd',
|
177 |
-
'transition' : 'transitionend'
|
178 |
-
};
|
179 |
-
|
180 |
-
// support CSS transitions and 3d transforms
|
181 |
-
this.supportTransitions = Modernizr.csstransitions;
|
182 |
-
this.supportTransforms3D = Modernizr.csstransforms3d;
|
183 |
-
|
184 |
-
this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.gridrotator';
|
185 |
-
|
186 |
-
// all animation types for the random option
|
187 |
-
this.animTypes = this.supportTransforms3D ? [
|
188 |
-
'fadeInOut',
|
189 |
-
'slideLeft',
|
190 |
-
'slideRight',
|
191 |
-
'slideTop',
|
192 |
-
'slideBottom',
|
193 |
-
'rotateLeft',
|
194 |
-
'rotateRight',
|
195 |
-
'rotateTop',
|
196 |
-
'rotateBottom',
|
197 |
-
'scale',
|
198 |
-
'rotate3d',
|
199 |
-
'rotateLeftScale',
|
200 |
-
'rotateRightScale',
|
201 |
-
'rotateTopScale',
|
202 |
-
'rotateBottomScale' ] :
|
203 |
-
[ 'fadeInOut', 'slideLeft', 'slideRight', 'slideTop', 'slideBottom' ];
|
204 |
-
|
205 |
-
this.animType = this.options.animType;
|
206 |
-
|
207 |
-
if( this.animType !== 'random' && !this.supportTransforms3D && $.inArray( this.animType, this.animTypes ) === -1 && this.animType !== 'showHide' ) {
|
208 |
-
|
209 |
-
// fallback to 'fadeInOut' if user sets a type which is not supported
|
210 |
-
this.animType = 'fadeInOut';
|
211 |
-
|
212 |
-
}
|
213 |
-
|
214 |
-
this.animTypesTotal = this.animTypes.length;
|
215 |
-
|
216 |
-
// the <ul> where the items are placed
|
217 |
-
this.$list = this.$el.children( 'ul' );
|
218 |
-
// remove images and add background-image to anchors
|
219 |
-
// preload the images before
|
220 |
-
var loaded = 0,
|
221 |
-
$imgs = this.$list.find( 'img' ),
|
222 |
-
count = $imgs.length;
|
223 |
-
|
224 |
-
$imgs.each( function() {
|
225 |
-
|
226 |
-
var $img = $( this ), src = $img.attr( 'src' );
|
227 |
-
|
228 |
-
$( '<img/>' ).load( function() {
|
229 |
-
|
230 |
-
++loaded;
|
231 |
-
$img.parent().css( 'background-image', 'url(' + src + ')' );
|
232 |
-
|
233 |
-
if( loaded === count ) {
|
234 |
-
|
235 |
-
$imgs.remove();
|
236 |
-
self.$el.removeClass( 'ri-grid-loading' );
|
237 |
-
// the items
|
238 |
-
self.$items = self.$list.children( 'li' );
|
239 |
-
// make a copy of the items
|
240 |
-
self.$itemsCache = self.$items.clone();
|
241 |
-
// total number of items
|
242 |
-
self.itemsTotal = self.$items.length;
|
243 |
-
// the items that will be out of the grid
|
244 |
-
// actually the item's child (anchor element)
|
245 |
-
self.outItems= [];
|
246 |
-
self._layout( function() {
|
247 |
-
self._initEvents();
|
248 |
-
} );
|
249 |
-
// replace [options.step] items after [options.interval] time
|
250 |
-
// the items that go out are randomly chosen, while the ones that get in
|
251 |
-
// follow a "First In First Out" logic
|
252 |
-
self._start();
|
253 |
-
|
254 |
-
}
|
255 |
-
|
256 |
-
} ).attr( 'src', src )
|
257 |
-
|
258 |
-
} );
|
259 |
-
|
260 |
-
},
|
261 |
-
_layout : function( callback ) {
|
262 |
-
|
263 |
-
var self = this;
|
264 |
-
|
265 |
-
// sets the grid dimentions based on the container's width
|
266 |
-
this._setGridDim();
|
267 |
-
|
268 |
-
// reset
|
269 |
-
this.$list.empty();
|
270 |
-
this.$items = this.$itemsCache.clone().appendTo( this.$list );
|
271 |
-
|
272 |
-
var $outItems = this.$items.filter( ':gt(' + ( this.showTotal - 1 ) + ')' ),
|
273 |
-
$outAItems = $outItems.children( 'a' );
|
274 |
-
|
275 |
-
this.outItems.length = 0;
|
276 |
-
|
277 |
-
$outAItems.each( function( i ) {
|
278 |
-
self.outItems.push( $( this ) );
|
279 |
-
} );
|
280 |
-
|
281 |
-
$outItems.remove();
|
282 |
-
|
283 |
-
// container's width
|
284 |
-
var containerWidth = ( document.defaultView ) ? parseInt( document.defaultView.getComputedStyle( this.$el.get( 0 ), null ).width ) : this.$el.width(),
|
285 |
-
// item's width
|
286 |
-
itemWidth = Math.floor( containerWidth / this.columns ),
|
287 |
-
// calculate gap
|
288 |
-
gapWidth = containerWidth - ( this.columns * Math.floor( itemWidth ) );
|
289 |
-
|
290 |
-
for( var i = 0; i < this.rows; ++i ) {
|
291 |
-
|
292 |
-
for( var j = 0; j < this.columns; ++j ) {
|
293 |
-
|
294 |
-
var idx = this.columns * i + j,
|
295 |
-
$item = this.$items.eq( idx );
|
296 |
-
|
297 |
-
$item.css( {
|
298 |
-
width : j < Math.floor( gapWidth ) ? itemWidth + 1 : itemWidth,
|
299 |
-
height : itemWidth
|
300 |
-
} );
|
301 |
-
|
302 |
-
if( $.inArray( idx, this.options.nochange ) !== -1 ) {
|
303 |
-
$item.addClass( 'ri-nochange' ).data( 'nochange', true );
|
304 |
-
}
|
305 |
-
|
306 |
-
}
|
307 |
-
|
308 |
-
}
|
309 |
-
|
310 |
-
if( this.options.preventClick ) {
|
311 |
-
|
312 |
-
this.$items.children().css( 'cursor', 'default' ).on( 'click.gridrotator', false );
|
313 |
-
|
314 |
-
}
|
315 |
-
|
316 |
-
if( callback ) {
|
317 |
-
callback.call();
|
318 |
-
}
|
319 |
-
|
320 |
-
},
|
321 |
-
// set the grid rows and columns
|
322 |
-
_setGridDim : function() {
|
323 |
-
|
324 |
-
// container's width
|
325 |
-
var c_w = this.$el.width();
|
326 |
-
|
327 |
-
// we will choose the number of rows/columns according to the container's width and the values set in the plugin options
|
328 |
-
switch( true ) {
|
329 |
-
case ( c_w < 240 ) : this.rows = this.options.w240.rows; this.columns = this.options.w240.columns; break;
|
330 |
-
case ( c_w < 320 ) : this.rows = this.options.w320.rows; this.columns = this.options.w320.columns; break;
|
331 |
-
case ( c_w < 480 ) : this.rows = this.options.w480.rows; this.columns = this.options.w480.columns; break;
|
332 |
-
case ( c_w < 768 ) : this.rows = this.options.w768.rows; this.columns = this.options.w768.columns; break;
|
333 |
-
case ( c_w < 1024 ) : this.rows = this.options.w1024.rows; this.columns = this.options.w1024.columns; break;
|
334 |
-
default : this.rows = this.options.rows; this.columns = this.options.columns; break;
|
335 |
-
}
|
336 |
-
|
337 |
-
this.showTotal = this.rows * this.columns;
|
338 |
-
|
339 |
-
},
|
340 |
-
// init window resize event
|
341 |
-
_initEvents : function() {
|
342 |
-
|
343 |
-
var self = this;
|
344 |
-
|
345 |
-
$window.on( 'debouncedresize.gridrotator', function() {
|
346 |
-
self._layout();
|
347 |
-
} );
|
348 |
-
|
349 |
-
// use the property name to generate the prefixed event name
|
350 |
-
var visProp = getHiddenProp();
|
351 |
-
|
352 |
-
// HTML5 PageVisibility API
|
353 |
-
// http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
|
354 |
-
// by Joe Marini (@joemarini)
|
355 |
-
if (visProp) {
|
356 |
-
|
357 |
-
var evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange';
|
358 |
-
document.addEventListener(evtname, function() { self._visChange(); } );
|
359 |
-
|
360 |
-
}
|
361 |
-
|
362 |
-
if( !Modernizr.touch && this.options.onhover ) {
|
363 |
-
|
364 |
-
self.$items.on( 'mouseenter.gridrotator', function() {
|
365 |
-
|
366 |
-
var $item = $( this );
|
367 |
-
if( !$item.data( 'active' ) && !$item.data( 'hovered' ) && !$item.data( 'nochange' ) ) {
|
368 |
-
$item.data( 'hovered', true );
|
369 |
-
self._replace( $item );
|
370 |
-
}
|
371 |
-
|
372 |
-
} ).on( 'mouseleave.gridrotator', function() {
|
373 |
-
|
374 |
-
$( this ).data( 'hovered', false );
|
375 |
-
|
376 |
-
} );
|
377 |
-
|
378 |
-
}
|
379 |
-
|
380 |
-
},
|
381 |
-
_visChange : function() {
|
382 |
-
|
383 |
-
isHidden() ? clearTimeout( this.playtimeout ) : this._start();
|
384 |
-
|
385 |
-
},
|
386 |
-
// start rotating elements
|
387 |
-
_start : function() {
|
388 |
-
|
389 |
-
if( this.showTotal < this.itemsTotal && this.options.slideshow ) {
|
390 |
-
this._showNext();
|
391 |
-
}
|
392 |
-
|
393 |
-
},
|
394 |
-
// get which type of animation
|
395 |
-
_getAnimType : function() {
|
396 |
-
|
397 |
-
return this.animType === 'random' ? this.animTypes[ Math.floor( Math.random() * this.animTypesTotal ) ] : this.animType;
|
398 |
-
|
399 |
-
},
|
400 |
-
// get css properties for the transition effect
|
401 |
-
_getAnimProperties : function( $out ) {
|
402 |
-
|
403 |
-
var startInProp = {}, startOutProp = {}, endInProp = {}, endOutProp = {},
|
404 |
-
animType = this._getAnimType(), speed, delay = 0;
|
405 |
-
|
406 |
-
switch( animType ) {
|
407 |
-
|
408 |
-
case 'showHide' :
|
409 |
-
|
410 |
-
speed = 0;
|
411 |
-
endOutProp.opacity = 0;
|
412 |
-
break;
|
413 |
-
|
414 |
-
case 'fadeInOut' :
|
415 |
-
|
416 |
-
endOutProp.opacity = 0;
|
417 |
-
break;
|
418 |
-
|
419 |
-
case 'slideLeft' :
|
420 |
-
|
421 |
-
startInProp.left = $out.width();
|
422 |
-
endInProp.left = 0;
|
423 |
-
endOutProp.left = -$out.width();
|
424 |
-
break;
|
425 |
-
|
426 |
-
case 'slideRight' :
|
427 |
-
|
428 |
-
startInProp.left = -$out.width();
|
429 |
-
endInProp.left = 0;
|
430 |
-
endOutProp.left = $out.width();
|
431 |
-
break;
|
432 |
-
|
433 |
-
case 'slideTop' :
|
434 |
-
|
435 |
-
startInProp.top = $out.height();
|
436 |
-
endInProp.top = 0;
|
437 |
-
endOutProp.top = -$out.height();
|
438 |
-
break;
|
439 |
-
|
440 |
-
case 'slideBottom' :
|
441 |
-
|
442 |
-
startInProp.top = -$out.height();
|
443 |
-
endInProp.top = 0;
|
444 |
-
endOutProp.top = $out.height();
|
445 |
-
break;
|
446 |
-
|
447 |
-
case 'rotateLeft' :
|
448 |
-
|
449 |
-
speed = this.options.animSpeed / 2;
|
450 |
-
startInProp.transform = 'rotateY(90deg)';
|
451 |
-
endInProp.transform = 'rotateY(0deg)';
|
452 |
-
delay = speed;
|
453 |
-
endOutProp.transform = 'rotateY(-90deg)';
|
454 |
-
break;
|
455 |
-
|
456 |
-
case 'rotateRight' :
|
457 |
-
|
458 |
-
speed = this.options.animSpeed / 2;
|
459 |
-
startInProp.transform = 'rotateY(-90deg)';
|
460 |
-
endInProp.transform = 'rotateY(0deg)';
|
461 |
-
delay = speed;
|
462 |
-
endOutProp.transform = 'rotateY(90deg)';
|
463 |
-
break;
|
464 |
-
|
465 |
-
case 'rotateTop' :
|
466 |
-
|
467 |
-
speed = this.options.animSpeed / 2;
|
468 |
-
startInProp.transform= 'rotateX(90deg)';
|
469 |
-
endInProp.transform = 'rotateX(0deg)';
|
470 |
-
delay = speed;
|
471 |
-
endOutProp.transform = 'rotateX(-90deg)';
|
472 |
-
break;
|
473 |
-
|
474 |
-
case 'rotateBottom' :
|
475 |
-
|
476 |
-
speed = this.options.animSpeed / 2;
|
477 |
-
startInProp.transform = 'rotateX(-90deg)';
|
478 |
-
endInProp.transform = 'rotateX(0deg)';
|
479 |
-
delay = speed;
|
480 |
-
endOutProp.transform = 'rotateX(90deg)';
|
481 |
-
break;
|
482 |
-
|
483 |
-
case 'scale' :
|
484 |
-
|
485 |
-
speed = this.options.animSpeed / 2;
|
486 |
-
startInProp.transform = 'scale(0)';
|
487 |
-
startOutProp.transform = 'scale(1)';
|
488 |
-
endInProp.transform = 'scale(1)';
|
489 |
-
delay = speed;
|
490 |
-
endOutProp.transform = 'scale(0)';
|
491 |
-
break;
|
492 |
-
|
493 |
-
case 'rotateLeftScale' :
|
494 |
-
|
495 |
-
startOutProp.transform = 'scale(1)';
|
496 |
-
speed = this.options.animSpeed / 2;
|
497 |
-
startInProp.transform = 'scale(0.3) rotateY(90deg)';
|
498 |
-
endInProp.transform = 'scale(1) rotateY(0deg)';
|
499 |
-
delay = speed;
|
500 |
-
endOutProp.transform = 'scale(0.3) rotateY(-90deg)';
|
501 |
-
break;
|
502 |
-
|
503 |
-
case 'rotateRightScale' :
|
504 |
-
|
505 |
-
startOutProp.transform = 'scale(1)';
|
506 |
-
speed = this.options.animSpeed / 2;
|
507 |
-
startInProp.transform = 'scale(0.3) rotateY(-90deg)';
|
508 |
-
endInProp.transform = 'scale(1) rotateY(0deg)';
|
509 |
-
delay = speed;
|
510 |
-
endOutProp.transform = 'scale(0.3) rotateY(90deg)';
|
511 |
-
break;
|
512 |
-
|
513 |
-
case 'rotateTopScale' :
|
514 |
-
|
515 |
-
startOutProp.transform = 'scale(1)';
|
516 |
-
speed = this.options.animSpeed / 2;
|
517 |
-
startInProp.transform = 'scale(0.3) rotateX(90deg)';
|
518 |
-
endInProp.transform = 'scale(1) rotateX(0deg)';
|
519 |
-
delay = speed;
|
520 |
-
endOutProp.transform = 'scale(0.3) rotateX(-90deg)';
|
521 |
-
break;
|
522 |
-
|
523 |
-
case 'rotateBottomScale' :
|
524 |
-
|
525 |
-
startOutProp.transform = 'scale(1)';
|
526 |
-
speed = this.options.animSpeed / 2;
|
527 |
-
startInProp.transform = 'scale(0.3) rotateX(-90deg)';
|
528 |
-
endInProp.transform = 'scale(1) rotateX(0deg)';
|
529 |
-
delay = speed;
|
530 |
-
endOutProp.transform = 'scale(0.3) rotateX(90deg)';
|
531 |
-
break;
|
532 |
-
|
533 |
-
case 'rotate3d' :
|
534 |
-
|
535 |
-
speed = this.options.animSpeed / 2;
|
536 |
-
startInProp.transform = 'rotate3d( 1, 1, 0, 90deg )';
|
537 |
-
endInProp.transform = 'rotate3d( 1, 1, 0, 0deg )';
|
538 |
-
delay = speed;
|
539 |
-
endOutProp.transform = 'rotate3d( 1, 1, 0, -90deg )';
|
540 |
-
break;
|
541 |
-
|
542 |
-
}
|
543 |
-
|
544 |
-
return {
|
545 |
-
startInProp : startInProp,
|
546 |
-
startOutProp : startOutProp,
|
547 |
-
endInProp : endInProp,
|
548 |
-
endOutProp : endOutProp,
|
549 |
-
delay : delay,
|
550 |
-
animSpeed : speed != undefined ? speed : this.options.animSpeed
|
551 |
-
};
|
552 |
-
|
553 |
-
},
|
554 |
-
// show next [option.step] elements
|
555 |
-
_showNext : function( time ) {
|
556 |
-
|
557 |
-
var self = this;
|
558 |
-
|
559 |
-
clearTimeout( this.playtimeout );
|
560 |
-
|
561 |
-
this.playtimeout = setTimeout( function() {
|
562 |
-
|
563 |
-
var step = self.options.step, max= self.options.maxStep, min = 1;
|
564 |
-
|
565 |
-
if( max > self.showTotal ) {
|
566 |
-
max = self.showTotal;
|
567 |
-
}
|
568 |
-
|
569 |
-
// number of items to swith at this point of time
|
570 |
-
var nmbOut = step === 'random' ? Math.floor( Math.random() * max + min ) : Math.min( Math.abs( step ) , max ) ,
|
571 |
-
// array with random indexes. These will be the indexes of the items we will replace
|
572 |
-
randArr = self._getRandom( nmbOut, self.showTotal );
|
573 |
-
|
574 |
-
for( var i = 0; i < nmbOut; ++i ) {
|
575 |
-
|
576 |
-
// element to go out
|
577 |
-
var $out = self.$items.eq( randArr[ i ] );
|
578 |
-
|
579 |
-
// if element is active, which means it is currently animating,
|
580 |
-
// then we need to get different positions..
|
581 |
-
if( $out.data( 'active' ) || $out.data( 'nochange' ) ) {
|
582 |
-
|
583 |
-
// one of the items is active, call again..
|
584 |
-
self._showNext( 1 );
|
585 |
-
return false;
|
586 |
-
|
587 |
-
}
|
588 |
-
|
589 |
-
self._replace( $out );
|
590 |
-
|
591 |
-
}
|
592 |
-
|
593 |
-
// again and again..
|
594 |
-
self._showNext();
|
595 |
-
|
596 |
-
}, time || Math.max( Math.abs( this.options.interval ) , 300 ) );
|
597 |
-
|
598 |
-
},
|
599 |
-
_replace : function( $out ) {
|
600 |
-
|
601 |
-
$out.data( 'active', true );
|
602 |
-
|
603 |
-
var self = this,
|
604 |
-
$outA = $out.children( 'a:last' ),
|
605 |
-
newElProp = {
|
606 |
-
width : $outA.width(),
|
607 |
-
height : $outA.height()
|
608 |
-
};
|
609 |
-
|
610 |
-
// element stays active
|
611 |
-
$out.data( 'active', true );
|
612 |
-
|
613 |
-
// get the element (anchor) that will go in (first one inserted in this.outItems)
|
614 |
-
var $inA = this.outItems.shift();
|
615 |
-
|
616 |
-
// save element that went out
|
617 |
-
this.outItems.push( $outA.clone().css( 'transition', 'none' ) );
|
618 |
-
|
619 |
-
// prepend in element
|
620 |
-
$inA.css( newElProp ).prependTo( $out );
|
621 |
-
|
622 |
-
var animProp = this._getAnimProperties( $outA );
|
623 |
-
|
624 |
-
$inA.css( animProp.startInProp );
|
625 |
-
$outA.css( animProp.startOutProp );
|
626 |
-
|
627 |
-
this._setTransition( $inA, 'all', animProp.animSpeed, animProp.delay, this.options.animEasingIn );
|
628 |
-
this._setTransition( $outA, 'all', animProp.animSpeed, 0, this.options.animEasingOut );
|
629 |
-
|
630 |
-
this._applyTransition( $inA, animProp.endInProp, animProp.animSpeed, function() {
|
631 |
-
|
632 |
-
var $el = $( this ),
|
633 |
-
t = animProp.animSpeed === self.options.animSpeed && isEmpty( animProp.endInProp ) ? animProp.animSpeed : 0;
|
634 |
-
|
635 |
-
setTimeout( function() {
|
636 |
-
|
637 |
-
if( self.supportTransitions ) {
|
638 |
-
$el.off( self.transEndEventName );
|
639 |
-
}
|
640 |
-
|
641 |
-
$el.next().remove();
|
642 |
-
$el.parent().data( 'active', false );
|
643 |
-
|
644 |
-
}, t );
|
645 |
-
|
646 |
-
}, animProp.animSpeed === 0 || isEmpty( animProp.endInProp ) );
|
647 |
-
this._applyTransition( $outA, animProp.endOutProp, animProp.animSpeed );
|
648 |
-
|
649 |
-
},
|
650 |
-
_getRandom : function( cnt, limit ) {
|
651 |
-
|
652 |
-
var randArray = [];
|
653 |
-
|
654 |
-
for( var i = 0; i < limit; ++i ) {
|
655 |
-
randArray.push( i )
|
656 |
-
}
|
657 |
-
|
658 |
-
return randArray.shuffle().slice( 0, cnt );
|
659 |
-
|
660 |
-
},
|
661 |
-
_setTransition : function( el, prop, speed, delay, easing ) {
|
662 |
-
|
663 |
-
setTimeout( function() {
|
664 |
-
el.css( 'transition', prop + ' ' + speed + 'ms ' + delay + 'ms ' + easing );
|
665 |
-
}, 25 );
|
666 |
-
|
667 |
-
},
|
668 |
-
_applyTransition : function( el, styleCSS, speed, fncomplete, force ) {
|
669 |
-
|
670 |
-
var self = this;
|
671 |
-
setTimeout( function() {
|
672 |
-
$.fn.applyStyle = self.supportTransitions ? $.fn.css : $.fn.animate;
|
673 |
-
|
674 |
-
if( fncomplete && self.supportTransitions ) {
|
675 |
-
|
676 |
-
el.on( self.transEndEventName, fncomplete );
|
677 |
-
|
678 |
-
if( force ) {
|
679 |
-
fncomplete.call( el );
|
680 |
-
}
|
681 |
-
|
682 |
-
}
|
683 |
-
|
684 |
-
fncomplete = fncomplete || function() { return false; };
|
685 |
-
|
686 |
-
el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms', complete : fncomplete } ) );
|
687 |
-
}, 25 );
|
688 |
-
|
689 |
-
}
|
690 |
-
|
691 |
-
};
|
692 |
-
|
693 |
-
var logError = function( message ) {
|
694 |
-
|
695 |
-
if ( window.console ) {
|
696 |
-
|
697 |
-
window.console.error( message );
|
698 |
-
|
699 |
-
}
|
700 |
-
|
701 |
-
};
|
702 |
-
|
703 |
-
$.fn.gridrotator = function( options ) {
|
704 |
-
|
705 |
-
var instance = $.data( this, 'gridrotator' );
|
706 |
-
|
707 |
-
if ( typeof options === 'string' ) {
|
708 |
-
|
709 |
-
var args = Array.prototype.slice.call( arguments, 1 );
|
710 |
-
|
711 |
-
this.each(function() {
|
712 |
-
|
713 |
-
if ( !instance ) {
|
714 |
-
|
715 |
-
logError( "cannot call methods on gridrotator prior to initialization; " +
|
716 |
-
"attempted to call method '" + options + "'" );
|
717 |
-
return;
|
718 |
-
|
719 |
-
}
|
720 |
-
|
721 |
-
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
722 |
-
|
723 |
-
logError( "no such method '" + options + "' for gridrotator instance" );
|
724 |
-
return;
|
725 |
-
|
726 |
-
}
|
727 |
-
|
728 |
-
instance[ options ].apply( instance, args );
|
729 |
-
|
730 |
-
});
|
731 |
-
|
732 |
-
}
|
733 |
-
else {
|
734 |
-
|
735 |
-
this.each(function() {
|
736 |
-
|
737 |
-
if ( instance ) {
|
738 |
-
|
739 |
-
instance._init();
|
740 |
-
|
741 |
-
}
|
742 |
-
else {
|
743 |
-
|
744 |
-
instance = $.data( this, 'gridrotator', new $.GridRotator( options, this ) );
|
745 |
-
|
746 |
-
}
|
747 |
-
|
748 |
-
});
|
749 |
-
|
750 |
-
}
|
751 |
-
|
752 |
-
return instance;
|
753 |
-
|
754 |
-
};
|
755 |
-
|
756 |
-
} )( jQuery, window );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/shortcode_button.js
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
add_action( 'init', 'wptuts_buttons' );
|
4 |
-
function wptuts_buttons() {
|
5 |
-
add_filter( "mce_external_plugins", "wptuts_add_buttons" );
|
6 |
-
add_filter( 'mce_buttons', 'wptuts_register_buttons' );
|
7 |
-
}
|
8 |
-
function wptuts_add_buttons( $plugin_array ) {
|
9 |
-
$plugin_array['wptuts'] = get_template_directory_uri() . '/wptuts-editor-buttons/wptuts-plugin.js';
|
10 |
-
return $plugin_array;
|
11 |
-
}
|
12 |
-
function wptuts_register_buttons( $buttons ) {
|
13 |
-
array_push( $buttons, 'dropcap', 'showrecent' ); // dropcap', 'recentposts
|
14 |
-
return $buttons;
|
15 |
-
}
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
add_shortcode( 'recent-posts', 'wptuts_recent_posts' );
|
20 |
-
function wptuts_recent_posts( $atts ) {
|
21 |
-
extract( shortcode_atts( array(
|
22 |
-
'numbers' => '5',
|
23 |
-
), $atts ) );
|
24 |
-
$rposts = new WP_Query( array( 'posts_per_page' => $numbers, 'orderby' => 'date' ) );
|
25 |
-
if ( $rposts->have_posts() ) {
|
26 |
-
$html = '<h3>Recent Posts</h3><ul class="recent-posts">';
|
27 |
-
while( $rposts->have_posts() ) {
|
28 |
-
$rposts->the_post();
|
29 |
-
$html .= sprintf(
|
30 |
-
'<li><a href="%s" title="%s">%s</a></li>',
|
31 |
-
get_permalink($rposts->post->ID),
|
32 |
-
get_the_title(),
|
33 |
-
get_the_title()
|
34 |
-
);
|
35 |
-
}
|
36 |
-
$html .= '</ul>';
|
37 |
-
}
|
38 |
-
wp_reset_query();
|
39 |
-
return $html;
|
40 |
-
}
|
41 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/enjoyinstagram.pot
ADDED
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#, fuzzy
|
2 |
+
msgid ""
|
3 |
+
msgstr ""
|
4 |
+
"Project-Id-Version: Enjoy Instagram Premium\n"
|
5 |
+
"POT-Creation-Date: 2018-05-11 18:28+0200\n"
|
6 |
+
"PO-Revision-Date: 2015-06-23 09:32+0100\n"
|
7 |
+
"Last-Translator: \n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"Language: en\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 2.0.7\n"
|
14 |
+
"X-Poedit-Basepath: ..\n"
|
15 |
+
"Plural-Forms: nplurals=2; plural=n!=1;\n"
|
16 |
+
"X-Poedit-KeywordsList: _e;_n:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
|
17 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;__\n"
|
18 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
19 |
+
"X-Poedit-SearchPath-0: .\n"
|
20 |
+
|
21 |
+
#: includes/class.enjoyinstagram-admin.php:77
|
22 |
+
msgid "Profile"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: includes/class.enjoyinstagram-admin.php:78
|
26 |
+
#: includes/class.enjoyinstagram-admin.php:147
|
27 |
+
msgid "Settings"
|
28 |
+
msgstr ""
|
29 |
+
|
30 |
+
#: includes/class.enjoyinstagram-admin.php:132
|
31 |
+
#: includes/class.enjoyinstagram-admin.php:133
|
32 |
+
msgid "Enjoy Plugin for Instagram"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: includes/class.enjoyinstagram-admin.php:148
|
36 |
+
msgid "Widgets"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: includes/class.enjoyinstagram-admin.php:149
|
40 |
+
msgid "Premium Version"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: includes/tinymce/shortcode-tinymce-window.php:19
|
44 |
+
#: includes/widgets/widgets.php:55 includes/widgets/widgets_grid.php:55
|
45 |
+
msgid "EnjoyInstagram"
|
46 |
+
msgstr ""
|
47 |
+
|
48 |
+
#: includes/tinymce/shortcode-tinymce-window.php:32
|
49 |
+
msgid "Insert Enjoy Plugin for Instagram Shortcode"
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#: includes/tinymce/shortcode-tinymce-window.php:37
|
53 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:187
|
54 |
+
#: templates/admin/enjoyinstagram-general-settings.php:42
|
55 |
+
msgid "Carousel View"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: includes/tinymce/shortcode-tinymce-window.php:40
|
59 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:188
|
60 |
+
#: templates/admin/enjoyinstagram-general-settings.php:43
|
61 |
+
msgid "Grid View"
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
+
#: includes/tinymce/shortcode-tinymce-window.php:45
|
65 |
+
msgid "Insert"
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
#: includes/tinymce/shortcode-tinymce-window.php:49
|
69 |
+
msgid "Cancel"
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: includes/tinymce/tinymce.php:93
|
73 |
+
msgid "You are not allowed to be here"
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: includes/widgets/widgets.php:21
|
77 |
+
msgid "EnjoyInstagram - Carousel"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: includes/widgets/widgets.php:22
|
81 |
+
msgid "EnjoyInstagram Widget for Carousel View"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: includes/widgets/widgets.php:64 includes/widgets/widgets_grid.php:64
|
85 |
+
msgctxt "option label"
|
86 |
+
msgid "Title:"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: includes/widgets/widgets.php:69
|
90 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:87
|
91 |
+
msgctxt "option label"
|
92 |
+
msgid "Images displayed at a time"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: includes/widgets/widgets.php:81
|
96 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:104
|
97 |
+
msgctxt "option label"
|
98 |
+
msgid "Navigation buttons"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: includes/widgets/widgets.php:85
|
102 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:111
|
103 |
+
msgid "Yes"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: includes/widgets/widgets.php:88
|
107 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:114
|
108 |
+
msgid "No"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
+
#: includes/widgets/widgets.php:93 includes/widgets/widgets_grid.php:92
|
112 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:40
|
113 |
+
msgid "Show pics"
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#: includes/widgets/widgets.php:95 includes/widgets/widgets_grid.php:94
|
117 |
+
msgid "of Your Profile"
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#: includes/widgets/widgets.php:97 includes/widgets/widgets_grid.php:96
|
121 |
+
msgid "by Hashtag"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: includes/widgets/widgets_grid.php:22
|
125 |
+
msgid "EnjoyInstagram - Grid"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: includes/widgets/widgets_grid.php:23
|
129 |
+
msgid "EnjoyInstagram Widget for Grid View"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: includes/widgets/widgets_grid.php:69
|
133 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:137
|
134 |
+
msgctxt "option label"
|
135 |
+
msgid "Number of Columns"
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
#: includes/widgets/widgets_grid.php:81
|
139 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:154
|
140 |
+
msgctxt "option label"
|
141 |
+
msgid "Number of Rows"
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:34
|
145 |
+
msgid "Inclusion mode"
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:46
|
149 |
+
msgctxt "option label"
|
150 |
+
msgid "of Your Profile"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:50
|
154 |
+
msgctxt "option label"
|
155 |
+
msgid "by Hashtag"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:64
|
159 |
+
msgctxt "option description"
|
160 |
+
msgid "insert a hashtag without '#'"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:80
|
164 |
+
msgid "Carousel settings"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:130
|
168 |
+
msgid "Grid view settings"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:173
|
172 |
+
msgid "<strong>Free version</strong>: Only 20 images allowed."
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:177
|
176 |
+
msgid "Save Settings"
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: templates/admin/enjoyinstagram-advanced-settings.php:186
|
180 |
+
#: templates/admin/enjoyinstagram-general-settings.php:41
|
181 |
+
msgid "Shortocodes to use"
|
182 |
+
msgstr ""
|
183 |
+
|
184 |
+
#: templates/admin/enjoyinstagram-general-settings.php:14
|
185 |
+
msgid "Your Instagram Profile"
|
186 |
+
msgstr ""
|
187 |
+
|
188 |
+
#: templates/admin/enjoyinstagram-general-settings.php:22
|
189 |
+
msgid "Unlink Profile"
|
190 |
+
msgstr ""
|
191 |
+
|
192 |
+
#: templates/admin/enjoyinstagram-general-settings.php:30
|
193 |
+
#, php-format
|
194 |
+
msgid "Customize the plugin with our <a href=\"%s\">settings</a> tab."
|
195 |
+
msgstr ""
|
196 |
+
|
197 |
+
#: templates/admin/enjoyinstagram-general-settings.php:49
|
198 |
+
#, php-format
|
199 |
+
msgid ""
|
200 |
+
"Thank you for you choice! <strong>Enjoy Plugin for Instagram - Responsive "
|
201 |
+
"gallery</strong> is a plugin lovingly developed for you by <a href=\"%s\" "
|
202 |
+
"target=\"_blank\"> Mediabeta</a>."
|
203 |
+
msgstr ""
|
204 |
+
|
205 |
+
#: templates/admin/enjoyinstagram-general-settings.php:52
|
206 |
+
#, php-format
|
207 |
+
msgid ""
|
208 |
+
"By using this plugin, you are agreeing to the <a href=\"%s\" target="
|
209 |
+
"\"_blank\">Instagram API Terms of Use</a>."
|
210 |
+
msgstr ""
|
211 |
+
|
212 |
+
#: templates/admin/enjoyinstagram-general-settings.php:60
|
213 |
+
msgid "Connect your Account"
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
#: templates/admin/settings.php:40
|
217 |
+
msgid "Buy me a coffee!"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: templates/admin/settings.php:41
|
221 |
+
msgid ""
|
222 |
+
"If you liked our work please consider to make a kind donation through "
|
223 |
+
"Paypal."
|
224 |
+
msgstr ""
|
225 |
+
|
226 |
+
#: templates/admin/settings.php:56
|
227 |
+
#, php-format
|
228 |
+
msgid ""
|
229 |
+
"Discover interesting OFFERS and UPDATES for <a href=\"%s\"> Premium "
|
230 |
+
"Version</a> !"
|
231 |
+
msgstr ""
|
232 |
+
|
233 |
+
#: templates/admin/settings.php:60
|
234 |
+
#, php-format
|
235 |
+
msgid ""
|
236 |
+
"Visit Now <a href=\"%s\">ENJOY INSTAGRAM PREMIUM</a> to verify if a Coupon-"
|
237 |
+
"Code is ready for you!"
|
238 |
+
msgstr ""
|
library/autenticazione.php
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
<p style="font-size:14px;">Thank you for you choice! <strong>Enjoy Plugin for Instagram - Responsive gallery</strong> is a plugin lovingly developed for you by <a href="http://www.mediabeta.com" target="_blank"> Mediabeta</a>.</p>
|
2 |
-
|
3 |
-
<p style="font-size:14px;">By using this plugin, you are agreeing to the <a href="http://instagram.com/about/legal/terms/api/" target="_blank">Instagram API Terms of Use</a>.</p>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
<script>
|
8 |
-
(function($) {
|
9 |
-
$(document).ready(function() {
|
10 |
-
var allPanels = $('.enjoy_accordion > dd').hide();
|
11 |
-
|
12 |
-
$('.enjoy_accordion > dt > a').click(function() {
|
13 |
-
allPanels.slideUp();
|
14 |
-
if (!$(this).parent().hasClass('enjoyinstagram_active')){
|
15 |
-
$('.enjoy_accordion > dd').removeClass('enjoyinstagram_active');
|
16 |
-
$(this).parent().next().slideDown();
|
17 |
-
$(this).parent().addClass('enjoyinstagram_active');
|
18 |
-
|
19 |
-
|
20 |
-
}else{
|
21 |
-
$(this).parent().removeClass('enjoyinstagram_active');
|
22 |
-
}
|
23 |
-
return false;
|
24 |
-
});
|
25 |
-
});
|
26 |
-
})(jQuery);
|
27 |
-
</script>
|
28 |
-
<style>
|
29 |
-
.enjoy_accordion dt{
|
30 |
-
background:rgba(204,204,204,0.5);
|
31 |
-
font-size:1.1rem;
|
32 |
-
padding-top:1rem;
|
33 |
-
padding-bottom:1rem;
|
34 |
-
margin-bottom:1px;
|
35 |
-
}
|
36 |
-
.enjoy_accordion dt a{
|
37 |
-
text-decoration:none; padding:1rem;
|
38 |
-
}
|
39 |
-
.step_number
|
40 |
-
{width: 2rem;
|
41 |
-
height: 2rem;
|
42 |
-
border-radius: 1rem;
|
43 |
-
|
44 |
-
color: #fff;
|
45 |
-
line-height: 2rem;
|
46 |
-
text-align: center;
|
47 |
-
background: #0074a2;
|
48 |
-
display:inline-block;
|
49 |
-
}
|
50 |
-
.enjoy_accordion {
|
51 |
-
margin: 50px;
|
52 |
-
dt, dd {
|
53 |
-
padding: 10px;
|
54 |
-
border: 1px solid black;
|
55 |
-
border-bottom: 0;
|
56 |
-
&:last-of-type {
|
57 |
-
border-bottom: 1px solid black;
|
58 |
-
}
|
59 |
-
a {
|
60 |
-
display: block;
|
61 |
-
color: black;
|
62 |
-
font-weight: bold;
|
63 |
-
}
|
64 |
-
}
|
65 |
-
dd {
|
66 |
-
border-top: 0;
|
67 |
-
font-size: 12px;
|
68 |
-
&:last-of-type {
|
69 |
-
border-top: 1px solid white;
|
70 |
-
position: relative;
|
71 |
-
top: -1px;
|
72 |
-
}
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
.enjoy_open {content: "\f347";}
|
77 |
-
.enjoy_close {content: "\f343";}
|
78 |
-
.button_accordion {display:inline-block; float:right; margin-right:1rem;}
|
79 |
-
|
80 |
-
|
81 |
-
</style>
|
82 |
-
|
83 |
-
|
84 |
-
<form method="post" action="options.php">
|
85 |
-
<?php settings_fields('enjoyinstagram_options_group_auth'); ?>
|
86 |
-
|
87 |
-
<p>
|
88 |
-
<input type="button" class="button-primary" id="button_autorizza_instagram" name="button_autorizza_instagram" value="Connect your Account" />
|
89 |
-
</p>
|
90 |
-
|
91 |
-
</form>
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/enjoyinstagram_shortcode.php
DELETED
@@ -1,101 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Add Shortcode
|
3 |
-
function enjoyinstagram_mb_shortcode($atts) {
|
4 |
-
$shortcode_content = '';
|
5 |
-
STATIC $i = 1;
|
6 |
-
|
7 |
-
|
8 |
-
if(get_option('enjoyinstagram_client_id')!==null || get_option('enjoyinstagram_client_id') != '') {
|
9 |
-
extract( shortcode_atts( array(
|
10 |
-
'n' => '4',
|
11 |
-
), $atts ) );
|
12 |
-
?>
|
13 |
-
<script>
|
14 |
-
jQuery(function(){
|
15 |
-
jQuery(document.body)
|
16 |
-
.on('click touchend','#swipebox-slider .current img', function(e){
|
17 |
-
jQuery('#swipebox-next').click();
|
18 |
-
return false;
|
19 |
-
})
|
20 |
-
.on('click touchend','#swipebox-slider .current', function(e){
|
21 |
-
jQuery('#swipebox-close').trigger('click');
|
22 |
-
});
|
23 |
-
});
|
24 |
-
</script>
|
25 |
-
<script type="text/javascript">
|
26 |
-
jQuery(function($) {
|
27 |
-
$(".swipebox").swipebox({
|
28 |
-
hideBarsDelay : 0
|
29 |
-
});
|
30 |
-
|
31 |
-
});
|
32 |
-
jQuery(document).ready(function() {
|
33 |
-
jQuery("#owl-<?php echo $i; ?>").owlCarousel({
|
34 |
-
lazyLoad : true,
|
35 |
-
items : <?php echo get_option('enjoyinstagram_carousel_items_number'); ?>,
|
36 |
-
itemsDesktop : [1199,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
|
37 |
-
itemsDesktopSmall : [980,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
|
38 |
-
itemsTablet: [768,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
|
39 |
-
itemsMobile : [479,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
|
40 |
-
stopOnHover: true,
|
41 |
-
navigation: <?php echo get_option('enjoyinstagram_carousel_navigation'); ?>
|
42 |
-
|
43 |
-
});
|
44 |
-
jQuery("#owl-<?php echo $i; ?>").fadeIn();
|
45 |
-
});
|
46 |
-
</script>
|
47 |
-
<?php
|
48 |
-
|
49 |
-
if(get_option('enjoyinstagram_user_or_hashtag')=='hashtag'){
|
50 |
-
$result = get_hash(urlencode(get_option('enjoyinstagram_hashtag')),20);
|
51 |
-
$result = $result['data'];
|
52 |
-
}else{
|
53 |
-
$result = get_user(urlencode(get_option('enjoyinstagram_user_username')),20);
|
54 |
-
$result = $result['data'];
|
55 |
-
}
|
56 |
-
$pre_shortcode_content = "<div id=\"owl-".$i."\" class=\"owl-example\" style=\"display:none;\">";
|
57 |
-
|
58 |
-
|
59 |
-
if (isHttps()&& !is_null($result)) {
|
60 |
-
foreach ($result as $entry) {
|
61 |
-
$entry['images']['thumbnail']['url'] = str_replace('http://', 'https://', $entry['images']['thumbnail']['url']);
|
62 |
-
$entry['images']['standard_resolution']['url'] = str_replace('http://', 'https://', $entry['images']['standard_resolution']['url']);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
if(!is_null($result)){
|
69 |
-
foreach ($result as $entry) {
|
70 |
-
if(!empty($entry['caption'])) {
|
71 |
-
$caption = $entry['caption']['text'];
|
72 |
-
}else{
|
73 |
-
$caption = '';
|
74 |
-
}
|
75 |
-
$square_thumbnail = str_replace('s150x150/', 's320x320/', $entry['images']['thumbnail']['url']);
|
76 |
-
if(get_option('enjoyinstagram_carousel_items_number')!='1'){
|
77 |
-
$shortcode_content .= "<div class=\"box\"><a title=\"{$caption}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry['images']['standard_resolution']['url']}\"><img src=\"{$square_thumbnail}\"></a></div>";
|
78 |
-
}else{
|
79 |
-
$shortcode_content .= "<div class=\"box\"><a title=\"{$caption}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry['images']['standard_resolution']['url']}\"><img style=\"width:100%;\" src=\"{$square_thumbnail}\"></a></div>";
|
80 |
-
}
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
$post_shortcode_content = "</div>";
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
}
|
89 |
-
$i++;
|
90 |
-
|
91 |
-
$shortcode_content = $pre_shortcode_content.$shortcode_content.$post_shortcode_content;
|
92 |
-
|
93 |
-
return $shortcode_content;
|
94 |
-
|
95 |
-
}
|
96 |
-
add_shortcode( 'enjoyinstagram_mb', 'enjoyinstagram_mb_shortcode' );
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/enjoyinstagram_shortcode_grid.php
DELETED
@@ -1,106 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Add Shortcode
|
3 |
-
function enjoyinstagram_mb_shortcode_grid() {
|
4 |
-
$shortcode_content = '';
|
5 |
-
STATIC $i = 1;
|
6 |
-
if(get_option('enjoyinstagram_client_id')!==null || get_option('enjoyinstagram_client_id') != '') {
|
7 |
-
|
8 |
-
|
9 |
-
if(get_option('enjoyinstagram_user_or_hashtag')=='hashtag'){
|
10 |
-
$result = get_hash(urlencode(get_option('enjoyinstagram_hashtag')),20);
|
11 |
-
$result = $result['data'];
|
12 |
-
}else{
|
13 |
-
$result = get_user(urlencode(get_option('enjoyinstagram_user_username')),20);
|
14 |
-
$result = $result['data'];
|
15 |
-
}
|
16 |
-
|
17 |
-
$pre_shortcode_content = "<div id=\"grid-".$i."\" class=\"ri-grid ri-grid-size-2 ri-shadow\" style=\"display:none;\"><ul>";
|
18 |
-
|
19 |
-
|
20 |
-
if (isHttps() && !is_null($result)) {
|
21 |
-
foreach ($result as $entry) {
|
22 |
-
$entry['images']['thumbnail']['url'] = str_replace('http://', 'https://', $entry['images']['thumbnail']['url']);
|
23 |
-
$entry['images']['standard_resolution']['url'] = str_replace('http://', 'https://', $entry['images']['standard_resolution']['url']);
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
if(!is_null($result)){
|
28 |
-
foreach ($result as $entry) {
|
29 |
-
if(!empty($entry['caption'])) {
|
30 |
-
$caption = $entry['caption']['text'];
|
31 |
-
}else{
|
32 |
-
$caption = '';
|
33 |
-
}
|
34 |
-
$square_thumbnail = str_replace('s150x150/', 's320x320/', $entry['images']['thumbnail']['url']);
|
35 |
-
$shortcode_content .= "<li><a title=\"{$caption}\" class=\"swipebox_grid\" href=\"{$entry['images']['standard_resolution']['url']}\"><img src=\"{$square_thumbnail}\"></a></li>";
|
36 |
-
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
$post_shortcode_content = "</ul></div>";
|
41 |
-
|
42 |
-
?>
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
<script type="text/javascript">
|
47 |
-
|
48 |
-
jQuery(function() {
|
49 |
-
jQuery('#grid-<?php echo $i; ?>').gridrotator({
|
50 |
-
rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
|
51 |
-
columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>,
|
52 |
-
animType : 'fadeInOut',
|
53 |
-
onhover : false,
|
54 |
-
interval : 7000,
|
55 |
-
preventClick : false,
|
56 |
-
w1400 : {
|
57 |
-
rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
|
58 |
-
columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
|
59 |
-
},
|
60 |
-
w1024 : {
|
61 |
-
rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
|
62 |
-
columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
|
63 |
-
},
|
64 |
-
|
65 |
-
w768 : {
|
66 |
-
rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
|
67 |
-
columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
|
68 |
-
},
|
69 |
-
|
70 |
-
w480 : {
|
71 |
-
rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
|
72 |
-
columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
|
73 |
-
},
|
74 |
-
|
75 |
-
w320 : {
|
76 |
-
rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
|
77 |
-
columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
|
78 |
-
},
|
79 |
-
|
80 |
-
w240 : {
|
81 |
-
rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
|
82 |
-
columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
|
83 |
-
}
|
84 |
-
});
|
85 |
-
|
86 |
-
jQuery('#grid-<?php echo $i; ?>').fadeIn('1000');
|
87 |
-
|
88 |
-
|
89 |
-
});
|
90 |
-
|
91 |
-
</script>
|
92 |
-
<?php
|
93 |
-
|
94 |
-
}
|
95 |
-
$i++;
|
96 |
-
|
97 |
-
$shortcode_content = $pre_shortcode_content.$shortcode_content.$post_shortcode_content;
|
98 |
-
|
99 |
-
return $shortcode_content;
|
100 |
-
}
|
101 |
-
|
102 |
-
add_shortcode( 'enjoyinstagram_mb_grid', 'enjoyinstagram_mb_shortcode_grid' );
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/enjoyinstagram_shortcode_grid_widget.php
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Add Shortcode
|
3 |
-
function enjoyinstagram_mb_shortcode_grid_widget($atts) {
|
4 |
-
if(get_option('enjoyinstagram_client_id') || get_option('enjoyinstagram_client_id') != '') {
|
5 |
-
extract( shortcode_atts( array(
|
6 |
-
'id' => 'rigrid_default',
|
7 |
-
'n_c' => '6',
|
8 |
-
'n_r' => '2',
|
9 |
-
'u_or_h' => 'user'
|
10 |
-
), $atts ) );
|
11 |
-
|
12 |
-
if("{$u_or_h}"=='hashtag'){
|
13 |
-
$result = get_hash(urlencode(get_option('enjoyinstagram_hashtag')),20);
|
14 |
-
$result = $result['data'];
|
15 |
-
}else{
|
16 |
-
$result = get_user(urlencode(get_option('enjoyinstagram_user_username')),20);
|
17 |
-
$result = $result['data'];
|
18 |
-
}
|
19 |
-
?>
|
20 |
-
|
21 |
-
<?php
|
22 |
-
|
23 |
-
if (isHttps() && !is_null($result)) {
|
24 |
-
foreach ($result as $entry) {
|
25 |
-
$entry['images']['thumbnail']['url'] = str_replace('http://', 'https://', $entry->images->thumbnail->url);
|
26 |
-
$entry['images']['standard_resolution']['url'] = str_replace('http://', 'https://', $entry['images']['standard_resolution']['url']);
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
?>
|
31 |
-
|
32 |
-
|
33 |
-
<div id="rigrid-<?php echo "{$id}"; ?>" class="ri-grid ri-grid-size-2 ri-shadow" style="display:none">
|
34 |
-
<ul>
|
35 |
-
<?php
|
36 |
-
|
37 |
-
if(!is_null($result)){
|
38 |
-
foreach ($result as $entry) {
|
39 |
-
if(!empty($entry['caption'])) {
|
40 |
-
$caption = $entry['caption']['text'];
|
41 |
-
}else{
|
42 |
-
$caption = '';
|
43 |
-
}
|
44 |
-
if(!empty($entry['images'])) {
|
45 |
-
$image = $entry['images']['standard_resolution']['url'];
|
46 |
-
}else{
|
47 |
-
$image = '';
|
48 |
-
}
|
49 |
-
|
50 |
-
echo "<li><a title=\"{$caption}\" class=\"swipebox_grid\" href=\"{$image}\"><img src=\"{$image}\"></a></li>";
|
51 |
-
|
52 |
-
}
|
53 |
-
}
|
54 |
-
?>
|
55 |
-
</ul></div>
|
56 |
-
|
57 |
-
<script type="text/javascript">
|
58 |
-
|
59 |
-
|
60 |
-
jQuery(function() {
|
61 |
-
|
62 |
-
jQuery('#rigrid-<?php echo "{$id}"; ?>').gridrotator({
|
63 |
-
rows : <?php echo "{$n_r}"; ?>,
|
64 |
-
columns : <?php echo "{$n_c}"; ?>,
|
65 |
-
animType : 'fadeInOut',
|
66 |
-
onhover : false,
|
67 |
-
interval : 7000,
|
68 |
-
preventClick : false,
|
69 |
-
w1024 : {
|
70 |
-
rows : <?php echo "{$n_r}"; ?>,
|
71 |
-
columns : <?php echo "{$n_c}"; ?>
|
72 |
-
},
|
73 |
-
|
74 |
-
w768 : {
|
75 |
-
rows : <?php echo "{$n_r}"; ?>,
|
76 |
-
columns : <?php echo "{$n_c}"; ?>
|
77 |
-
},
|
78 |
-
|
79 |
-
w480 : {
|
80 |
-
rows : <?php echo "{$n_r}"; ?>,
|
81 |
-
columns : <?php echo "{$n_c}"; ?>
|
82 |
-
},
|
83 |
-
|
84 |
-
w320 : {
|
85 |
-
rows : <?php echo "{$n_r}"; ?>,
|
86 |
-
columns : <?php echo "{$n_c}"; ?>
|
87 |
-
},
|
88 |
-
|
89 |
-
w240 : {
|
90 |
-
rows : <?php echo "{$n_r}"; ?>,
|
91 |
-
columns : <?php echo "{$n_c}"; ?>
|
92 |
-
}
|
93 |
-
});
|
94 |
-
jQuery('#rigrid-<?php echo "{$id}"; ?>').fadeIn('slow');
|
95 |
-
});
|
96 |
-
|
97 |
-
|
98 |
-
</script>
|
99 |
-
<?php
|
100 |
-
|
101 |
-
}
|
102 |
-
?>
|
103 |
-
|
104 |
-
|
105 |
-
<?php
|
106 |
-
}
|
107 |
-
|
108 |
-
add_shortcode( 'enjoyinstagram_mb_grid_widget', 'enjoyinstagram_mb_shortcode_grid_widget' );
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/enjoyinstagram_shortcode_widget.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Add Shortcode
|
3 |
-
function enjoyinstagram_mb_shortcode_widget($atts) {
|
4 |
-
if(get_option('enjoyinstagram_client_id') || get_option('enjoyinstagram_client_id') != '') {
|
5 |
-
extract(shortcode_atts(array(
|
6 |
-
'n' => '4',
|
7 |
-
'id' => 'owl',
|
8 |
-
'n_y_n' => 'false',
|
9 |
-
'u_or_h' => 'user'
|
10 |
-
), $atts));
|
11 |
-
?>
|
12 |
-
<script>
|
13 |
-
jQuery(function () {
|
14 |
-
jQuery(document.body)
|
15 |
-
.on('click touchend', '#swipebox-slider .current img', function (e) {
|
16 |
-
jQuery('#swipebox-next').click();
|
17 |
-
return false;
|
18 |
-
})
|
19 |
-
.on('click touchend', '#swipebox-slider .current', function (e) {
|
20 |
-
jQuery('#swipebox-close').trigger('click');
|
21 |
-
});
|
22 |
-
});
|
23 |
-
</script>
|
24 |
-
<script type="text/javascript">
|
25 |
-
jQuery(function ($) {
|
26 |
-
$(".swipebox").swipebox({
|
27 |
-
hideBarsDelay: 0
|
28 |
-
});
|
29 |
-
|
30 |
-
});
|
31 |
-
jQuery(document).ready(function () {
|
32 |
-
jQuery("#owl-<?php echo "{$id}"; ?>").owlCarousel({
|
33 |
-
items: <?php echo "{$n}"; ?>,
|
34 |
-
navigation: <?php echo "{$n_y_n}"; ?>,
|
35 |
-
});
|
36 |
-
jQuery("#owl-<?php echo "{$id}"; ?>").fadeIn('slow');
|
37 |
-
});
|
38 |
-
</script>
|
39 |
-
<?php
|
40 |
-
if ("{$u_or_h}" == 'hashtag') {
|
41 |
-
$result = get_hash(urlencode(get_option('enjoyinstagram_hashtag')),20);
|
42 |
-
$result = $result['data'];
|
43 |
-
} else {
|
44 |
-
$result = get_user(urlencode(get_option('enjoyinstagram_user_username')),20);
|
45 |
-
$result = $result['data'];
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
if (isHttps() && !is_null($result)){
|
50 |
-
foreach ($result as $entry) {
|
51 |
-
$entry['images']['thumbnail']['url'] = str_replace('http://', 'https://', $entry['images']['thumbnail']['url']);
|
52 |
-
$entry['images']['standard_resolution']['url'] = str_replace('http://', 'https://', $entry['images']['standard_resolution']['url']);
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
?>
|
57 |
-
<div id="owl-<?php echo "{$id}"; ?>" class="owl-example">
|
58 |
-
<?php
|
59 |
-
if(!is_null($result)){
|
60 |
-
foreach ($result as $entry) {
|
61 |
-
if(!empty($entry['caption'])) {
|
62 |
-
$caption = $entry['caption']['text'];
|
63 |
-
}else{
|
64 |
-
$caption = '';
|
65 |
-
}
|
66 |
-
if(get_option('enjoyinstagram_carousel_items_number')!='1'){
|
67 |
-
echo "<div class=\"box\"><a title=\"{$caption}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry['images']['standard_resolution']['url']}\"><img src=\"{$entry['images']['thumbnail']['url']}\"></a></div>";
|
68 |
-
}else{
|
69 |
-
echo "<div class=\"box\"><a title=\"{$caption}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry['images']['standard_resolution']['url']}\"><img style=\"width:100%;\" src=\"{$entry['images']['standard_resolution']['url']}\"></a></div>";
|
70 |
-
}
|
71 |
-
}
|
72 |
-
}
|
73 |
-
?>
|
74 |
-
</div>
|
75 |
-
<?php
|
76 |
-
|
77 |
-
}
|
78 |
-
}
|
79 |
-
add_shortcode( 'enjoyinstagram_mb_widget', 'enjoyinstagram_mb_shortcode_widget' );
|
80 |
-
|
81 |
-
|
82 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/impostazioni_shortcode.php
DELETED
@@ -1,169 +0,0 @@
|
|
1 |
-
<form method="post" action="options.php" novalidate>
|
2 |
-
<?php settings_fields('enjoyinstagram_options_carousel_group'); ?>
|
3 |
-
<?php echo realpath(home_url()); ?>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
<script type="text/javascript">
|
8 |
-
jQuery(document).ready(function($){
|
9 |
-
$("input[name$='enjoyinstagram_user_or_hashtag']").click(function() {
|
10 |
-
var test = $(this).val();
|
11 |
-
if(test=='user'){
|
12 |
-
$('#enjoyinstagram_hashtag').attr('disabled',true);
|
13 |
-
}else if(test=='hashtag'){
|
14 |
-
$('#enjoyinstagram_hashtag').attr('disabled',false);
|
15 |
-
}
|
16 |
-
$("div.desc").hide();
|
17 |
-
$("#enjoyinstagram_user_or_hashtag_" + test).show();
|
18 |
-
});});
|
19 |
-
</script>
|
20 |
-
|
21 |
-
<table class="form-table">
|
22 |
-
<tbody>
|
23 |
-
|
24 |
-
<tr valign="top">
|
25 |
-
<th scope="row" style="align:left;">
|
26 |
-
<label for="enjoyinstagram_user_or_hashtag" class="enfasi">Inclusion mode:</label>
|
27 |
-
</th>
|
28 |
-
<td><div class="ei_block">
|
29 |
-
<div class="ei_settings_float_block">
|
30 |
-
Show pics:
|
31 |
-
</div>
|
32 |
-
<div class="ei_settings_float_block">
|
33 |
-
<input type="radio" name="enjoyinstagram_user_or_hashtag" <?php if (get_option('enjoyinstagram_user_or_hashtag')=='user') echo "checked";?> value="user">of Your Profile<br/><br/>
|
34 |
-
<input type="radio" name="enjoyinstagram_user_or_hashtag" <?php if (get_option('enjoyinstagram_user_or_hashtag')=='hashtag') echo "checked";?> value="hashtag">by Hashtag<br />
|
35 |
-
</div>
|
36 |
-
<div class="ei_settings_float_block">
|
37 |
-
|
38 |
-
<div id="enjoyinstagram_user_or_hashtag_user" class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag')!='user') echo 'style="display:none;"';?> >
|
39 |
-
<input type="text" class="ei_disabled" id="enjoyinstagram_user" disabled value="<?php echo get_option('enjoyinstagram_user_username'); ?>" name="enjoyinstagram_user" />
|
40 |
-
</div>
|
41 |
-
|
42 |
-
<div id="enjoyinstagram_user_or_hashtag_hashtag" class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag')!='hashtag') echo 'style="display:none;"';?>>
|
43 |
-
#<input type="text" id="enjoyinstagram_hashtag" required value="<?php echo get_option('enjoyinstagram_hashtag'); ?>" name="enjoyinstagram_hashtag" />
|
44 |
-
<span class="description">insert a hashtag without '#'</span>
|
45 |
-
|
46 |
-
</div>
|
47 |
-
</div> </div>
|
48 |
-
</td>
|
49 |
-
|
50 |
-
</tr>
|
51 |
-
</tbody>
|
52 |
-
</table>
|
53 |
-
|
54 |
-
<hr />
|
55 |
-
|
56 |
-
<table class="form-table">
|
57 |
-
<tbody>
|
58 |
-
<tr valign="top">
|
59 |
-
<th scope="row" style="align:left;">
|
60 |
-
<label for="enjoyinstagram_carousel_items_numbe" class="enfasi">Carousel settings:</label>
|
61 |
-
</th>
|
62 |
-
|
63 |
-
<td><div class="ei_block">
|
64 |
-
<div class="ei_settings_float_block ei_fixed">
|
65 |
-
Images displayed at a time:
|
66 |
-
</div>
|
67 |
-
<div class="ei_settings_float_block">
|
68 |
-
<select name="enjoyinstagram_carousel_items_number" class="ei_sel" id="enjoyinstagram_carousel_items_number">
|
69 |
-
<?php for ($i = 1; $i <= 10; $i++) { ?>
|
70 |
-
<option value="<?php echo $i?>" <?php if (get_option('enjoyinstagram_carousel_items_number')==$i)
|
71 |
-
echo "selected='selected'";?>>
|
72 |
-
<?php echo " ".$i; ?>
|
73 |
-
</option>
|
74 |
-
|
75 |
-
<?php } ?>
|
76 |
-
</select>
|
77 |
-
</div>
|
78 |
-
</div>
|
79 |
-
<div class="ei_block">
|
80 |
-
<div class="ei_settings_float_block ei_fixed">
|
81 |
-
Navigation buttons:
|
82 |
-
</div>
|
83 |
-
<div class="ei_settings_float_block">
|
84 |
-
<select name="enjoyinstagram_carousel_navigation" class="ei_sel" id="enjoyinstagram_carousel_navigation">
|
85 |
-
<option value="true" <?php if (get_option('enjoyinstagram_carousel_navigation')=='true') echo "selected='selected'";?>>Yes
|
86 |
-
</option>
|
87 |
-
<option value="false" <?php if (get_option('enjoyinstagram_carousel_navigation')=='false') echo "selected='selected'";?>>No
|
88 |
-
</option>
|
89 |
-
</select>
|
90 |
-
</div>
|
91 |
-
</div>
|
92 |
-
</td>
|
93 |
-
</tr>
|
94 |
-
</tbody>
|
95 |
-
</table>
|
96 |
-
|
97 |
-
<hr />
|
98 |
-
|
99 |
-
<!-- SHORTCODE WALL GRID -->
|
100 |
-
|
101 |
-
<table class="form-table">
|
102 |
-
<tbody>
|
103 |
-
<tr valign="top">
|
104 |
-
<th scope="row" style="align:left;">
|
105 |
-
<label for="enjoyinstagram_carousel_grid" class="enfasi">Grid view settings:</label>
|
106 |
-
</th>
|
107 |
-
|
108 |
-
<td><div class="ei_block">
|
109 |
-
<div class="ei_settings_float_block ei_fixed">
|
110 |
-
Number of Columns:
|
111 |
-
</div>
|
112 |
-
<div class="ei_settings_float_block">
|
113 |
-
<select name="enjoyinstagram_grid_cols" id="enjoyinstagram_grid_cols" class="ei_sel">
|
114 |
-
|
115 |
-
|
116 |
-
<?php for ($i = 1; $i <= 10; $i++) { ?>
|
117 |
-
<option value="<?php echo $i?>" <?php if (get_option('enjoyinstagram_grid_cols')==$i)
|
118 |
-
echo "selected='selected'";?>>
|
119 |
-
<?php echo " ".$i; ?>
|
120 |
-
</option>
|
121 |
-
|
122 |
-
<?php } ?>
|
123 |
-
</select>
|
124 |
-
</div>
|
125 |
-
</div>
|
126 |
-
|
127 |
-
<div class="ei_block">
|
128 |
-
<div class="ei_settings_float_block ei_fixed">
|
129 |
-
Number of Rows:
|
130 |
-
</div>
|
131 |
-
<div class="ei_settings_float_block">
|
132 |
-
<select name="enjoyinstagram_grid_rows" id="enjoyinstagram_grid_rows" class="ei_sel">
|
133 |
-
|
134 |
-
|
135 |
-
<?php for ($i = 1; $i <= 10; $i++) { ?>
|
136 |
-
<option value="<?php echo $i?>" <?php if (get_option('enjoyinstagram_grid_rows')==$i)
|
137 |
-
echo "selected='selected'";?>>
|
138 |
-
<?php echo " ".$i; ?>
|
139 |
-
</option>
|
140 |
-
|
141 |
-
<?php } ?>
|
142 |
-
</select>
|
143 |
-
</div>
|
144 |
-
</div>
|
145 |
-
|
146 |
-
|
147 |
-
</td>
|
148 |
-
</tr>
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
</tbody>
|
154 |
-
</table>
|
155 |
-
<hr/>
|
156 |
-
<p><strong>Free version</strong>: Only 20 images allowed.</p>
|
157 |
-
<input type="submit" class="button-primary" id="button_enjoyinstagram_advanced" name="button_enjoyinstagram_advanced" value="Save Settings"/>
|
158 |
-
</form>
|
159 |
-
<div class="wrap" style="
|
160 |
-
float: left;
|
161 |
-
width: 95%;
|
162 |
-
background: rgba(79, 173, 26, 0.45);
|
163 |
-
padding: 20px;
|
164 |
-
margin-top: 20px;
|
165 |
-
border: 2px solid green;">
|
166 |
-
<h3>Shortocodes to use:</h3>
|
167 |
-
<b>[enjoyinstagram_mb]</b> -> Carousel View <br />
|
168 |
-
<b>[enjoyinstagram_mb_grid]</b> -> Grid View
|
169 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/instagram.class.php
DELETED
@@ -1,569 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Instagram API class
|
5 |
-
* API Documentation: http://instagram.com/developer/
|
6 |
-
* Class Documentation: https://github.com/cosenary/Instagram-PHP-API/tree/dev
|
7 |
-
*
|
8 |
-
* @author Christian Metz
|
9 |
-
* @since 30.10.2011
|
10 |
-
* @copyright Christian Metz - MetzWeb Networks 2011-2014
|
11 |
-
* @version 2.1
|
12 |
-
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
13 |
-
*/
|
14 |
-
class Enjoy_Instagram {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* The API base URL
|
18 |
-
*/
|
19 |
-
const API_URL = 'https://api.instagram.com/v1/';
|
20 |
-
|
21 |
-
/**
|
22 |
-
* The API OAuth URL
|
23 |
-
*/
|
24 |
-
const API_OAUTH_URL = 'https://api.instagram.com/oauth/authorize';
|
25 |
-
|
26 |
-
/**
|
27 |
-
* The OAuth token URL
|
28 |
-
*/
|
29 |
-
const API_OAUTH_TOKEN_URL = 'https://api.instagram.com/oauth/access_token';
|
30 |
-
|
31 |
-
/**
|
32 |
-
* The Instagram API Key
|
33 |
-
*
|
34 |
-
* @var string
|
35 |
-
*/
|
36 |
-
private $_apikey;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* The Instagram OAuth API secret
|
40 |
-
*
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
private $_apisecret;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* The callback URL
|
47 |
-
*
|
48 |
-
* @var string
|
49 |
-
*/
|
50 |
-
private $_callbackurl;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* The user access token
|
54 |
-
*
|
55 |
-
* @var string
|
56 |
-
*/
|
57 |
-
private $_accesstoken;
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Available scopes
|
61 |
-
*
|
62 |
-
* @var array
|
63 |
-
*/
|
64 |
-
private $_scopes = array('basic', 'likes', 'comments', 'relationships');
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Available actions
|
68 |
-
*
|
69 |
-
* @var array
|
70 |
-
*/
|
71 |
-
private $_actions = array('follow', 'unfollow', 'block', 'unblock', 'approve', 'deny');
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Default constructor
|
75 |
-
*
|
76 |
-
* @param array|string $config Instagram configuration data
|
77 |
-
* @return void
|
78 |
-
*/
|
79 |
-
public function __construct($config) {
|
80 |
-
if (true === is_array($config)) {
|
81 |
-
// if you want to access user data
|
82 |
-
$this->setApiKey($config['apiKey']);
|
83 |
-
$this->setApiSecret($config['apiSecret']);
|
84 |
-
$this->setApiCallback($config['apiCallback']);
|
85 |
-
} else if (true === is_string($config)) {
|
86 |
-
// if you only want to access public data
|
87 |
-
$this->setApiKey($config);
|
88 |
-
} else {
|
89 |
-
throw new Exception("Error: __construct() - Configuration data is missing.");
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Generates the OAuth login URL
|
95 |
-
*
|
96 |
-
* @param array [optional] $scope Requesting additional permissions
|
97 |
-
* @return string Instagram OAuth login URL
|
98 |
-
*/
|
99 |
-
public function getLoginUrl($scope = array('basic')) {
|
100 |
-
if (is_array($scope) && count(array_intersect($scope, $this->_scopes)) === count($scope)) {
|
101 |
-
return self::API_OAUTH_URL . '?client_id=' . $this->getApiKey() . '&redirect_uri=' . urlencode($this->getApiCallback()) . '&scope=' . implode('+', $scope) . '&response_type=code';
|
102 |
-
} else {
|
103 |
-
throw new Exception("Error: getLoginUrl() - The parameter isn't an array or invalid scope permissions used.");
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Search for a user
|
109 |
-
*
|
110 |
-
* @param string $name Instagram username
|
111 |
-
* @param integer [optional] $limit Limit of returned results
|
112 |
-
* @return mixed
|
113 |
-
*/
|
114 |
-
public function searchUser($name, $limit = 0) {
|
115 |
-
return $this->_makeCall('users/search', false, array('q' => $name, 'count' => $limit));
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Get user info
|
120 |
-
*
|
121 |
-
* @param integer [optional] $id Instagram user ID
|
122 |
-
* @return mixed
|
123 |
-
*/
|
124 |
-
public function getUser($id = 0) {
|
125 |
-
$auth = false;
|
126 |
-
if ($id === 0 && isset($this->_accesstoken)) { $id = 'self'; $auth = true; }
|
127 |
-
return $this->_makeCall('users/' . $id, $auth);
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Get user activity feed
|
132 |
-
*
|
133 |
-
* @param integer [optional] $limit Limit of returned results
|
134 |
-
* @return mixed
|
135 |
-
*/
|
136 |
-
public function getUserFeed($limit = 0) {
|
137 |
-
return $this->_makeCall('users/self/feed', true, array('count' => $limit));
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Get user recent media
|
142 |
-
*
|
143 |
-
* @param integer [optional] $id Instagram user ID
|
144 |
-
* @param integer [optional] $limit Limit of returned results
|
145 |
-
* @return mixed
|
146 |
-
*/
|
147 |
-
public function getUserMedia($id = 'self', $limit = 0) {
|
148 |
-
return $this->_makeCall('users/' . $id . '/media/recent', ($id === 'self'), array('count' => $limit));
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Get the liked photos of a user
|
153 |
-
*
|
154 |
-
* @param integer [optional] $limit Limit of returned results
|
155 |
-
* @return mixed
|
156 |
-
*/
|
157 |
-
public function getUserLikes($limit = 0) {
|
158 |
-
return $this->_makeCall('users/self/media/liked', true, array('count' => $limit));
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Get the list of users this user follows
|
163 |
-
*
|
164 |
-
* @param integer [optional] $id Instagram user ID
|
165 |
-
* @param integer [optional] $limit Limit of returned results
|
166 |
-
* @return mixed
|
167 |
-
*/
|
168 |
-
public function getUserFollows($id = 'self', $limit = 0) {
|
169 |
-
return $this->_makeCall('users/' . $id . '/follows', true, array('count' => $limit));
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Get the list of users this user is followed by
|
174 |
-
*
|
175 |
-
* @param integer [optional] $id Instagram user ID
|
176 |
-
* @param integer [optional] $limit Limit of returned results
|
177 |
-
* @return mixed
|
178 |
-
*/
|
179 |
-
public function getUserFollower($id = 'self', $limit = 0) {
|
180 |
-
return $this->_makeCall('users/' . $id . '/followed-by', true, array('count' => $limit));
|
181 |
-
}
|
182 |
-
|
183 |
-
/**
|
184 |
-
* Get information about a relationship to another user
|
185 |
-
*
|
186 |
-
* @param integer $id Instagram user ID
|
187 |
-
* @return mixed
|
188 |
-
*/
|
189 |
-
public function getUserRelationship($id) {
|
190 |
-
return $this->_makeCall('users/' . $id . '/relationship', true);
|
191 |
-
}
|
192 |
-
|
193 |
-
/**
|
194 |
-
* Modify the relationship between the current user and the target user
|
195 |
-
*
|
196 |
-
* @param string $action Action command (follow/unfollow/block/unblock/approve/deny)
|
197 |
-
* @param integer $user Target user ID
|
198 |
-
* @return mixed
|
199 |
-
*/
|
200 |
-
public function modifyRelationship($action, $user) {
|
201 |
-
if (true === in_array($action, $this->_actions) && isset($user)) {
|
202 |
-
return $this->_makeCall('users/' . $user . '/relationship', true, array('action' => $action), 'POST');
|
203 |
-
}
|
204 |
-
throw new Exception("Error: modifyRelationship() | This method requires an action command and the target user id.");
|
205 |
-
}
|
206 |
-
|
207 |
-
/**
|
208 |
-
* Search media by its location
|
209 |
-
*
|
210 |
-
* @param float $lat Latitude of the center search coordinate
|
211 |
-
* @param float $lng Longitude of the center search coordinate
|
212 |
-
* @param integer [optional] $distance Distance in metres (default is 1km (distance=1000), max. is 5km)
|
213 |
-
* @param long [optional] $minTimestamp Media taken later than this timestamp (default: 5 days ago)
|
214 |
-
* @param long [optional] $maxTimestamp Media taken earlier than this timestamp (default: now)
|
215 |
-
* @return mixed
|
216 |
-
*/
|
217 |
-
public function searchMedia($lat, $lng, $distance = 1000, $minTimestamp = NULL, $maxTimestamp = NULL) {
|
218 |
-
return $this->_makeCall('media/search', false, array('lat' => $lat, 'lng' => $lng, 'distance' => $distance, 'min_timestamp' => $minTimestamp, 'max_timestamp' => $maxTimestamp));
|
219 |
-
}
|
220 |
-
|
221 |
-
/**
|
222 |
-
* Get media by its id
|
223 |
-
*
|
224 |
-
* @param integer $id Instagram media ID
|
225 |
-
* @return mixed
|
226 |
-
*/
|
227 |
-
public function getMedia($id) {
|
228 |
-
return $this->_makeCall('media/' . $id);
|
229 |
-
}
|
230 |
-
|
231 |
-
/**
|
232 |
-
* Get the most popular media
|
233 |
-
*
|
234 |
-
* @return mixed
|
235 |
-
*/
|
236 |
-
public function getPopularMedia() {
|
237 |
-
return $this->_makeCall('media/popular');
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Search for tags by name
|
242 |
-
*
|
243 |
-
* @param string $name Valid tag name
|
244 |
-
* @return mixed
|
245 |
-
*/
|
246 |
-
public function searchTags($name) {
|
247 |
-
return $this->_makeCall('tags/search', false, array('q' => $name));
|
248 |
-
}
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Get info about a tag
|
252 |
-
*
|
253 |
-
* @param string $name Valid tag name
|
254 |
-
* @return mixed
|
255 |
-
*/
|
256 |
-
public function getTag($name) {
|
257 |
-
return $this->_makeCall('tags/' . $name);
|
258 |
-
}
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Get a recently tagged media
|
262 |
-
*
|
263 |
-
* @param string $name Valid tag name
|
264 |
-
* @param integer [optional] $limit Limit of returned results
|
265 |
-
* @return mixed
|
266 |
-
*/
|
267 |
-
public function getTagMedia($name, $params = array()) {
|
268 |
-
return $this->_makeCall('tags/' . $name . '/media/recent', false, $params);
|
269 |
-
}
|
270 |
-
|
271 |
-
/**
|
272 |
-
* Get a list of users who have liked this media
|
273 |
-
*
|
274 |
-
* @param integer $id Instagram media ID
|
275 |
-
* @return mixed
|
276 |
-
*/
|
277 |
-
public function getMediaLikes($id) {
|
278 |
-
return $this->_makeCall('media/' . $id . '/likes', true);
|
279 |
-
}
|
280 |
-
|
281 |
-
/**
|
282 |
-
* Get a list of comments for this media
|
283 |
-
*
|
284 |
-
* @param integer $id Instagram media ID
|
285 |
-
* @return mixed
|
286 |
-
*/
|
287 |
-
public function getMediaComments($id) {
|
288 |
-
return $this->_makeCall('media/' . $id . '/comments', false);
|
289 |
-
}
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Add a comment on a media
|
293 |
-
*
|
294 |
-
* @param integer $id Instagram media ID
|
295 |
-
* @param string $text Comment content
|
296 |
-
* @return mixed
|
297 |
-
*/
|
298 |
-
public function addMediaComment($id, $text) {
|
299 |
-
return $this->_makeCall('media/' . $id . '/comments', true, array('text' => $text), 'POST');
|
300 |
-
}
|
301 |
-
|
302 |
-
/**
|
303 |
-
* Remove user comment on a media
|
304 |
-
*
|
305 |
-
* @param integer $id Instagram media ID
|
306 |
-
* @param string $commentID User comment ID
|
307 |
-
* @return mixed
|
308 |
-
*/
|
309 |
-
public function deleteMediaComment($id, $commentID) {
|
310 |
-
return $this->_makeCall('media/' . $id . '/comments/' . $commentID, true, null, 'DELETE');
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Set user like on a media
|
315 |
-
*
|
316 |
-
* @param integer $id Instagram media ID
|
317 |
-
* @return mixed
|
318 |
-
*/
|
319 |
-
public function likeMedia($id) {
|
320 |
-
return $this->_makeCall('media/' . $id . '/likes', true, null, 'POST');
|
321 |
-
}
|
322 |
-
|
323 |
-
/**
|
324 |
-
* Remove user like on a media
|
325 |
-
*
|
326 |
-
* @param integer $id Instagram media ID
|
327 |
-
* @return mixed
|
328 |
-
*/
|
329 |
-
public function deleteLikedMedia($id) {
|
330 |
-
return $this->_makeCall('media/' . $id . '/likes', true, null, 'DELETE');
|
331 |
-
}
|
332 |
-
|
333 |
-
/**
|
334 |
-
* Get information about a location
|
335 |
-
*
|
336 |
-
* @param integer $id Instagram location ID
|
337 |
-
* @return mixed
|
338 |
-
*/
|
339 |
-
public function getLocation($id) {
|
340 |
-
return $this->_makeCall('locations/' . $id, false);
|
341 |
-
}
|
342 |
-
|
343 |
-
/**
|
344 |
-
* Get recent media from a given location
|
345 |
-
*
|
346 |
-
* @param integer $id Instagram location ID
|
347 |
-
* @return mixed
|
348 |
-
*/
|
349 |
-
public function getLocationMedia($id) {
|
350 |
-
return $this->_makeCall('locations/' . $id . '/media/recent', false);
|
351 |
-
}
|
352 |
-
|
353 |
-
/**
|
354 |
-
* Get recent media from a given location
|
355 |
-
*
|
356 |
-
* @param float $lat Latitude of the center search coordinate
|
357 |
-
* @param float $lng Longitude of the center search coordinate
|
358 |
-
* @param integer [optional] $distance Distance in meter (max. distance: 5km = 5000)
|
359 |
-
* @return mixed
|
360 |
-
*/
|
361 |
-
public function searchLocation($lat, $lng, $distance = 1000) {
|
362 |
-
return $this->_makeCall('locations/search', false, array('lat' => $lat, 'lng' => $lng, 'distance' => $distance));
|
363 |
-
}
|
364 |
-
|
365 |
-
/**
|
366 |
-
* Pagination feature
|
367 |
-
*
|
368 |
-
* @param object $obj Instagram object returned by a method
|
369 |
-
* @param integer $limit Limit of returned results
|
370 |
-
* @return mixed
|
371 |
-
*/
|
372 |
-
public function pagination($obj, $limit = 0) {
|
373 |
-
if (true === is_object($obj) && !is_null($obj->pagination)) {
|
374 |
-
if (!isset($obj->pagination->next_url)) {
|
375 |
-
return;
|
376 |
-
}
|
377 |
-
$apiCall = explode('?', $obj->pagination->next_url);
|
378 |
-
if (count($apiCall) < 2) {
|
379 |
-
return;
|
380 |
-
}
|
381 |
-
$function = str_replace(self::API_URL, '', $apiCall[0]);
|
382 |
-
$auth = (strpos($apiCall[1], 'access_token') !== false);
|
383 |
-
if (isset($obj->pagination->next_max_id)) {
|
384 |
-
return $this->_makeCall($function, $auth, array('max_id' => $obj->pagination->next_max_id, 'count' => $limit));
|
385 |
-
} else {
|
386 |
-
return $this->_makeCall($function, $auth, array('cursor' => $obj->pagination->next_cursor, 'count' => $limit));
|
387 |
-
}
|
388 |
-
} else {
|
389 |
-
throw new Exception("Error: pagination() | This method doesn't support pagination.");
|
390 |
-
}
|
391 |
-
}
|
392 |
-
|
393 |
-
/**
|
394 |
-
* Get the OAuth data of a user by the returned callback code
|
395 |
-
*
|
396 |
-
* @param string $code OAuth2 code variable (after a successful login)
|
397 |
-
* @param boolean [optional] $token If it's true, only the access token will be returned
|
398 |
-
* @return mixed
|
399 |
-
*/
|
400 |
-
public function getOAuthToken($code, $token = false) {
|
401 |
-
$apiData = array(
|
402 |
-
'grant_type' => 'authorization_code',
|
403 |
-
'client_id' => $this->getApiKey(),
|
404 |
-
'client_secret' => $this->getApiSecret(),
|
405 |
-
'redirect_uri' => $this->getApiCallback(),
|
406 |
-
'code' => $code
|
407 |
-
);
|
408 |
-
|
409 |
-
$result = $this->_makeOAuthCall($apiData);
|
410 |
-
return (false === $token) ? $result : $result->access_token;
|
411 |
-
}
|
412 |
-
|
413 |
-
/**
|
414 |
-
* The call operator
|
415 |
-
*
|
416 |
-
* @param string $function API resource path
|
417 |
-
* @param array [optional] $params Additional request parameters
|
418 |
-
* @param boolean [optional] $auth Whether the function requires an access token
|
419 |
-
* @param string [optional] $method Request type GET|POST
|
420 |
-
* @return mixed
|
421 |
-
*/
|
422 |
-
protected function _makeCall($function, $auth = false, $params = null, $method = 'GET') {
|
423 |
-
if (false === $auth) {
|
424 |
-
// if the call doesn't requires authentication
|
425 |
-
$authMethod = '?client_id=' . $this->getApiKey();
|
426 |
-
} else {
|
427 |
-
// if the call needs an authenticated user
|
428 |
-
if (true === isset($this->_accesstoken)) {
|
429 |
-
$authMethod = '?access_token=' . $this->getAccessToken();
|
430 |
-
} else {
|
431 |
-
throw new Exception("Error: _makeCall() | $function - This method requires an authenticated users access token.");
|
432 |
-
}
|
433 |
-
}
|
434 |
-
|
435 |
-
if (isset($params) && is_array($params)) {
|
436 |
-
$paramString = '&' . http_build_query($params);
|
437 |
-
} else {
|
438 |
-
$paramString = null;
|
439 |
-
}
|
440 |
-
|
441 |
-
$apiCall = self::API_URL . $function . $authMethod . (('GET' === $method) ? $paramString : null);
|
442 |
-
|
443 |
-
$ch = curl_init();
|
444 |
-
curl_setopt($ch, CURLOPT_URL, $apiCall);
|
445 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
|
446 |
-
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
447 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
448 |
-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
449 |
-
|
450 |
-
if ('POST' === $method) {
|
451 |
-
curl_setopt($ch, CURLOPT_POST, count($params));
|
452 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, ltrim($paramString, '&'));
|
453 |
-
} else if ('DELETE' === $method) {
|
454 |
-
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
455 |
-
}
|
456 |
-
|
457 |
-
$jsonData = curl_exec($ch);
|
458 |
-
if (false === $jsonData) {
|
459 |
-
throw new Exception("Error: _makeCall() - cURL error: " . curl_error($ch));
|
460 |
-
}
|
461 |
-
curl_close($ch);
|
462 |
-
|
463 |
-
return json_decode($jsonData);
|
464 |
-
}
|
465 |
-
|
466 |
-
/**
|
467 |
-
* The OAuth call operator
|
468 |
-
*
|
469 |
-
* @param array $apiData The post API data
|
470 |
-
* @return mixed
|
471 |
-
*/
|
472 |
-
private function _makeOAuthCall($apiData) {
|
473 |
-
$apiHost = self::API_OAUTH_TOKEN_URL;
|
474 |
-
|
475 |
-
$ch = curl_init();
|
476 |
-
curl_setopt($ch, CURLOPT_URL, $apiHost);
|
477 |
-
curl_setopt($ch, CURLOPT_POST, count($apiData));
|
478 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($apiData));
|
479 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
|
480 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
481 |
-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
482 |
-
|
483 |
-
$jsonData = curl_exec($ch);
|
484 |
-
if (false === $jsonData) {
|
485 |
-
throw new Exception("Error: _makeOAuthCall() - cURL error: " . curl_error($ch));
|
486 |
-
}
|
487 |
-
curl_close($ch);
|
488 |
-
|
489 |
-
return json_decode($jsonData);
|
490 |
-
}
|
491 |
-
|
492 |
-
/**
|
493 |
-
* Access Token Setter
|
494 |
-
*
|
495 |
-
* @param object|string $data
|
496 |
-
* @return void
|
497 |
-
*/
|
498 |
-
public function setAccessToken($data) {
|
499 |
-
(true === is_object($data)) ? $token = $data->access_token : $token = $data;
|
500 |
-
$this->_accesstoken = $token;
|
501 |
-
}
|
502 |
-
|
503 |
-
/**
|
504 |
-
* Access Token Getter
|
505 |
-
*
|
506 |
-
* @return string
|
507 |
-
*/
|
508 |
-
public function getAccessToken() {
|
509 |
-
return $this->_accesstoken;
|
510 |
-
}
|
511 |
-
|
512 |
-
/**
|
513 |
-
* API-key Setter
|
514 |
-
*
|
515 |
-
* @param string $apiKey
|
516 |
-
* @return void
|
517 |
-
*/
|
518 |
-
public function setApiKey($apiKey) {
|
519 |
-
$this->_apikey = $apiKey;
|
520 |
-
}
|
521 |
-
|
522 |
-
/**
|
523 |
-
* API Key Getter
|
524 |
-
*
|
525 |
-
* @return string
|
526 |
-
*/
|
527 |
-
public function getApiKey() {
|
528 |
-
return $this->_apikey;
|
529 |
-
}
|
530 |
-
|
531 |
-
/**
|
532 |
-
* API Secret Setter
|
533 |
-
*
|
534 |
-
* @param string $apiSecret
|
535 |
-
* @return void
|
536 |
-
*/
|
537 |
-
public function setApiSecret($apiSecret) {
|
538 |
-
$this->_apisecret = $apiSecret;
|
539 |
-
}
|
540 |
-
|
541 |
-
/**
|
542 |
-
* API Secret Getter
|
543 |
-
*
|
544 |
-
* @return string
|
545 |
-
*/
|
546 |
-
public function getApiSecret() {
|
547 |
-
return $this->_apisecret;
|
548 |
-
}
|
549 |
-
|
550 |
-
/**
|
551 |
-
* API Callback URL Setter
|
552 |
-
*
|
553 |
-
* @param string $apiCallback
|
554 |
-
* @return void
|
555 |
-
*/
|
556 |
-
public function setApiCallback($apiCallback) {
|
557 |
-
$this->_callbackurl = $apiCallback;
|
558 |
-
}
|
559 |
-
|
560 |
-
/**
|
561 |
-
* API Callback URL Getter
|
562 |
-
*
|
563 |
-
* @return string
|
564 |
-
*/
|
565 |
-
public function getApiCallback() {
|
566 |
-
return $this->_callbackurl;
|
567 |
-
}
|
568 |
-
|
569 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/profile_auth.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<p>
|
2 |
-
<h2>Your Instagram Profile</h2>
|
3 |
-
<hr />
|
4 |
-
|
5 |
-
<div id="enjoy_user_profile">
|
6 |
-
<img class="enjoy_user_profile" src="<?php echo get_option('enjoyinstagram_user_profile_picture'); ?>">
|
7 |
-
<input type="button" id="button_logout" value="Unlink Profile" class="button-primary ei_top" />
|
8 |
-
</div>
|
9 |
-
|
10 |
-
<div id="enjoy_user_block" >
|
11 |
-
<h3><?php echo get_option('enjoyinstagram_user_username'); ?></h3>
|
12 |
-
<p><i><?php echo get_option('enjoyinstagram_user_bio'); ?></i></p>
|
13 |
-
<hr/>
|
14 |
-
Customize the plugin with our <a href="<?php echo get_admin_url(); ?>options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_advanced_settings">settings</a> tab.
|
15 |
-
|
16 |
-
<hr />
|
17 |
-
</div>
|
18 |
-
|
19 |
-
</p>
|
20 |
-
<div class="wrap" style="
|
21 |
-
float: left;
|
22 |
-
width: 95%;
|
23 |
-
background: rgba(79, 173, 26, 0.45);
|
24 |
-
padding: 20px;
|
25 |
-
margin-top: 20px;
|
26 |
-
border: 2px solid green;">
|
27 |
-
<h3>Shortocodes to use:</h3>
|
28 |
-
<b>[enjoyinstagram_mb]</b> -> Carousel View <br />
|
29 |
-
<b>[enjoyinstagram_mb_grid]</b> -> Grid View
|
30 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/shortcode_button.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
4 |
-
die( "Can't load this file directly" );
|
5 |
-
|
6 |
-
class MyGallery
|
7 |
-
{
|
8 |
-
function __construct() {
|
9 |
-
add_action( 'admin_init', array( $this, 'action_admin_init' ) );
|
10 |
-
}
|
11 |
-
|
12 |
-
function action_admin_init() {
|
13 |
-
if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
|
14 |
-
add_filter( 'mce_buttons', array( $this, 'filter_mce_button' ) );
|
15 |
-
add_filter( 'mce_external_plugins', array( $this, 'filter_mce_plugin' ) );
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
function filter_mce_button( $buttons ) {
|
20 |
-
array_push( $buttons, '|', 'mygallery_button' );
|
21 |
-
return $buttons;
|
22 |
-
}
|
23 |
-
|
24 |
-
function filter_mce_plugin( $plugins ) {
|
25 |
-
$plugins['mygallery'] = plugins_url('shortcode_button.js',__FILE__);
|
26 |
-
return $plugins;
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
$mygallery = new MyGallery();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/widgets.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Slider_Widget extends WP_Widget {
|
4 |
-
|
5 |
-
|
6 |
-
function __construct() {
|
7 |
-
parent::__construct(
|
8 |
-
'Slider_Widget', // Base ID
|
9 |
-
__('EnjoyInstagram - Carousel', 'text_domain'), // Name
|
10 |
-
array( 'description' => __( 'A Foo Widget', 'text_domain' ), ) // Args
|
11 |
-
);
|
12 |
-
}
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
public function widget( $args, $instance ) {
|
18 |
-
$title = apply_filters( 'widget_title', $instance['title'] );
|
19 |
-
$number_images_in_slide = apply_filters( 'widget_content', $instance['number_images_in_slide'] );
|
20 |
-
$navigation_y_n = apply_filters( 'widget_content', $instance['navigation_y_n'] );
|
21 |
-
$user_or_hashtag = apply_filters( 'widget_content', $instance['user_or_hashtag'] );
|
22 |
-
|
23 |
-
|
24 |
-
echo $args['before_widget'];
|
25 |
-
if ( ! empty( $title ) )
|
26 |
-
echo $args['before_title'] . $title . $args['after_title'];
|
27 |
-
do_shortcode('[enjoyinstagram_mb_widget n="'.$instance['number_images_in_slide'].'" id="'.$args['widget_id'].'" n_y_n="'.$instance['navigation_y_n'].'" u_or_h="'.$instance['user_or_hashtag'].'"]');
|
28 |
-
echo $args['after_widget'];
|
29 |
-
}
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
public function form( $instance ) {
|
35 |
-
if ( isset( $instance[ 'title' ] ) ) {
|
36 |
-
$title = $instance[ 'title' ];
|
37 |
-
}
|
38 |
-
else {
|
39 |
-
$title = __( 'New title', 'text_domain' );
|
40 |
-
}
|
41 |
-
|
42 |
-
$instance = wp_parse_args( (array) $instance, array(
|
43 |
-
'number_images_in_slide' => '4',
|
44 |
-
'navigation_y_n' => 'false',
|
45 |
-
'user_or_hashtag' => 'user'
|
46 |
-
|
47 |
-
) );
|
48 |
-
|
49 |
-
?>
|
50 |
-
|
51 |
-
<p>
|
52 |
-
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
53 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
|
54 |
-
</p>
|
55 |
-
|
56 |
-
<p>
|
57 |
-
<label for="<?php echo $this->get_field_id( 'number_images_in_slide' ); ?>"><?php _e( 'Images displayed at a time:' ); ?></label><br />
|
58 |
-
<select name="<?php echo $this->get_field_name( 'number_images_in_slide' ); ?>" id="<?php echo $this->get_field_id( 'number_images_in_slide' ); ?>">
|
59 |
-
<option value="1" <?php if ($instance['number_images_in_slide']=='1') echo "selected='selected'";?>>1</option>
|
60 |
-
<option value="2" <?php if ($instance['number_images_in_slide']=='2') echo "selected='selected'";?>>2</option>
|
61 |
-
<option value="3" <?php if ($instance['number_images_in_slide']=='3') echo "selected='selected'";?>>3</option>
|
62 |
-
<option value="4" <?php if ($instance['number_images_in_slide']=='4') echo "selected='selected'";?>>4</option>
|
63 |
-
<option value="5" <?php if ($instance['number_images_in_slide']=='5') echo "selected='selected'";?>>5</option>
|
64 |
-
<option value="6" <?php if ($instance['number_images_in_slide']=='6') echo "selected='selected'";?>>6</option>
|
65 |
-
<option value="7" <?php if ($instance['number_images_in_slide']=='7') echo "selected='selected'";?>>7</option>
|
66 |
-
<option value="8" <?php if ($instance['number_images_in_slide']=='8') echo "selected='selected'";?>>8</option>
|
67 |
-
<option value="9" <?php if ($instance['number_images_in_slide']=='9') echo "selected='selected'";?>>9</option>
|
68 |
-
<option value="10" <?php if ($instance['number_images_in_slide']=='10') echo "selected='selected'";?>>10</option>
|
69 |
-
</select>
|
70 |
-
|
71 |
-
</p>
|
72 |
-
|
73 |
-
<p>
|
74 |
-
<label for="<?php echo $this->get_field_id( 'navigation_y_n' ); ?>"><?php _e( 'Navigation buttons:' ); ?></label><br />
|
75 |
-
<select name="<?php echo $this->get_field_name( 'navigation_y_n' ); ?>" id="<?php echo $this->get_field_id( 'navigation_y_n' ); ?>">
|
76 |
-
<option value="true" <?php if ($instance['navigation_y_n']=='true') echo "selected='selected'";?>>Yes</option>
|
77 |
-
<option value="false" <?php if ($instance['navigation_y_n']=='false') echo "selected='selected'";?>>No</option>
|
78 |
-
</select>
|
79 |
-
|
80 |
-
</p>
|
81 |
-
|
82 |
-
<p>
|
83 |
-
Show pics: <br />
|
84 |
-
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag' ); ?>" <?php if ($instance['user_or_hashtag']=='user') echo "checked";?> value="user">of Your Profile<br></p>
|
85 |
-
<p>
|
86 |
-
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag' ); ?>" <?php if ($instance['user_or_hashtag']=='hashtag') echo "checked";?> value="hashtag">by Hashtag
|
87 |
-
<br /></p>
|
88 |
-
<!--
|
89 |
-
# <input type="text" id="enjoyinstagram_hashtag" value="<?php echo get_option('enjoyinstagram_hashtag'); ?>" name="enjoyinstagram_hashtag" disabled/>
|
90 |
-
<span class="description"></span>
|
91 |
-
-->
|
92 |
-
|
93 |
-
<?php
|
94 |
-
}
|
95 |
-
|
96 |
-
|
97 |
-
public function update( $new_instance, $old_instance ) {
|
98 |
-
$instance = array();
|
99 |
-
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
|
100 |
-
$instance['number_images_in_slide'] = ( ! empty( $new_instance['number_images_in_slide'] ) ) ? strip_tags( $new_instance['number_images_in_slide'] ) : '';
|
101 |
-
$instance['navigation_y_n'] = ( ! empty( $new_instance['navigation_y_n'] ) ) ? strip_tags( $new_instance['navigation_y_n'] ) : '';
|
102 |
-
$instance['user_or_hashtag'] = ( ! empty( $new_instance['user_or_hashtag'] ) ) ? strip_tags( $new_instance['user_or_hashtag'] ) : '';
|
103 |
-
|
104 |
-
return $instance;
|
105 |
-
}
|
106 |
-
|
107 |
-
}
|
108 |
-
|
109 |
-
function register_Slider_Widget() {
|
110 |
-
register_widget( 'Slider_Widget' );
|
111 |
-
}
|
112 |
-
add_action( 'widgets_init', 'register_Slider_Widget' );
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
library/widgets_grid.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
class Grid_Widget extends WP_Widget {
|
5 |
-
|
6 |
-
function __construct() {
|
7 |
-
parent::__construct(
|
8 |
-
'Grid_Widget', // Base ID
|
9 |
-
__('EnjoyInstagram - Grid', 'text_domain'), // Name
|
10 |
-
array( 'description' => __( 'A Foo Widget', 'text_domain' ), ) // Args
|
11 |
-
);
|
12 |
-
}
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
public function widget( $args, $instance ) {
|
18 |
-
$title = apply_filters( 'widget_title', $instance['title'] );
|
19 |
-
$number_cols_in_grid = apply_filters( 'widget_content', $instance['number_cols_in_grid'] );
|
20 |
-
$number_rows_in_grid = apply_filters( 'widget_content', $instance['number_rows_in_grid'] );
|
21 |
-
$user_or_hashtag_in_grid = apply_filters( 'widget_content', $instance['user_or_hashtag_in_grid'] );
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
echo $args['before_widget'];
|
26 |
-
if ( ! empty( $title ) )
|
27 |
-
echo $args['before_title'] . $title . $args['after_title'];
|
28 |
-
do_shortcode('[enjoyinstagram_mb_grid_widget id="'.$args['widget_id'].'" n_c="'.$instance['number_cols_in_grid'].'" n_r="'.$instance['number_rows_in_grid'].'" u_or_h="'.$instance['user_or_hashtag_in_grid'].'"]');
|
29 |
-
echo $args['after_widget'];
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
public function form( $instance ) {
|
35 |
-
if ( isset( $instance[ 'title' ] ) ) {
|
36 |
-
$title = $instance[ 'title' ];
|
37 |
-
}
|
38 |
-
else {
|
39 |
-
$title = __( 'New title', 'text_domain' );
|
40 |
-
}
|
41 |
-
$instance = wp_parse_args( (array) $instance, array(
|
42 |
-
'number_cols_in_grid' => '4',
|
43 |
-
'number_rows_in_grid' => '2',
|
44 |
-
'user_or_hashtag_in_grid' => 'user'
|
45 |
-
|
46 |
-
) );
|
47 |
-
|
48 |
-
?>
|
49 |
-
<p>
|
50 |
-
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
51 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
|
52 |
-
</p>
|
53 |
-
<p>
|
54 |
-
<label for="<?php echo $this->get_field_id( 'number_cols_in_grid' ); ?>"><?php _e( 'Number of Columns:' ); ?></label><br />
|
55 |
-
<select name="<?php echo $this->get_field_name( 'number_cols_in_grid' ); ?>" id="<?php echo $this->get_field_id( 'number_cols_in_grid' ); ?>">
|
56 |
-
<option value="1" <?php if ($instance['number_cols_in_grid']=='1') echo "selected='selected'";?>>1</option>
|
57 |
-
<option value="2" <?php if ($instance['number_cols_in_grid']=='2') echo "selected='selected'";?>>2</option>
|
58 |
-
<option value="3" <?php if ($instance['number_cols_in_grid']=='3') echo "selected='selected'";?>>3</option>
|
59 |
-
<option value="4" <?php if ($instance['number_cols_in_grid']=='4') echo "selected='selected'";?>>4</option>
|
60 |
-
<option value="5" <?php if ($instance['number_cols_in_grid']=='5') echo "selected='selected'";?>>5</option>
|
61 |
-
<option value="6" <?php if ($instance['number_cols_in_grid']=='6') echo "selected='selected'";?>>6</option>
|
62 |
-
<option value="7" <?php if ($instance['number_cols_in_grid']=='7') echo "selected='selected'";?>>7</option>
|
63 |
-
<option value="8" <?php if ($instance['number_cols_in_grid']=='8') echo "selected='selected'";?>>8</option>
|
64 |
-
<option value="9" <?php if ($instance['number_cols_in_grid']=='9') echo "selected='selected'";?>>9</option>
|
65 |
-
<option value="10" <?php if ($instance['number_cols_in_grid']=='10') echo "selected='selected'";?>>10</option>
|
66 |
-
</select>
|
67 |
-
|
68 |
-
</p>
|
69 |
-
<p>
|
70 |
-
<label for="<?php echo $this->get_field_id( 'number_rows_in_grid' ); ?>"><?php _e( 'Number of Rows:' ); ?></label><br />
|
71 |
-
<select name="<?php echo $this->get_field_name( 'number_rows_in_grid' ); ?>" id="<?php echo $this->get_field_id( 'number_rows_in_grid' ); ?>">
|
72 |
-
<option value="1" <?php if ($instance['number_rows_in_grid']=='1') echo "selected='selected'";?>>1</option>
|
73 |
-
<option value="2" <?php if ($instance['number_rows_in_grid']=='2') echo "selected='selected'";?>>2</option>
|
74 |
-
<option value="3" <?php if ($instance['number_rows_in_grid']=='3') echo "selected='selected'";?>>3</option>
|
75 |
-
<option value="4" <?php if ($instance['number_rows_in_grid']=='4') echo "selected='selected'";?>>4</option>
|
76 |
-
<option value="5" <?php if ($instance['number_rows_in_grid']=='5') echo "selected='selected'";?>>5</option>
|
77 |
-
<option value="6" <?php if ($instance['number_rows_in_grid']=='6') echo "selected='selected'";?>>6</option>
|
78 |
-
<option value="7" <?php if ($instance['number_rows_in_grid']=='7') echo "selected='selected'";?>>7</option>
|
79 |
-
<option value="8" <?php if ($instance['number_rows_in_grid']=='8') echo "selected='selected'";?>>8</option>
|
80 |
-
<option value="9" <?php if ($instance['number_rows_in_grid']=='9') echo "selected='selected'";?>>9</option>
|
81 |
-
<option value="10" <?php if ($instance['number_rows_in_grid']=='10') echo "selected='selected'";?>>10</option>
|
82 |
-
</select>
|
83 |
-
|
84 |
-
</p>
|
85 |
-
<p>
|
86 |
-
Show pics:
|
87 |
-
<br />
|
88 |
-
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag_in_grid' ); ?>" <?php if ($instance['user_or_hashtag_in_grid']=='user') echo "checked";?> value="user">of Your Profile<br></p>
|
89 |
-
<p>
|
90 |
-
<input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag_in_grid' ); ?>" <?php if ($instance['user_or_hashtag_in_grid']=='hashtag') echo "checked";?> value="hashtag">by Hashtag
|
91 |
-
<br /></p>
|
92 |
-
|
93 |
-
<?php
|
94 |
-
}
|
95 |
-
|
96 |
-
|
97 |
-
public function update( $new_instance, $old_instance ) {
|
98 |
-
$instance = array();
|
99 |
-
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
|
100 |
-
$instance['number_cols_in_grid'] = ( ! empty( $new_instance['number_cols_in_grid'] ) ) ? strip_tags( $new_instance['number_cols_in_grid'] ) : '';
|
101 |
-
$instance['number_rows_in_grid'] = ( ! empty( $new_instance['number_rows_in_grid'] ) ) ? strip_tags( $new_instance['number_rows_in_grid'] ) : '';
|
102 |
-
$instance['user_or_hashtag_in_grid'] = ( ! empty( $new_instance['user_or_hashtag_in_grid'] ) ) ? strip_tags( $new_instance['user_or_hashtag_in_grid'] ) : '';
|
103 |
-
|
104 |
-
return $instance;
|
105 |
-
}
|
106 |
-
|
107 |
-
}
|
108 |
-
|
109 |
-
function register_Grid_Widget() {
|
110 |
-
register_widget( 'Grid_Widget' );
|
111 |
-
}
|
112 |
-
add_action( 'widgets_init', 'register_Grid_Widget' );
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugin-options/options.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main plugin options array
|
4 |
+
* The array is divided by Settings Group
|
5 |
+
*
|
6 |
+
* array(
|
7 |
+
* group => array(
|
8 |
+
* option_id => default
|
9 |
+
* )
|
10 |
+
* )
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
|
14 |
+
return apply_filters( 'enjoyinstagram_main_array_options', array(
|
15 |
+
'enjoyinstagram_options_group_auth' => array(
|
16 |
+
'enjoyinstagram_client_id' => '',
|
17 |
+
'enjoyinstagram_client_secret' => '',
|
18 |
+
'enjoyinstagram_client_code' => '',
|
19 |
+
'enjoyinstagram_user_instagram' => '',
|
20 |
+
'enjoyinstagram_user_id' => '',
|
21 |
+
'enjoyinstagram_user_username' => '',
|
22 |
+
'enjoyinstagram_user_profile_picture' => '',
|
23 |
+
'enjoyinstagram_user_fullname' => '',
|
24 |
+
'enjoyinstagram_user_website' => '',
|
25 |
+
'enjoyinstagram_user_bio' => '',
|
26 |
+
'enjoyinstagram_access_token' => '',
|
27 |
+
),
|
28 |
+
'enjoyinstagram_options_carousel_group' => array(
|
29 |
+
'enjoyinstagram_carousel_items_number' => '4',
|
30 |
+
'enjoyinstagram_carousel_navigation' => 'false',
|
31 |
+
'enjoyinstagram_grid_rows' => '2',
|
32 |
+
'enjoyinstagram_grid_cols' => '5',
|
33 |
+
'enjoyinstagram_hashtag' => '',
|
34 |
+
'enjoyinstagram_user_or_hashtag' => 'user',
|
35 |
+
)
|
36 |
+
));
|
readme.txt
CHANGED
@@ -1,73 +1,133 @@
|
|
1 |
-
=== Enjoy Instagram ===
|
2 |
-
Contributors:
|
3 |
Donate link: https://www.google.com/url?q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin%2Fwebscr%3Fcmd%3D_s-xclick%26hosted_button_id%3D8MXZ37DWHAX46&sa=D&sntz=1&usg=AFQjCNFHixLdowdc2AAEXDYmM9tQBl-TXQ
|
4 |
-
Tags: Instagram
|
5 |
Requires at least: 3.0.1
|
6 |
-
Tested up to: 4.
|
7 |
-
Version:
|
8 |
-
Stable tag:
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
-
Instagram
|
13 |
|
14 |
== Description ==
|
15 |
|
|
|
16 |
|
17 |
-
|
|
|
|
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
Everything is responsive and optimized for mobile devices.
|
23 |
|
24 |
-
=
|
25 |
|
26 |
= Enjoy Instagram Basic Features =
|
27 |
|
28 |
-
*
|
29 |
-
*
|
30 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
* Number of columns and rows customizable
|
32 |
-
*
|
33 |
-
|
34 |
-
*
|
35 |
-
*
|
36 |
-
*
|
|
|
37 |
* Touch
|
38 |
-
* Completely responsive and Optimized Mobile Devices
|
39 |
-
*
|
40 |
-
|
|
|
|
|
41 |
|
42 |
-
= Very Simple Installation and Configuration =
|
43 |
-
|
|
|
44 |
|
45 |
= Enjoy Instagram PREMIUM VERSION =
|
46 |
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
= Features introduced in the last premium version =
|
51 |
-
|
52 |
-
* NEW - multi hashtag supported
|
53 |
-
* NEW - pictures with squared format supported
|
54 |
-
* NEW - grid view with border between pictures
|
55 |
-
* NEW - video visualization for browser supporting HTML5
|
56 |
-
* NEW - performance improvement
|
57 |
-
* NEW - cleaning and optimization code
|
58 |
-
* NEW - improvement for css and js loading
|
59 |
-
* NEW - better management of loading images for Grid view
|
60 |
-
* NEW - better management for a big number of pictures in line with the latest Instagram guidelines
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
= Other features: =
|
65 |
|
66 |
-
*
|
67 |
-
*
|
68 |
-
*
|
69 |
-
*
|
70 |
-
* Moderation Panel: In real time you can moderate new photos and decide to approve and to publish or to rejected (Watch how it works:
|
71 |
[youtube https://www.youtube.com/watch?v=W6gNqlghbLE]
|
72 |
* Autoplay
|
73 |
* Loop
|
@@ -79,8 +139,11 @@ In the premium configuration you will choose which Instagram photos display in y
|
|
79 |
|
80 |
and many others features..
|
81 |
|
82 |
-
= LIVE PREMIUM VERSION DEMO: =
|
83 |
-
http://www.mediabetaprojects.com/enjoy-instagram-premium/
|
|
|
|
|
|
|
84 |
|
85 |
== Installation ==
|
86 |
|
@@ -99,21 +162,21 @@ Installation and Configuration are very simple :
|
|
99 |
—————
|
100 |
|
101 |
= How to Install Enjoy Instagram WordPress Plugin =
|
102 |
-
|
103 |
|
104 |
|
105 |
= My profile disappeared. What’s happened? =
|
106 |
-
Sometimes, when you upgrade the plugin you need also to hook again your Instagram profile. So repeat the step that you can see in slide 4 of this presentation http://www.mediabetaprojects.com/enjoy-instagram-premium/install-enjoy-instagram-wordpress-plugin/
|
107 |
|
108 |
|
109 |
= Where can i find ShortCodes ? =
|
110 |
The shortcodes are automatically generated by clicking the “Enjoy Instagram Button” that you can see on text editor of posts and pages.
|
111 |
If you do not see the button of shortcodes, you can use these shortcodes to:
|
112 |
|
113 |
-
[enjoyinstagram_mb] -> Carousel View
|
114 |
-
[enjoyinstagram_mb_grid] -> Grid View
|
115 |
|
116 |
-
In the Setting section yon can customize grid and/or Carousel view
|
117 |
|
118 |
|
119 |
== Screenshots ==
|
@@ -129,105 +192,70 @@ In the Setting section yon can customize grid and/or Carousel view
|
|
129 |
|
130 |
== Changelog ==
|
131 |
|
132 |
-
=
|
133 |
-
*
|
134 |
-
|
135 |
-
*
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
= 1.4 =
|
143 |
-
* Fix warning for empty hashtag value
|
144 |
-
= 1.5 =
|
145 |
-
* Fix shortcode use and setting saving
|
146 |
-
= 1.5.1 =
|
147 |
-
* Bugs Fix
|
148 |
-
= 1.5.2 =
|
149 |
-
* Bug for utf8 4-byte (mobile emoticon) Fixed
|
150 |
-
= 1.5.3 =
|
151 |
-
* Support for swedish specific characters.
|
152 |
-
= 1.6 =
|
153 |
-
* Add support for https protocol
|
154 |
-
= 1.6.1 =
|
155 |
-
* Fix hashtag mode
|
156 |
-
= 1.6.2 =
|
157 |
* Bug Fix
|
158 |
-
=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
* Bug Fix
|
160 |
= 1.6.4 =
|
161 |
* Bug Fix
|
162 |
-
= 1.6.
|
163 |
* Bug Fix
|
164 |
-
= 2
|
165 |
-
*
|
166 |
-
=
|
167 |
-
*
|
168 |
-
=
|
169 |
-
*
|
170 |
-
=
|
171 |
-
*
|
172 |
-
=
|
173 |
-
*
|
174 |
-
=
|
175 |
-
*
|
176 |
-
=
|
177 |
-
*
|
178 |
-
=
|
179 |
-
*
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
== Upgrade Notice ==
|
184 |
-
|
185 |
-
= 1.0 =
|
186 |
-
* Initial Version
|
187 |
-
= 1.01 =
|
188 |
-
* Bux Fix
|
189 |
-
= 1.1 =
|
190 |
* Bux Fix
|
191 |
= 1.2 =
|
192 |
* Bux Fix
|
193 |
-
= 1.
|
194 |
* Bux Fix
|
195 |
-
= 1.
|
196 |
-
* Fix
|
197 |
-
= 1.
|
198 |
-
*
|
199 |
-
= 1.5.1 =
|
200 |
-
* Bugs Fix
|
201 |
-
= 1.5.2 =
|
202 |
-
* Bug for utf8 4-byte (mobile emoticon) Fixed
|
203 |
-
= 1.5.3 =
|
204 |
-
* Support for swedish specific characters.
|
205 |
-
= 1.6 =
|
206 |
-
* Add support for https protocol
|
207 |
-
= 1.6.1 =
|
208 |
-
* Fix hashtag mode
|
209 |
-
= 1.6.2 =
|
210 |
-
* Bug Fix
|
211 |
-
= 1.6.3 =
|
212 |
-
* Bug Fix
|
213 |
-
= 1.6.4 =
|
214 |
-
* Bug Fix
|
215 |
-
= 1.6.5 =
|
216 |
-
* Bug Fix
|
217 |
-
= 2.0 =
|
218 |
-
* Small Bug Fixed
|
219 |
-
= 2.1 =
|
220 |
-
* Small Bug Fixed
|
221 |
-
= 2.1.1 =
|
222 |
-
* Hashtag mode fixed
|
223 |
-
= 2.1.2 =
|
224 |
-
* Banner Removed
|
225 |
-
= 2.1.3 =
|
226 |
-
* Add Shortcakes Info
|
227 |
-
= 3.0 =
|
228 |
-
* New Instagram Api Implementation
|
229 |
-
= 3.1 =
|
230 |
-
* Fixed: Minor issues
|
231 |
-
= 3.2 =
|
232 |
-
* New: pictures with squared format supported
|
233 |
-
* Fixed: Minor issues
|
1 |
+
=== Enjoy Instagram feed on website with WordPress Widget and Shortcode ===
|
2 |
+
Contributors: mediabeta
|
3 |
Donate link: https://www.google.com/url?q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin%2Fwebscr%3Fcmd%3D_s-xclick%26hosted_button_id%3D8MXZ37DWHAX46&sa=D&sntz=1&usg=AFQjCNFHixLdowdc2AAEXDYmM9tQBl-TXQ
|
4 |
+
Tags: Instagram, Instagram feed, Instagram grid, Instagram carousel, Widget Instagram, Embed Instagram, Embed Instagram feed, Instagram feed on website, responsive carousel, WordPress carousel, Instagram gallery, Instagram WordPress, Instagram pictures
|
5 |
Requires at least: 3.0.1
|
6 |
+
Tested up to: 4.9
|
7 |
+
Version: 4.0.0
|
8 |
+
Stable tag: 4.0.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
+
Instagram feed on website by hashtag and profile with shortcodes on posts, pages. Instagram widgets on sidebar.
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
= Enjoy Instagram allows to display Instagram feed based on hashtag and public Instagram account with carousel and grid view. =
|
17 |
|
18 |
+
Only one plugin to publish, with shortcode and widget, Instagram pictures and Instagram videos in your pages, posts and sidebars.
|
19 |
+
Each Instagram photo can be shown in Carousel and Grid mode with Lightbox effect.
|
20 |
+
Enjoy Instagram is responsive and optimized for mobile devices.
|
21 |
|
22 |
+
Once you have installed our plugin Enjoy Instagram, thanks to the presence of Enjoy Instagram icon on the editor, you are able to use shortcodes to embed feed in just one single line.
|
23 |
|
24 |
+
= Here is Live Demo for Enjoy Instagram: = [http://www.mediabetaprojects.com/enjoy-instagram-premium/instagram-feeds-in-your-website-enjoy-instagram-free/](http://www.mediabetaprojects.com/enjoy-instagram-premium/instagram-feeds-in-your-website-enjoy-instagram-free/)
|
|
|
25 |
|
26 |
+
= Enjoy Plugin for Instagram basic allows Instagram video visualization for browser supporting HTML5 =
|
27 |
|
28 |
= Enjoy Instagram Basic Features =
|
29 |
|
30 |
+
* Hashtag-based Instagram feed to show pictures by Instagram hashtag
|
31 |
+
* Profile-based Instagram feed to show pictures by Instagram profiles
|
32 |
+
* Instagram video visualization
|
33 |
+
* Instagram Carousel feed and Instagram Grid feed to add with Shortcode
|
34 |
+
* Shortcode button in the editor page and post
|
35 |
+
* Widget for sidebars to publish Instagram feed with carousel and grid visualization
|
36 |
+
|
37 |
+
* Pictures Transition for carousel: one picture / more pictures at a time
|
38 |
+
* Option for activating Navigation in carousel view (yes/no)
|
39 |
+
* Customization for Number of Instagram pictures to see in the same time
|
40 |
+
|
41 |
* Number of columns and rows customizable
|
42 |
+
* Fade In Effect for Instagram Grid View
|
43 |
+
|
44 |
+
* Standard resolution in Lightbox view
|
45 |
+
* Lightbox with media caption and navigation arrow
|
46 |
+
* HTML 5 video support in Lightbox view
|
47 |
+
|
48 |
* Touch
|
49 |
+
* Completely responsive and Optimized for Mobile Devices
|
50 |
+
* Instagram pictures with squared format supported
|
51 |
+
|
52 |
+
* One click set up.
|
53 |
+
* Php 7 compatible
|
54 |
|
55 |
+
= Very Simple Installation and Configuration for Enjoy Instagram =
|
56 |
+
|
57 |
+
[http://www.mediabetaprojects.com/enjoy-instagram-premium/install-enjoy-instagram-wordpress-plugin/](http://www.mediabetaprojects.com/enjoy-instagram-premium/install-enjoy-instagram-wordpress-plugin/)
|
58 |
|
59 |
= Enjoy Instagram PREMIUM VERSION =
|
60 |
|
61 |
+
Enjoy Instagram is the only Wordpress plugin with a MODERATION PANEL which allows you to display or not the images in the pages, posts and sidebars.
|
62 |
+
The last plugin version now supports multi hashtags and profiles, pictures with square format, grid view with a border between pictures.
|
63 |
+
|
64 |
+
|
65 |
+
= Features supported in Enjoy Instagram Premium version =
|
66 |
+
|
67 |
+
* More shortcodes in the same page or post to display multiple instagram feeds
|
68 |
+
* More shortcodes for different hashtags or profiles in the same page or post
|
69 |
+
* Display photos from Multi hashtags in the same feed
|
70 |
+
* Display instagram feed for public Instagram profile
|
71 |
+
* Customize the margin/space between photos of Instagram feed
|
72 |
+
* Instagram pictures with squared format supported
|
73 |
+
* Instagram grid view with border between pictures
|
74 |
+
* Instagram video visualization for browser supporting HTML5
|
75 |
+
* Instagram Carousel, Instagram Grid, Instagram Polaroid, Instagram Album and Badge view
|
76 |
+
* On click, Pictures of different views can be redirected to Instagram page, to a particular website or opened in a Lightbox
|
77 |
+
* The Lightbox displays Instagram pictures as a slideshow with media caption
|
78 |
+
* NEW - Performance improved
|
79 |
+
* NEW - Cleaned and optimizated code
|
80 |
+
* NEW - Improved css and js loading
|
81 |
+
* NEW - Better management of loading Instagram images for Grid view
|
82 |
+
* NEW - Better management for a big number of Instagram pictures in line with the latest Instagram guidelines
|
83 |
+
|
84 |
+
For Lightbox you can set:
|
85 |
+
* delay to Hide bars
|
86 |
+
* delay to Hide bars on Mobile
|
87 |
+
* to Show Likes Count
|
88 |
+
* to Show author
|
89 |
+
|
90 |
+
= For Instagram Carousel feed view you can set: =
|
91 |
+
* images displayed at a time
|
92 |
+
* animation in / animation out
|
93 |
+
* show different number of images for different screen resolution
|
94 |
+
* customize text of navigation button
|
95 |
+
* customize slide speed / loop / autoplay / stop on Hover / timeout autoplay / speed autoplay
|
96 |
+
|
97 |
+
[DEMO for Instagram Carousel feed on website WordPress](https://www.mediabetaprojects.com/enjoy-instagram-premium/carousel-view-instagram-wordpress-plugin/)
|
98 |
+
|
99 |
+
= For Instagram Grid feed view you can set: =
|
100 |
+
* the number of rows and columns for the different shortcodes
|
101 |
+
* the number of images that are replaced at the same time
|
102 |
+
* interval the images will be replaced
|
103 |
+
* images switch when mouse over
|
104 |
+
* animation speed / animation type
|
105 |
+
|
106 |
+
[DEMO for Instagram Grid feed on website WordPress](https://www.mediabetaprojects.com/enjoy-instagram-premium/grid-view-instagram-plugin/)
|
107 |
+
|
108 |
+
= For Polaroid Instagram feed view you can set: =
|
109 |
+
* to show info (caption) on back
|
110 |
+
* color background, border width, border color
|
111 |
+
|
112 |
+
[DEMO for Polaroid Instagram feed on website WordPress](https://www.mediabetaprojects.com/enjoy-instagram-premium/polaroid-view-instagram-wordpress-plugin/)
|
113 |
+
|
114 |
+
See Also demo for:
|
115 |
+
* [Album Instagram feed on website WordPress](https://www.mediabetaprojects.com/enjoy-instagram-premium/add-instagram-hashtag-album-view/)
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
+
* [Badge Instagram feed on website WordPress](https://www.mediabetaprojects.com/enjoy-instagram-premium/instagram-widget-badge-view/)
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
= See LIVE PREVIEW: =
|
123 |
+
[http://www.mediabetaprojects.com/enjoy-instagram-premium/](http://www.mediabetaprojects.com/enjoy-instagram-premium/)
|
124 |
|
125 |
= Other features: =
|
126 |
|
127 |
+
* Instagram Album View to show your pictures organized for Instagram username and or Instagram hashtags
|
128 |
+
* Instagram Badge View that will help you link to and promote your Instagram web profile
|
129 |
+
* Autoreload Stream of Instagram Photos
|
130 |
+
* Moderation Panel: In real time you can moderate new Instagram photos and decide to approve and to publish or to rejected (Watch how it works:
|
|
|
131 |
[youtube https://www.youtube.com/watch?v=W6gNqlghbLE]
|
132 |
* Autoplay
|
133 |
* Loop
|
139 |
|
140 |
and many others features..
|
141 |
|
142 |
+
= LIVE PREMIUM VERSION DEMO for Enjoy Instagram: =
|
143 |
+
[http://www.mediabetaprojects.com/enjoy-instagram-premium/](http://www.mediabetaprojects.com/enjoy-instagram-premium/)
|
144 |
+
|
145 |
+
Contributors:
|
146 |
+
F.Prestipino, F.Di Pane Masi, A.Nucita and F.Micali
|
147 |
|
148 |
== Installation ==
|
149 |
|
162 |
—————
|
163 |
|
164 |
= How to Install Enjoy Instagram WordPress Plugin =
|
165 |
+
[https://www.mediabetaprojects.com/enjoy-instagram-premium/install-enjoy-instagram-wordpress-plugin/](https://www.mediabetaprojects.com/enjoy-instagram-premium/install-enjoy-instagram-wordpress-plugin/)
|
166 |
|
167 |
|
168 |
= My profile disappeared. What’s happened? =
|
169 |
+
Sometimes, when you upgrade the plugin you need also to hook again your Instagram profile. So repeat the step that you can see in slide 4 of this presentation [https://www.mediabetaprojects.com/enjoy-instagram-premium/install-enjoy-instagram-wordpress-plugin/](http://www.mediabetaprojects.com/enjoy-instagram-premium/install-enjoy-instagram-wordpress-plugin/)
|
170 |
|
171 |
|
172 |
= Where can i find ShortCodes ? =
|
173 |
The shortcodes are automatically generated by clicking the “Enjoy Instagram Button” that you can see on text editor of posts and pages.
|
174 |
If you do not see the button of shortcodes, you can use these shortcodes to:
|
175 |
|
176 |
+
[enjoyinstagram_mb] -> Instagram Carousel View
|
177 |
+
[enjoyinstagram_mb_grid] -> Instagram Grid View
|
178 |
|
179 |
+
In the Setting section yon can customize grid and/or Carousel view
|
180 |
|
181 |
|
182 |
== Screenshots ==
|
192 |
|
193 |
== Changelog ==
|
194 |
|
195 |
+
= 4.0.0 =
|
196 |
+
* Code rewritten and optimized
|
197 |
+
* Code Ready for localization
|
198 |
+
* Javascript errors fixed
|
199 |
+
* Compatibility fix for Beaver Builder
|
200 |
+
= 3.4.4 =
|
201 |
+
* Bug fix
|
202 |
+
= 3.4.3 =
|
203 |
+
* Hot Fix for Instagram feed update
|
204 |
+
= 3.4.2 =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
* Bug Fix
|
206 |
+
= 3.4.1 =
|
207 |
+
* NB: Enjoy Instagram feed on website Wordpress is Php 7 compatible
|
208 |
+
= 3.4 =
|
209 |
+
* Bux fixing: Instagram feed on website Wordpress full compatibility with DIVI theme
|
210 |
+
= 3.3 =
|
211 |
+
* New: Video Instagram feed visualization for browser supporting HTML5
|
212 |
+
* Fixed: Minor issues
|
213 |
+
= 3.2 =
|
214 |
+
* New: Enjoy Instagram feed with squared format supported
|
215 |
+
* Fixed: Minor issues
|
216 |
+
= 3.1 =
|
217 |
+
* Fixed: Minor issues
|
218 |
+
= 3.0 =
|
219 |
+
* New: Enjoy Instagram feed on website full compatible with New Instagram Api Implementation
|
220 |
+
= 2.1.3 =
|
221 |
+
* Add Shortcakes Info
|
222 |
+
= 2.1.2 =
|
223 |
+
* Banner Removed
|
224 |
+
= 2.1.1 =
|
225 |
+
* Hashtag mode fixed
|
226 |
+
= 2.1 =
|
227 |
+
* Small Bug Fixed
|
228 |
+
= 2.0 =
|
229 |
+
* Small Bug Fixed
|
230 |
+
= 1.6.5 =
|
231 |
* Bug Fix
|
232 |
= 1.6.4 =
|
233 |
* Bug Fix
|
234 |
+
= 1.6.3 =
|
235 |
* Bug Fix
|
236 |
+
= 1.6.2 =
|
237 |
+
* Bug Fix
|
238 |
+
= 1.6.1 =
|
239 |
+
* Fix hashtag mode
|
240 |
+
= 1.6 =
|
241 |
+
* Add support for https protocol
|
242 |
+
= 1.5.3 =
|
243 |
+
* Support for swedish specific characters on captions of Instagram feed on website
|
244 |
+
= 1.5.2 =
|
245 |
+
* Bug for utf8 4-byte (mobile emoticon) Fixed
|
246 |
+
= 1.5.1 =
|
247 |
+
* Bugs Fix
|
248 |
+
= 1.5 =
|
249 |
+
* Fix shortcode use and setting saving - Instagram feed on website
|
250 |
+
= 1.4 =
|
251 |
+
* Fix warning for empty hashtag value on Instagram feed on website
|
252 |
+
= 1.3 =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
* Bux Fix
|
254 |
= 1.2 =
|
255 |
* Bux Fix
|
256 |
+
= 1.1 =
|
257 |
* Bux Fix
|
258 |
+
= 1.01 =
|
259 |
+
* Bux Fix
|
260 |
+
= 1.0 =
|
261 |
+
* Initial Version of Enjoy Instagram feed on website
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/admin/enjoyinstagram-advanced-settings.php
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Appearance settings template
|
4 |
+
*/
|
5 |
+
|
6 |
+
if (!defined('ABSPATH')) {
|
7 |
+
exit; // return if called directly
|
8 |
+
}
|
9 |
+
?>
|
10 |
+
|
11 |
+
<form method="post" action="options.php" novalidate>
|
12 |
+
<?php settings_fields('enjoyinstagram_options_carousel_group'); ?>
|
13 |
+
|
14 |
+
<script type="text/javascript">
|
15 |
+
jQuery(document).ready(function ($) {
|
16 |
+
$("input[name$='enjoyinstagram_user_or_hashtag']").click(function () {
|
17 |
+
var test = $(this).val();
|
18 |
+
if (test == 'user') {
|
19 |
+
$('#enjoyinstagram_hashtag').attr('disabled', true);
|
20 |
+
} else if (test == 'hashtag') {
|
21 |
+
$('#enjoyinstagram_hashtag').attr('disabled', false);
|
22 |
+
}
|
23 |
+
$("div.desc").hide();
|
24 |
+
$("#enjoyinstagram_user_or_hashtag_" + test).show();
|
25 |
+
});
|
26 |
+
});
|
27 |
+
</script>
|
28 |
+
|
29 |
+
<table class="form-table">
|
30 |
+
<tbody>
|
31 |
+
<tr valign="top">
|
32 |
+
<th scope="row" style="align:left;">
|
33 |
+
<span class="highlighted">
|
34 |
+
<?php _e('Inclusion mode', 'enjoyinstagram'); ?>:
|
35 |
+
</span>
|
36 |
+
</th>
|
37 |
+
<td>
|
38 |
+
<div class="ei_block">
|
39 |
+
<div class="ei_settings_float_block">
|
40 |
+
<?php _e('Show pics', 'enjoyinstagram'); ?>:
|
41 |
+
</div>
|
42 |
+
<div class="ei_settings_float_block">
|
43 |
+
<input type="radio"
|
44 |
+
name="enjoyinstagram_user_or_hashtag" <?php checked('user', get_option('enjoyinstagram_user_or_hashtag')) ?>
|
45 |
+
value="user">
|
46 |
+
<?php _ex('of Your Profile', 'option label', 'enjoyinstagram'); ?><br/><br/>
|
47 |
+
<input type="radio"
|
48 |
+
name="enjoyinstagram_user_or_hashtag" <?php checked('hashtag', get_option('enjoyinstagram_user_or_hashtag')) ?>
|
49 |
+
value="hashtag">
|
50 |
+
<?php _ex('by Hashtag', 'option label', 'enjoyinstagram'); ?><br/>
|
51 |
+
</div>
|
52 |
+
<div class="ei_settings_float_block">
|
53 |
+
<div id="enjoyinstagram_user_or_hashtag_user"
|
54 |
+
class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag') != 'user') echo 'style="display:none;"'; ?>>
|
55 |
+
<input type="text" class="ei_disabled" id="enjoyinstagram_user" disabled
|
56 |
+
value="<?php echo get_option('enjoyinstagram_user_username'); ?>"
|
57 |
+
name="enjoyinstagram_user"/>
|
58 |
+
</div>
|
59 |
+
<div id="enjoyinstagram_user_or_hashtag_hashtag"
|
60 |
+
class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag') != 'hashtag') echo 'style="display:none;"'; ?>>
|
61 |
+
#<input type="text" id="enjoyinstagram_hashtag" required
|
62 |
+
value="<?php echo get_option('enjoyinstagram_hashtag'); ?>"
|
63 |
+
name="enjoyinstagram_hashtag"/>
|
64 |
+
<span class="description"><?php _ex("insert a hashtag without '#'", 'option description', 'enjoyinstagram'); ?></span>
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
</tbody>
|
71 |
+
</table>
|
72 |
+
|
73 |
+
<hr/>
|
74 |
+
|
75 |
+
<table class="form-table">
|
76 |
+
<tbody>
|
77 |
+
<tr valign="top">
|
78 |
+
<th scope="row" style="align:left;">
|
79 |
+
<span class="highlighted">
|
80 |
+
<?php _e('Carousel settings', 'enjoyinstagram'); ?>:
|
81 |
+
</span>
|
82 |
+
</th>
|
83 |
+
<td>
|
84 |
+
<div class="ei_block">
|
85 |
+
<div class="ei_settings_float_block ei_fixed">
|
86 |
+
<label for="enjoyinstagram_carousel_items_number">
|
87 |
+
<?php _ex('Images displayed at a time', 'option label', 'enjoyinstagram'); ?>:
|
88 |
+
</label>
|
89 |
+
</div>
|
90 |
+
<div class="ei_settings_float_block">
|
91 |
+
<select name="enjoyinstagram_carousel_items_number" class="ei_sel"
|
92 |
+
id="enjoyinstagram_carousel_items_number">
|
93 |
+
<?php for ($i = 1; $i <= 10; $i++): ?>
|
94 |
+
<option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_carousel_items_number')); ?>>
|
95 |
+
<?php echo " " . $i; ?>
|
96 |
+
</option>
|
97 |
+
<?php endfor; ?>
|
98 |
+
</select>
|
99 |
+
</div>
|
100 |
+
</div>
|
101 |
+
<div class="ei_block">
|
102 |
+
<div class="ei_settings_float_block ei_fixed">
|
103 |
+
<label for="enjoyinstagram_carousel_navigation">
|
104 |
+
<?php _ex('Navigation buttons', 'option label', 'enjoyinstagram'); ?>:
|
105 |
+
</label>
|
106 |
+
</div>
|
107 |
+
<div class="ei_settings_float_block">
|
108 |
+
<select name="enjoyinstagram_carousel_navigation" class="ei_sel"
|
109 |
+
id="enjoyinstagram_carousel_navigation">
|
110 |
+
<option value="true" <?php selected('true', get_option('enjoyinstagram_carousel_navigation')); ?>>
|
111 |
+
<?php _e('Yes', 'enjoyinstagram'); ?>
|
112 |
+
</option>
|
113 |
+
<option value="false" <?php selected('false', get_option('enjoyinstagram_carousel_navigation')); ?>>
|
114 |
+
<?php _e('No', 'enjoyinstagram'); ?>
|
115 |
+
</option>
|
116 |
+
</select>
|
117 |
+
</div>
|
118 |
+
</div>
|
119 |
+
</td>
|
120 |
+
</tr>
|
121 |
+
</tbody>
|
122 |
+
</table>
|
123 |
+
<hr/>
|
124 |
+
<!-- SHORTCODE WALL GRID -->
|
125 |
+
<table class="form-table">
|
126 |
+
<tbody>
|
127 |
+
<tr valign="top">
|
128 |
+
<th scope="row" style="align:left;">
|
129 |
+
<span class="highlighted">
|
130 |
+
<?php _e('Grid view settings', 'enjoyinstagram'); ?>:
|
131 |
+
</span>
|
132 |
+
</th>
|
133 |
+
<td>
|
134 |
+
<div class="ei_block">
|
135 |
+
<div class="ei_settings_float_block ei_fixed">
|
136 |
+
<label for="enjoyinstagram_grid_cols">
|
137 |
+
<?php _ex('Number of Columns', 'option label', 'enjoyinstagram'); ?>:
|
138 |
+
</label>
|
139 |
+
</div>
|
140 |
+
<div class="ei_settings_float_block">
|
141 |
+
<select name="enjoyinstagram_grid_cols" id="enjoyinstagram_grid_cols" class="ei_sel">
|
142 |
+
<?php for ($i = 1; $i <= 10; $i++) : ?>
|
143 |
+
<option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_grid_cols')); ?>>
|
144 |
+
<?php echo " " . $i; ?>
|
145 |
+
</option>
|
146 |
+
<?php endfor; ?>
|
147 |
+
</select>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
|
151 |
+
<div class="ei_block">
|
152 |
+
<div class="ei_settings_float_block ei_fixed">
|
153 |
+
<label for="enjoyinstagram_grid_rows">
|
154 |
+
<?php _ex('Number of Rows', 'option label', 'enjoyinstagram'); ?>:
|
155 |
+
</label>
|
156 |
+
</div>
|
157 |
+
<div class="ei_settings_float_block">
|
158 |
+
<select name="enjoyinstagram_grid_rows" id="enjoyinstagram_grid_rows" class="ei_sel">
|
159 |
+
<?php for ($i = 1; $i <= 10; $i++) : ?>
|
160 |
+
<option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_grid_rows')); ?>>
|
161 |
+
<?php echo " " . $i; ?>
|
162 |
+
</option>
|
163 |
+
<?php endfor; ?>
|
164 |
+
</select>
|
165 |
+
</div>
|
166 |
+
</div>
|
167 |
+
</td>
|
168 |
+
</tr>
|
169 |
+
</tbody>
|
170 |
+
</table>
|
171 |
+
<hr/>
|
172 |
+
<p>
|
173 |
+
<?php _e('<strong>Free version</strong>: Only 20 images allowed.', 'enjoyinstagram'); ?>
|
174 |
+
</p>
|
175 |
+
<input type="submit" class="button-primary" id="button_enjoyinstagram_advanced"
|
176 |
+
name="button_enjoyinstagram_advanced"
|
177 |
+
value="<?php _e('Save Settings', 'enjoyinstagram'); ?>">
|
178 |
+
</form>
|
179 |
+
<div class="wrap" style="
|
180 |
+
float: left;
|
181 |
+
width: 95%;
|
182 |
+
background: rgba(79, 173, 26, 0.45);
|
183 |
+
padding: 20px;
|
184 |
+
margin-top: 20px;
|
185 |
+
border: 2px solid green;">
|
186 |
+
<h3><?php _e('Shortocodes to use', 'enjoyinstagram'); ?>:</h3>
|
187 |
+
<b>[enjoyinstagram_mb]</b> -> <?php _e('Carousel View', 'enjoyinstagram'); ?><br/>
|
188 |
+
<b>[enjoyinstagram_mb_grid]</b> -> <?php _e('Grid View', 'enjoyinstagram'); ?>
|
189 |
+
</div>
|
190 |
+
|
templates/admin/enjoyinstagram-general-settings.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Users settings template
|
4 |
+
*/
|
5 |
+
|
6 |
+
if (!defined('ABSPATH')) {
|
7 |
+
exit; // return if called directly
|
8 |
+
}
|
9 |
+
|
10 |
+
$user_token = get_option('enjoyinstagram_access_token', '');
|
11 |
+
|
12 |
+
if ($user_token) : ?>
|
13 |
+
<div>
|
14 |
+
<h2><?php _e('Your Instagram Profile', 'enjoyinstagram'); ?></h2>
|
15 |
+
<hr/>
|
16 |
+
|
17 |
+
<div id="enjoy_user_profile">
|
18 |
+
<img class="enjoy_user_profile" src="<?php echo get_option('enjoyinstagram_user_profile_picture'); ?>">
|
19 |
+
<form method="post">
|
20 |
+
<input type="hidden" name="action" value="enjoyinstagram_remove_user">
|
21 |
+
<input type="submit" id="button_logout"
|
22 |
+
value="<?php _e( 'Unlink Profile', 'enjoyinstagram' ); ?>" class="button-primary ei_top"/>
|
23 |
+
</form>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div id="enjoy_user_block">
|
27 |
+
<h3><?php echo get_option('enjoyinstagram_user_username'); ?></h3>
|
28 |
+
<p><i><?php echo get_option('enjoyinstagram_user_bio'); ?></i></p>
|
29 |
+
<hr/>
|
30 |
+
<?php printf(__('Customize the plugin with our <a href="%s">settings</a> tab.', 'enjoyinstagram'), EnjoyInstagram_Admin()->get_tab_url('enjoyinstagram_advanced_settings')); ?>
|
31 |
+
<hr/>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
<div class="wrap" style="
|
35 |
+
float: left;
|
36 |
+
width: 95%;
|
37 |
+
background: rgba(79, 173, 26, 0.45);
|
38 |
+
padding: 20px;
|
39 |
+
margin-top: 20px;
|
40 |
+
border: 2px solid green;">
|
41 |
+
<h3><?php _e('Shortocodes to use', 'enjoyinstagram'); ?>:</h3>
|
42 |
+
<b>[enjoyinstagram_mb]</b> -> <?php _e('Carousel View', 'enjoyinstagram'); ?><br/>
|
43 |
+
<b>[enjoyinstagram_mb_grid]</b> -> <?php _e('Grid View', 'enjoyinstagram'); ?>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<?php else : ?>
|
47 |
+
|
48 |
+
<p style="font-size:14px;">
|
49 |
+
<?php printf(__('Thank you for you choice! <strong>Enjoy Plugin for Instagram - Responsive gallery</strong> is a plugin lovingly developed for you by <a href="%s" target="_blank"> Mediabeta</a>.', 'enjoyinstagram'), 'http://www.mediabeta.com'); ?>
|
50 |
+
</p>
|
51 |
+
<p style="font-size:14px;">
|
52 |
+
<?php printf(__('By using this plugin, you are agreeing to the <a href="%s" target="_blank">Instagram API Terms of Use</a>.', 'enjoyinstagram'), 'http://instagram.com/about/legal/terms/api/'); ?>
|
53 |
+
</p>
|
54 |
+
|
55 |
+
<a href="<?php echo EnjoyInstagram_Admin()->get_instagram_login_url() ?>" class="button-primary">
|
56 |
+
<?php _e('Connect your Account', 'enjoyinstagram'); ?>
|
57 |
+
</a>
|
58 |
+
|
59 |
+
<?php endif; ?>
|
templates/admin/settings.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main plugin settings template
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // return if called directly
|
8 |
+
}
|
9 |
+
|
10 |
+
?>
|
11 |
+
<div class="wrap">
|
12 |
+
<div class="ei_block">
|
13 |
+
<div class="ei_left_block">
|
14 |
+
<div class="ei_hard_block">
|
15 |
+
<img src="<?php echo ENJOYINSTAGRAM_ASSETS_URL . '/images/enjoyinstagram.png'; ?>">
|
16 |
+
</div>
|
17 |
+
|
18 |
+
<div class="ei_twitter_block">
|
19 |
+
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.mediabeta.com/enjoy-instagram/" data-text="I've just installed Enjoy Plugin for Instagram for wordpress. Awesome!" data-hashtags="wordpress">Tweet</a>
|
20 |
+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
|
21 |
+
</script>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div id="fb-root"></div>
|
25 |
+
<script>(function(d, s, id) {
|
26 |
+
var js, fjs = d.getElementsByTagName(s)[0];
|
27 |
+
if (d.getElementById(id)) return;
|
28 |
+
js = d.createElement(s); js.id = id;
|
29 |
+
js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&appId=359330984151581&version=v2.0";
|
30 |
+
fjs.parentNode.insertBefore(js, fjs);
|
31 |
+
}(document, 'script', 'facebook-jssdk'));</script>
|
32 |
+
<div class="ei_facebook_block">
|
33 |
+
<div class="fb-like" data-href="http://www.mediabeta.com/enjoy-instagram/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true">
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<div id="buy_me_a_coffee" style="background:url(<?php echo ENJOYINSTAGRAM_ASSETS_URL . '/images/buymeacoffee.png'; ?>)#fff no-repeat; ">
|
39 |
+
<div class="pad_coffee">
|
40 |
+
<span class="coffee_title"><?php _e( 'Buy me a coffee!', 'enjoyinstagram' ); ?></span>
|
41 |
+
<p><span><?php _e( 'If you liked our work please consider to make a kind donation through Paypal.', 'enjoyinstagram' ); ?></span></p>
|
42 |
+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
43 |
+
<input type="hidden" name="cmd" value="_s-xclick">
|
44 |
+
<input type="hidden" name="hosted_button_id" value="8MXZ37DWHAX46">
|
45 |
+
<input type="image" src="https://www.paypalobjects.com/en_US/IT/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
46 |
+
<img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
|
47 |
+
</form>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<div class="ei_block">
|
53 |
+
<div id="premium_release">
|
54 |
+
<div class="pad_premium_release">
|
55 |
+
<span class="coffee_title">
|
56 |
+
<?php printf( __( 'Discover interesting OFFERS and UPDATES for <a href="%s"> Premium Version</a> !', 'enjoyinstagram' ), 'http://www.mediabetaprojects.com/enjoy-instagram-premium/coupon-code-enjoy-instagram-premium/' ); ?>
|
57 |
+
</span>
|
58 |
+
<p>
|
59 |
+
<span style="color:#900; font-weight: bold;">
|
60 |
+
<?php printf( __( 'Visit Now <a href="%s">ENJOY INSTAGRAM PREMIUM</a> to verify if a Coupon-Code is ready for you!', 'enjoyinstagram' ), 'http://www.mediabetaprojects.com/enjoy-instagram-premium/coupon-code-enjoy-instagram-premium/' ); ?>
|
61 |
+
</span>
|
62 |
+
</p>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<h2 class="nav-tab-wrapper">
|
68 |
+
<?php foreach( $tabs as $tab_id => $tab ) : ?>
|
69 |
+
<a class="nav-tab <?php echo $active_tab == $tab_id ? 'nav-tab-active' : ''; ?>" href="<?php echo EnjoyInstagram_Admin()->get_tab_url( $tab_id ); ?>">
|
70 |
+
<?php echo $tab ?>
|
71 |
+
</a>
|
72 |
+
<?php endforeach; ?>
|
73 |
+
</h2>
|
74 |
+
<?php
|
75 |
+
// include template
|
76 |
+
$active_tab && $active_tab = str_replace( '_', '-', $active_tab );
|
77 |
+
$active_tab && include( ENJOYINSTAGRAM_TEMPLATE_PATH . '/admin/' . $active_tab . '.php' );
|
78 |
+
?>
|
79 |
+
</div>
|
templates/shortcodes/carousel-widget.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Carousel widget shortcode template
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
?>
|
11 |
+
<script>
|
12 |
+
jQuery(function () {
|
13 |
+
jQuery(document.body)
|
14 |
+
.on('click touchend', '#swipebox-slider .current img', function (e) {
|
15 |
+
jQuery('#swipebox-next').click();
|
16 |
+
return false;
|
17 |
+
})
|
18 |
+
.on('click touchend', '#swipebox-slider .current', function (e) {
|
19 |
+
jQuery('#swipebox-close').trigger('click');
|
20 |
+
});
|
21 |
+
});
|
22 |
+
jQuery(function ($) {
|
23 |
+
$(".swipebox").swipebox({
|
24 |
+
hideBarsDelay: 0
|
25 |
+
});
|
26 |
+
|
27 |
+
});
|
28 |
+
jQuery(document).ready(function () {
|
29 |
+
jQuery("#owl-<?php echo "{$id}"; ?>").owlCarousel({
|
30 |
+
items: <?php echo "{$n}"; ?>,
|
31 |
+
navigation: <?php echo "{$n_y_n}"; ?>,
|
32 |
+
afterAction: callback_height
|
33 |
+
});
|
34 |
+
function callback_height() {
|
35 |
+
let it = jQuery("#owl-<?php echo $i; ?>").find('.owl-item a');
|
36 |
+
it.css( 'height', it.first().outerWidth() );
|
37 |
+
}
|
38 |
+
jQuery("#owl-<?php echo "{$id}"; ?>").fadeIn('slow');
|
39 |
+
});
|
40 |
+
</script>
|
41 |
+
<div id="owl-<?php echo "{$id}"; ?>" class="owl-example enjoy-instagram-carousel">
|
42 |
+
<?php foreach( $result as $entry ) :
|
43 |
+
$url = ($n > 3) ? $entry['images']['thumbnail']['url'] : $entry['images']['standard_resolution']['url'];
|
44 |
+
$link_style = "style=\"background-image: url('{$entry['images']['standard_resolution']['url']}'); background-size: cover; display: block; opacity: 1;\"";
|
45 |
+
?>
|
46 |
+
<div class="box">
|
47 |
+
<a title="<?php echo $entry['caption']['text'] ?>" rel="gallery_swypebox" class="swipebox"
|
48 |
+
href="<?php echo $entry['images']['standard_resolution']['url'] ?>" <?php echo $link_style ?>
|
49 |
+
<img src="<?php echo $url ?>">
|
50 |
+
</a>
|
51 |
+
</div>
|
52 |
+
<?php endforeach; ?>
|
53 |
+
</div>
|
templates/shortcodes/carousel.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Carousel shortcode template
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
?>
|
11 |
+
|
12 |
+
<script>
|
13 |
+
jQuery(function(){
|
14 |
+
jQuery(document.body)
|
15 |
+
.on('click touchend','#swipebox-slider .current img', function(e){
|
16 |
+
jQuery('#swipebox-next').click();
|
17 |
+
return false;
|
18 |
+
})
|
19 |
+
.on('click touchend','#swipebox-slider .current', function(e){
|
20 |
+
jQuery('#swipebox-close').trigger('click');
|
21 |
+
});
|
22 |
+
});
|
23 |
+
jQuery(function($) {
|
24 |
+
$(".swipebox").swipebox({
|
25 |
+
hideBarsDelay: 0
|
26 |
+
});
|
27 |
+
});
|
28 |
+
jQuery(document).ready(function() {
|
29 |
+
jQuery("#owl-<?php echo $i; ?>").owlCarousel({
|
30 |
+
lazyLoad: true,
|
31 |
+
items: <?php echo $items_num ?>,
|
32 |
+
itemsDesktop: [1199,<?php echo $items_num ?>],
|
33 |
+
itemsDesktopSmall: [980,<?php echo $items_num ?>],
|
34 |
+
itemsTablet: [768,<?php echo $items_num ?>],
|
35 |
+
itemsMobile: [479,<?php echo $items_num ?>],
|
36 |
+
stopOnHover: true,
|
37 |
+
navigation: <?php echo $nav ?>,
|
38 |
+
afterAction: callback_height
|
39 |
+
});
|
40 |
+
function callback_height() {
|
41 |
+
let it = jQuery("#owl-<?php echo $i; ?>").find('.owl-item a');
|
42 |
+
it.css( 'height', it.first().outerWidth() );
|
43 |
+
}
|
44 |
+
jQuery("#owl-<?php echo $i; ?>").fadeIn();
|
45 |
+
});
|
46 |
+
</script>
|
47 |
+
|
48 |
+
<div id="owl-<?php echo $i ?>" class="owl-example enjoy-instagram-carousel" style="display:none;">
|
49 |
+
<?php foreach( $result as $entry ) :
|
50 |
+
$link = $entry['images']['standard_resolution']['url'];
|
51 |
+
$url = ($items_num > 3) ? $entry['images']['thumbnail']['url'] : $entry['images']['standard_resolution']['url'];
|
52 |
+
$entry['type'] == 'video' && $link = $entry['videos']['standard_resolution']['url'];
|
53 |
+
$link_style = "style=\"background-image: url('{$entry['images']['standard_resolution']['url']}'); background-size: cover; display: block; opacity: 1;\"";
|
54 |
+
?>
|
55 |
+
<div class="box">
|
56 |
+
<a title="<?php echo $entry['caption']['text'] ?>" rel="gallery_swypebox" class="swipebox" href="<?php echo $link ?>" <?php echo $link_style ?>>
|
57 |
+
<img alt="<?php echo $entry['caption']['text'] ?>" src="<?php echo $url ?>">
|
58 |
+
</a>
|
59 |
+
</div>
|
60 |
+
<?php endforeach; ?>
|
61 |
+
</div>
|
templates/shortcodes/grid-widget.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Grid shortcode template
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
?>
|
11 |
+
<div id="rigrid-<?php echo "{$id}"; ?>" class="ri-grid ri-grid-size-2 ri-shadow" style="display:none">
|
12 |
+
<ul>
|
13 |
+
<?php foreach( $result as $entry ) :
|
14 |
+
if( empty( $entry['images'] ) )
|
15 |
+
continue;
|
16 |
+
?>
|
17 |
+
<li>
|
18 |
+
<a title="<?php echo $entry['caption']['text']; ?>" class="swipebox_grid"
|
19 |
+
href="<?php echo $entry['images']['standard_resolution']['url'] ?>">
|
20 |
+
<img src="<?php echo $entry['images']['standard_resolution']['url'] ?>">
|
21 |
+
</a>
|
22 |
+
</li>
|
23 |
+
<?php endforeach; ?>
|
24 |
+
</ul>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<script type="text/javascript">
|
28 |
+
jQuery(function() {
|
29 |
+
jQuery('#rigrid-<?php echo "{$id}"; ?>').gridrotator({
|
30 |
+
rows: <?php echo "{$n_r}"; ?>,
|
31 |
+
columns: <?php echo "{$n_c}"; ?>,
|
32 |
+
animType: 'fadeInOut',
|
33 |
+
onhover: false,
|
34 |
+
interval: 7000,
|
35 |
+
preventClick: false,
|
36 |
+
w1024: {
|
37 |
+
rows: <?php echo "{$n_r}"; ?>,
|
38 |
+
columns: <?php echo "{$n_c}"; ?>
|
39 |
+
},
|
40 |
+
w768: {
|
41 |
+
rows: <?php echo "{$n_r}"; ?>,
|
42 |
+
columns: <?php echo "{$n_c}"; ?>
|
43 |
+
},
|
44 |
+
w480: {
|
45 |
+
rows: <?php echo "{$n_r}"; ?>,
|
46 |
+
columns: <?php echo "{$n_c}"; ?>
|
47 |
+
},
|
48 |
+
w320: {
|
49 |
+
rows: <?php echo "{$n_r}"; ?>,
|
50 |
+
columns: <?php echo "{$n_c}"; ?>
|
51 |
+
},
|
52 |
+
w240: {
|
53 |
+
rows: <?php echo "{$n_r}"; ?>,
|
54 |
+
columns: <?php echo "{$n_c}"; ?>
|
55 |
+
}
|
56 |
+
});
|
57 |
+
jQuery('#rigrid-<?php echo "{$id}"; ?>').fadeIn('slow');
|
58 |
+
});
|
59 |
+
</script>
|
templates/shortcodes/grid.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Grid shortcode template
|
4 |
+
*/
|
5 |
+
|
6 |
+
if( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
?>
|
11 |
+
<script type="text/javascript">
|
12 |
+
jQuery(function() {
|
13 |
+
jQuery('#grid-<?php echo $i; ?>').gridrotator({
|
14 |
+
rows: <?php echo $rows ?>,
|
15 |
+
columns: <?php echo $cols ?>,
|
16 |
+
animType: 'fadeInOut',
|
17 |
+
onhover: false,
|
18 |
+
interval: 7000,
|
19 |
+
preventClick: false,
|
20 |
+
w1400: {
|
21 |
+
rows: <?php echo $rows ?>,
|
22 |
+
columns: <?php echo $cols ?>
|
23 |
+
},
|
24 |
+
w1024: {
|
25 |
+
rows: <?php echo $rows ?>,
|
26 |
+
columns: <?php echo $cols ?>
|
27 |
+
},
|
28 |
+
w768: {
|
29 |
+
rows: <?php echo $rows ?>,
|
30 |
+
columns: <?php echo $cols ?>
|
31 |
+
},
|
32 |
+
w480: {
|
33 |
+
rows: <?php echo $rows ?>,
|
34 |
+
columns: <?php echo $cols ?>
|
35 |
+
},
|
36 |
+
w320: {
|
37 |
+
rows: <?php echo $rows ?>,
|
38 |
+
columns: <?php echo $cols ?>
|
39 |
+
},
|
40 |
+
w240: {
|
41 |
+
rows: <?php echo $rows ?>,
|
42 |
+
columns: <?php echo $cols ?>
|
43 |
+
}
|
44 |
+
});
|
45 |
+
|
46 |
+
jQuery('#grid-<?php echo $i; ?>').fadeIn('1000');
|
47 |
+
});
|
48 |
+
</script>
|
49 |
+
<div id="grid-<?php echo $i ?>" class="ri-grid ri-grid-size-2 ri-shadow" style="display:none;">
|
50 |
+
<ul>
|
51 |
+
<?php foreach( $result as $entry ) :
|
52 |
+
$link = $entry['images']['standard_resolution']['url'];
|
53 |
+
$entry['type'] == 'video' && $link = $entry['videos']['standard_resolution']['url'];
|
54 |
+
?>
|
55 |
+
<li>
|
56 |
+
<a title="<?php echo $entry['caption']['text'] ?>" class="swipebox_grid"
|
57 |
+
data-video="<?php echo ($entry['type'] == 'video') ? 'yes' : 'no' ?>" href="<?php echo $link ?>">
|
58 |
+
<img alt="<?php echo $entry['caption']['text'] ?>" src="<?php echo $entry['images']['standard_resolution']['url'] ?>">
|
59 |
+
</a>
|
60 |
+
</li>
|
61 |
+
<?php endforeach; ?>
|
62 |
+
</ul>
|
63 |
+
</div>
|
tinymce/ajax.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
* @return string folder content
|
5 |
-
*/
|
6 |
-
add_action('wp_ajax_enjoyinstagram_tinymce', 'enjoyinstagram_ajax_tinymce');
|
7 |
-
/**
|
8 |
-
* Call TinyMCE window content via admin-ajax
|
9 |
-
*
|
10 |
-
* @since 1.7.0
|
11 |
-
* @return html content
|
12 |
-
*/
|
13 |
-
|
14 |
-
function enjoyinstagram_ajax_tinymce() {
|
15 |
-
if (!current_user_can('edit_pages') && !current_user_can('edit_posts')) // check for rights
|
16 |
-
die(__("You are not allowed to be here"));
|
17 |
-
include_once( 'window.php');
|
18 |
-
die();
|
19 |
-
}
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tinymce/icon_enjoyinstagram.png
DELETED
Binary file
|
tinymce/tinymce.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class add_enjoyinstagram_button {
|
4 |
-
|
5 |
-
var $pluginname = 'enjoyinstagram';
|
6 |
-
var $path = '';
|
7 |
-
var $internalVersion = 200;
|
8 |
-
/**
|
9 |
-
* add_enjoyinstagram_button::add_enjoyinstagram_button()
|
10 |
-
* the constructor
|
11 |
-
*
|
12 |
-
* @return void
|
13 |
-
*/
|
14 |
-
function __construct() {
|
15 |
-
// Set path to editor_plugin.js
|
16 |
-
$this->path = plugins_url('/',__FILE__);
|
17 |
-
|
18 |
-
// Modify the version when tinyMCE plugins are changed.
|
19 |
-
add_filter('tiny_mce_version', array(&$this, 'change_tinymce_version'));
|
20 |
-
|
21 |
-
// init process for button control
|
22 |
-
add_action('init', array(&$this, 'addbuttons'));
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* add_enjoyinstagram_button::addbuttons()
|
27 |
-
*
|
28 |
-
* @return void
|
29 |
-
*/
|
30 |
-
function addbuttons() {
|
31 |
-
// Don't bother doing this stuff if the current user lacks permissions
|
32 |
-
if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
|
33 |
-
return;
|
34 |
-
// Check for enjoyinstagram capability
|
35 |
-
// if ( !current_user_can('enjoyinstagram Use TinyMCE') )
|
36 |
-
// return;
|
37 |
-
// Add only in Rich Editor mode
|
38 |
-
if (get_user_option('rich_editing') == 'true') {
|
39 |
-
|
40 |
-
// add the button for wp2.5 in a new way
|
41 |
-
add_filter("mce_external_plugins", array(&$this, 'add_tinymce_plugin'), 5);
|
42 |
-
add_filter('mce_buttons', array(&$this, 'register_button'), 5);
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* add_enjoyinstagram_button::register_button()
|
48 |
-
* used to insert button in wordpress 2.5x editor
|
49 |
-
*
|
50 |
-
* @return $buttons
|
51 |
-
*/
|
52 |
-
function register_button($buttons) {
|
53 |
-
array_push($buttons, 'separator', $this->pluginname);
|
54 |
-
return $buttons;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* add_enjoyinstagram_button::add_tinymce_plugin()
|
59 |
-
* Load the TinyMCE plugin : editor_plugin.js
|
60 |
-
*
|
61 |
-
* @return $plugin_array
|
62 |
-
*/
|
63 |
-
function add_tinymce_plugin($plugin_array) {
|
64 |
-
$plugin_array[$this->pluginname] = $this->path . 'editor_plugin.js';
|
65 |
-
return $plugin_array;
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* add_enjoyinstagram_button::change_tinymce_version()
|
70 |
-
* A different version will rebuild the cache
|
71 |
-
*
|
72 |
-
* @return $versio
|
73 |
-
*/
|
74 |
-
function change_tinymce_version($version) {
|
75 |
-
$version = $version + $this->internalVersion;
|
76 |
-
return $version;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
// Call it now
|
81 |
-
$tinymce_button = new add_enjoyinstagram_button();
|
82 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|