Version Description
- Fix. small CSS fixes
Download this release
Release Info
Developer | quadlayers |
Plugin | Instagram Gallery |
Version | 3.0.4 |
Comparing to | |
See all releases |
Code changes from version 3.0.3 to 3.0.4
- assets/frontend/js/qligg.js +9 -3
- assets/frontend/js/qligg.min.js +1 -1
- includes/api/api.php +7 -0
- includes/api/apiFeed.php +95 -24
- includes/frontend.php +2 -2
- includes/helpers.php +1 -1
- insta-gallery.php +2 -2
- readme.txt +8 -2
assets/frontend/js/qligg.js
CHANGED
@@ -246,8 +246,14 @@
|
|
246 |
|
247 |
var media = '', profile = '', counter = '', caption = '', info = '', likes = '', date = '', comments = '';
|
248 |
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
counter = '<div class="mfp-icons"><div class="mfp-counter">' + (item.index + 1) + ' / ' + $('.insta-gallery-item', $wrap).length + '</div><a class="mfp-link" href="' + item.el.data('item').link + '" target="_blank" rel="noopener"><i class="qligg-icon-instagram"></i>Instagram</a></div>';
|
252 |
|
253 |
if (options.popup.profile) {
|
@@ -312,7 +318,7 @@
|
|
312 |
|
313 |
qligg_load_item_images($item, 0);
|
314 |
|
315 |
-
});
|
316 |
|
317 |
// IE8
|
318 |
// ---------------------------------------------------------------------------
|
246 |
|
247 |
var media = '', profile = '', counter = '', caption = '', info = '', likes = '', date = '', comments = '';
|
248 |
|
249 |
+
if (item.el.data('item').type && item.el.data('item').type == 'video') {
|
250 |
+
media = '\n\
|
251 |
+
<video autoplay>\n\
|
252 |
+
<source src="' + item.el.data('item').videos.standard + '" type="video/mp4">\n\
|
253 |
+
</video>'
|
254 |
+
} else {
|
255 |
+
media = '<img src="' + item.el.data('item').images.standard + '"/>'
|
256 |
+
}
|
257 |
counter = '<div class="mfp-icons"><div class="mfp-counter">' + (item.index + 1) + ' / ' + $('.insta-gallery-item', $wrap).length + '</div><a class="mfp-link" href="' + item.el.data('item').link + '" target="_blank" rel="noopener"><i class="qligg-icon-instagram"></i>Instagram</a></div>';
|
258 |
|
259 |
if (options.popup.profile) {
|
318 |
|
319 |
qligg_load_item_images($item, 0);
|
320 |
|
321 |
+
});
|
322 |
|
323 |
// IE8
|
324 |
// ---------------------------------------------------------------------------
|
assets/frontend/js/qligg.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function($){"use strict";var swiper_index=0,$swipers={};function qligg_load_item_images($item,next_max_id){var $wrap=$(".insta-gallery-list",$item),$spinner=$(".insta-gallery-spinner",$item),feed=$item.data("feed");$.ajax({url:qligg.ajax_url,type:"post",timeout:3e4,data:{action:"qligg_load_item_images",next_max_id:next_max_id,feed:JSON.stringify(feed)},beforeSend:function(){$spinner.show()},success:function(response){if(!0!==response.success)return $wrap.append($(response.data)),void $spinner.hide();var $images=$(response.data);$wrap.append($images).trigger("qligg.loaded",[$images])},complete:function(){},error:function(jqXHR,textStatus){$spinner.hide(),console.log(textStatus)}})}$(".insta-gallery-feed").on("qligg.loaded",(function(e,images){var $item=$(e.delegateTarget),$wrap=$(".insta-gallery-list",$item),$spinner=$(".insta-gallery-spinner",$item),$button=$(".insta-gallery-button.load",$item),options=$item.data("feed"),total=$(images).length,loaded=0;total&&$wrap.find(".insta-gallery-image").load((function(e){++loaded>=total&&$wrap.trigger("qligg.imagesLoaded",[images])})),total<options.limit&&($spinner.hide(),setTimeout((function(){$button.fadeOut()}),300))})),$(".insta-gallery-feed").on("qligg.imagesLoaded",(function(e){var $item=$(e.delegateTarget),$spinner;$(".insta-gallery-spinner",$item).hide()})),$(".insta-gallery-feed[data-feed_layout=gallery]").on("qligg.imagesLoaded",(function(e,images){var $item;$(e.delegateTarget).addClass("loaded"),$(images).each((function(i,item){setTimeout((function(){$(item).addClass("ig-image-loaded")}),150+30*i)}))})),$(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",(function(e,images){var $item;$(e.delegateTarget).addClass("loaded"),$(images).each((function(i,item){$(item).addClass("ig-image-loaded")}))})),$(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",(function(e,images){var $item=$(e.delegateTarget),$swiper=$(".swiper-container",$item),options=$item.data("feed");options.carousel.slides=options.carousel.slidespv,swiper_index++,$swipers[swiper_index]=new Swiper($swiper,{loop:!0,autoHeight:!0,observer:!0,observeParents:!0,slidesPerView:1,spaceBetween:2,autoplay:!!options.carousel.autoplay&&{delay:parseInt(options.carousel.autoplay_interval)},pagination:{el:".swiper-pagination",dynamicBullets:!0,clickable:!0,type:"bullets"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{320:{slidesPerView:1,spaceBetween:1},480:{spaceBetween:parseInt(options.spacing),slidesPerView:Math.min(2,parseInt(options.carousel.slides))},768:{spaceBetween:parseInt(options.spacing),slidesPerView:Math.min(3,parseInt(options.carousel.slides))},1024:{spaceBetween:parseInt(options.spacing),slidesPerView:parseInt(options.carousel.slides)}}})})),$(".insta-gallery-feed[data-feed_layout=masonry]").on("qligg.imagesLoaded",(function(e,images){var $item=$(e.delegateTarget),$wrap=$(".insta-gallery-list",$item);$wrap.data("masonry")?$wrap.masonry("appended",images,!1):$wrap.masonry({itemSelector:".insta-gallery-item",isResizable:!0,isAnimated:!1,transitionDuration:0,percentPosition:!0,columnWidth:".insta-gallery-item:last-child"})})),$(".insta-gallery-feed[data-feed_layout=masonry]").on("layoutComplete",(function(e,items){var $item;$(e.delegateTarget).addClass("loaded"),$(items).each((function(i,item){$(item.element).addClass("ig-image-loaded")}))})),$(".insta-gallery-feed").on("qligg.loaded",(function(e){var $item=$(e.delegateTarget),$wrap=$(".insta-gallery-list",$item),options=$item.data("feed");$(".insta-gallery-item .insta-gallery-icon.qligg-icon-instagram",$wrap).on("click",(function(e){e.stopPropagation()})),options.popup.display&&$(".insta-gallery-item",$wrap).magnificPopup({type:"inline",callbacks:{beforeOpen:function(){this.st.mainClass=this.st.mainClass+" qligg-mfp-wrap"},elementParse:function(item){var media="",profile="",counter="",caption="",info="",likes="",date="",comments="";media='<img src="'+item.el.data("item").images.standard+'"/>',counter='<div class="mfp-icons"><div class="mfp-counter">'+(item.index+1)+" / "+$(".insta-gallery-item",$wrap).length+'</div><a class="mfp-link" href="'+item.el.data("item").link+'" target="_blank" rel="noopener"><i class="qligg-icon-instagram"></i>Instagram</a></div>',options.popup.profile&&(profile='<div class="mfp-user"><img src="'+options.profile.profile_picture_url+'"><a href="https://www.instagram.com/'+options.profile.username+'" title="'+options.profile.name+'" target="_blank" rel="noopener">'+options.profile.username+"</a></div>"),options.popup.caption&&(caption='<div class="mfp-caption">'+item.el.data("item").caption+"</div>"),item.el.data("item").date&&(date='<div class="mfp-date">'+item.el.data("item").date+"</div>"),item.el.data("item").comments&&options.popup.comments&&(comments='<div class="mfp-comments"><i class="qligg-icon-comment"></i>'+item.el.data("item").comments+"</div>"),item.el.data("item").likes&&options.popup.likes&&(likes='<div class="mfp-likes"><i class="qligg-icon-heart"></i>'+item.el.data("item").likes+"</div>"),(options.popup.likes||options.popup.comments)&&(info='<div class="mfp-info">'+likes+comments+date+"</div>"),item.src='<div class="mfp-figure '+options.popup.align+'">'+media+'<div class="mfp-close"></div><div class="mfp-bottom-bar"><div class="mfp-title">'+profile+counter+caption+info+"</div></div></div>"}},gallery:{enabled:!0}})})),$(".insta-gallery-feed").on("click",".insta-gallery-button.load",(function(e){e.preventDefault();var $item=$(e.delegateTarget),next_max_id;if(!$item.hasClass("loaded"))return!1;qligg_load_item_images($item,$(".insta-gallery-list .insta-gallery-item:last-child",$item).data("item").i)})),$(".insta-gallery-feed").each((function(index,item){var $item=$(item);if($item.hasClass("loaded"))return!1;qligg_load_item_images($item,0)})),-1!=navigator.appVersion.indexOf("MSIE 8.")&&(document.body.className+=" instagal-ie-8"),-1!=navigator.appVersion.indexOf("MSIE 9.")&&(document.body.className+=" instagal-ie-9")}(jQuery);
|
1 |
+
!function($){"use strict";var swiper_index=0,$swipers={};function qligg_load_item_images($item,next_max_id){var $wrap=$(".insta-gallery-list",$item),$spinner=$(".insta-gallery-spinner",$item),feed=$item.data("feed");$.ajax({url:qligg.ajax_url,type:"post",timeout:3e4,data:{action:"qligg_load_item_images",next_max_id:next_max_id,feed:JSON.stringify(feed)},beforeSend:function(){$spinner.show()},success:function(response){if(!0!==response.success)return $wrap.append($(response.data)),void $spinner.hide();var $images=$(response.data);$wrap.append($images).trigger("qligg.loaded",[$images])},complete:function(){},error:function(jqXHR,textStatus){$spinner.hide(),console.log(textStatus)}})}$(".insta-gallery-feed").on("qligg.loaded",(function(e,images){var $item=$(e.delegateTarget),$wrap=$(".insta-gallery-list",$item),$spinner=$(".insta-gallery-spinner",$item),$button=$(".insta-gallery-button.load",$item),options=$item.data("feed"),total=$(images).length,loaded=0;total&&$wrap.find(".insta-gallery-image").load((function(e){++loaded>=total&&$wrap.trigger("qligg.imagesLoaded",[images])})),total<options.limit&&($spinner.hide(),setTimeout((function(){$button.fadeOut()}),300))})),$(".insta-gallery-feed").on("qligg.imagesLoaded",(function(e){var $item=$(e.delegateTarget),$spinner;$(".insta-gallery-spinner",$item).hide()})),$(".insta-gallery-feed[data-feed_layout=gallery]").on("qligg.imagesLoaded",(function(e,images){var $item;$(e.delegateTarget).addClass("loaded"),$(images).each((function(i,item){setTimeout((function(){$(item).addClass("ig-image-loaded")}),150+30*i)}))})),$(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",(function(e,images){var $item;$(e.delegateTarget).addClass("loaded"),$(images).each((function(i,item){$(item).addClass("ig-image-loaded")}))})),$(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",(function(e,images){var $item=$(e.delegateTarget),$swiper=$(".swiper-container",$item),options=$item.data("feed");options.carousel.slides=options.carousel.slidespv,swiper_index++,$swipers[swiper_index]=new Swiper($swiper,{loop:!0,autoHeight:!0,observer:!0,observeParents:!0,slidesPerView:1,spaceBetween:2,autoplay:!!options.carousel.autoplay&&{delay:parseInt(options.carousel.autoplay_interval)},pagination:{el:".swiper-pagination",dynamicBullets:!0,clickable:!0,type:"bullets"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{320:{slidesPerView:1,spaceBetween:1},480:{spaceBetween:parseInt(options.spacing),slidesPerView:Math.min(2,parseInt(options.carousel.slides))},768:{spaceBetween:parseInt(options.spacing),slidesPerView:Math.min(3,parseInt(options.carousel.slides))},1024:{spaceBetween:parseInt(options.spacing),slidesPerView:parseInt(options.carousel.slides)}}})})),$(".insta-gallery-feed[data-feed_layout=masonry]").on("qligg.imagesLoaded",(function(e,images){var $item=$(e.delegateTarget),$wrap=$(".insta-gallery-list",$item);$wrap.data("masonry")?$wrap.masonry("appended",images,!1):$wrap.masonry({itemSelector:".insta-gallery-item",isResizable:!0,isAnimated:!1,transitionDuration:0,percentPosition:!0,columnWidth:".insta-gallery-item:last-child"})})),$(".insta-gallery-feed[data-feed_layout=masonry]").on("layoutComplete",(function(e,items){var $item;$(e.delegateTarget).addClass("loaded"),$(items).each((function(i,item){$(item.element).addClass("ig-image-loaded")}))})),$(".insta-gallery-feed").on("qligg.loaded",(function(e){var $item=$(e.delegateTarget),$wrap=$(".insta-gallery-list",$item),options=$item.data("feed");$(".insta-gallery-item .insta-gallery-icon.qligg-icon-instagram",$wrap).on("click",(function(e){e.stopPropagation()})),options.popup.display&&$(".insta-gallery-item",$wrap).magnificPopup({type:"inline",callbacks:{beforeOpen:function(){this.st.mainClass=this.st.mainClass+" qligg-mfp-wrap"},elementParse:function(item){var media="",profile="",counter="",caption="",info="",likes="",date="",comments="";media=item.el.data("item").type&&"video"==item.el.data("item").type?'\n <video autoplay>\n <source src="'+item.el.data("item").videos.standard+'" type="video/mp4">\n </video>':'<img src="'+item.el.data("item").images.standard+'"/>',counter='<div class="mfp-icons"><div class="mfp-counter">'+(item.index+1)+" / "+$(".insta-gallery-item",$wrap).length+'</div><a class="mfp-link" href="'+item.el.data("item").link+'" target="_blank" rel="noopener"><i class="qligg-icon-instagram"></i>Instagram</a></div>',options.popup.profile&&(profile='<div class="mfp-user"><img src="'+options.profile.profile_picture_url+'"><a href="https://www.instagram.com/'+options.profile.username+'" title="'+options.profile.name+'" target="_blank" rel="noopener">'+options.profile.username+"</a></div>"),options.popup.caption&&(caption='<div class="mfp-caption">'+item.el.data("item").caption+"</div>"),item.el.data("item").date&&(date='<div class="mfp-date">'+item.el.data("item").date+"</div>"),item.el.data("item").comments&&options.popup.comments&&(comments='<div class="mfp-comments"><i class="qligg-icon-comment"></i>'+item.el.data("item").comments+"</div>"),item.el.data("item").likes&&options.popup.likes&&(likes='<div class="mfp-likes"><i class="qligg-icon-heart"></i>'+item.el.data("item").likes+"</div>"),(options.popup.likes||options.popup.comments)&&(info='<div class="mfp-info">'+likes+comments+date+"</div>"),item.src='<div class="mfp-figure '+options.popup.align+'">'+media+'<div class="mfp-close"></div><div class="mfp-bottom-bar"><div class="mfp-title">'+profile+counter+caption+info+"</div></div></div>"}},gallery:{enabled:!0}})})),$(".insta-gallery-feed").on("click",".insta-gallery-button.load",(function(e){e.preventDefault();var $item=$(e.delegateTarget),next_max_id;if(!$item.hasClass("loaded"))return!1;qligg_load_item_images($item,$(".insta-gallery-list .insta-gallery-item:last-child",$item).data("item").i)})),$(".insta-gallery-feed").each((function(index,item){var $item=$(item);if($item.hasClass("loaded"))return!1;qligg_load_item_images($item,0)})),-1!=navigator.appVersion.indexOf("MSIE 8.")&&(document.body.className+=" instagal-ie-8"),-1!=navigator.appVersion.indexOf("MSIE 9.")&&(document.body.className+=" instagal-ie-9")}(jQuery);
|
includes/api/api.php
CHANGED
@@ -17,6 +17,13 @@ abstract class QLIGG_API
|
|
17 |
{
|
18 |
global $qliggAPI;
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
return $qliggAPI->FEED->setupPersonalMediaItems($data, $last_id);
|
21 |
}
|
22 |
|
17 |
{
|
18 |
global $qliggAPI;
|
19 |
|
20 |
+
return $qliggAPI->FEED->setupMediaItems($data, $last_id);
|
21 |
+
}
|
22 |
+
|
23 |
+
function setupPersonalMediaItems($data, $last_id = null)
|
24 |
+
{
|
25 |
+
global $qliggAPI;
|
26 |
+
|
27 |
return $qliggAPI->FEED->setupPersonalMediaItems($data, $last_id);
|
28 |
}
|
29 |
|
includes/api/apiFeed.php
CHANGED
@@ -20,7 +20,7 @@ class QLIGG_API_Feed
|
|
20 |
return self::$_instance;
|
21 |
}
|
22 |
|
23 |
-
function
|
24 |
{
|
25 |
|
26 |
static $load = false;
|
@@ -38,30 +38,33 @@ class QLIGG_API_Feed
|
|
38 |
|
39 |
if ($load) {
|
40 |
|
41 |
-
|
|
|
|
|
42 |
|
43 |
-
$media_url = ($item
|
44 |
-
$date = isset($item['timestamp']) ? date_i18n('j F, Y', strtotime(trim(str_replace(array('T', '+', ' 0000'), ' ', $item['timestamp'])))) : false;
|
45 |
|
46 |
-
$
|
|
|
|
|
47 |
'i' => $i,
|
48 |
'id' => $item['id'],
|
49 |
'type' => strtolower(str_replace('_ALBUM', '', $item['media_type'])),
|
50 |
'media' => $media_url,
|
51 |
'images' => array(
|
52 |
-
'standard' => $
|
53 |
-
'medium' =>
|
54 |
-
'small' =>
|
55 |
),
|
56 |
'videos' => array(
|
57 |
-
'standard' => $
|
58 |
-
'medium' =>
|
59 |
-
'small' =>
|
60 |
),
|
61 |
'likes' => isset($item['like_count']) ? $item['like_count'] : false,
|
62 |
'comments' => isset($item['comments_count']) ? $item['comments_count'] : false,
|
63 |
'caption' => preg_replace('/(?<!\S)#([0-9a-zA-Z]+)/', "<a href=\"{$this->instagram_url}/explore/tags/$1\">#$1</a>", htmlspecialchars(@$item['caption'])),
|
64 |
-
'hashtags' =>
|
65 |
'link' => $item['permalink'],
|
66 |
'date' => $date
|
67 |
);
|
@@ -78,7 +81,7 @@ class QLIGG_API_Feed
|
|
78 |
return $instagram_items;
|
79 |
}
|
80 |
|
81 |
-
function
|
82 |
{
|
83 |
|
84 |
static $load = false;
|
@@ -96,30 +99,33 @@ class QLIGG_API_Feed
|
|
96 |
|
97 |
if ($load) {
|
98 |
|
99 |
-
|
|
|
|
|
100 |
|
101 |
-
$media_url = ($item
|
102 |
-
$date = isset($item['timestamp']) ? date_i18n('j F, Y', strtotime(trim(str_replace(array('T', '+', ' 0000'), ' ', $item['timestamp'])))) : false;
|
103 |
|
104 |
-
$
|
|
|
|
|
105 |
'i' => $i,
|
106 |
'id' => $item['id'],
|
107 |
'type' => strtolower(str_replace('_ALBUM', '', $item['media_type'])),
|
108 |
'media' => $media_url,
|
109 |
'images' => array(
|
110 |
-
'standard' =>
|
111 |
-
'medium' =>
|
112 |
-
'small' =>
|
113 |
),
|
114 |
'videos' => array(
|
115 |
-
'standard' =>
|
116 |
-
'medium' =>
|
117 |
-
'small' =>
|
118 |
),
|
119 |
'likes' => isset($item['like_count']) ? $item['like_count'] : false,
|
120 |
'comments' => isset($item['comments_count']) ? $item['comments_count'] : false,
|
121 |
'caption' => preg_replace('/(?<!\S)#([0-9a-zA-Z]+)/', "<a href=\"{$this->instagram_url}/explore/tags/$1\">#$1</a>", htmlspecialchars(@$item['caption'])),
|
122 |
-
'hashtags' =>
|
123 |
'link' => $item['permalink'],
|
124 |
'date' => $date
|
125 |
);
|
@@ -136,6 +142,71 @@ class QLIGG_API_Feed
|
|
136 |
return $instagram_items;
|
137 |
}
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
// Return messages
|
140 |
// ---------------------------------------------------------------------------
|
141 |
public function getMessages()
|
20 |
return self::$_instance;
|
21 |
}
|
22 |
|
23 |
+
function setupMediaItems($data, $last_id = null)
|
24 |
{
|
25 |
|
26 |
static $load = false;
|
38 |
|
39 |
if ($load) {
|
40 |
|
41 |
+
$hashtags = $this->getItemHashtags($item);
|
42 |
+
|
43 |
+
$image_url = $this->getItemImageURL($item);
|
44 |
|
45 |
+
$media_url = $this->getItemMediaURL($item);
|
|
|
46 |
|
47 |
+
$date = $this->getItemDate($item);
|
48 |
+
|
49 |
+
$instagram_items[] = array(
|
50 |
'i' => $i,
|
51 |
'id' => $item['id'],
|
52 |
'type' => strtolower(str_replace('_ALBUM', '', $item['media_type'])),
|
53 |
'media' => $media_url,
|
54 |
'images' => array(
|
55 |
+
'standard' => $image_url,
|
56 |
+
'medium' => "{$item['permalink']}media?size=m",
|
57 |
+
'small' => "{$item['permalink']}media?size=t",
|
58 |
),
|
59 |
'videos' => array(
|
60 |
+
'standard' => $media_url,
|
61 |
+
'medium' => $media_url,
|
62 |
+
'small' => $media_url,
|
63 |
),
|
64 |
'likes' => isset($item['like_count']) ? $item['like_count'] : false,
|
65 |
'comments' => isset($item['comments_count']) ? $item['comments_count'] : false,
|
66 |
'caption' => preg_replace('/(?<!\S)#([0-9a-zA-Z]+)/', "<a href=\"{$this->instagram_url}/explore/tags/$1\">#$1</a>", htmlspecialchars(@$item['caption'])),
|
67 |
+
'hashtags' => $hashtags, //array_map('utf8_encode', (array) @$hashtags[1]), // issue with uft 8 encode breakes json_encode
|
68 |
'link' => $item['permalink'],
|
69 |
'date' => $date
|
70 |
);
|
81 |
return $instagram_items;
|
82 |
}
|
83 |
|
84 |
+
function setupPersonalMediaItems($data, $last_id = null)
|
85 |
{
|
86 |
|
87 |
static $load = false;
|
99 |
|
100 |
if ($load) {
|
101 |
|
102 |
+
$hashtags = $this->getItemHashtags($item);
|
103 |
+
|
104 |
+
$image_url = $this->getItemImageURL($item);
|
105 |
|
106 |
+
$media_url = $this->getItemMediaURL($item);
|
|
|
107 |
|
108 |
+
$date = $this->getItemDate($item);
|
109 |
+
|
110 |
+
$instagram_items[] = array(
|
111 |
'i' => $i,
|
112 |
'id' => $item['id'],
|
113 |
'type' => strtolower(str_replace('_ALBUM', '', $item['media_type'])),
|
114 |
'media' => $media_url,
|
115 |
'images' => array(
|
116 |
+
'standard' => $image_url,
|
117 |
+
'medium' => $image_url,
|
118 |
+
'small' => $image_url,
|
119 |
),
|
120 |
'videos' => array(
|
121 |
+
'standard' => $media_url,
|
122 |
+
'medium' => $media_url,
|
123 |
+
'small' => $media_url,
|
124 |
),
|
125 |
'likes' => isset($item['like_count']) ? $item['like_count'] : false,
|
126 |
'comments' => isset($item['comments_count']) ? $item['comments_count'] : false,
|
127 |
'caption' => preg_replace('/(?<!\S)#([0-9a-zA-Z]+)/', "<a href=\"{$this->instagram_url}/explore/tags/$1\">#$1</a>", htmlspecialchars(@$item['caption'])),
|
128 |
+
'hashtags' => $hashtags, //array_map('utf8_encode', (array) @$hashtags[1]), // issue with uft 8 encode breakes json_encode
|
129 |
'link' => $item['permalink'],
|
130 |
'date' => $date
|
131 |
);
|
142 |
return $instagram_items;
|
143 |
}
|
144 |
|
145 |
+
function getItemMediaURL(array $item = [])
|
146 |
+
{
|
147 |
+
|
148 |
+
if (isset($item['media_type'])) {
|
149 |
+
|
150 |
+
switch ($item['media_type']) {
|
151 |
+
case 'IMAGE':
|
152 |
+
$image = @$item['media_url'];
|
153 |
+
break;
|
154 |
+
case 'VIDEO':
|
155 |
+
$image = @$item['media_url'];
|
156 |
+
break;
|
157 |
+
case 'CAROUSEL_ALBUM':
|
158 |
+
$image = @$item['children']['data'][0]['media_url'];
|
159 |
+
break;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
return $image;
|
164 |
+
}
|
165 |
+
|
166 |
+
function getItemImageURL(array $item = [])
|
167 |
+
{
|
168 |
+
|
169 |
+
if (isset($item['media_type'])) {
|
170 |
+
|
171 |
+
switch ($item['media_type']) {
|
172 |
+
case 'IMAGE':
|
173 |
+
$image = @$item['media_url'];
|
174 |
+
break;
|
175 |
+
case 'VIDEO':
|
176 |
+
$image = @$item['thumbnail_url'];
|
177 |
+
break;
|
178 |
+
case 'CAROUSEL_ALBUM':
|
179 |
+
$image = @$item['children']['data'][0]['media_url'];
|
180 |
+
break;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
return $image;
|
185 |
+
}
|
186 |
+
|
187 |
+
function getItemDate(array $item = [])
|
188 |
+
{
|
189 |
+
|
190 |
+
if (isset($item['timestamp'])) {
|
191 |
+
return date_i18n('j F, Y', strtotime(trim(str_replace(array('T', '+', ' 0000'), ' ', $item['timestamp']))));
|
192 |
+
}
|
193 |
+
|
194 |
+
return false;
|
195 |
+
}
|
196 |
+
|
197 |
+
function getItemHashtags(array $item = [])
|
198 |
+
{
|
199 |
+
|
200 |
+
if (isset($item['caption'])) {
|
201 |
+
|
202 |
+
preg_match_all('/(?<!\S)#([0-9a-zA-Z]+)/', $item['caption'], $hashtags);
|
203 |
+
|
204 |
+
if (isset($hashtags[1])) {
|
205 |
+
return $hashtags[1];
|
206 |
+
}
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
// Return messages
|
211 |
// ---------------------------------------------------------------------------
|
212 |
public function getMessages()
|
includes/frontend.php
CHANGED
@@ -148,9 +148,9 @@ if (!class_exists('QLIGG_Frontend')) {
|
|
148 |
$profile_info = $feed['profile'];
|
149 |
|
150 |
//if ($feed['type'] == 'username') {
|
151 |
-
|
152 |
|
153 |
-
|
154 |
//}
|
155 |
|
156 |
}
|
148 |
$profile_info = $feed['profile'];
|
149 |
|
150 |
//if ($feed['type'] == 'username') {
|
151 |
+
$profile_info = qligg_get_user_profile($feed['username']);
|
152 |
|
153 |
+
$feed['profile'] = array_merge($profile_info, array_filter($feed['profile']));
|
154 |
//}
|
155 |
|
156 |
}
|
includes/helpers.php
CHANGED
@@ -186,7 +186,7 @@ function qligg_get_user_media($feed, $last_id = null, $after = null)
|
|
186 |
set_transient($tk, $response, absint($settings['insta_reset']) * HOUR_IN_SECONDS);
|
187 |
}
|
188 |
|
189 |
-
$feeds = $qliggAPI->PERSONAL->
|
190 |
|
191 |
if (!$last_id) {
|
192 |
return $feeds;
|
186 |
set_transient($tk, $response, absint($settings['insta_reset']) * HOUR_IN_SECONDS);
|
187 |
}
|
188 |
|
189 |
+
$feeds = $qliggAPI->PERSONAL->setupPersonalMediaItems($response['data'], $last_id);
|
190 |
|
191 |
if (!$last_id) {
|
192 |
return $feeds;
|
insta-gallery.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Social Feed Gallery
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/instagram-feed-gallery/
|
6 |
* Description: Display beautiful and responsive galleries on your website from your Instagram feed account.
|
7 |
-
* Version: 3.0.
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
@@ -19,7 +19,7 @@ if (!defined('QLIGG_PLUGIN_NAME')) {
|
|
19 |
define('QLIGG_PLUGIN_NAME', 'Social Feed Gallery');
|
20 |
}
|
21 |
if (!defined('QLIGG_PLUGIN_VERSION')) {
|
22 |
-
define('QLIGG_PLUGIN_VERSION', '3.0.
|
23 |
}
|
24 |
if (!defined('QLIGG_PLUGIN_FILE')) {
|
25 |
define('QLIGG_PLUGIN_FILE', __FILE__);
|
4 |
* Plugin Name: Social Feed Gallery
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/instagram-feed-gallery/
|
6 |
* Description: Display beautiful and responsive galleries on your website from your Instagram feed account.
|
7 |
+
* Version: 3.0.4
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
19 |
define('QLIGG_PLUGIN_NAME', 'Social Feed Gallery');
|
20 |
}
|
21 |
if (!defined('QLIGG_PLUGIN_VERSION')) {
|
22 |
+
define('QLIGG_PLUGIN_VERSION', '3.0.4');
|
23 |
}
|
24 |
if (!defined('QLIGG_PLUGIN_FILE')) {
|
25 |
define('QLIGG_PLUGIN_FILE', __FILE__);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/portfolio/instagram-gallery/
|
|
4 |
Tags: Instagram, Instagram feed, Instagram gallery, Instagram photos, Instagram widget, Instagram pictures
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 5.5.0
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -105,12 +105,18 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
|
|
105 |
|
106 |
== Changelog ==
|
107 |
|
|
|
|
|
|
|
108 |
= 3.0.3 =
|
109 |
-
* Fix.
|
110 |
|
111 |
= 3.0.2 =
|
112 |
* Fix. small CSS fixes
|
113 |
|
|
|
|
|
|
|
114 |
= 3.0.0 =
|
115 |
* Fix. WordPress 5.5 compatibility
|
116 |
|
4 |
Tags: Instagram, Instagram feed, Instagram gallery, Instagram photos, Instagram widget, Instagram pictures
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 5.5.0
|
7 |
+
Stable tag: 3.0.4
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
105 |
|
106 |
== Changelog ==
|
107 |
|
108 |
+
= 3.0.4 =
|
109 |
+
* Fix. small CSS fixes
|
110 |
+
|
111 |
= 3.0.3 =
|
112 |
+
* Fix. small CSS fixes
|
113 |
|
114 |
= 3.0.2 =
|
115 |
* Fix. small CSS fixes
|
116 |
|
117 |
+
= 3.0.1 =
|
118 |
+
* Fix. small CSS fixes
|
119 |
+
|
120 |
= 3.0.0 =
|
121 |
* Fix. WordPress 5.5 compatibility
|
122 |
|