Instagram Gallery - Version 1.3.2

Version Description

  • display likes and comments
  • old shortcode support ended
  • deprecated Slider view option
Download this release

Release Info

Developer buntisoft
Plugin Icon 128x128 Instagram Gallery
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.2.4 to 1.3.2

app/{ig-spider.php → Libra/InstagramSpider.php} RENAMED
@@ -1,33 +1,33 @@
1
<?php
2
3
- /*
4
* Instagram Spider
5
* @author Karan Singh
6
- * @version 1.1.1
7
- * @description get items.
8
*/
9
class InstagramSpider
10
{
11
-
12
protected $instagram;
13
-
14
public $messages;
15
-
16
public function __construct()
17
{
18
$this->instagram = 'https://www.instagram.com/';
19
$this->messages = array();
20
}
21
-
22
/**
23
* takes username and return items list array
24
*
25
- * @param string $username
26
* @return array
27
*/
28
function getUserItems($username = '')
29
{
30
- $username = (string) $username;
31
if (empty($username)) {
32
$this->messages[] = 'Please provide a valid username';
33
return;
@@ -43,24 +43,28 @@ class InstagramSpider
43
44
if (! empty($instaRes) && is_array($instaRes)) {
45
foreach ($instaRes as $res) {
46
- $items[] = array('img_standard' => $res->images->standard_resolution->url,
47
- 'img_low' => $res->images->low_resolution->url
48
);
49
}
50
}
51
}
52
return $items;
53
}
54
-
55
/**
56
* takes #Tag name and return items list array
57
*
58
- * @param string $tag
59
* @return array
60
*/
61
function getTagItems($tag = '')
62
{
63
- $tag = (string) $tag;
64
if (empty($tag)) {
65
$this->messages[] = 'Please provide a valid # tag';
66
return;
@@ -74,8 +78,12 @@ class InstagramSpider
74
75
if (! empty($instaRes) && is_array($instaRes)) {
76
foreach ($instaRes as $res) {
77
- $items[] = array('img_standard' => $res->display_src,
78
- 'img_low' => $res->thumbnail_src
79
);
80
}
81
}
@@ -83,11 +91,11 @@ class InstagramSpider
83
84
return $items;
85
}
86
-
87
/**
88
* takes URL string and return URL content
89
*
90
- * @param string $url
91
* @return string
92
*/
93
protected function ig_spider($url = '')
@@ -118,9 +126,11 @@ class InstagramSpider
118
}
119
return $instaItems;
120
}
121
// return messages array
122
public function getMessages()
123
{
124
return $this->messages;
125
}
126
}
1
<?php
2
3
+ /**
4
* Instagram Spider
5
* @author Karan Singh
6
+ * @version 1.1.4
7
+ * @description script to get instagram media by using Username and/or Tag.
8
*/
9
class InstagramSpider
10
{
11
+
12
protected $instagram;
13
+
14
public $messages;
15
+
16
public function __construct()
17
{
18
$this->instagram = 'https://www.instagram.com/';
19
$this->messages = array();
20
}
21
+
22
/**
23
* takes username and return items list array
24
*
25
+ * @param string $username
26
* @return array
27
*/
28
function getUserItems($username = '')
29
{
30
+ $username = urlencode((string) $username); // non-english string support
31
if (empty($username)) {
32
$this->messages[] = 'Please provide a valid username';
33
return;
43
44
if (! empty($instaRes) && is_array($instaRes)) {
45
foreach ($instaRes as $res) {
46
+ $items[] = array(
47
+ 'img_standard' => $res->images->standard_resolution->url,
48
+ 'img_low' => $res->images->low_resolution->url,
49
+ 'likes' => $res->likes->count,
50
+ 'comments' => $res->comments->count,
51
+ 'caption' => isset($res->caption->text) ? htmlspecialchars($res->caption->text) : '',
52
);
53
}
54
}
55
}
56
return $items;
57
}
58
+
59
/**
60
* takes #Tag name and return items list array
61
*
62
+ * @param string $tag
63
* @return array
64
*/
65
function getTagItems($tag = '')
66
{
67
+ $tag = urlencode((string) $tag);
68
if (empty($tag)) {
69
$this->messages[] = 'Please provide a valid # tag';
70
return;
78
79
if (! empty($instaRes) && is_array($instaRes)) {
80
foreach ($instaRes as $res) {
81
+ $items[] = array(
82
+ 'img_standard' => $res->display_src,
83
+ 'img_low' => $res->thumbnail_src,
84
+ 'likes' => $res->likes->count,
85
+ 'comments' => $res->comments->count,
86
+ 'caption' => isset($res->caption) ? htmlspecialchars($res->caption) : '',
87
);
88
}
89
}
91
92
return $items;
93
}
94
+
95
/**
96
* takes URL string and return URL content
97
*
98
+ * @param string $url
99
* @return string
100
*/
101
protected function ig_spider($url = '')
126
}
127
return $instaItems;
128
}
129
+
130
// return messages array
131
public function getMessages()
132
{
133
return $this->messages;
134
}
135
}
136
+
app/views/edit.php CHANGED
@@ -3,7 +3,7 @@ if (! defined('ABSPATH')) {
3
die();
4
}
5
$InstaGalleryItem = null;
6
- if (isset($_GET['ig_item']) && ! empty( $_GET['ig_item']) ) {
7
$ig_item_id = (int) $_GET['ig_item'];
8
$InstaGalleryItems = get_option('insta_gallery_items');
9
if (isset($InstaGalleryItems[$ig_item_id])) {
@@ -21,62 +21,73 @@ if (isset($InstaGalleryItem['ig_select_from'])) {
21
}
22
}
23
$active_gallery = true;
24
$active_slider = false;
25
if (isset($InstaGalleryItem['ig_display_type'])) {
26
- if ($InstaGalleryItem['ig_display_type'] != 'gallery') {
27
$active_gallery = false;
28
$active_slider = true;
29
}
30
}
31
32
?>
33
<p>
34
- <a href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>" title="View Galleries List" class="ig-btn"><span
35
- class="dashicons dashicons-arrow-left-alt"></span>Back to List</a>
36
</p>
37
- <form method="post" id="ig-form-update" action="<?php if(empty($InstaGalleryItem)) echo INSGALLERY_URL_ADMIN_PAGE; ?>">
38
<table class="form-table ig-table-edit">
39
<tbody>
40
<tr>
41
<th scope="row">Display Instagram Gallery from:</th>
42
<td>
43
<ul class="ig-list-buttons">
44
- <li>
45
- <input type="radio" id="ig_select_from-username" name="ig_select_from" value="username"
46
- <?php if($active_username) echo 'checked';?> /><label for="ig_select_from-username">User Name</label>
47
- <div class="check"></div>
48
- </li>
49
- <li>
50
- <input type="radio" id="ig_select_from-tag" name="ig_select_from" value="tag"
51
- <?php if($active_tag) echo 'checked';?> /> <label for="ig_select_from-tag"># Tag</label>
52
- <div class="check"></div>
53
- </li>
54
- </ul> <span class="description"> (Please select option to show pics from Instagram Username OR # Tag.)</span>
55
56
</td>
57
</tr>
58
- <tr id="ig-select-username-wrap" class="ig-tab-content-row <?php if($active_username) echo 'active';?>">
59
<td colspan="100%">
60
<table>
61
<tr>
62
<th scope="row">Instagram User Name:</th>
63
<td><input name="insta_user" type="text" placeholder="MyUsername"
64
- value="<?php if(!empty($InstaGalleryItem['insta_user'])){echo $InstaGalleryItem['insta_user']; }?>" /> <span
65
- class="description">e.g. https://www.instagram.com/<strong style="font-size: 120%; color: #e23565;">MyUsername</strong>/
66
</span>
67
<p class="ig-generate-msgs">Please enter Instagram User Name.</p></td>
68
</tr>
69
</table>
70
</td>
71
</tr>
72
- <tr id="ig-select-tag-wrap" class="ig-tab-content-row <?php if($active_tag) echo 'active';?>">
73
<td colspan="100%">
74
<table>
75
<tr>
76
<th scope="row">Instagram # Tag:</th>
77
<td><input name="insta_tag" type="text" placeholder="beautiful"
78
- value="<?php if(!empty($InstaGalleryItem['insta_tag'])){echo $InstaGalleryItem['insta_tag']; }?>" /> <span
79
- class="description">e.g. https://www.instagram.com/explore/tags/<strong style="font-size: 120%; color: #e23565;">beautiful</strong>/
80
</span>
81
<p class="ig-generate-msgs">Please enter Instagram # Tag.</p></td>
82
</td>
@@ -94,57 +105,105 @@ if (isset($InstaGalleryItem['ig_display_type'])) {
94
<th scope="row">Show As:</th>
95
<td>
96
<ul class="ig-list-buttons">
97
- <li>
98
- <input type="radio" id="ig_display_type-gallery" name="ig_display_type" value="gallery"
99
- <?php if($active_gallery) echo 'checked';?> /><label for="ig_display_type-gallery">Gallery</label>
100
- <div class="check"></div>
101
- </li>
102
- <li>
103
- <input type="radio" id="ig_display_type-slider" name="ig_display_type" value="slider"
104
- <?php if($active_slider) echo 'checked';?> /><label for="ig_display_type-slider"> Slider</label>
105
- <div class="check"></div>
106
- </li>
107
</ul>
108
</td>
109
</tr>
110
- <tr id="ig-section-as-galllery" class="ig-tab-content-row <?php if($active_gallery) echo 'active';?>">
111
<td colspan="100%">
112
- <p>Pictures will be displayed as Grid and we can popup gallery by clicking them. </p>
113
<table>
114
<tr>
115
<th scope="row">No. of Pics Columns:</th>
116
<td><input name="insta_gal-cols" type="number" min="1" max="20"
117
value="<?php if(!empty($InstaGalleryItem['insta_gal-cols'])){echo $InstaGalleryItem['insta_gal-cols']; } else {echo 3;}?>" />
118
<span class="description">number of pics in a row. </span></td>
119
- <td rowspan="3"><img src="<?php echo INSGALLERY_URL; ?>/assests/media/demo-gallery.jpg" alt="demo gallery"
120
- width="500" /></td>
121
</tr>
122
<tr>
123
<th scope="row">Popup image on click:</th>
124
<td><input name="insta_gal-popup" type="checkbox" value="1"
125
- <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_gal-popup'])) ? '' : 'checked'; ?> /> <span
126
- class="description">show popup gallery by clicking on image <br />( uncheck this if it conflicts with other
127
- plugins)
128
</span></td>
129
</tr>
130
<tr>
131
<th scope="row">Image hover effect:</th>
132
<td><input name="insta_gal-hover" type="checkbox" value="1"
133
- <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_gal-hover'])) ? '' : 'checked'; ?> /> <span
134
- class="description">mouseover animation effect on image </span></td>
135
</tr>
136
<tr>
137
<th scope="row">Space between images:</th>
138
<td><input name="insta_gal-spacing" type="checkbox" value="1"
139
- <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_gal-spacing'])) ? '' : 'checked'; ?> /> <span
140
- class="description">add blank space between images </span></td>
141
</tr>
142
</table>
143
</td>
144
</tr>
145
- <tr id="ig-section-as-slider" class="ig-tab-content-row <?php if($active_slider) echo 'active';?>">
146
<td colspan="100%">
147
- <p>Pictures will be displayed as Slider. for better display pictures should be same size.</p>
148
<table>
149
<tr>
150
<th scope="row">Slide effect:</th>
@@ -153,8 +212,9 @@ if (isset($InstaGalleryItem['ig_display_type'])) {
153
<option value="slide"
154
<?php echo (isset($InstaGalleryItem['insta_sli-effect']) && ($InstaGalleryItem['insta_sli-effect']=='slide')) ? 'selected' : ''; ?>>slide</option>
155
</select> <span class="description">sliding effect/animation. </span></td>
156
- <td rowspan="5"><img src="<?php echo INSGALLERY_URL; ?>/assests/media/demo-slider.jpg" alt="demo slider"
157
- width="500" /></td>
158
</tr>
159
<tr>
160
<th scope="row">Slide timeout:</th>
@@ -171,29 +231,43 @@ if (isset($InstaGalleryItem['ig_display_type'])) {
171
<tr>
172
<th scope="row">Dotted navigation:</th>
173
<td><input name="insta_sli-dots" type="checkbox" value="1"
174
- <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_sli-dots'])) ? '' : 'checked'; ?> /> <span
175
- class="description">show dotted navigation buttons. </span></td>
176
</tr>
177
<tr>
178
<th scope="row">Scrollbar:</th>
179
<td><input name="insta_sli-scroll" type="checkbox" value="1"
180
- <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_sli-scroll'])) ? '' : 'checked'; ?> /> <span
181
- class="description">show scrollbar on slider bottom. </span></td>
182
</tr>
183
</table>
184
</td>
185
</tr>
186
</tbody>
187
</table>
188
<div>
189
<button class="button-primary ig-add-update" type="submit">
190
<span class="dashicons dashicons-plus"></span> Update / Add
191
</button>
192
- <p class="description">update info here and copy/paste generated shortcode in your post/pages.</p>
193
</div>
194
<input type="hidden" name="ig-form-update" value="true" />
195
<?php if(!empty($InstaGalleryItem['ig_item_id'])) {?>
196
- <input type="hidden" name="igitem_id" value="<?php echo $InstaGalleryItem['ig_item_id']; ?>" />
197
<?php } ?>
198
</form>
199
<script>
@@ -213,11 +287,15 @@ if (isset($InstaGalleryItem['ig_display_type'])) {
213
$('input[name="ig_display_type"]').on('change',function(){
214
215
if(this.value == 'gallery'){
216
- $('#ig-section-as-slider').hide(500, function() {
217
$('#ig-section-as-galllery').show( ).addClass('active');
218
}).removeClass('active');
219
- }else{
220
- $('#ig-section-as-galllery').hide(500, function() {
221
$('#ig-section-as-slider').show( ).addClass('active');
222
}).removeClass('active');
223
}
3
die();
4
}
5
$InstaGalleryItem = null;
6
+ if (isset($_GET['ig_item']) && ! empty($_GET['ig_item'])) {
7
$ig_item_id = (int) $_GET['ig_item'];
8
$InstaGalleryItems = get_option('insta_gallery_items');
9
if (isset($InstaGalleryItems[$ig_item_id])) {
21
}
22
}
23
$active_gallery = true;
24
+ $active_carousel = false;
25
$active_slider = false;
26
if (isset($InstaGalleryItem['ig_display_type'])) {
27
+ if ($InstaGalleryItem['ig_display_type'] == 'carousel') {
28
$active_gallery = false;
29
+ $active_carousel = true;
30
+ $active_slider = false;
31
+ } else if ($InstaGalleryItem['ig_display_type'] == 'slider') {
32
+ $active_gallery = false;
33
+ $active_carousel = false;
34
$active_slider = true;
35
}
36
}
37
38
?>
39
<p>
40
+ <a href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>" title="View Galleries List"
41
+ class="ig-btn"><span class="dashicons dashicons-arrow-left-alt"></span>Back to
42
+ List</a>
43
</p>
44
+ <form method="post" id="ig-form-update"
45
+ action="<?php if(empty($InstaGalleryItem)) echo INSGALLERY_URL_ADMIN_PAGE; ?>">
46
<table class="form-table ig-table-edit">
47
<tbody>
48
<tr>
49
<th scope="row">Display Instagram Gallery from:</th>
50
<td>
51
<ul class="ig-list-buttons">
52
+ <li><input type="radio" id="ig_select_from-username" name="ig_select_from"
53
+ value="username" <?php if($active_username) echo 'checked';?> /><label
54
+ for="ig_select_from-username">User Name</label>
55
+ <div class="check"></div></li>
56
+ <li><input type="radio" id="ig_select_from-tag" name="ig_select_from"
57
+ value="tag" <?php if($active_tag) echo 'checked';?> /> <label
58
+ for="ig_select_from-tag"># Tag</label>
59
+ <div class="check"></div></li>
60
+ </ul> <span class="description"> (Please select option to show pics from
61
+ Instagram Username OR # Tag.)</span>
62
63
</td>
64
</tr>
65
+ <tr id="ig-select-username-wrap"
66
+ class="ig-tab-content-row <?php if($active_username) echo 'active';?>">
67
<td colspan="100%">
68
<table>
69
<tr>
70
<th scope="row">Instagram User Name:</th>
71
<td><input name="insta_user" type="text" placeholder="MyUsername"
72
+ value="<?php if(!empty($InstaGalleryItem['insta_user'])){echo $InstaGalleryItem['insta_user']; }?>" />
73
+ <span class="description">e.g. https://www.instagram.com/<strong
74
+ class="ig-thm-color" style="font-size: 120%;">MyUsername</strong>/
75
</span>
76
<p class="ig-generate-msgs">Please enter Instagram User Name.</p></td>
77
</tr>
78
</table>
79
</td>
80
</tr>
81
+ <tr id="ig-select-tag-wrap"
82
+ class="ig-tab-content-row <?php if($active_tag) echo 'active';?>">
83
<td colspan="100%">
84
<table>
85
<tr>
86
<th scope="row">Instagram # Tag:</th>
87
<td><input name="insta_tag" type="text" placeholder="beautiful"
88
+ value="<?php if(!empty($InstaGalleryItem['insta_tag'])){echo $InstaGalleryItem['insta_tag']; }?>" />
89
+ <span class="description">e.g. https://www.instagram.com/explore/tags/<strong
90
+ style="font-size: 120%; color: #e23565;">beautiful</strong>/
91
</span>
92
<p class="ig-generate-msgs">Please enter Instagram # Tag.</p></td>
93
</td>
105
<th scope="row">Show As:</th>
106
<td>
107
<ul class="ig-list-buttons">
108
+ <li><input type="radio" id="ig_display_type-gallery"
109
+ name="ig_display_type" value="gallery"
110
+ <?php if($active_gallery) echo 'checked';?> /><label
111
+ for="ig_display_type-gallery">Gallery</label>
112
+ <div class="check"></div></li>
113
+ <li><input type="radio" id="ig_display_type-carousel"
114
+ name="ig_display_type" value="carousel"
115
+ <?php if($active_carousel) echo 'checked';?> /><label
116
+ for="ig_display_type-carousel">Carousel</label>
117
+ <div class="check"></div></li>
118
+ <li><input type="radio" id="ig_display_type-slider" name="ig_display_type"
119
+ value="slider" <?php if($active_slider) echo 'checked';?> /><label
120
+ for="ig_display_type-slider">Slider</label>
121
+ <div class="check"></div></li>
122
</ul>
123
</td>
124
</tr>
125
+ <tr id="ig-section-as-galllery"
126
+ class="ig-tab-content-row <?php if($active_gallery) echo 'active';?>">
127
<td colspan="100%">
128
+ <p>Pictures will be displayed as Grid and we can popup gallery by clicking
129
+ them.</p>
130
<table>
131
<tr>
132
<th scope="row">No. of Pics Columns:</th>
133
<td><input name="insta_gal-cols" type="number" min="1" max="20"
134
value="<?php if(!empty($InstaGalleryItem['insta_gal-cols'])){echo $InstaGalleryItem['insta_gal-cols']; } else {echo 3;}?>" />
135
<span class="description">number of pics in a row. </span></td>
136
+ <td rowspan="3"><img
137
+ src="<?php echo INSGALLERY_URL; ?>/assests/media/demo-gallery.jpg"
138
+ alt="demo gallery" width="500" /></td>
139
</tr>
140
<tr>
141
<th scope="row">Popup image on click:</th>
142
<td><input name="insta_gal-popup" type="checkbox" value="1"
143
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_gal-popup'])) ? '' : 'checked'; ?> />
144
+ <span class="description">show popup gallery by clicking on image <br />(
145
+ <span class="ig-thm-color">uncheck this if it conflicts with other
146
+ plugins, like: fancybox popup etc.</span> )
147
</span></td>
148
</tr>
149
<tr>
150
<th scope="row">Image hover effect:</th>
151
<td><input name="insta_gal-hover" type="checkbox" value="1"
152
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_gal-hover'])) ? '' : 'checked'; ?> />
153
+ <span class="description">mouseover animation effect on image </span></td>
154
</tr>
155
<tr>
156
<th scope="row">Space between images:</th>
157
<td><input name="insta_gal-spacing" type="checkbox" value="1"
158
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_gal-spacing'])) ? '' : 'checked'; ?> />
159
+ <span class="description">add blank space between images </span></td>
160
</tr>
161
</table>
162
</td>
163
</tr>
164
+ <tr id="ig-section-as-carousel"
165
+ class="ig-tab-content-row <?php if($active_carousel) echo 'active';?>">
166
<td colspan="100%">
167
+ <p>Pictures will be displayed as Carousel.</p>
168
+ <table>
169
+ <tr>
170
+ <th scope="row">Slides per view:</th>
171
+ <td><input name="insta_car-slidespv" type="number" min="1" max="10"
172
+ value="<?php if(!empty($InstaGalleryItem['insta_car-slidespv'])){echo $InstaGalleryItem['insta_car-slidespv']; } else {echo 5;}?>" />
173
+ <span class="description">display number of pictures per slide view. </span></td>
174
+ <td rowspan="5"><img
175
+ src="<?php echo INSGALLERY_URL; ?>/assests/media/demo-carousel.jpg"
176
+ alt="demo carousel" width="500" /></td>
177
+ </tr>
178
+ <tr>
179
+ <th scope="row">Navigation arrows:</th>
180
+ <td><input name="insta_car-navarrows" type="checkbox" value="1"
181
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_car-navarrows'])) ? '' : 'checked'; ?> />
182
+ <span class="description">show prev-next navigation arrows. </span></td>
183
+ </tr>
184
+ <tr>
185
+ <th scope="row">Dotted navigation:</th>
186
+ <td><input name="insta_car-dots" type="checkbox" value="1"
187
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_car-dots'])) ? '' : 'checked'; ?> />
188
+ <span class="description">show dotted navigation buttons. </span></td>
189
+ </tr>
190
+ <tr>
191
+ <th scope="row">Space Between:</th>
192
+ <td><input name="insta_car-spacing" type="checkbox" value="1"
193
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_car-spacing'])) ? '' : 'checked'; ?> />
194
+ <span class="description">add space between carousel items. </span></td>
195
+ </tr>
196
+ </table>
197
+ </td>
198
+ </tr>
199
+ <tr id="ig-section-as-slider"
200
+ class="ig-tab-content-row <?php if($active_slider) echo 'active';?>">
201
+ <td colspan="100%">
202
+ <p>
203
+ Pictures will be displayed as Slider. (<span class="ig-thm-color">for
204
+ better display pictures should be same size.</span>)
205
+ </p>
206
+ <p><u><i><span class="ig-thm-color">Deprecated: pictures different sizes issue.</span> (<strong><span class="ig-thm-color">Slider</span></strong> option will be removed in the next updates of the plugin.</i></u></p>
207
<table>
208
<tr>
209
<th scope="row">Slide effect:</th>
212
<option value="slide"
213
<?php echo (isset($InstaGalleryItem['insta_sli-effect']) && ($InstaGalleryItem['insta_sli-effect']=='slide')) ? 'selected' : ''; ?>>slide</option>
214
</select> <span class="description">sliding effect/animation. </span></td>
215
+ <td rowspan="5"><img
216
+ src="<?php echo INSGALLERY_URL; ?>/assests/media/demo-slider.jpg"
217
+ alt="demo slider" width="500" /></td>
218
</tr>
219
<tr>
220
<th scope="row">Slide timeout:</th>
231
<tr>
232
<th scope="row">Dotted navigation:</th>
233
<td><input name="insta_sli-dots" type="checkbox" value="1"
234
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_sli-dots'])) ? '' : 'checked'; ?> />
235
+ <span class="description">show dotted navigation buttons. </span></td>
236
</tr>
237
<tr>
238
<th scope="row">Scrollbar:</th>
239
<td><input name="insta_sli-scroll" type="checkbox" value="1"
240
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_sli-scroll'])) ? '' : 'checked'; ?> />
241
+ <span class="description">show scrollbar on slider bottom. </span></td>
242
</tr>
243
</table>
244
</td>
245
</tr>
246
+ <tr>
247
+ <th scope="row">Display Likes:</th>
248
+ <td><input name="insta_likes" type="checkbox" value="1"
249
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_likes'])) ? '' : 'checked'; ?> />
250
+ <span class="description">display likes count of images. </span></td>
251
+ </tr>
252
+ <tr>
253
+ <th scope="row">Display Comments:</th>
254
+ <td><input name="insta_comments" type="checkbox" value="1"
255
+ <?php echo (isset($InstaGalleryItem) && empty($InstaGalleryItem['insta_comments'])) ? '' : 'checked'; ?> />
256
+ <span class="description">display comments count of images. </span></td>
257
+ </tr>
258
</tbody>
259
</table>
260
<div>
261
<button class="button-primary ig-add-update" type="submit">
262
<span class="dashicons dashicons-plus"></span> Update / Add
263
</button>
264
+ <p class="description">update info here and copy/paste generated shortcode in
265
+ your post/pages.</p>
266
</div>
267
<input type="hidden" name="ig-form-update" value="true" />
268
<?php if(!empty($InstaGalleryItem['ig_item_id'])) {?>
269
+ <input type="hidden" name="igitem_id"
270
+ value="<?php echo $InstaGalleryItem['ig_item_id']; ?>" />
271
<?php } ?>
272
</form>
273
<script>
287
$('input[name="ig_display_type"]').on('change',function(){
288
289
if(this.value == 'gallery'){
290
+ $('#ig-section-as-slider,#ig-section-as-carousel').hide(500, function() {
291
$('#ig-section-as-galllery').show( ).addClass('active');
292
}).removeClass('active');
293
+ }else if(this.value == 'carousel'){
294
+ $('#ig-section-as-galllery,#ig-section-as-slider').hide(500, function() {
295
+ $('#ig-section-as-carousel').show( ).addClass('active');
296
+ }).removeClass('active');
297
+ } else {
298
+ $('#ig-section-as-galllery,#ig-section-as-carousel').hide(500, function() {
299
$('#ig-section-as-slider').show( ).addClass('active');
300
}).removeClass('active');
301
}
app/views/list.php CHANGED
@@ -5,17 +5,17 @@ if (! defined('ABSPATH')) {
5
$InstaGalleryItems = get_option('insta_gallery_items');
6
?>
7
<p>
8
- <a href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>&tab=edit" title="Add New Gallery" class="ig-btn"><span
9
- class="dashicons dashicons-plus"></span>Add New Gallery</a>
10
</p>
11
<?php
12
-
13
// update_option( 'insta_gallery_items', '' );
14
// delete_option('wpshout_tut_option');
15
if (empty($InstaGalleryItems)) {
16
?>
17
- <h3 class="ig-no-items-msg">It looks like you have not added any gallery yet. Please Click on 'ADD NEW GALLERY' to add
18
- one.</h3>
19
<?php } ?>
20
21
<?php if( !empty($InstaGalleryItems) && is_array($InstaGalleryItems) ){ ?>
@@ -36,7 +36,7 @@ if (empty($InstaGalleryItems)) {
36
<td>
37
<?php
38
39
- if ($IGItem['ig_select_from'] == 'username') {
40
echo 'Username / ' . $IGItem['insta_user'];
41
} else {
42
echo '# Tag / ' . $IGItem['insta_tag'];
@@ -44,15 +44,26 @@ if ($IGItem['ig_select_from'] == 'username') {
44
?>
45
</td>
46
<td><code>[insta-gallery id="<?php echo $k; ?>"]</code></td>
47
- <td><a href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>&tab=edit&ig_item=<?php echo $k; ?>" class="ig-btn"><span
48
- class="dashicons dashicons-edit"></span> Edit</a> <a
49
- href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>&ig_item_delete=<?php echo $k; ?>" class="ig-btn"
50
- onclick="return ig_item_delete();"><span class="dashicons dashicons-trash"></span> Delete</a></td>
51
</tr>
52
<?php } unset($i); ?>
53
</tbody>
54
</table>
55
</div>
56
<?php } ?>
57
58
<script>
5
$InstaGalleryItems = get_option('insta_gallery_items');
6
?>
7
<p>
8
+ <a href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>&tab=edit"
9
+ title="Add New Gallery" class="ig-btn"><span class="dashicons dashicons-plus"></span>Add
10
+ New Gallery</a>
11
</p>
12
<?php
13
// update_option( 'insta_gallery_items', '' );
14
// delete_option('wpshout_tut_option');
15
if (empty($InstaGalleryItems)) {
16
?>
17
+ <h3 class="ig-no-items-msg">It looks like you have not added any gallery yet.
18
+ Please Click on 'ADD NEW GALLERY' to add one.</h3>
19
<?php } ?>
20
21
<?php if( !empty($InstaGalleryItems) && is_array($InstaGalleryItems) ){ ?>
36
<td>
37
<?php
38
39
+ if ($IGItem['ig_select_from'] == 'username') {
40
echo 'Username / ' . $IGItem['insta_user'];
41
} else {
42
echo '# Tag / ' . $IGItem['insta_tag'];
44
?>
45
</td>
46
<td><code>[insta-gallery id="<?php echo $k; ?>"]</code></td>
47
+ <td><a
48
+ href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>&tab=edit&ig_item=<?php echo $k; ?>"
49
+ class="ig-btn"><span class="dashicons dashicons-edit"></span> Edit</a> <a
50
+ href="<?php echo INSGALLERY_URL_ADMIN_PAGE; ?>&ig_item_delete=<?php echo $k; ?>"
51
+ class="ig-btn" onclick="return ig_item_delete();"><span
52
+ class="dashicons dashicons-trash"></span> Delete</a></td>
53
</tr>
54
<?php } unset($i); ?>
55
</tbody>
56
</table>
57
</div>
58
+ <div class="ig_donation-wrap">
59
+ <p>
60
+ Donate Now to support the Advancement of this plugin.Thanks <a
61
+ class="ig_donation_btn" href="https://www.paypal.me/karanpay" target="blank">Donate
62
+ <img src="<?php echo INSGALLERY_URL; ?>/assests/media/paypal-logo.svg"
63
+ class="ig-logo" />
64
+ </a>
65
+ </p>
66
+ </div>
67
<?php } ?>
68
69
<script>
app/wp-front.php CHANGED
@@ -3,15 +3,18 @@ if (! defined('ABSPATH')) {
3
die();
4
}
5
6
- // Registering css.
7
add_action('wp_enqueue_scripts', 'insgal_enqueue_scripts');
8
function insgal_enqueue_scripts()
9
{
10
wp_enqueue_style('insta-gallery', INSGALLERY_URL . '/assests/style.css');
11
}
12
- include_once (INSGALLERY_PATH . 'app/ig-spider.php');
13
// shortcode added
14
add_shortcode('insta-gallery', 'insta_gallery');
15
// Insta-Gallery shortcode handler
16
function insta_gallery($atts)
17
{
@@ -37,11 +40,18 @@ function insta_gallery($atts)
37
$IGItem['insta_gal-popup'] = filter_var($IGItem['insta_gal-popup'], FILTER_VALIDATE_BOOLEAN);
38
$IGItem['insta_gal-hover'] = filter_var($IGItem['insta_gal-hover'], FILTER_VALIDATE_BOOLEAN);
39
$IGItem['insta_gal-spacing'] = filter_var($IGItem['insta_gal-spacing'], FILTER_VALIDATE_BOOLEAN);
40
- $IGItem['insta_sli-navarrows'] = filter_var($IGItem['insta_sli-navarrows'],
41
- FILTER_VALIDATE_BOOLEAN);
42
$IGItem['insta_sli-dots'] = filter_var($IGItem['insta_sli-dots'], FILTER_VALIDATE_BOOLEAN);
43
$IGItem['insta_sli-scroll'] = filter_var($IGItem['insta_sli-scroll'], FILTER_VALIDATE_BOOLEAN);
44
45
// continue to results
46
$results = '';
47
global $INSTAGAL_Results;
@@ -71,10 +81,11 @@ function insta_gallery($atts)
71
$instaItems = $INSTAGAL_Results[$instagram_reskey];
72
}
73
74
-
75
if (! empty($instaItems)) {
76
if ($IGItem['ig_display_type'] == 'gallery') {
77
include (INSGALLERY_PATH . 'templates/gallery.php');
78
} else {
79
include (INSGALLERY_PATH . 'templates/slider.php');
80
}
@@ -84,7 +95,7 @@ function insta_gallery($atts)
84
$results .= '<ul>';
85
$results .= '<li>your Instagram account may be private.</li>';
86
$results .= '<li>inavalid Instagram tag.</li>';
87
- $results .= '<li>some other network or server issue.</li>';
88
$results .= '</ul>';
89
}
90
}
@@ -93,86 +104,25 @@ function insta_gallery($atts)
93
94
/**
95
* ****
96
- *
97
*
98
- * below is for OLD shortcode support
99
*/
100
// shortcode added
101
add_shortcode('Insta-Gallery', 'instaGallery');
102
-
103
// Insta-Gallery shortcode handler
104
function instaGallery($atts)
105
{
106
- $av = shortcode_atts(
107
- array('user' => '','limit' => '12','type' => '','gal_cols' => '3','gal_imgpopup' => true,
108
- 'gal_imghover' => true,'sli_effect' => 'fade','sli_timeout' => 5000,
109
- 'sli_navarrows' => true,'sli_dots' => true,'sli_scroll' => true
110
- ), $atts);
111
-
112
- $av['gal_imgpopup'] = filter_var($av['gal_imgpopup'], FILTER_VALIDATE_BOOLEAN);
113
- $av['gal_imghover'] = filter_var($av['gal_imghover'], FILTER_VALIDATE_BOOLEAN);
114
- $av['sli_navarrows'] = filter_var($av['sli_navarrows'], FILTER_VALIDATE_BOOLEAN);
115
- $av['sli_dots'] = filter_var($av['sli_dots'], FILTER_VALIDATE_BOOLEAN);
116
- $av['sli_scroll'] = filter_var($av['sli_scroll'], FILTER_VALIDATE_BOOLEAN);
117
-
118
- if (empty($av['user']))
119
- return 'Please enter valid Instagram Account';
120
$results = '';
121
- global $INSTAGAL_Results;
122
-
123
- $instagram_user = $av['user'];
124
- $instagram_user = trim($instagram_user);
125
- if (substr($instagram_user, 0, 1) == '@')
126
- $instagram_user = substr($instagram_user, 1);
127
- if (! empty($INSTAGAL_Results[$instagram_user])) {
128
- $instaItems = $INSTAGAL_Results[$instagram_user];
129
- } else {
130
-
131
- $inURL = 'https://www.instagram.com/' . $instagram_user . '/media/';
132
- $instaItems = '';
133
- if (function_exists('curl_version')) {
134
- $ch = curl_init();
135
- curl_setopt($ch, CURLOPT_URL, $inURL);
136
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
137
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
138
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
139
- $contents = curl_exec($ch);
140
- if (curl_error($ch)) {
141
- // for debugging
142
- // echo 'error:' . curl_error($ch);
143
- }
144
- curl_close($ch);
145
- $instaItems = $contents;
146
- } else {
147
- if (ini_get('allow_url_fopen')) {
148
- $instaItems = @file_get_contents($inURL);
149
- } else {
150
- if (current_user_can('administrator')) {
151
- $results .= '<p>Your server does\'t have enabled the required extensions/functions.</p>';
152
- } else {
153
- // nothing to show
154
- }
155
- }
156
- }
157
-
158
- $INSTAGAL_Results[$instagram_user] = $instaItems;
159
- }
160
-
161
- $instaItems = @json_decode($instaItems);
162
- if (! empty($instaItems->items)) {
163
- if ($av['type'] == 'gallery') {
164
- include (INSGALLERY_PATH . '/templates/gallery-OLD.php');
165
- } else {
166
- include (INSGALLERY_PATH . '/templates/slider-OLD.php');
167
- }
168
- } else {
169
- if (current_user_can('administrator')) {
170
- $results .= '<p>ERROR: unable to get results. your instagram account may be private OR other issue. </p>';
171
- }
172
- }
173
// deprecated warning
174
if (current_user_can('administrator')) {
175
- $results .= '<p class="ig-deprecated-shortcode" style="color:#e23565;"> Deprecated Shortcode: It looks like you are using OLD shortcode. Please goto Instagram Gallery plugin page and generate a new Shortcode. </p>';
176
}
177
return $results;
178
}
3
die();
4
}
5
6
+ // Registering css.
7
add_action('wp_enqueue_scripts', 'insgal_enqueue_scripts');
8
+
9
function insgal_enqueue_scripts()
10
{
11
wp_enqueue_style('insta-gallery', INSGALLERY_URL . '/assests/style.css');
12
+ wp_enqueue_style( 'dashicons' );
13
}
14
+ include_once (INSGALLERY_PATH . 'app/Libra/InstagramSpider.php');
15
// shortcode added
16
add_shortcode('insta-gallery', 'insta_gallery');
17
+
18
// Insta-Gallery shortcode handler
19
function insta_gallery($atts)
20
{
40
$IGItem['insta_gal-popup'] = filter_var($IGItem['insta_gal-popup'], FILTER_VALIDATE_BOOLEAN);
41
$IGItem['insta_gal-hover'] = filter_var($IGItem['insta_gal-hover'], FILTER_VALIDATE_BOOLEAN);
42
$IGItem['insta_gal-spacing'] = filter_var($IGItem['insta_gal-spacing'], FILTER_VALIDATE_BOOLEAN);
43
+
44
+ $IGItem['insta_car-navarrows'] = @filter_var($IGItem['insta_car-navarrows'], FILTER_VALIDATE_BOOLEAN);
45
+ $IGItem['insta_car-dots'] = @filter_var($IGItem['insta_car-dots'], FILTER_VALIDATE_BOOLEAN);
46
+ $IGItem['insta_car-spacing'] = @filter_var($IGItem['insta_car-spacing'], FILTER_VALIDATE_BOOLEAN);
47
+
48
+ $IGItem['insta_sli-navarrows'] = filter_var($IGItem['insta_sli-navarrows'], FILTER_VALIDATE_BOOLEAN);
49
$IGItem['insta_sli-dots'] = filter_var($IGItem['insta_sli-dots'], FILTER_VALIDATE_BOOLEAN);
50
$IGItem['insta_sli-scroll'] = filter_var($IGItem['insta_sli-scroll'], FILTER_VALIDATE_BOOLEAN);
51
52
+ $IGItem['insta_likes'] = @filter_var($IGItem['insta_likes'], FILTER_VALIDATE_BOOLEAN);
53
+ $IGItem['insta_comments'] = @filter_var($IGItem['insta_comments'], FILTER_VALIDATE_BOOLEAN);
54
+
55
// continue to results
56
$results = '';
57
global $INSTAGAL_Results;
81
$instaItems = $INSTAGAL_Results[$instagram_reskey];
82
}
83
84
if (! empty($instaItems)) {
85
if ($IGItem['ig_display_type'] == 'gallery') {
86
include (INSGALLERY_PATH . 'templates/gallery.php');
87
+ } else if ($IGItem['ig_display_type'] == 'carousel') {
88
+ include (INSGALLERY_PATH . 'templates/carousel.php');
89
} else {
90
include (INSGALLERY_PATH . 'templates/slider.php');
91
}
95
$results .= '<ul>';
96
$results .= '<li>your Instagram account may be private.</li>';
97
$results .= '<li>inavalid Instagram tag.</li>';
98
+ $results .= '<li>network or server issue.</li>';
99
$results .= '</ul>';
100
}
101
}
104
105
/**
106
* ****
107
*
108
+ *
109
+ *
110
+ *
111
+ * OLD shortcode warning
112
+ *
113
+ *
114
+ *
115
+ *
116
*/
117
// shortcode added
118
add_shortcode('Insta-Gallery', 'instaGallery');
119
// Insta-Gallery shortcode handler
120
function instaGallery($atts)
121
{
122
$results = '';
123
// deprecated warning
124
if (current_user_can('administrator')) {
125
+ $results .= '<p class="ig-deprecated-shortcode" style="color:#e23565;">(Admin Notice) Shortcode Removed: It looks like you are using old shortcode. Please goto Instagram Gallery plugin page and regenerate new shortcode. </p>';
126
}
127
return $results;
128
}
app/wp-panel.php CHANGED
@@ -22,11 +22,17 @@ if (isset($_POST['ig-form-update'])) {
22
$IGItem['insta_gal-popup'] = @$POSTDATA['insta_gal-popup'];
23
$IGItem['insta_gal-hover'] = @$POSTDATA['insta_gal-hover'];
24
$IGItem['insta_gal-spacing'] = @$POSTDATA['insta_gal-spacing'];
25
$IGItem['insta_sli-effect'] = $POSTDATA['insta_sli-effect'];
26
$IGItem['insta_sli-timeout'] = $POSTDATA['insta_sli-timeout'];
27
$IGItem['insta_sli-navarrows'] = @$POSTDATA['insta_sli-navarrows'];
28
$IGItem['insta_sli-dots'] = @$POSTDATA['insta_sli-dots'];
29
$IGItem['insta_sli-scroll'] = @$POSTDATA['insta_sli-scroll'];
30
31
// removing @, # and trimming input
32
$IGItem['insta_user'] = trim($IGItem['insta_user']);
22
$IGItem['insta_gal-popup'] = @$POSTDATA['insta_gal-popup'];
23
$IGItem['insta_gal-hover'] = @$POSTDATA['insta_gal-hover'];
24
$IGItem['insta_gal-spacing'] = @$POSTDATA['insta_gal-spacing'];
25
+ $IGItem['insta_car-slidespv'] = $POSTDATA['insta_car-slidespv'];
26
+ $IGItem['insta_car-navarrows'] = @$POSTDATA['insta_car-navarrows'];
27
+ $IGItem['insta_car-dots'] = @$POSTDATA['insta_car-dots'];
28
+ $IGItem['insta_car-spacing'] = @$POSTDATA['insta_car-spacing'];
29
$IGItem['insta_sli-effect'] = $POSTDATA['insta_sli-effect'];
30
$IGItem['insta_sli-timeout'] = $POSTDATA['insta_sli-timeout'];
31
$IGItem['insta_sli-navarrows'] = @$POSTDATA['insta_sli-navarrows'];
32
$IGItem['insta_sli-dots'] = @$POSTDATA['insta_sli-dots'];
33
$IGItem['insta_sli-scroll'] = @$POSTDATA['insta_sli-scroll'];
34
+ $IGItem['insta_likes'] = @$POSTDATA['insta_likes'];
35
+ $IGItem['insta_comments'] = @$POSTDATA['insta_comments'];
36
37
// removing @, # and trimming input
38
$IGItem['insta_user'] = trim($IGItem['insta_user']);
assests/admin-style.css CHANGED
@@ -1,5 +1,7 @@
1
@CHARSET "ISO-8859-1";
2
-
3
.ig-page-header .ig-logo {
4
float: left;
5
margin-right: 20px;
@@ -166,4 +168,35 @@
166
}
167
.ig-table-edit input[type="checkbox"]:checked:before {
168
color: #e23565;
169
}
1
@CHARSET "ISO-8859-1";
2
+ .ig-thm-color{
3
+ color: #e23565;
4
+ }
5
.ig-page-header .ig-logo {
6
float: left;
7
margin-right: 20px;
168
}
169
.ig-table-edit input[type="checkbox"]:checked:before {
170
color: #e23565;
171
+ }
172
+
173
+ /* ******** paypal btn ********** */
174
+ .ig_donation-wrap {
175
+ padding: 10px 20px;
176
+ background: lightgoldenrodyellow;
177
+ margin-top: 35px;
178
+ }
179
+
180
+ .ig_donation-wrap p {
181
+ font-size: 125%;
182
+ }
183
+
184
+ .ig_donation_btn {
185
+ display: inline-block;
186
+ margin-left: 20px;
187
+ text-decoration: none;
188
+ padding: 6px 20px;
189
+ background: #fecb5d;
190
+ color: #23282d;
191
+ text-transform: uppercase;
192
+ box-shadow: 1px 1px 5px #888888;
193
+ font: bold 100%/24px sans-serif;
194
+ }
195
+ .ig_donation_btn:hover{
196
+ color: #fff;
197
+ background: #972dbe;
198
+ }
199
+ .ig_donation_btn img {
200
+ vertical-align: middle;
201
+ height: 24px;
202
}
assests/media/demo-carousel.jpg ADDED
Binary file
assests/media/demo-gallery.jpg CHANGED
Binary file
assests/media/paypal-logo.svg ADDED
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="27px" height="32px" viewBox="0 0 27 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Group 2</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="Group-2">
9
+ <path d="M22.7414035,2.38613277 C21.3298193,0.75049672 18.7792287,0.0498117292 15.5163136,0.0498117292 L6.04468477,0.0498117292 C5.37749301,0.0498117292 4.80977131,0.543400682 4.70584736,1.21299108 L0.761784999,26.641426 C0.683990499,27.143166 1.06553986,27.5969055 1.56496867,27.5969055 L7.41232395,27.5969055 L8.88121475,18.1269411 L8.83548821,18.4236982 C8.93970909,17.7541078 9.50267997,17.2608208 10.1695748,17.2608208 L12.9485012,17.2608208 C18.406884,17.2608208 22.6805338,15.0063117 23.9294027,8.48610732 C23.9662215,8.29289819 23.9979925,8.10572684 24.0262004,7.92217817 C23.868533,7.83704539 23.868533,7.83704539 24.0262004,7.92187628 C24.3979513,5.51159236 24.0235281,3.87172986 22.7414035,2.38613277" id="Fill-13" fill="#003087"></path>
10
+ <path d="M10.4591366,7.9539973 C10.521491,7.55127701 10.7759562,7.22131204 11.1183114,7.05436728 C11.2739004,6.97859307 11.4478988,6.93632858 11.6302111,6.93632858 L19.054835,6.93632858 C19.9343285,6.93632858 20.754437,6.99489509 21.504174,7.11776403 C21.7185543,7.15278318 21.926996,7.19323634 22.1294993,7.23882162 C22.3320025,7.28470879 22.5285672,7.33572808 22.7188965,7.39218137 C22.8142096,7.42055896 22.9077412,7.45014411 22.9997881,7.4812387 C23.3679758,7.60561708 23.7109249,7.75203338 24.0262598,7.92199703 C24.3980106,5.51171312 24.0235875,3.87154873 22.7414629,2.38625353 C21.3295818,0.750617476 18.7792881,0.0499324849 15.516373,0.0499324849 L6.04444722,0.0499324849 C5.37755239,0.0499324849 4.8098307,0.543219549 4.70590675,1.21311183 L0.761844384,26.6412449 C0.684049884,27.1429848 1.06530232,27.5967244 1.56502805,27.5967244 L7.41238333,27.5967244 L8.88127413,18.12676 L10.4591366,7.9539973 Z" id="Fill-15" fill="#003087"></path>
11
+ <path d="M24.0262301,7.92199703 L24.0262301,7.92199703 C23.9977253,8.1058476 23.9662512,8.29301895 23.9294324,8.48592619 C22.6805634,15.0061306 18.4066168,17.2609415 12.9485309,17.2609415 L10.1693076,17.2609415 C9.50241274,17.2609415 8.93944185,17.7542286 8.8355179,18.423819 L8.8355179,18.423819 L7.41235364,27.5967244 L7.00883179,30.198708 C6.94053891,30.637655 7.27428325,31.0346394 7.71135769,31.0346394 L12.6400252,31.0346394 C13.223484,31.0346394 13.7199436,30.6032396 13.8110997,30.0172726 L13.8592016,29.762478 L14.7876879,23.7763157 L14.8476669,23.445747 C14.9385261,22.8597799 15.4352826,22.4280782 16.0187413,22.4280782 L16.7560075,22.4280782 C21.5308676,22.4280782 25.2694575,20.4558357 26.3621436,14.7519398 C26.8185182,12.3682222 26.5824624,10.3787719 25.3754599,8.98011892 C25.0102415,8.55717205 24.5559454,8.20728239 24.0262301,7.92199703" id="Fill-17" fill="#009CDE"></path>
12
+ <path d="M22.7189856,7.39224175 C22.5286563,7.33578845 22.3320916,7.28446728 22.1295884,7.238882 C21.9270851,7.19299483 21.7183464,7.15284356 21.5042631,7.1178244 C20.7542291,6.99495547 19.9344176,6.93638895 19.0546271,6.93638895 L11.6300032,6.93638895 C11.4476909,6.93638895 11.2739895,6.97865345 11.1184005,7.05442766 C10.7757484,7.22137242 10.5215801,7.5510355 10.4592257,7.95405768 L8.88136321,18.1268203 L8.83563667,18.4238794 C8.93956062,17.7539871 9.50253151,17.2607 10.1694263,17.2607 L12.9486497,17.2607 C18.4067355,17.2607 22.6806822,15.006191 23.9292542,8.48598657 C23.9663699,8.29307932 23.9978441,8.10590798 24.0263489,7.92205741 C23.710717,7.75209375 23.3680649,7.60567746 22.9998772,7.48129908 C22.9078303,7.45020449 22.8140018,7.42061934 22.7189856,7.39224175" id="Fill-19" fill="#012169"></path>
13
+ </g>
14
+ </g>
15
+ </svg>
assests/style.css CHANGED
@@ -394,6 +394,7 @@ img.mfp-img {
394
height: 0px;
395
position: absolute;
396
z-index: 8;
397
transition: all .3s ease;
398
opacity: 0;
399
}
@@ -410,17 +411,110 @@ img.mfp-img {
410
margin: auto;
411
max-width: 100%;
412
}
413
/*
414
* slider
415
*/
416
417
- .swiper-slide img {
418
margin: auto;
419
float: none;
420
display: block;
421
}
422
423
424
/*
425
* responsive
426
*/
394
height: 0px;
395
position: absolute;
396
z-index: 8;
397
+ -webkit-transition: all .3s ease;
398
transition: all .3s ease;
399
opacity: 0;
400
}
411
margin: auto;
412
max-width: 100%;
413
}
414
+ .ig-likes-comments {
415
+ position: absolute;
416
+ top: 45%;
417
+ z-index: 9;
418
+ width: 100%;
419
+ color: #fff;
420
+ left: 0px;
421
+ -webkit-transition: all .5s ease;
422
+ transition: all .5s ease;
423
+ opacity: 0;
424
+ line-height: 20px;
425
+ font-size: 18px;
426
+ text-align: center;
427
+ }
428
+ .ig-likes-comments > span{
429
+ padding:0px 5px;
430
+ }
431
+ .ig-item a:hover .ig-likes-comments {
432
+ opacity: 1;
433
+ }
434
/*
435
* slider
436
*/
437
438
+ .instaslider .swiper-slide img {
439
margin: auto;
440
float: none;
441
display: block;
442
+ max-width: 100%;
443
}
444
445
+ /*
446
+ * carousel
447
+ */
448
+ .instacarousel .swiper-slide {
449
+ overflow: hidden;
450
+ }
451
452
+ .instacarousel .swiper-slide a:hover img {
453
+ transform: scale(1.2);
454
+ }
455
+
456
+ .instacarousel .swiper-slide img {
457
+ -webkit-transition: all .3s;
458
+ transition: all .3s;
459
+ }
460
+
461
+ .ic-likes-comments {
462
+ position: absolute;
463
+ top: -20%;
464
+ z-index: 9;
465
+ width: 100%;
466
+ color: #fff;
467
+ left: 0px;
468
+ -webkit-transition: all .5s ease;
469
+ transition: all .5s ease;
470
+ opacity: 0;
471
+ line-height: 20px;
472
+ font-size: 18px;
473
+ text-align: center;
474
+ }
475
+ .ic-likes-comments > span{
476
+ padding:0px 5px;
477
+ }
478
+ .instacarousel .swiper-slide a:hover .ic-likes-comments {
479
+ opacity: 1;
480
+ top: 45%;
481
+ }
482
+ .instacarousel .swiper-slide a:after {
483
+ content: "";
484
+ left: 50%;
485
+ top: 50%;
486
+ width: 0px;
487
+ height: 0px;
488
+ position: absolute;
489
+ z-index: 8;
490
+ -webkit-transition: all .5s ease;
491
+ transition: all .5s ease;
492
+ opacity: 0;
493
+ }
494
+ .instacarousel .swiper-slide a:hover:after {
495
+ background: #007aff;
496
+ width: 100%;
497
+ height: 100%;
498
+ opacity: 0.5;
499
+ left: 0px;
500
+ top: 0px;
501
+ }
502
+ /*
503
+ * common
504
+ */
505
+ .instaslider .swiper-button-next:hover, .instaslider .swiper-container-rtl .swiper-button-prev:hover,
506
+ .instacarousel .swiper-button-next:hover, .instacarousel .swiper-container-rtl .swiper-button-prev:hover {
507
+ background-image: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2027%2044%27%3E%3Cpath%20d%3D%27M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z%27%20fill%3D%27%23e23565%27/%3E%3C/svg%3E);
508
+ }
509
+ .instaslider .swiper-button-prev:hover, .instaslider .swiper-container-rtl .swiper-button-next:hover,
510
+ .instacarousel .swiper-button-prev:hover, .instacarousel .swiper-container-rtl .swiper-button-next:hover {
511
+ background-image: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2027%2044%27%3E%3Cpath%20d%3D%27M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z%27%20fill%3D%27%23e23565%27/%3E%3C/svg%3E);
512
+ }
513
+ .instaslider .swiper-button-next, .instaslider .swiper-button-prev,
514
+ .instacarousel .swiper-button-next, .instacarousel .swiper-button-prev{
515
+ -webkit-transition: all .3s;
516
+ transition: all .3s;
517
+ }
518
/*
519
* responsive
520
*/
insta-gallery.php CHANGED
@@ -3,9 +3,9 @@
3
* Plugin Name: Instagram Gallery
4
* Description: Display pictures on your website from Instagram.
5
* Author: Karan Singh
6
- * Author URI: http://karansingh.ml/
7
* Text Domain: insta-gallery
8
- * Version: 1.2.4
9
*/
10
11
// plugin global constants
3
* Plugin Name: Instagram Gallery
4
* Description: Display pictures on your website from Instagram.
5
* Author: Karan Singh
6
+ * Author URI: https://karansingh.ml/
7
* Text Domain: insta-gallery
8
+ * Version: 1.3.2
9
*/
10
11
// plugin global constants
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
=== Plugin Name ===
2
Contributors: Karan Singh
3
- Tags: instagram, gallery, pictures, slider, images, image gallery, image slider, instagram gallery, instagram pictures
4
Requires at least: 3.8.0
5
Tested up to: 4.7
6
- Stable tag: 1.2.4
7
License: GPLv2 or later
8
License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
Donate link: https://www.paypal.me/karanpay
@@ -12,14 +12,13 @@ Instagram Gallery is an easy way to display your Instagram pictures on the site.
12
13
== Description ==
14
15
- This plugin is an easy and simple way to display your Instagram images on the website.
16
- we can display pictures from Instagram account as Gallery or as Slider. Now there is also an option to display pictures from #Tag.
17
- this plugin updates new pictures as you upload new-one on Instagram.
18
19
- **Note:** you have to add your instagram account username.
20
- and profile needs to be publicly visible to show pictures.
21
22
- **Demo:** you can see live demo [HERE](http://karansingh.ml/public/demo/insta-gallery/). or check 'screenshots' section for demo.
23
24
**How to use:** add new gallery in plugin setting panel, generate shortcode and paste them in the pages/post content OR use the "echo do_shortcode( '[MyShortcode]' );" php code to add them in PHP file.
25
@@ -40,10 +39,6 @@ Upload and install in the same way you'd install any other plugin OR see [HERE](
40
41
== Frequently Asked Questions ==
42
43
- = can i add multiple galleries? =
44
-
45
- yes, you can add multiple galleries within a page.
46
-
47
= why my pictures are not showing on page? =
48
49
profile needs to be publicly visible to show pictures.
@@ -54,13 +49,21 @@ Yes you can.
54
55
== Screenshots ==
56
57
- 1. plugin backend
58
- 2. gallery front-end view
59
- 3. gallery front-end view with image popup
60
- 4. slider view
61
-
62
63
== Changelog ==
64
= 1.2.4 =
65
* IE images issue fixed
66
@@ -83,6 +86,12 @@ Yes you can.
83
84
85
== Upgrade Notice ==
86
= 1.2.3 =
87
update to fix IE issues
88
1
=== Plugin Name ===
2
Contributors: Karan Singh
3
+ Tags: instagram, gallery, pictures, slider, carousel slider, image gallery, image slider, instagram gallery, instagram pictures
4
Requires at least: 3.8.0
5
Tested up to: 4.7
6
+ Stable tag: 1.3.2
7
License: GPLv2 or later
8
License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
Donate link: https://www.paypal.me/karanpay
12
13
== Description ==
14
15
+ Easy and simple way to display your Instagram images on the website.
16
+ Display pictures from Instagram account as Gallery or as Carousel Slider. For this you have to paste your Instagram account username. It's also supports to display pictures from Instagram #Tag.
17
+ Plugin updates new pictures as you upload new-one on Instagram.
18
19
+ **Note:** Profile needs to be publicly visible to show pictures.
20
21
+ **Demo:** you can see live demo [HERE](https://karansingh.ml/public/demo/insta-gallery/). or check 'screenshots' section for demo.
22
23
**How to use:** add new gallery in plugin setting panel, generate shortcode and paste them in the pages/post content OR use the "echo do_shortcode( '[MyShortcode]' );" php code to add them in PHP file.
24
39
40
== Frequently Asked Questions ==
41
42
= why my pictures are not showing on page? =
43
44
profile needs to be publicly visible to show pictures.
49
50
== Screenshots ==
51
52
+ 1. Plugin backend
53
+ 2. Gallery front-end view
54
+ 3. Gallery front-end view with image popup
55
+ 4. Carousel Slider view
56
57
== Changelog ==
58
+ = 1.3.2 =
59
+ * display likes and comments
60
+ * old shortcode support ended
61
+ * deprecated Slider view option
62
+
63
+ = 1.3.1 =
64
+ * Carousel view feature added
65
+ * non-english tag/account supported
66
+
67
= 1.2.4 =
68
* IE images issue fixed
69
86
87
88
== Upgrade Notice ==
89
+ = 1.3.2 =
90
+ update to display Likes/Comments
91
+
92
+ = 1.3.1 =
93
+ update to display as Carousel
94
+
95
= 1.2.3 =
96
update to fix IE issues
97
templates/carousel.php ADDED
@@ -0,0 +1,118 @@
1
+ <?php
2
+ $insta_limit = $IGItem['insta_limit'];
3
+ $car_slidespv = $IGItem['insta_car-slidespv'];
4
+ $car_navarrows = $IGItem['insta_car-navarrows'];
5
+ $car_dots = $IGItem['insta_car-dots'];
6
+ $car_spacing = $IGItem['insta_car-spacing'];
7
+ $insta_likes = $IGItem['insta_likes'];
8
+ $insta_comments = $IGItem['insta_comments'];
9
+
10
+ $insta_source = ($IGItem['ig_select_from'] == 'username') ? 'user_' . $IGItem['insta_user'] : 'tag_' . $IGItem['insta_tag'];
11
+
12
+ global $instacar_COUNT;
13
+ if (empty($instacar_COUNT))
14
+ $instacar_COUNT = 0;
15
+ $instacar_COUNT ++;
16
+
17
+ // Registering scripts.
18
+ // wp_enqueue_style('swiper', INSGALLERY_URL . '/assests/swiper/swiper.min.css');
19
+ wp_enqueue_script('swiper', INSGALLERY_URL . '/assests/swiper/swiper.jquery.min.js');
20
+ wp_enqueue_script('magnific', INSGALLERY_URL . '/assests/magnific-popup/jquery.magnific-popup.min.js');
21
+
22
+ $i = 1;
23
+
24
+ $results .= '<div class="swiper-container instacarousel" data-source="' . $insta_source . '" id="instacarousel-' . $instacar_COUNT . '">';
25
+ $results .= '<div class="swiper-wrapper">';
26
+ foreach ($instaItems as $item) {
27
+ if (! empty($item['img_low']) && ! empty($item['img_standard'])) {
28
+ $results .= '<div class="swiper-slide" >';
29
+ $results .= '<a href="' . $item['img_standard'] . '" data-title="' .$item['caption']. '">';
30
+ $results .= '<img src="' . $item['img_low'] . '" alt="' .$item['caption']. '" />';
31
+ if ($insta_likes || $insta_comments) {
32
+ $results .= '<span class="ic-likes-comments">';
33
+ if ($insta_likes) {
34
+ $results .= '<span><span class="dashicons dashicons-heart"></span>' . $item['likes'] . '</span>';
35
+ }
36
+ if ($insta_comments) {
37
+ $results .= '<span><span class="dashicons dashicons-admin-comments"></span>' . $item['comments'] . '</span>';
38
+ }
39
+ $results .= '</span>';
40
+ }
41
+ $results .= '</a>';
42
+ $results .= '</div>';
43
+ }
44
+ $i ++;
45
+ if (($insta_limit != 0) && ($i > $insta_limit))
46
+ break;
47
+ }
48
+ $results .= '</div>';
49
+ $results .= '<div class="swiper-pagination"></div>';
50
+ if ($car_navarrows) {
51
+ $results .= '<div class="swiper-button-prev"></div><div class="swiper-button-next"></div>';
52
+ }
53
+ $results .= '</div>';
54
+
55
+ $JSICSelector = '#instacarousel-' . $instacar_COUNT;
56
+
57
+ $results .= "<script>
58
+ jQuery(document).ready(function ($) {
59
+ var mySwiper = new Swiper ('$JSICSelector', {
60
+ loop: true,autoplay: 3000,";
61
+ if ($car_dots) {
62
+ $results .= "pagination: '.swiper-pagination',
63
+ ";
64
+ }
65
+ if ($car_navarrows) {
66
+ $results .= "nextButton: '.swiper-button-next',
67
+ prevButton: '.swiper-button-prev',paginationClickable: true,";
68
+ }
69
+ if ($car_spacing) {
70
+ $results .= "spaceBetween: 20,";
71
+ }
72
+
73
+ $results .= "slidesPerView: $car_slidespv,";
74
+
75
+ $results .= "breakpoints: {";
76
+ if ($car_slidespv > 3) {
77
+ $results .= "1023: {
78
+ slidesPerView: 3,
79
+ spaceBetween: 20
80
+ },";
81
+ }
82
+ if ($car_slidespv > 2) {
83
+ $results .= "767: {
84
+ slidesPerView: 2,
85
+ spaceBetween: 15
86
+ },";
87
+ }
88
+ $results .= "420: {
89
+ slidesPerView: 1
90
+ }";
91
+ $results .= "}";
92
+
93
+ $results .= "});
94
+
95
+ jQuery('$JSICSelector .swiper-slide>a').magnificPopup({
96
+ type: 'image',
97
+ mainClass: 'mfp-with-zoom',
98
+ zoom: {
99
+ enabled: true,
100
+ duration: 300,
101
+ easing: 'ease-in-out',
102
+ opener: function(openerElement) {
103
+ return openerElement.is('img') ? openerElement : openerElement.find('img');
104
+ }
105
+ },
106
+ gallery: {
107
+ enabled: true
108
+ },
109
+ image: {
110
+ titleSrc: function(item) {
111
+ return item.el.attr('data-title');
112
+ }
113
+ }
114
+ });
115
+ });
116
+ </script>";
117
+
118
+ return $results;
templates/gallery-OLD.php DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- $insta_limit = $av['limit'];
3
- $gal_cols = $av['gal_cols'];
4
- $gal_imgpopup = $av['gal_imgpopup'];
5
- $gal_imghover = $av['gal_imghover'];
6
-
7
- global $instagal_COUNT;
8
- if(empty($instagal_COUNT))$instagal_COUNT = 0;
9
- $instagal_COUNT++;
10
- // Registering scripts.
11
- if ($gal_imgpopup) {
12
- // wp_enqueue_style('magnific', INSGALLERY_URL . '/assests/magnific-popup/magnific-popup.css');
13
- wp_enqueue_script('magnific', INSGALLERY_URL . '/assests/magnific-popup/jquery.magnific-popup.min.js');
14
- }
15
- $i = 1;
16
-
17
- $results .= '<div class="instagallery-items" id="instagallery-'.$instagal_COUNT.'">';
18
- foreach ($instaItems->items as $item) {
19
- if (! empty($item->images)) {
20
- $img_src = ($gal_cols == 1) ? $item->images->standard_resolution->url : $item->images->low_resolution->url;
21
- $hovered = $gal_imghover ? 'ighover' : '';
22
- $results .= '<div class="ig-item '.$hovered.' cols-' . $gal_cols . '" style="width:' . (100 / $gal_cols) . '%;">';
23
-
24
- $results .= '<a href="' . $item->images->standard_resolution->url . '">';
25
- $results .= '<img src="' . $img_src . '" />';
26
- $results .= '</a>';
27
- $results .= '</div>';
28
- }
29
- $i ++;
30
- if (($insta_limit != 0) && ($i > $insta_limit))
31
- break;
32
- }
33
- $results .= '</div>';
34
-
35
- if ($gal_imgpopup) {
36
-
37
- $JSIGSelector = '#instagallery-'.$instagal_COUNT.' .ig-item a';
38
- $rs = <<<JS
39
- <script>
40
- jQuery(document).ready(function ($) {
41
- jQuery('$JSIGSelector').magnificPopup({
42
- type: 'image',
43
- mainClass: 'mfp-with-zoom',
44
- zoom: {
45
- enabled: true,
46
- duration: 300,
47
- easing: 'ease-in-out',
48
- opener: function(openerElement) {
49
- return openerElement.is('img') ? openerElement : openerElement.find('img');
50
- }
51
- },
52
- gallery: {
53
- enabled: true
54
- },
55
- });
56
- });
57
- </script>
58
- JS;
59
- $results .= $rs;
60
- }
61
- return $results;
templates/gallery.php CHANGED
@@ -4,6 +4,8 @@ $gal_cols = $IGItem['insta_gal-cols'];
4
$gal_imgpopup = $IGItem['insta_gal-popup'];
5
$gal_imghover = $IGItem['insta_gal-hover'];
6
$gal_imgspacing = $IGItem['insta_gal-spacing'];
7
8
$insta_source = ($IGItem['ig_select_from'] == 'username') ? 'user_'. $IGItem['insta_user'] : 'tag_'. $IGItem['insta_tag'];
9
@@ -26,7 +28,7 @@ $results .= '<!--[if lt IE 9]>
26
</style>
27
<![endif]-->';
28
29
- $results .= '<div class="instagallery-items" data-source="'.$insta_source.'" id="instagallery-'.$instagal_COUNT.'">';
30
foreach ($instaItems as $item) {
31
32
$img_src = ($gal_cols == 1) ? $item['img_standard'] : $item['img_low'];
@@ -34,8 +36,18 @@ foreach ($instaItems as $item) {
34
$spacing = $gal_imgspacing ? '' : 'no-spacing';
35
$results .= '<div class="ig-item '.$hovered.' '. $spacing .' cols-' . $gal_cols . '" style="width:' . (100 / $gal_cols) . '%;">';
36
37
- $results .= '<a href="' . $item['img_standard'] . '">';
38
- $results .= '<img src="' . $img_src . '" alt="instagram"/>';
39
$results .= '</a>';
40
$results .= '</div>';
41
@@ -64,7 +76,12 @@ if ($gal_imgpopup) {
64
},
65
gallery: {
66
enabled: true
67
- },
68
});
69
});
70
</script>
4
$gal_imgpopup = $IGItem['insta_gal-popup'];
5
$gal_imghover = $IGItem['insta_gal-hover'];
6
$gal_imgspacing = $IGItem['insta_gal-spacing'];
7
+ $insta_likes = $IGItem['insta_likes'];
8
+ $insta_comments = $IGItem['insta_comments'];
9
10
$insta_source = ($IGItem['ig_select_from'] == 'username') ? 'user_'. $IGItem['insta_user'] : 'tag_'. $IGItem['insta_tag'];
11
28
</style>
29
<![endif]-->';
30
31
+ $results .= '<div class="instagallery-items instagallery" data-source="'.$insta_source.'" id="instagallery-'.$instagal_COUNT.'">';
32
foreach ($instaItems as $item) {
33
34
$img_src = ($gal_cols == 1) ? $item['img_standard'] : $item['img_low'];
36
$spacing = $gal_imgspacing ? '' : 'no-spacing';
37
$results .= '<div class="ig-item '.$hovered.' '. $spacing .' cols-' . $gal_cols . '" style="width:' . (100 / $gal_cols) . '%;">';
38
39
+ $results .= '<a href="' . $item['img_standard'] . '" data-title="' .$item['caption']. '">';
40
+ $results .= '<img src="' . $img_src . '" alt="' .$item['caption']. '"/>';
41
+ if($insta_likes || $insta_comments){
42
+ $results .= '<span class="ig-likes-comments">';
43
+ if($insta_likes){
44
+ $results .= '<span><span class="dashicons dashicons-heart"></span>' . $item['likes'] . '</span>';
45
+ }
46
+ if($insta_comments){
47
+ $results .= '<span><span class="dashicons dashicons-admin-comments"></span>' . $item['comments'] . '</span>';
48
+ }
49
+ $results .= '</span>';
50
+ }
51
$results .= '</a>';
52
$results .= '</div>';
53
76
},
77
gallery: {
78
enabled: true
79
+ },
80
+ image: {
81
+ titleSrc: function(item) {
82
+ return item.el.attr('data-title');
83
+ }
84
+ }
85
});
86
});
87
</script>
templates/slider-OLD.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- $insta_limit = $av['limit'];
3
- $sli_effect = $av['sli_effect'];
4
- $sli_timeout = (int) $av['sli_timeout'];
5
- $sli_navarrows = $av['sli_navarrows'];
6
- $sli_dots = $av['sli_dots'];
7
- $sli_scroll = $av['sli_scroll'];
8
-
9
- global $instasli_COUNT;
10
- if(empty($instasli_COUNT))$instasli_COUNT = 0;
11
- $instasli_COUNT++;
12
-
13
- // Registering scripts.
14
- // wp_enqueue_style('swiper', INSGALLERY_URL . '/assests/swiper/swiper.min.css');
15
- wp_enqueue_script('swiper', INSGALLERY_URL . '/assests/swiper/swiper.jquery.min.js');
16
-
17
- $i = 1;
18
-
19
- $results .= '<div class="swiper-container" id="instaslider-'.$instasli_COUNT.'">';
20
- $results .= '<div class="swiper-wrapper">';
21
- foreach ($instaItems->items as $item) {
22
- if (! empty($item->images->standard_resolution->url)) {
23
- $results .= '<div class="swiper-slide" >';
24
- $results .= '<img src="' . $item->images->standard_resolution->url . '" /></div>';
25
- }
26
- $i ++;
27
- if (($insta_limit != 0) && ($i > $insta_limit))
28
- break;
29
- }
30
- $results .= '</div>';
31
- $results .= '<div class="swiper-pagination"></div>';
32
- if ($sli_navarrows) {
33
- $results .= '<div class="swiper-button-prev"></div><div class="swiper-button-next"></div>';
34
- }
35
- if ($sli_scroll) {
36
- $results .= '<div class="swiper-scrollbar"></div>';
37
- }
38
- $results .= '</div>';
39
-
40
- $JSISSelector = '#instaslider-'.$instasli_COUNT;
41
-
42
- $results .= "<script>
43
- jQuery(document).ready(function () {
44
- var mySwiper = new Swiper ('$JSISSelector', {
45
- loop: true,";
46
- if ($sli_dots) {
47
- $results .= "pagination: '.swiper-pagination',
48
- ";
49
- }
50
- if ($sli_navarrows) {
51
- $results .= "nextButton: '.swiper-button-next',
52
- prevButton: '.swiper-button-prev',";
53
- }
54
- if ($sli_scroll) {
55
- $results .= "scrollbar: '.swiper-scrollbar',";
56
- }
57
-
58
- $results .= "effect: '$sli_effect',autoplay: '$sli_timeout',
59
- });
60
- });
61
- </script>";
62
-
63
- return $results;
templates/slider.php CHANGED
@@ -18,7 +18,7 @@ wp_enqueue_script('swiper', INSGALLERY_URL . '/assests/swiper/swiper.jquery.min.
18
19
$i = 1;
20
21
- $results .= '<div class="swiper-container" data-source="'.$insta_source.'" id="instaslider-'.$instasli_COUNT.'">';
22
$results .= '<div class="swiper-wrapper">';
23
foreach ($instaItems as $item) {
24
if (! empty($item['img_standard'])) {
@@ -42,7 +42,7 @@ $results .= '</div>';
42
$JSISSelector = '#instaslider-'.$instasli_COUNT;
43
44
$results .= "<script>
45
- jQuery(document).ready(function () {
46
var mySwiper = new Swiper ('$JSISSelector', {
47
loop: true,";
48
if ($sli_dots) {
18
19
$i = 1;
20
21
+ $results .= '<div class="swiper-container instaslider" data-source="'.$insta_source.'" id="instaslider-'.$instasli_COUNT.'">';
22
$results .= '<div class="swiper-wrapper">';
23
foreach ($instaItems as $item) {
24
if (! empty($item['img_standard'])) {
42
$JSISSelector = '#instaslider-'.$instasli_COUNT;
43
44
$results .= "<script>
45
+ jQuery(document).ready(function ($) {
46
var mySwiper = new Swiper ('$JSISSelector', {
47
loop: true,";
48
if ($sli_dots) {