Version Description
Download this release
Release Info
Developer | slickremix |
Plugin | Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest |
Version | 2.4.4 |
Comparing to | |
See all releases |
Code changes from version 2.4.3 to 2.4.4
- feed-them.php +3 -3
- feeds/facebook/facebook-feed-post-types.php +90 -123
- feeds/facebook/facebook-feed.php +139 -165
- readme.txt +5 -2
feed-them.php
CHANGED
@@ -8,18 +8,18 @@
|
|
8 |
* Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
|
9 |
* Plugin URI: http://feedthemsocial.com/
|
10 |
* Description: Customize feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
|
11 |
-
* Version: 2.4.
|
12 |
* Author: SlickRemix
|
13 |
* Author URI: https://slickremix.com/
|
14 |
* Text Domain: feed-them-social
|
15 |
* Domain Path: /languages
|
16 |
* Requires at least: wordpress 4.0.0
|
17 |
* Tested up to: WordPress 4.9.6
|
18 |
-
* Stable tag: 2.4.
|
19 |
* License: GPLv2 or later
|
20 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
21 |
*
|
22 |
-
* @version 2.4.
|
23 |
* @package FeedThemSocial/Core
|
24 |
* @copyright Copyright (c) 2012-2018 SlickRemix
|
25 |
*
|
8 |
* Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
|
9 |
* Plugin URI: http://feedthemsocial.com/
|
10 |
* Description: Customize feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
|
11 |
+
* Version: 2.4.4
|
12 |
* Author: SlickRemix
|
13 |
* Author URI: https://slickremix.com/
|
14 |
* Text Domain: feed-them-social
|
15 |
* Domain Path: /languages
|
16 |
* Requires at least: wordpress 4.0.0
|
17 |
* Tested up to: WordPress 4.9.6
|
18 |
+
* Stable tag: 2.4.4
|
19 |
* License: GPLv2 or later
|
20 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
21 |
*
|
22 |
+
* @version 2.4.4
|
23 |
* @package FeedThemSocial/Core
|
24 |
* @copyright Copyright (c) 2012-2018 SlickRemix
|
25 |
*
|
feeds/facebook/facebook-feed-post-types.php
CHANGED
@@ -6,9 +6,7 @@
|
|
6 |
* @package feedthemsocial
|
7 |
* @since 1.9.6
|
8 |
*/
|
9 |
-
class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
10 |
-
{
|
11 |
-
|
12 |
|
13 |
|
14 |
/**
|
@@ -58,11 +56,9 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
58 |
$FBpost_object_id = isset($post_data->object_id) ? $post_data->object_id : "";
|
59 |
$FBalbum_photo_count = isset($post_data->count) ? $post_data->count : "";
|
60 |
$FBalbum_cover = isset($post_data->cover_photo->id) ? $post_data->cover_photo->id : "";
|
61 |
-
$FBalbum_picture = isset($post_data->
|
|
|
62 |
|
63 |
-
// echo '<pre>';
|
64 |
-
// print_r($FBalbum_picture);
|
65 |
-
// echo '</pre>';
|
66 |
|
67 |
$FBattachments = isset($post_data->attachments) ? $post_data->attachments : "";
|
68 |
// youtube and vimeo embed url
|
@@ -83,8 +79,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
83 |
if (isset($FBpost_full_ID[1])) {
|
84 |
$FBpost_single_id = $FBpost_full_ID[1];
|
85 |
}
|
86 |
-
}
|
87 |
-
else {
|
88 |
$FBpost_id = '';
|
89 |
$FBpost_user_id = '';
|
90 |
}
|
@@ -110,7 +105,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
110 |
$CustomDateCheck = get_option('fts-date-and-time-format') ? get_option('fts-date-and-time-format') : '';
|
111 |
|
112 |
$FBpictureGallery1 = isset($post_data->attachments->data[0]->subattachments->data[1]->media->image->src) ? $post_data->attachments->data[0]->subattachments->data[1]->media->image->src : '';
|
113 |
-
$FBpictureGallery2 = isset($post_data->attachments->data[0]->subattachments->data[2]->media->image->src)? $post_data->attachments->data[0]->subattachments->data[2]->media->image->src :
|
114 |
$FBpictureGallery3 = isset($post_data->attachments->data[0]->subattachments->data[3]->media->image->src) ? $post_data->attachments->data[0]->subattachments->data[3]->media->image->src : '';
|
115 |
|
116 |
// we get the width of the first attachment so we can set the max width for the frame around the main image and thumbs.. this makes it so our percent width on thumbnails are nice and aligned
|
@@ -203,19 +198,19 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
203 |
//Reviews
|
204 |
if ($FB_Shortcode['type'] == 'reviews') {
|
205 |
$itemscope_reviews = 'itemscope itemtype="http://schema.org/Review"';
|
206 |
-
$review_rating = '<meta itemprop="itemReviewed" itemscope itemtype="http://schema.org/CreativeWork"><div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" style="display: none;"><meta itemprop="worstRating" content = "1"><meta itemprop="ratingValue" content = "'
|
207 |
} else {
|
208 |
$itemscope_reviews = '';
|
209 |
$review_rating = '';
|
210 |
}
|
211 |
|
212 |
//Right Wrap
|
213 |
-
$FTS_FB_OUTPUT .= '<div ' . $itemscope_reviews . ' class="fts-jal-fb-right-wrap">'
|
214 |
|
215 |
//Top Wrap (Exluding : albums, album_photos, and hiding)
|
216 |
$hide_date_likes_comments = $FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['hide_date_likes_comments'] == 'yes' || $FB_Shortcode['type'] == 'albums' && $FB_Shortcode['hide_date_likes_comments'] == 'yes' ? 'hide-date-likes-comments-etc' : '';
|
217 |
|
218 |
-
$show_media = isset($FB_Shortcode['show_media']) ? $FB_Shortcode['show_media']
|
219 |
|
220 |
if ($show_media !== 'top') {
|
221 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-top-wrap ' . $hide_date_likes_comments . '">';
|
@@ -229,9 +224,9 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
229 |
|
230 |
if ($show_media !== 'top') {
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
|
236 |
//UserName
|
237 |
$FTS_FB_OUTPUT .= $FB_Shortcode['type'] == 'reviews' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') ? '<span class="fts-jal-fb-user-name" itemprop="author" itemscope itemtype="http://schema.org/Person"><a href="https://facebook.com/' . $post_data->reviewer->id . '/" target="_blank" ><span itemprop="name">' . $post_data->reviewer->name . '</span></a>' . $FTS_Facebook_Reviews->reviews_rating_format($FB_Shortcode, $post_data->rating) . '</span>' : '<span class="fts-jal-fb-user-name"><a href="https://facebook.com/' . $post_data->from->id . '" target="_blank">' . $post_data->from->name . '</a>' . $fb_hide_shared_by_etc_text . '</span>';
|
@@ -245,7 +240,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
245 |
}
|
246 |
|
247 |
|
248 |
-
if($FB_Shortcode['type'] !== 'reviews') {
|
249 |
//Comments Count
|
250 |
$FBpost_id_final = substr($FBpost_id, strpos($FBpost_id, "_") + 1);
|
251 |
}
|
@@ -263,16 +258,16 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
263 |
// Going to consider this for the future if facebook fixes the api to define when are checking in. Add '.$checked_in.' inside the fts-jal-fb-message div
|
264 |
// $checked_in = '<a target="_blank" class="fts-checked-in-img" href="https://www.facebook.com/'.$post_data->place->id.'"><img src="https://graph.facebook.com/'.$post_data->place->id.'/picture?width=150"/></a><a target="_blank" class="fts-checked-in-text-link" href="https://www.facebook.com/'.$post_data->place->id.'">'.__("Checked in at", "feed-them-social").' '.$post_data->place->name.'</a><br/> '.__("Location", "feed-them-social").': '.$post_data->place->location->city.', '.$post_data->place->location->country.' '.$post_data->place->location->zip.'<br/><a target="_blank" class="fts-fb-get-directions fts-checked-in-get-directions" href="https://www.facebook.com/'.$post_data->place->id.'">'.__("Get Direction", "feed-them-social").'</a>';
|
265 |
|
266 |
-
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message"'
|
267 |
|
268 |
$FTS_FB_OUTPUT .= !empty($trimmed_content) ? $trimmed_content : '';
|
269 |
//If POPUP
|
270 |
// $FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';
|
271 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div> ';
|
272 |
|
273 |
-
} elseif($show_media !== 'top') {
|
274 |
$FB_final_message = $this->fts_facebook_tag_filter($FBmessage);
|
275 |
-
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message"'
|
276 |
$FTS_FB_OUTPUT .= nl2br($FB_final_message);
|
277 |
//If POPUP
|
278 |
// $FTS_FB_OUTPUT .= isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';
|
@@ -280,8 +275,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
280 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div>';
|
281 |
}
|
282 |
|
283 |
-
}
|
284 |
-
elseif (!$FBmessage && $FB_Shortcode['type'] == 'album_photos' || !$FBmessage && $FB_Shortcode['type'] == 'albums') {
|
285 |
|
286 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">';
|
287 |
|
@@ -297,35 +291,37 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
297 |
$FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype, NULL, $FBby) : '';
|
298 |
|
299 |
|
300 |
-
|
301 |
//Output Photo Description
|
302 |
if (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
303 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-caption fts-fb-album-view-link">';
|
304 |
-
|
305 |
-
|
306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
if ($FB_Shortcode['play_btn'] !== 'yes') {
|
308 |
-
if(isset($post_data->format[3]->picture)){
|
309 |
$PhotoOption = $post_data->format[3]->picture;
|
310 |
-
}
|
311 |
-
elseif(isset($post_data->format[2]->picture)){
|
312 |
$PhotoOption = $post_data->format[2]->picture;
|
313 |
-
}
|
314 |
-
elseif(isset($post_data->format[1]->picture)){
|
315 |
$PhotoOption = $post_data->format[1]->picture;
|
316 |
-
}
|
317 |
-
elseif(isset($post_data->format[0]->picture)){
|
318 |
$PhotoOption = $post_data->format[0]->picture;
|
319 |
-
}
|
320 |
-
else {
|
321 |
$PhotoOption = '';
|
322 |
}
|
323 |
-
|
324 |
}
|
325 |
$FTS_FB_OUTPUT .= '</div>';
|
326 |
} else {
|
327 |
//photos
|
328 |
-
$FTS_FB_OUTPUT .= '<a href="'
|
329 |
}
|
330 |
|
331 |
// $FTS_FB_OUTPUT .= '<div class="fts-fb-caption"><a class="view-on-facebook-albums-link" href="' . $FBlink . '" target="_blank">' . __('View on Facebook', 'feed-them-social') . '</a></div>';
|
@@ -333,10 +329,10 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
333 |
|
334 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div>';
|
335 |
} //END Output Message
|
336 |
-
|
337 |
//If POPUP
|
338 |
// $FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-jal-fb-message"><div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div></div>' : '';
|
339 |
-
|
340 |
if ($show_media !== 'top') {
|
341 |
$FTS_FB_OUTPUT .= '</div>'; // end .fts-jal-fb-top-wrap <!--end fts-jal-fb-top-wrap -->
|
342 |
}
|
@@ -515,8 +511,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
515 |
|
516 |
if ($host == 'www.facebook.com' and $first_dir == 'events') {
|
517 |
$FTS_FB_OUTPUT .= $FBpicture ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $post_data->picture) : '';
|
518 |
-
}
|
519 |
-
elseif (strpos($FBlink, 'soundcloud') > 0) {
|
520 |
//Get the SoundCloud URL
|
521 |
$url = $FBlink;
|
522 |
//Get the JSON data of song details with embed code from SoundCloud oEmbed
|
@@ -529,14 +524,14 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
529 |
// echo str_replace('height="400"', 'height="140"', $jsonObj->html);
|
530 |
$fts_dynamic_vid_name_string = trim($this->rand_string(10) . '_' . $FB_Shortcode['type']);
|
531 |
$fts_dynamic_vid_name = 'feed_dynamic_video_class' . $fts_dynamic_vid_name_string;
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
$FTS_FB_OUTPUT .= '<script>';
|
541 |
$FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {';
|
542 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
@@ -610,22 +605,12 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
610 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-picture ' . $fts_dynamic_vid_name . '">';
|
611 |
|
612 |
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
// This puts the video in a popup instead of displaying it directly on the page.
|
619 |
if (is_plugin_active('feed-them-premium/feed-them-premium.php') && isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
620 |
$FTS_FB_OUTPUT .= '<a href="' . $post_data->source . '" class="fts-facebook-link-target fts-jal-fb-vid-html5video">';
|
621 |
}
|
622 |
|
623 |
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
$FTS_FB_OUTPUT .= '<img border="0" alt="' . $post_data->from->name . '" src="' . $post_data->full_picture . '"/>';
|
630 |
// CLOSE This puts the video in a popup instead of displaying it directly on the page.
|
631 |
// This puts the video in a popup instead of displaying it directly on the page.
|
@@ -637,7 +622,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
637 |
$FTS_FB_OUTPUT .= '<div class="fts-fluid-videoWrapper-html5"><video id="' . $fts_dynamic_vid_name . '" controls width="100%;" style="max-width:100%;"><source src="" type="video/mp4"></video></div><div class="slicker-facebook-album-photoshadow"></div></div>';
|
638 |
|
639 |
// This puts the video on the page instead of the popup if you don't have the premium version
|
640 |
-
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !=='yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == '' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
641 |
$FTS_FB_OUTPUT .= '<script>jQuery(document).ready(function() {';
|
642 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").bind("click", function() {';
|
643 |
$FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");';
|
@@ -657,8 +642,6 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
657 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-picture ' . $fts_dynamic_vid_name . '">';
|
658 |
|
659 |
|
660 |
-
|
661 |
-
|
662 |
if (strpos($FBvideo_embed, 'youtube') > 0 || strpos($FBvideo_embed, 'youtu.be') > 0) {
|
663 |
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $FBvideo_embed, $matches);
|
664 |
$videoURLfinal = 'https://www.youtube.com/watch?v=' . $matches[1];
|
@@ -667,30 +650,17 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
667 |
}
|
668 |
|
669 |
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
// This puts the video in a popup instead of displaying it directly on the page.
|
675 |
if (is_plugin_active('feed-them-premium/feed-them-premium.php') && isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
676 |
|
677 |
-
if(strpos($FBlink, 'youtube') > 0 || strpos($FBlink, 'youtu.be') > 0 || strpos($FBlink, 'vimeo') > 0){
|
678 |
$FTS_FB_OUTPUT .= '<a href="' . $videoURLfinal . '" class="fts-facebook-link-target fts-jal-fb-vid-image fts-iframe-type">';
|
679 |
-
}
|
680 |
-
else {
|
681 |
$FTS_FB_OUTPUT .= '<a href="' . $videoURLfinal . '" class="fts-facebook-link-target fts-jal-fb-vid-html5video">';
|
682 |
}
|
683 |
}
|
684 |
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
$FTS_FB_OUTPUT .= '<img class="fts-jal-fb-vid-image" border="0" alt="' . $post_data->from->name . '" src="' . $post_data->full_picture . '"/>';
|
695 |
|
696 |
|
@@ -708,7 +678,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
708 |
// $youtubeURLfinal = $matches[1];
|
709 |
|
710 |
// This puts the video on the page instead of the popup if you don't have the premium version
|
711 |
-
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !=='yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == '' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
712 |
$FTS_FB_OUTPUT .= '<script>jQuery(document).ready(function() {';
|
713 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
714 |
$FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");';
|
@@ -728,7 +698,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
728 |
// preg_match($pattern, $FBlink, $matches);
|
729 |
// $youtubeURLfinal = $matches[1];
|
730 |
// This puts the video in a popup instead of displaying it directly on the page.
|
731 |
-
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !=='yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == ' ' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
732 |
$FTS_FB_OUTPUT .= '<script>';
|
733 |
$FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {';
|
734 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
@@ -751,7 +721,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
751 |
// $vimeoURLfinal = $matches[0];
|
752 |
|
753 |
// This puts the video in a popup instead of displaying it directly on the page.
|
754 |
-
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !=='yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == '' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
755 |
$FTS_FB_OUTPUT .= '<script>';
|
756 |
$FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {';
|
757 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
@@ -798,8 +768,6 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
798 |
$photo_source_final = isset($photo_source->full_picture) && $FB_Shortcode['type'] == 'group' || isset($post_data->full_picture) && $FB_Shortcode['type'] == 'event' || isset($post_data->full_picture) && $FB_Shortcode['type'] == 'page' ? $post_data->full_picture : 'https://graph.facebook.com/' . $FBpost_object_id . '/picture';
|
799 |
|
800 |
|
801 |
-
|
802 |
-
|
803 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-link-wrap fts-album-photos-wrap"';
|
804 |
if ($FB_Shortcode['type'] == 'album_photos' || $FB_Shortcode['type'] == 'albums') {
|
805 |
$FTS_FB_OUTPUT .= ' style="line-height:' . $FB_Shortcode['image_height'] . ' !important;"';
|
@@ -815,7 +783,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
815 |
// $FTS_FB_OUTPUT .= $fts_fb_image_count;
|
816 |
if ($fts_fb_image_count == '0' || $fts_fb_image_count > 2) {
|
817 |
|
818 |
-
|
819 |
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $photo_source_final : $FBlink) . '" target="_blank" class="fts-jal-fb-picture fts-fb-large-photo" ><img border="0" alt="' . $post_data->from->name . '" src="' . $photo_source_final . '"></a>';
|
820 |
|
821 |
}
|
@@ -826,7 +794,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
826 |
|
827 |
// we count the number of attachments in the subattachments->data portion of the array and count the objects http://php.net/manual/en/function.count.php
|
828 |
$fts_fb_image_counter = $fts_fb_image_count - 3;
|
829 |
-
$fts_fb_image_count_output = '<div class="fts-image-count-tint-underlay"></div><div class="fts-image-count"><span>+</span>'
|
830 |
|
831 |
$fts_fb_image_count_check = $fts_fb_image_count < 3 ? ' fts-more-images-tint' : '';
|
832 |
|
@@ -834,50 +802,47 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
834 |
// if we only have 2 photos we show them side by side
|
835 |
$FBpictureGallery2True = $FBpictureGallery2 == '' ? ' fts-more-photos-auto-width' : '';
|
836 |
// if we have 3 photos we add this class so we can make the 2 attachments below the large image will fit side by side
|
837 |
-
$FBpictureGallery3True = $FBpictureGallery3 == ''
|
838 |
|
839 |
$columnsCSS = '';
|
840 |
|
841 |
-
|
842 |
|
843 |
-
if($fts_fb_image_count === 2){
|
844 |
$columns = '2';
|
845 |
$columnsCSS = 'fts-more-photos-2-or-3-photos ';
|
846 |
$morethan3 = 'fts-2-photos ';
|
847 |
-
}
|
848 |
-
elseif($fts_fb_image_count === 3) {
|
849 |
$columns = '2';
|
850 |
$columnsCSS = 'fts-more-photos-2-or-3-photos ';
|
851 |
$morethan3 = 'fts-3-photos ';
|
852 |
-
}
|
853 |
-
elseif($fts_fb_image_count >= 4) {
|
854 |
$columns = '3';
|
855 |
$columnsCSS = 'fts-more-photos-4-photos ';
|
856 |
$morethan3 = 'fts-4-photos ';
|
857 |
}
|
858 |
|
859 |
-
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div><div class="'
|
860 |
}
|
861 |
-
|
862 |
-
|
863 |
|
864 |
-
|
865 |
if ($FBpictureGallery1 !== '') {
|
866 |
-
|
867 |
|
868 |
-
if($FBpictureGallery2 !== ''){
|
869 |
-
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $FBpictureGallery2 : $FBpictureGalleryLink2) . '" target="_blank" class="fts-2-or-3-photos slicker-facebook-placeholder fts-fb-thumbs-wrap '
|
870 |
|
871 |
}
|
872 |
-
if($FBpictureGallery3 !== ''){
|
873 |
-
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $FBpictureGallery3 : $FBpictureGalleryLink3) . '" target="_blank" class="slicker-facebook-placeholder fts-fb-thumbs-wrap '
|
874 |
}
|
875 |
}
|
876 |
if ($FBpictureGallery1 !== '') {
|
877 |
$FTS_FB_OUTPUT .= '</div>';
|
878 |
}
|
879 |
-
}
|
880 |
-
else {
|
881 |
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $photo_source_final : $FBlink) . '" target="_blank" class="fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . $post_data->from->name . '" src="' . $photo_source_final . '"></a>';
|
882 |
}
|
883 |
} elseif ($FBpicture) {
|
@@ -885,13 +850,11 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
885 |
$FTS_FB_OUTPUT .= $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, 'https://graph.facebook.com/' . $FBpost_object_id . '/picture');
|
886 |
} else {
|
887 |
|
888 |
-
if(isset($post_data->format[1]->picture)){
|
889 |
$video_photo = $post_data->format[1]->picture;
|
890 |
-
}
|
891 |
-
elseif(isset($post_data->format[0]->picture)){
|
892 |
$video_photo = $post_data->format[0]->picture;
|
893 |
-
}
|
894 |
-
else{
|
895 |
$video_photo = $post_data->picture;
|
896 |
}
|
897 |
|
@@ -937,8 +900,13 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
937 |
$FTS_FB_OUTPUT .= ' style="line-height:' . $FB_Shortcode['image_height'] . ' !important;"';
|
938 |
}
|
939 |
$FTS_FB_OUTPUT .= '>';
|
|
|
|
|
|
|
|
|
|
|
940 |
//Output Photo Picture
|
941 |
-
$FTS_FB_OUTPUT .= $FBalbum_cover ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $
|
942 |
$FTS_FB_OUTPUT .= '<div class="slicker-facebook-album-photoshadow"></div>';
|
943 |
if (!$FB_Shortcode['type'] == 'albums') {
|
944 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">';
|
@@ -959,7 +927,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
959 |
//Post Comments
|
960 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-comments-wrap">';
|
961 |
$hide_comments_popup = isset($FB_Shortcode['hide_comments_popup']) ? $FB_Shortcode['hide_comments_popup'] : 'no';
|
962 |
-
if (isset($lcs_array['comments_thread']->data) && !empty($lcs_array['comments_thread']->data) && $hide_comments_popup !== 'yes' || isset($lcs_array['comments_thread']->data) && !empty($lcs_array['comments_thread']->data) && $hide_comments_popup == ''){
|
963 |
//Post Comments
|
964 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-comments-content fts-comments-post-' . $FBpost_id . '">';
|
965 |
|
@@ -969,7 +937,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
969 |
$avatar_id = isset($comment->from->id) ? $comment->from->id : '118790751525884';
|
970 |
$FTS_FB_OUTPUT .= '<img class="fts-fb-comment-user-pic" src="https://graph.facebook.com/' . $avatar_id . '/picture?type=square"/>';
|
971 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-comment-msg">';
|
972 |
-
if(isset($comment->from->name)) {
|
973 |
$FTS_FB_OUTPUT .= '<span class="fts-fb-comment-user-name">' . $comment->from->name . '</span> ';
|
974 |
}
|
975 |
$FTS_FB_OUTPUT .= $comment->message . '</div>';
|
@@ -996,19 +964,19 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
996 |
$FTS_FB_OUTPUT .= '<div class="fts-mashup-icon-wrap-left fts-mashup-facebook-icon"><a href="https://facebook.com/' . $post_data->from->id . '" target="_blank"></a></div>';
|
997 |
}
|
998 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-top-wrap ' . $hide_date_likes_comments . '" style="display:block !important;">';
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
|
1003 |
-
|
1004 |
-
|
1005 |
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
|
1013 |
// here we trim the words for the premium version. The $FB_Shortcode['words'] string actually comes from the javascript
|
1014 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php') && array_key_exists('words', $FB_Shortcode) || is_plugin_active('feed-them-premium/feed-them-premium.php') && array_key_exists('words', $FB_Shortcode)) {
|
@@ -1025,8 +993,7 @@ class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed
|
|
1025 |
// $FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';
|
1026 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div> ';
|
1027 |
|
1028 |
-
}
|
1029 |
-
else {
|
1030 |
$FB_final_message = $this->fts_facebook_tag_filter($FBmessage);
|
1031 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message">';
|
1032 |
$FTS_FB_OUTPUT .= nl2br($FB_final_message);
|
6 |
* @package feedthemsocial
|
7 |
* @since 1.9.6
|
8 |
*/
|
9 |
+
class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed {
|
|
|
|
|
10 |
|
11 |
|
12 |
/**
|
56 |
$FBpost_object_id = isset($post_data->object_id) ? $post_data->object_id : "";
|
57 |
$FBalbum_photo_count = isset($post_data->count) ? $post_data->count : "";
|
58 |
$FBalbum_cover = isset($post_data->cover_photo->id) ? $post_data->cover_photo->id : "";
|
59 |
+
$FBalbum_picture = isset($post_data->source) ? $post_data->source : '';
|
60 |
+
|
61 |
|
|
|
|
|
|
|
62 |
|
63 |
$FBattachments = isset($post_data->attachments) ? $post_data->attachments : "";
|
64 |
// youtube and vimeo embed url
|
79 |
if (isset($FBpost_full_ID[1])) {
|
80 |
$FBpost_single_id = $FBpost_full_ID[1];
|
81 |
}
|
82 |
+
} else {
|
|
|
83 |
$FBpost_id = '';
|
84 |
$FBpost_user_id = '';
|
85 |
}
|
105 |
$CustomDateCheck = get_option('fts-date-and-time-format') ? get_option('fts-date-and-time-format') : '';
|
106 |
|
107 |
$FBpictureGallery1 = isset($post_data->attachments->data[0]->subattachments->data[1]->media->image->src) ? $post_data->attachments->data[0]->subattachments->data[1]->media->image->src : '';
|
108 |
+
$FBpictureGallery2 = isset($post_data->attachments->data[0]->subattachments->data[2]->media->image->src) ? $post_data->attachments->data[0]->subattachments->data[2]->media->image->src : '';
|
109 |
$FBpictureGallery3 = isset($post_data->attachments->data[0]->subattachments->data[3]->media->image->src) ? $post_data->attachments->data[0]->subattachments->data[3]->media->image->src : '';
|
110 |
|
111 |
// we get the width of the first attachment so we can set the max width for the frame around the main image and thumbs.. this makes it so our percent width on thumbnails are nice and aligned
|
198 |
//Reviews
|
199 |
if ($FB_Shortcode['type'] == 'reviews') {
|
200 |
$itemscope_reviews = 'itemscope itemtype="http://schema.org/Review"';
|
201 |
+
$review_rating = '<meta itemprop="itemReviewed" itemscope itemtype="http://schema.org/CreativeWork"><div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" style="display: none;"><meta itemprop="worstRating" content = "1"><meta itemprop="ratingValue" content = "' . $post_data->rating . '"><meta itemprop="bestRating" content = "5"></div>';
|
202 |
} else {
|
203 |
$itemscope_reviews = '';
|
204 |
$review_rating = '';
|
205 |
}
|
206 |
|
207 |
//Right Wrap
|
208 |
+
$FTS_FB_OUTPUT .= '<div ' . $itemscope_reviews . ' class="fts-jal-fb-right-wrap">' . $review_rating . '';
|
209 |
|
210 |
//Top Wrap (Exluding : albums, album_photos, and hiding)
|
211 |
$hide_date_likes_comments = $FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['hide_date_likes_comments'] == 'yes' || $FB_Shortcode['type'] == 'albums' && $FB_Shortcode['hide_date_likes_comments'] == 'yes' ? 'hide-date-likes-comments-etc' : '';
|
212 |
|
213 |
+
$show_media = isset($FB_Shortcode['show_media']) ? $FB_Shortcode['show_media'] : 'bottom';
|
214 |
|
215 |
if ($show_media !== 'top') {
|
216 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-top-wrap ' . $hide_date_likes_comments . '">';
|
224 |
|
225 |
if ($show_media !== 'top') {
|
226 |
|
227 |
+
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-user-thumb">';
|
228 |
+
$FTS_FB_OUTPUT .= '<a href="https://facebook.com/' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->id : $post_data->from->id) . '" target="_blank"><img border="0" alt="' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->name : $post_data->from->name) . '" src="https://graph.facebook.com/' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->id : $post_data->from->id) . '/picture"/></a>';
|
229 |
+
$FTS_FB_OUTPUT .= '</div>';
|
230 |
|
231 |
//UserName
|
232 |
$FTS_FB_OUTPUT .= $FB_Shortcode['type'] == 'reviews' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') ? '<span class="fts-jal-fb-user-name" itemprop="author" itemscope itemtype="http://schema.org/Person"><a href="https://facebook.com/' . $post_data->reviewer->id . '/" target="_blank" ><span itemprop="name">' . $post_data->reviewer->name . '</span></a>' . $FTS_Facebook_Reviews->reviews_rating_format($FB_Shortcode, $post_data->rating) . '</span>' : '<span class="fts-jal-fb-user-name"><a href="https://facebook.com/' . $post_data->from->id . '" target="_blank">' . $post_data->from->name . '</a>' . $fb_hide_shared_by_etc_text . '</span>';
|
240 |
}
|
241 |
|
242 |
|
243 |
+
if ($FB_Shortcode['type'] !== 'reviews') {
|
244 |
//Comments Count
|
245 |
$FBpost_id_final = substr($FBpost_id, strpos($FBpost_id, "_") + 1);
|
246 |
}
|
258 |
// Going to consider this for the future if facebook fixes the api to define when are checking in. Add '.$checked_in.' inside the fts-jal-fb-message div
|
259 |
// $checked_in = '<a target="_blank" class="fts-checked-in-img" href="https://www.facebook.com/'.$post_data->place->id.'"><img src="https://graph.facebook.com/'.$post_data->place->id.'/picture?width=150"/></a><a target="_blank" class="fts-checked-in-text-link" href="https://www.facebook.com/'.$post_data->place->id.'">'.__("Checked in at", "feed-them-social").' '.$post_data->place->name.'</a><br/> '.__("Location", "feed-them-social").': '.$post_data->place->location->city.', '.$post_data->place->location->country.' '.$post_data->place->location->zip.'<br/><a target="_blank" class="fts-fb-get-directions fts-checked-in-get-directions" href="https://www.facebook.com/'.$post_data->place->id.'">'.__("Get Direction", "feed-them-social").'</a>';
|
260 |
|
261 |
+
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message"' . $itemprop_description_reviews . '>';
|
262 |
|
263 |
$FTS_FB_OUTPUT .= !empty($trimmed_content) ? $trimmed_content : '';
|
264 |
//If POPUP
|
265 |
// $FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';
|
266 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div> ';
|
267 |
|
268 |
+
} elseif ($show_media !== 'top') {
|
269 |
$FB_final_message = $this->fts_facebook_tag_filter($FBmessage);
|
270 |
+
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message"' . $itemprop_description_reviews . '>';
|
271 |
$FTS_FB_OUTPUT .= nl2br($FB_final_message);
|
272 |
//If POPUP
|
273 |
// $FTS_FB_OUTPUT .= isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';
|
275 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div>';
|
276 |
}
|
277 |
|
278 |
+
} elseif (!$FBmessage && $FB_Shortcode['type'] == 'album_photos' || !$FBmessage && $FB_Shortcode['type'] == 'albums') {
|
|
|
279 |
|
280 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">';
|
281 |
|
291 |
$FTS_FB_OUTPUT .= $FBdescription ? $this->fts_facebook_post_desc($FBdescription, $FB_Shortcode, $FBtype, NULL, $FBby) : '';
|
292 |
|
293 |
|
|
|
294 |
//Output Photo Description
|
295 |
if (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
296 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-caption fts-fb-album-view-link">';
|
297 |
+
//Album Covers
|
298 |
+
if($FB_Shortcode['type'] == 'albums'){
|
299 |
+
$FTS_FB_OUTPUT .= '<a href="https://graph.facebook.com/' . $FBalbum_cover . '/picture" class="fts-view-album-photos-large" target="_blank">' . __('View Photo', 'feed-them-social') . '</a></div>';
|
300 |
+
}
|
301 |
+
//Album Photos
|
302 |
+
elseif($FB_Shortcode['type'] == 'album_photos' && (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] !== 'yes' || !isset($FB_Shortcode['video_album']))){
|
303 |
+
$FTS_FB_OUTPUT .= '<a href="' . $FBalbum_picture . '" class="fts-view-album-photos-large" target="_blank">' . __('View Photo', 'feed-them-social') . '</a></div>';
|
304 |
+
}
|
305 |
+
//Video Albums
|
306 |
+
elseif (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes') {
|
307 |
if ($FB_Shortcode['play_btn'] !== 'yes') {
|
308 |
+
if (isset($post_data->format[3]->picture)) {
|
309 |
$PhotoOption = $post_data->format[3]->picture;
|
310 |
+
} elseif (isset($post_data->format[2]->picture)) {
|
|
|
311 |
$PhotoOption = $post_data->format[2]->picture;
|
312 |
+
} elseif (isset($post_data->format[1]->picture)) {
|
|
|
313 |
$PhotoOption = $post_data->format[1]->picture;
|
314 |
+
} elseif (isset($post_data->format[0]->picture)) {
|
|
|
315 |
$PhotoOption = $post_data->format[0]->picture;
|
316 |
+
} else {
|
|
|
317 |
$PhotoOption = '';
|
318 |
}
|
319 |
+
$FTS_FB_OUTPUT .= '<a href="' . $post_data->source . '" data-poster="' . $PhotoOption . '" id="fts-view-vid1-' . $fts_dynamic_vid_name_string . '" class="fts-jal-fb-vid-html5video fts-view-fb-videos-large fts-view-fb-videos-btn fb-video-popup-' . $fts_dynamic_vid_name_string . '">' . __('View Video', 'feed-them-social') . '</a>';
|
320 |
}
|
321 |
$FTS_FB_OUTPUT .= '</div>';
|
322 |
} else {
|
323 |
//photos
|
324 |
+
$FTS_FB_OUTPUT .= '<a href="' . $post_data->source . '" class="fts-view-album-photos-large" target="_blank">' . __('View Photo', 'feed-them-social') . '</a></div>';
|
325 |
}
|
326 |
|
327 |
// $FTS_FB_OUTPUT .= '<div class="fts-fb-caption"><a class="view-on-facebook-albums-link" href="' . $FBlink . '" target="_blank">' . __('View on Facebook', 'feed-them-social') . '</a></div>';
|
329 |
|
330 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div>';
|
331 |
} //END Output Message
|
332 |
+
// elseif ($FBmessage == '' && $FB_Shortcode['type'] !== 'album_photos' || $FBmessage == '' && $FB_Shortcode['type'] !== 'albums') {
|
333 |
//If POPUP
|
334 |
// $FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-jal-fb-message"><div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div></div>' : '';
|
335 |
+
// }
|
336 |
if ($show_media !== 'top') {
|
337 |
$FTS_FB_OUTPUT .= '</div>'; // end .fts-jal-fb-top-wrap <!--end fts-jal-fb-top-wrap -->
|
338 |
}
|
511 |
|
512 |
if ($host == 'www.facebook.com' and $first_dir == 'events') {
|
513 |
$FTS_FB_OUTPUT .= $FBpicture ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $post_data->picture) : '';
|
514 |
+
} elseif (strpos($FBlink, 'soundcloud') > 0) {
|
|
|
515 |
//Get the SoundCloud URL
|
516 |
$url = $FBlink;
|
517 |
//Get the JSON data of song details with embed code from SoundCloud oEmbed
|
524 |
// echo str_replace('height="400"', 'height="140"', $jsonObj->html);
|
525 |
$fts_dynamic_vid_name_string = trim($this->rand_string(10) . '_' . $FB_Shortcode['type']);
|
526 |
$fts_dynamic_vid_name = 'feed_dynamic_video_class' . $fts_dynamic_vid_name_string;
|
527 |
+
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-picture ' . $fts_dynamic_vid_name . '">';
|
528 |
+
if (!empty($post_data->full_picture)) {
|
529 |
+
$FTS_FB_OUTPUT .= $FBpicture ? $this->fts_facebook_post_photo('javascript:;', $FB_Shortcode, $post_data->from->name, $post_data->full_picture) : '';
|
530 |
+
} elseif (!empty($post_data->picture)) {
|
531 |
+
$FTS_FB_OUTPUT .= $FBpicture ? $this->fts_facebook_post_photo('javascript:;', $FB_Shortcode, $post_data->from->name, $post_data->picture) : '';
|
532 |
+
}
|
533 |
+
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-play-btn"></div>';
|
534 |
+
$FTS_FB_OUTPUT .= '</div>';
|
535 |
$FTS_FB_OUTPUT .= '<script>';
|
536 |
$FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {';
|
537 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
605 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-picture ' . $fts_dynamic_vid_name . '">';
|
606 |
|
607 |
|
|
|
|
|
|
|
|
|
|
|
608 |
// This puts the video in a popup instead of displaying it directly on the page.
|
609 |
if (is_plugin_active('feed-them-premium/feed-them-premium.php') && isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
610 |
$FTS_FB_OUTPUT .= '<a href="' . $post_data->source . '" class="fts-facebook-link-target fts-jal-fb-vid-html5video">';
|
611 |
}
|
612 |
|
613 |
|
|
|
|
|
|
|
|
|
|
|
614 |
$FTS_FB_OUTPUT .= '<img border="0" alt="' . $post_data->from->name . '" src="' . $post_data->full_picture . '"/>';
|
615 |
// CLOSE This puts the video in a popup instead of displaying it directly on the page.
|
616 |
// This puts the video in a popup instead of displaying it directly on the page.
|
622 |
$FTS_FB_OUTPUT .= '<div class="fts-fluid-videoWrapper-html5"><video id="' . $fts_dynamic_vid_name . '" controls width="100%;" style="max-width:100%;"><source src="" type="video/mp4"></video></div><div class="slicker-facebook-album-photoshadow"></div></div>';
|
623 |
|
624 |
// This puts the video on the page instead of the popup if you don't have the premium version
|
625 |
+
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !== 'yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == '' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
626 |
$FTS_FB_OUTPUT .= '<script>jQuery(document).ready(function() {';
|
627 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").bind("click", function() {';
|
628 |
$FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");';
|
642 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-vid-picture ' . $fts_dynamic_vid_name . '">';
|
643 |
|
644 |
|
|
|
|
|
645 |
if (strpos($FBvideo_embed, 'youtube') > 0 || strpos($FBvideo_embed, 'youtu.be') > 0) {
|
646 |
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $FBvideo_embed, $matches);
|
647 |
$videoURLfinal = 'https://www.youtube.com/watch?v=' . $matches[1];
|
650 |
}
|
651 |
|
652 |
|
|
|
|
|
|
|
|
|
653 |
// This puts the video in a popup instead of displaying it directly on the page.
|
654 |
if (is_plugin_active('feed-them-premium/feed-them-premium.php') && isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
655 |
|
656 |
+
if (strpos($FBlink, 'youtube') > 0 || strpos($FBlink, 'youtu.be') > 0 || strpos($FBlink, 'vimeo') > 0) {
|
657 |
$FTS_FB_OUTPUT .= '<a href="' . $videoURLfinal . '" class="fts-facebook-link-target fts-jal-fb-vid-image fts-iframe-type">';
|
658 |
+
} else {
|
|
|
659 |
$FTS_FB_OUTPUT .= '<a href="' . $videoURLfinal . '" class="fts-facebook-link-target fts-jal-fb-vid-html5video">';
|
660 |
}
|
661 |
}
|
662 |
|
663 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
664 |
$FTS_FB_OUTPUT .= '<img class="fts-jal-fb-vid-image" border="0" alt="' . $post_data->from->name . '" src="' . $post_data->full_picture . '"/>';
|
665 |
|
666 |
|
678 |
// $youtubeURLfinal = $matches[1];
|
679 |
|
680 |
// This puts the video on the page instead of the popup if you don't have the premium version
|
681 |
+
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !== 'yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == '' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
682 |
$FTS_FB_OUTPUT .= '<script>jQuery(document).ready(function() {';
|
683 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
684 |
$FTS_FB_OUTPUT .= 'jQuery(this).addClass("fts-vid-div");';
|
698 |
// preg_match($pattern, $FBlink, $matches);
|
699 |
// $youtubeURLfinal = $matches[1];
|
700 |
// This puts the video in a popup instead of displaying it directly on the page.
|
701 |
+
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !== 'yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == ' ' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
702 |
$FTS_FB_OUTPUT .= '<script>';
|
703 |
$FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {';
|
704 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
721 |
// $vimeoURLfinal = $matches[0];
|
722 |
|
723 |
// This puts the video in a popup instead of displaying it directly on the page.
|
724 |
+
if (!isset($FB_Shortcode['popup']) || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] !== 'yes' && is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == '' || isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'no') {
|
725 |
$FTS_FB_OUTPUT .= '<script>';
|
726 |
$FTS_FB_OUTPUT .= 'jQuery(document).ready(function() {';
|
727 |
$FTS_FB_OUTPUT .= 'jQuery(".' . $fts_dynamic_vid_name . '").click(function() {';
|
768 |
$photo_source_final = isset($photo_source->full_picture) && $FB_Shortcode['type'] == 'group' || isset($post_data->full_picture) && $FB_Shortcode['type'] == 'event' || isset($post_data->full_picture) && $FB_Shortcode['type'] == 'page' ? $post_data->full_picture : 'https://graph.facebook.com/' . $FBpost_object_id . '/picture';
|
769 |
|
770 |
|
|
|
|
|
771 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-link-wrap fts-album-photos-wrap"';
|
772 |
if ($FB_Shortcode['type'] == 'album_photos' || $FB_Shortcode['type'] == 'albums') {
|
773 |
$FTS_FB_OUTPUT .= ' style="line-height:' . $FB_Shortcode['image_height'] . ' !important;"';
|
783 |
// $FTS_FB_OUTPUT .= $fts_fb_image_count;
|
784 |
if ($fts_fb_image_count == '0' || $fts_fb_image_count > 2) {
|
785 |
|
786 |
+
// $FTS_FB_OUTPUT .= $fts_fb_image_count;
|
787 |
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $photo_source_final : $FBlink) . '" target="_blank" class="fts-jal-fb-picture fts-fb-large-photo" ><img border="0" alt="' . $post_data->from->name . '" src="' . $photo_source_final . '"></a>';
|
788 |
|
789 |
}
|
794 |
|
795 |
// we count the number of attachments in the subattachments->data portion of the array and count the objects http://php.net/manual/en/function.count.php
|
796 |
$fts_fb_image_counter = $fts_fb_image_count - 3;
|
797 |
+
$fts_fb_image_count_output = '<div class="fts-image-count-tint-underlay"></div><div class="fts-image-count"><span>+</span>' . $fts_fb_image_counter . '</div>';
|
798 |
|
799 |
$fts_fb_image_count_check = $fts_fb_image_count < 3 ? ' fts-more-images-tint' : '';
|
800 |
|
802 |
// if we only have 2 photos we show them side by side
|
803 |
$FBpictureGallery2True = $FBpictureGallery2 == '' ? ' fts-more-photos-auto-width' : '';
|
804 |
// if we have 3 photos we add this class so we can make the 2 attachments below the large image will fit side by side
|
805 |
+
$FBpictureGallery3True = $FBpictureGallery3 == '' && $FBpictureGallery2 !== '' ? ' fts-more-photos-three-photo-wrap' : '';
|
806 |
|
807 |
$columnsCSS = '';
|
808 |
|
809 |
+
// print $fts_fb_image_count;
|
810 |
|
811 |
+
if ($fts_fb_image_count === 2) {
|
812 |
$columns = '2';
|
813 |
$columnsCSS = 'fts-more-photos-2-or-3-photos ';
|
814 |
$morethan3 = 'fts-2-photos ';
|
815 |
+
} elseif ($fts_fb_image_count === 3) {
|
|
|
816 |
$columns = '2';
|
817 |
$columnsCSS = 'fts-more-photos-2-or-3-photos ';
|
818 |
$morethan3 = 'fts-3-photos ';
|
819 |
+
} elseif ($fts_fb_image_count >= 4) {
|
|
|
820 |
$columns = '3';
|
821 |
$columnsCSS = 'fts-more-photos-4-photos ';
|
822 |
$morethan3 = 'fts-4-photos ';
|
823 |
}
|
824 |
|
825 |
+
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div><div class="' . $columnsCSS . 'fts-fb-more-photos-wrap fts-facebook-inline-block-centered' . $FBpictureGallery2True . $FBpictureGallery3True . '" style="max-width:' . $FBpictureGallery1Check . '" data-ftsi-id=' . $fts_dynamic_vid_name_string . ' data-ftsi-columns="' . $columns . '" data-ftsi-margin="1px" data-ftsi-force-columns="yes">';
|
826 |
}
|
827 |
+
if ($fts_fb_image_count === 2) {
|
828 |
+
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $photo_source_final : $FBlink) . '" target="_blank" class="slicker-facebook-placeholder fts-fb-thumbs-wrap ' . $morethan3 . 'fts-fb-thumb-zero-wrap fts-fb-large-photo" style="background:url(' . $photo_source_final . ');"></a>';
|
829 |
|
830 |
+
}
|
831 |
if ($FBpictureGallery1 !== '') {
|
832 |
+
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $FBpictureGallery1 : $FBpictureGalleryLink1) . '" target="_blank" class="slicker-facebook-placeholder fts-fb-thumbs-wrap ' . $morethan3 . 'fts-fb-thumb-zero-wrap fts-fb-large-photo" style="background:url(' . $FBpictureGallery1 . ');"></a>';
|
833 |
|
834 |
+
if ($FBpictureGallery2 !== '') {
|
835 |
+
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $FBpictureGallery2 : $FBpictureGalleryLink2) . '" target="_blank" class="fts-2-or-3-photos slicker-facebook-placeholder fts-fb-thumbs-wrap ' . $morethan3 . 'fts-fb-thumb-one-wrap fts-fb-large-photo" style="background:url(' . $FBpictureGallery2 . ');"></a>';
|
836 |
|
837 |
}
|
838 |
+
if ($FBpictureGallery3 !== '') {
|
839 |
+
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $FBpictureGallery3 : $FBpictureGalleryLink3) . '" target="_blank" class="slicker-facebook-placeholder fts-fb-thumbs-wrap ' . $morethan3 . 'fts-fb-thumb-two-wrap fts-fb-large-photo' . $fts_fb_image_count_check . '" style="background:url(' . $FBpictureGallery3 . ');">' . $fts_fb_image_count_output . '</a>';
|
840 |
}
|
841 |
}
|
842 |
if ($FBpictureGallery1 !== '') {
|
843 |
$FTS_FB_OUTPUT .= '</div>';
|
844 |
}
|
845 |
+
} else {
|
|
|
846 |
$FTS_FB_OUTPUT .= '<a href="' . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? $photo_source_final : $FBlink) . '" target="_blank" class="fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . $post_data->from->name . '" src="' . $photo_source_final . '"></a>';
|
847 |
}
|
848 |
} elseif ($FBpicture) {
|
850 |
$FTS_FB_OUTPUT .= $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, 'https://graph.facebook.com/' . $FBpost_object_id . '/picture');
|
851 |
} else {
|
852 |
|
853 |
+
if (isset($post_data->format[1]->picture)) {
|
854 |
$video_photo = $post_data->format[1]->picture;
|
855 |
+
} elseif (isset($post_data->format[0]->picture)) {
|
|
|
856 |
$video_photo = $post_data->format[0]->picture;
|
857 |
+
} else {
|
|
|
858 |
$video_photo = $post_data->picture;
|
859 |
}
|
860 |
|
900 |
$FTS_FB_OUTPUT .= ' style="line-height:' . $FB_Shortcode['image_height'] . ' !important;"';
|
901 |
}
|
902 |
$FTS_FB_OUTPUT .= '>';
|
903 |
+
|
904 |
+
// echo '<pre>rrr';
|
905 |
+
// print_r($FBalbum_cover);
|
906 |
+
// echo '</pre>';
|
907 |
+
|
908 |
//Output Photo Picture
|
909 |
+
$FTS_FB_OUTPUT .= $FBalbum_cover ? $this->fts_facebook_post_photo($FBlink, $FB_Shortcode, $post_data->from->name, $FBalbum_cover) : '';
|
910 |
$FTS_FB_OUTPUT .= '<div class="slicker-facebook-album-photoshadow"></div>';
|
911 |
if (!$FB_Shortcode['type'] == 'albums') {
|
912 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-description-wrap">';
|
927 |
//Post Comments
|
928 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-comments-wrap">';
|
929 |
$hide_comments_popup = isset($FB_Shortcode['hide_comments_popup']) ? $FB_Shortcode['hide_comments_popup'] : 'no';
|
930 |
+
if (isset($lcs_array['comments_thread']->data) && !empty($lcs_array['comments_thread']->data) && $hide_comments_popup !== 'yes' || isset($lcs_array['comments_thread']->data) && !empty($lcs_array['comments_thread']->data) && $hide_comments_popup == '') {
|
931 |
//Post Comments
|
932 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-comments-content fts-comments-post-' . $FBpost_id . '">';
|
933 |
|
937 |
$avatar_id = isset($comment->from->id) ? $comment->from->id : '118790751525884';
|
938 |
$FTS_FB_OUTPUT .= '<img class="fts-fb-comment-user-pic" src="https://graph.facebook.com/' . $avatar_id . '/picture?type=square"/>';
|
939 |
$FTS_FB_OUTPUT .= '<div class="fts-fb-comment-msg">';
|
940 |
+
if (isset($comment->from->name)) {
|
941 |
$FTS_FB_OUTPUT .= '<span class="fts-fb-comment-user-name">' . $comment->from->name . '</span> ';
|
942 |
}
|
943 |
$FTS_FB_OUTPUT .= $comment->message . '</div>';
|
964 |
$FTS_FB_OUTPUT .= '<div class="fts-mashup-icon-wrap-left fts-mashup-facebook-icon"><a href="https://facebook.com/' . $post_data->from->id . '" target="_blank"></a></div>';
|
965 |
}
|
966 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-top-wrap ' . $hide_date_likes_comments . '" style="display:block !important;">';
|
967 |
+
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-user-thumb">';
|
968 |
+
$FTS_FB_OUTPUT .= '<a href="https://facebook.com/' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->id : $post_data->from->id) . '" target="_blank"><img border="0" alt="' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->name : $post_data->from->name) . '" src="https://graph.facebook.com/' . ($FB_Shortcode['type'] == 'reviews' ? $post_data->reviewer->id : $post_data->from->id) . '/picture"/></a>';
|
969 |
+
$FTS_FB_OUTPUT .= '</div>';
|
970 |
|
971 |
+
//UserName
|
972 |
+
$FTS_FB_OUTPUT .= '<span class="fts-jal-fb-user-name"><a href="https://facebook.com/' . $post_data->from->id . '" target="_blank">' . $post_data->from->name . '</a>' . $fb_hide_shared_by_etc_text . '</span>';
|
973 |
|
974 |
+
// tied to date function
|
975 |
+
$feed_type = 'facebook';
|
976 |
+
$times = $CustomTimeFormat;
|
977 |
+
$fts_final_date = $this->fts_custom_date($times, $feed_type);
|
978 |
+
//PostTime
|
979 |
+
$FTS_FB_OUTPUT .= '<span class="fts-jal-fb-post-time">' . $fts_final_date . '</span><div class="fts-clear"></div>';
|
980 |
|
981 |
// here we trim the words for the premium version. The $FB_Shortcode['words'] string actually comes from the javascript
|
982 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php') && array_key_exists('words', $FB_Shortcode) || is_plugin_active('feed-them-premium/feed-them-premium.php') && array_key_exists('words', $FB_Shortcode)) {
|
993 |
// $FTS_FB_OUTPUT .= $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';
|
994 |
$FTS_FB_OUTPUT .= '<div class="fts-clear"></div></div> ';
|
995 |
|
996 |
+
} else {
|
|
|
997 |
$FB_final_message = $this->fts_facebook_tag_filter($FBmessage);
|
998 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-message">';
|
999 |
$FTS_FB_OUTPUT .= nl2br($FB_final_message);
|
feeds/facebook/facebook-feed.php
CHANGED
@@ -36,10 +36,10 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
36 |
}
|
37 |
|
38 |
// Date sort option for multiple feeds in a shortcode
|
39 |
-
function dateSort($a
|
40 |
$dateA = strtotime($a->created_time);
|
41 |
$dateB = strtotime($b->created_time);
|
42 |
-
return ($dateB
|
43 |
}
|
44 |
|
45 |
|
@@ -69,7 +69,7 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
69 |
include(WP_CONTENT_DIR . '/plugins/feed-them-premium/feeds/facebook/facebook-premium-feed.php');
|
70 |
//Load up some scripts for popup
|
71 |
$this->load_popup_scripts($FB_Shortcode);
|
72 |
-
} elseif (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php') && !is_plugin_active('feed-them-premium/feed-them-premium.php')){
|
73 |
$FB_Shortcode = shortcode_atts(array(
|
74 |
'id' => '',
|
75 |
'type' => '',
|
@@ -93,15 +93,15 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
93 |
'colmn_width' => '',
|
94 |
'space_between_posts' => '',
|
95 |
//new show media on top options
|
96 |
-
'show_media'
|
97 |
-
'show_date'
|
98 |
-
'show_name'
|
99 |
|
100 |
), $atts);
|
101 |
if ($FB_Shortcode['posts'] == NULL)
|
102 |
$FB_Shortcode['posts'] = '6';
|
103 |
|
104 |
-
}else {
|
105 |
$FB_Shortcode = shortcode_atts(array(
|
106 |
'id' => '',
|
107 |
'type' => '',
|
@@ -125,7 +125,7 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
125 |
$FB_Shortcode['posts'] = '6';
|
126 |
}
|
127 |
|
128 |
-
if($FB_Shortcode['type'] == 'album_videos'){
|
129 |
$FB_Shortcode['type'] = 'album_photos';
|
130 |
$FB_Shortcode['video_album'] = 'yes';
|
131 |
$FB_Shortcode['album_id'] = 'photo_stream';
|
@@ -172,9 +172,9 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
172 |
|
173 |
$feed_data_check = json_decode($response2['feed_data']);
|
174 |
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
|
179 |
// $idNew = array();
|
180 |
// $idNew = explode(',', $FB_Shortcode['id']);
|
@@ -185,30 +185,29 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
185 |
|
186 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php')) {
|
187 |
$ftsCountIds = substr_count($FB_Shortcode['id'], ",");
|
188 |
-
}
|
189 |
-
else{
|
190 |
$ftsCountIds = '';
|
191 |
}
|
192 |
|
193 |
-
if(isset($feed_data_check->data)){
|
194 |
-
if($ftsCountIds >= 1 && $FB_Shortcode['type'] !== 'reviews') {
|
195 |
$fts_list_arrays = array();
|
196 |
foreach ($feed_data_check as $feed_data_name) {
|
197 |
|
198 |
-
if(isset($feed_data_name->data)){
|
199 |
-
$fts_list_arrays =
|
200 |
}
|
201 |
//var_dump( $fts_list_arrays[$i]);
|
202 |
|
203 |
}
|
204 |
// we don't need to sort event feeds for this check because we already to that
|
205 |
-
if($FB_Shortcode['type'] !== 'events') {
|
206 |
// Sort the array using the call back function
|
207 |
usort($fts_list_arrays, array($this, "dateSort"));
|
208 |
}
|
209 |
|
210 |
$merged_Array['data'] = $fts_list_arrays;
|
211 |
-
$feed_data_check = (object)
|
212 |
}
|
213 |
|
214 |
// Test the created dataes are being sorted properly
|
@@ -249,9 +248,9 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
249 |
}
|
250 |
|
251 |
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
}
|
256 |
|
257 |
///////////////////////////////////////////////////
|
@@ -283,55 +282,54 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
283 |
|
284 |
if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') && get_option('fts_facebook_custom_api_token_biz') == TRUE && $FB_Shortcode['type'] == 'reviews') {
|
285 |
|
286 |
-
|
287 |
|
288 |
-
|
289 |
-
|
290 |
|
291 |
-
|
292 |
-
|
293 |
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
|
301 |
-
|
302 |
// SHOW THE REVIEWS FEED PRINT_R
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
}
|
317 |
}
|
|
|
318 |
$ratings_data = json_decode($response['ratings_data']);
|
319 |
// SHOW THE REVIEWS RATING INFO PRINT_R
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
|
324 |
}
|
325 |
|
326 |
|
327 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php')) {
|
328 |
$ftsCountIds = substr_count($FB_Shortcode['id'], ",");
|
329 |
-
}
|
330 |
-
else{
|
331 |
$ftsCountIds = '';
|
332 |
}
|
333 |
|
334 |
-
if($ftsCountIds >= 1 && $FB_Shortcode['type'] !== 'reviews') {
|
335 |
|
336 |
$fts_list_arrays = array();
|
337 |
foreach ($feed_data as $feed_data_name) {
|
@@ -342,7 +340,7 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
342 |
}
|
343 |
|
344 |
// we don't need to sort event feeds because we already to that
|
345 |
-
if($FB_Shortcode['type'] !== 'events') {
|
346 |
// Sort the array using the call back function
|
347 |
usort($fts_list_arrays, array($this, "dateSort"));
|
348 |
}
|
@@ -408,13 +406,11 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
408 |
//******************
|
409 |
// SOCIAL BUTTON
|
410 |
//******************
|
411 |
-
if(!$ftsCountIds >= 1) {
|
412 |
$FTS_FB_OUTPUT .= $this->fb_social_btn_placement($FB_Shortcode, $access_token, 'fb-like-top-above-title');
|
413 |
}
|
414 |
|
415 |
|
416 |
-
|
417 |
-
|
418 |
if ($FB_Shortcode['type'] !== 'reviews') {
|
419 |
$page_data->description = isset($page_data->description) ? $page_data->description : "";
|
420 |
$page_data->name = isset($page_data->name) ? $page_data->name : "";
|
@@ -443,7 +439,7 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
443 |
|
444 |
|
445 |
}
|
446 |
-
if($FB_Shortcode['type'] !== 'reviews') {
|
447 |
if (is_plugin_active('feed-them-premium/feed-them-premium.php')) {
|
448 |
// $FTS_FB_OUTPUT .= our Facebook Page Title or About Text. Commented out the group description because in the future we will be adding the about description.
|
449 |
$fts_align_title = isset($FB_Shortcode['title_align']) && $FB_Shortcode['title_align'] !== '' ? 'style="text-align:' . $FB_Shortcode['title_align'] . ';"' : '';
|
@@ -466,7 +462,7 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
466 |
//******************
|
467 |
// SOCIAL BUTTON
|
468 |
//******************
|
469 |
-
if(!$ftsCountIds >= 1) {
|
470 |
$FTS_FB_OUTPUT .= $this->fb_social_btn_placement($FB_Shortcode, $access_token, 'fb-like-top-below-title');
|
471 |
}
|
472 |
|
@@ -478,17 +474,17 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
478 |
if (!isset($_GET['load_more_ajaxing'])) {
|
479 |
|
480 |
|
481 |
-
$fts_mashup_media_top = isset($FB_Shortcode['show_media']) && $FB_Shortcode['show_media'] == 'top'
|
482 |
-
$fts_mashup_show_name = isset($FB_Shortcode['show_name']) && $FB_Shortcode['show_name'] == 'no'
|
483 |
-
$fts_mashup_show_date = isset($FB_Shortcode['show_date']) && $FB_Shortcode['show_date'] == 'no'
|
484 |
-
$fts_mashup_show_thumbnail = isset($FB_Shortcode['show_thumbnail']) && $FB_Shortcode['show_thumbnail'] == 'no'
|
485 |
|
486 |
|
487 |
if (!isset($FBtype) && $FB_Shortcode['type'] == 'albums' || !isset($FBtype) && $FB_Shortcode['type'] == 'album_photos' || isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') {
|
488 |
|
489 |
|
490 |
if (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes') {
|
491 |
-
} elseif (isset($FB_Shortcode['slider']) && $FB_Shortcode['slider'] !== 'yes' && $FB_Shortcode['image_stack_animation'] == 'yes' || isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes' || isset($FB_Shortcode['image_stack_animation']) && $FB_Shortcode['image_stack_animation'] == 'yes'
|
492 |
wp_enqueue_script('fts-masonry-pkgd', plugins_url('feed-them-social/feeds/js/masonry.pkgd.min.js'), array('jquery'));
|
493 |
$FTS_FB_OUTPUT .= '<script>';
|
494 |
$FTS_FB_OUTPUT .= 'jQuery(window).load(function(){';
|
@@ -501,7 +497,11 @@ class FTS_Facebook_Feed extends feed_them_social_functions {
|
|
501 |
|
502 |
|
503 |
if (!isset($FBtype) && $FB_Shortcode['type'] == 'albums' || !isset($FBtype) && $FB_Shortcode['type'] == 'album_photos' && !isset($FBtype) && !isset($FB_Shortcode['slider']) || !isset($FBtype) && $FB_Shortcode['type'] == 'album_photos' && !isset($FBtype) && isset($FB_Shortcode['slider']) && $FB_Shortcode['slider'] !== 'yes') {
|
504 |
-
$FTS_FB_OUTPUT .= '<div class="fts-slicker-facebook-photos fts-slicker-facebook-albums' . (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] && $FB_Shortcode['video_album'] == 'yes' ? ' popup-video-gallery-fb' : '') . (isset($FB_Shortcode['image_stack_animation']) && $FB_Shortcode['image_stack_animation'] == 'yes' ? ' masonry js-masonry' : '') . (isset($FB_Shortcode['images_align']) && $FB_Shortcode['images_align'] ? ' popup-video-gallery-align-' . $FB_Shortcode['images_align'] : '') . ' popup-gallery-fb ' . $fts_dynamic_class_name . '"';
|
|
|
|
|
|
|
|
|
505 |
|
506 |
} // slideshow scrollHorz or carousel
|
507 |
elseif (!isset($FBtype) && isset($FB_Shortcode['slider']) && $FB_Shortcode['slider'] == 'yes') {
|
@@ -629,8 +629,7 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
629 |
$FTS_FB_OUTPUT .= '<div class="fts-slicker-facebook-posts masonry js-masonry ' . $fts_mashup_media_top . $fts_mashup_show_name . $fts_mashup_show_date . $fts_mashup_show_thumbnail . ($FB_Shortcode['popup'] == 'yes' ? 'popup-gallery-fb-posts ' : '') . ($FB_Shortcode['type'] == 'reviews' ? 'fts-reviews-feed ' : '') . $fts_dynamic_class_name . ' " style="margin:auto;" data-masonry-options=\'{ "isFitWidth": ' . ($FB_Shortcode['center_container'] == 'no' ? 'false' : 'true') . ' ' . ($FB_Shortcode['image_stack_animation'] == 'no' ? ', "transitionDuration": 0' : '') . '}\'>';
|
630 |
// $FTS_FB_OUTPUT .= '<div class="fts-slicker-facebook-photos fts-slicker-facebook-posts masonry js-masonry ' . ($FB_Shortcode['popup'] == 'yes' ? 'popup-gallery-fb-posts ' : '') . ($FB_Shortcode['type'] == 'reviews' ? 'fts-reviews-feed ' : '') . $fts_dynamic_class_name . ' " style="margin:auto;" data-masonry-options=\'{ "isFitWidth": ' . ($FB_Shortcode['center_container'] == 'no' ? 'false' : 'true') . ' ' . ($FB_Shortcode['image_stack_animation'] == 'no' ? ', "transitionDuration": 0' : '') . '}\'>';
|
631 |
}
|
632 |
-
}
|
633 |
-
else {
|
634 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-group-display fts-simple-fb-wrapper ' . $fts_mashup_media_top . $fts_mashup_show_name . $fts_mashup_show_date . $fts_mashup_show_thumbnail . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? ' popup-gallery-fb-posts ' : '') . ($FB_Shortcode['type'] == 'reviews' ? 'fts-reviews-feed ' : '') . $fts_dynamic_class_name . ' ' . ($FB_Shortcode['height'] !== 'auto' && empty($FB_Shortcode['height']) == NULL ? 'fts-fb-scrollable" style="height:' . $FB_Shortcode['height'] . '"' : '"') . '>';
|
635 |
}
|
636 |
} //End ajaxing Check
|
@@ -823,14 +822,13 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
823 |
}
|
824 |
|
825 |
|
826 |
-
|
827 |
unset($_REQUEST['next_url']);
|
828 |
|
829 |
|
830 |
//******************
|
831 |
// SOCIAL BUTTON
|
832 |
//******************
|
833 |
-
if(!$ftsCountIds >= 1) {
|
834 |
$FTS_FB_OUTPUT .= $this->fb_social_btn_placement($FB_Shortcode, $access_token, 'fb-like-below');
|
835 |
}
|
836 |
|
@@ -888,25 +886,16 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
888 |
*/
|
889 |
function fts_facebook_post_photo($FBlink, $FB_Shortcode, $photo_from, $photo_source) {
|
890 |
if ($FB_Shortcode['type'] == 'album_photos' || $FB_Shortcode['type'] == 'albums') {
|
891 |
-
$output = '<a href="' . $FBlink . '" target="_blank" class="fts-jal-fb-picture album-photo-fts" style="width:' . $FB_Shortcode['image_width'].';height:' . $FB_Shortcode['image_height'].';';
|
892 |
-
// if ($FB_Shortcode['image_position_lr'] !== '-0%' || $FB_Shortcode['image_position_top'] !== '-0%') {
|
893 |
-
// $output .= 'style="right:' . $FB_Shortcode['image_position_lr'] . ';left:' . $FB_Shortcode['image_position_lr'] . ';top:' . $FB_Shortcode['image_position_top'] . '"';
|
894 |
-
|
895 |
-
// }
|
896 |
if ($FB_Shortcode['type'] == 'albums') {
|
897 |
-
$output .= 'background-image:url(' . $photo_source . ');">';
|
898 |
-
|
899 |
-
// $output .= '><img border="0" alt="' . $photo_from . '" src="https://graph.facebook.com/' . $photo_source . '/picture"/>';
|
900 |
} else {
|
901 |
-
|
902 |
-
$output .= 'background-image:url(' . $photo_source . ');">';
|
903 |
}
|
904 |
$output .= '</a>';
|
905 |
} else {
|
906 |
$FB_ShortcodePopup = isset($FB_Shortcode['popup']) ? $FB_Shortcode['popup'] : '';
|
907 |
if ($FB_ShortcodePopup == 'yes' && $FBlink !== 'javascript:;') {
|
908 |
-
// $output = isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $FBlink . '" class="fts-view-on-facebook-link" target="_blank">' . __('View on Facebook', 'feed-them-social') . '</a></div> ' : '';
|
909 |
-
|
910 |
$output = '<a href="' . $photo_source . '" target="_blank" class="fts-facebook-link-target fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . $photo_from . '" src="' . $photo_source . '"/></a>';
|
911 |
|
912 |
} else {
|
@@ -1117,12 +1106,12 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1117 |
}
|
1118 |
if ($FBpost_comments_count == '1') {
|
1119 |
$LSC_array['comments'] = "<i class='icon-comments'></i> 1";
|
1120 |
-
$LSC_array['comments_thread'] =
|
1121 |
|
1122 |
}
|
1123 |
if ($FBpost_comments_count > '1') {
|
1124 |
$LSC_array['comments'] = "<i class='icon-comments'></i> " . $FBpost_comments_count;
|
1125 |
-
$LSC_array['comments_thread'] =
|
1126 |
}
|
1127 |
}
|
1128 |
}
|
@@ -1140,7 +1129,6 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1140 |
}
|
1141 |
|
1142 |
|
1143 |
-
|
1144 |
/**
|
1145 |
* FTS Facebook Post See More
|
1146 |
*
|
@@ -1170,17 +1158,17 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1170 |
case 'events':
|
1171 |
$single_event_id = 'https://facebook.com/events/' . $single_event_id;
|
1172 |
$fts_share_option = $share_this->fts_share_option($single_event_id, $description);
|
1173 |
-
$output = '<div class="fts-likes-shares-etc-wrap">'
|
1174 |
return $output;
|
1175 |
case 'photo':
|
1176 |
if (!empty($FBlink)) {
|
1177 |
$fts_share_option = $share_this->fts_share_option($FBlink, $description);
|
1178 |
-
$output = '<div class="fts-likes-shares-etc-wrap">'
|
1179 |
} // exception for videos
|
1180 |
else {
|
1181 |
$single_video_id = 'https://facebook.com/' . $FBpost_id;
|
1182 |
$fts_share_option = $share_this->fts_share_option($single_video_id, $description);
|
1183 |
-
$output = '<div class="fts-likes-shares-etc-wrap">'
|
1184 |
}
|
1185 |
if ($FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['hide_date_likes_comments'] == 'yes') {
|
1186 |
$output .= '<div class="hide-date-likes-comments-etc">' . $lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ' . $lcs_array['shares'] . ' </div>';
|
@@ -1203,7 +1191,7 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1203 |
|
1204 |
$fts_share_option = $share_this->fts_share_option($new_album_url, $description);
|
1205 |
|
1206 |
-
$output = '<div class="fts-likes-shares-etc-wrap">'
|
1207 |
if ($FB_Shortcode['type'] = 'albums' && $FB_Shortcode['hide_date_likes_comments'] == 'yes') {
|
1208 |
} else {
|
1209 |
$output .= '' . $lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ';
|
@@ -1219,16 +1207,16 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1219 |
$fb_reviews_see_more_reviews_language = get_option('fb_reviews_see_more_reviews_language') ? get_option('fb_reviews_see_more_reviews_language') : 'See More Reviews';
|
1220 |
|
1221 |
$hide_see_more = isset($FB_Shortcode['hide_see_more_reviews_link']) ? $FB_Shortcode['hide_see_more_reviews_link'] : 'yes';
|
1222 |
-
if($hide_see_more !== 'yes') {
|
1223 |
$output .= ' <a href="https://facebook.com/' . $FB_Shortcode['id'] . '/reviews" target="_blank" class="fts-jal-fb-see-more">' . __($fb_reviews_see_more_reviews_language, 'feed-them-social') . '</a>';
|
1224 |
}
|
1225 |
} else {
|
1226 |
$post_single_id = 'https://facebook.com/' . $FBpost_user_id . '/posts/' . $FBpost_single_id;
|
1227 |
$fts_share_option = $share_this->fts_share_option($post_single_id, $description);
|
1228 |
-
$output = '<div class="fts-likes-shares-etc-wrap">'
|
1229 |
$output .= '' . $lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ' . __('View on Facebook', 'feed-them-social') . '</a></div>';
|
1230 |
}
|
1231 |
-
if(get_option('fb_reviews_remove_see_reviews_link') !== 'yes'
|
1232 |
return $output;
|
1233 |
}
|
1234 |
}
|
@@ -1242,27 +1230,27 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1242 |
*/
|
1243 |
function get_access_token() {
|
1244 |
//API Access Token
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
}
|
1267 |
|
1268 |
/**
|
@@ -1300,7 +1288,7 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1300 |
$fts_view_fb_link = 'https://www.facebook.com/' . $FB_Shortcode['id'] . '/reviews/';
|
1301 |
break;
|
1302 |
}
|
1303 |
-
$fts_view_fb_link =
|
1304 |
return $fts_view_fb_link;
|
1305 |
}
|
1306 |
|
@@ -1315,7 +1303,7 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1315 |
//URL to get page info
|
1316 |
$rCount = substr_count($FB_Shortcode['id'], ",");
|
1317 |
|
1318 |
-
if($rCount >= 1){
|
1319 |
$result = preg_replace('/[ ,]+/', '-', trim($FB_Shortcode['id']));
|
1320 |
$FB_Shortcode['id'] = $result;
|
1321 |
}
|
@@ -1404,8 +1392,7 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1404 |
|
1405 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php')) {
|
1406 |
$ftsCountIds = substr_count($FB_Shortcode['id'], ",");
|
1407 |
-
}
|
1408 |
-
else{
|
1409 |
$ftsCountIds = '';
|
1410 |
}
|
1411 |
|
@@ -1416,10 +1403,9 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1416 |
if ($FB_Shortcode['type'] == 'page' && $FB_Shortcode['posts_displayed'] == 'page_only') {
|
1417 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name,description&access_token=' . $access_token . $language . '');
|
1418 |
|
1419 |
-
if(!$ftsCountIds >= 1) {
|
1420 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/posts?fields=id,caption,attachments,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1421 |
-
}
|
1422 |
-
else{
|
1423 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/posts?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,attachments,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1424 |
}
|
1425 |
|
@@ -1429,21 +1415,19 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1429 |
$date = date('Y-m-d');
|
1430 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name&access_token=' . $access_token . $language . '');
|
1431 |
//Check If Ajax next URL needs to be used
|
1432 |
-
if(!$ftsCountIds >= 1) {
|
1433 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/events?since=' . $date . '&access_token=' . $access_token . $language . '';
|
1434 |
-
}
|
1435 |
-
else {
|
1436 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/events?ids=' . $FB_Shortcode['id'] . '&since=' . $date . '&access_token=' . $access_token . $language . '';
|
1437 |
}
|
1438 |
} //Albums
|
1439 |
elseif ($FB_Shortcode['type'] == 'albums') {
|
1440 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name,description,link&access_token=' . $access_token . $language . '');
|
1441 |
//Check If Ajax next URL needs to be used
|
1442 |
-
if(!$ftsCountIds >= 1) {
|
1443 |
-
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/albums?fields=id,photos
|
1444 |
-
}
|
1445 |
-
|
1446 |
-
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/albums?ids=' . $FB_Shortcode['id'] . '&fields=id,photos{webp_images},created_time,name,from,link,cover_photo,count,updated_time,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1447 |
}
|
1448 |
|
1449 |
// $mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/albums?fields=id,created_time,name,from,link,cover_photo,count,updated_time,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
@@ -1453,24 +1437,21 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1453 |
//Check If Ajax next URL needs to be used
|
1454 |
//The reason I did not create a whole new else if for the video album is because I did not want to duplicate all the code required to make the video because the videos gallery comes from the photo albums on facebook.
|
1455 |
if (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes') {
|
1456 |
-
if(!$ftsCountIds >= 1) {
|
1457 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/videos?fields=id,created_time,description,from,icon,link,message,object_id,picture,place,shares,source,to,type,format,embed_html&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1458 |
-
}
|
1459 |
-
else{
|
1460 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/videos?ids=' . $FB_Shortcode['id'] . '&fields=id,created_time,description,from,icon,link,message,object_id,picture,place,shares,source,to,type,format,embed_html&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1461 |
}
|
1462 |
} elseif (isset($FB_Shortcode['album_id']) && $FB_Shortcode['album_id'] == 'photo_stream') {
|
1463 |
-
if(!$ftsCountIds >= 1) {
|
1464 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/photos?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&type=uploaded&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1465 |
-
}
|
1466 |
-
else{
|
1467 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/photos?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&type=uploaded&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1468 |
}
|
1469 |
} else {
|
1470 |
-
if(!$ftsCountIds >= 1) {
|
1471 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['album_id'] . '/photos?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1472 |
-
}
|
1473 |
-
else {
|
1474 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/photos?ids=' . $FB_Shortcode['album_id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1475 |
}
|
1476 |
}
|
@@ -1486,10 +1467,9 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1486 |
elseif ($FB_Shortcode['type'] == 'group') {
|
1487 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name,description&access_token=' . $access_token . $language . '');
|
1488 |
//Check If Ajax next URL needs to be used
|
1489 |
-
if(!$ftsCountIds >= 1) {
|
1490 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/feed?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1491 |
-
}
|
1492 |
-
else{
|
1493 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/feed?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1494 |
}
|
1495 |
} //Reviews
|
@@ -1507,23 +1487,22 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1507 |
} else {
|
1508 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=feed,id,name,description&access_token=' . $access_token . $language . '');
|
1509 |
//Check If Ajax next URL needs to be used
|
1510 |
-
if(!$ftsCountIds >= 1) {
|
1511 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/feed?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1512 |
-
}
|
1513 |
-
else{
|
1514 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/feed?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1515 |
}
|
1516 |
}
|
1517 |
$response = $this->fts_get_feed_json($mulit_data);
|
1518 |
|
1519 |
if (!isset($_GET['load_more_ajaxing'])) {
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
}
|
1528 |
|
1529 |
//Make sure it's not ajaxing
|
@@ -1586,16 +1565,14 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1586 |
|
1587 |
if ($FB_Shortcode['type'] == 'album_photos') {
|
1588 |
$fb_post_data_cache = 'fb_' . $FB_Shortcode['type'] . '_post_' . $FB_Shortcode['album_id'] . '_num' . $FB_Shortcode['posts'] . '';
|
1589 |
-
}
|
1590 |
-
else {
|
1591 |
$fb_post_data_cache = 'fb_' . $FB_Shortcode['type'] . '_post_' . $FB_Shortcode['id'] . '_num' . $FB_Shortcode['posts'] . '';
|
1592 |
}
|
1593 |
|
1594 |
// if (file_exists($fb_post_data_cache) && !filesize($fb_post_data_cache) == 0 && filemtime($fb_post_data_cache) > time() - 900 && false !== strpos($fb_post_data_cache, '-num' . $FB_Shortcode['posts'] . '') && !isset($_GET['load_more_ajaxing']) && $developer_mode !== '1') {
|
1595 |
if (false !== ($transient_exists = $this->fts_check_feed_cache_exists($fb_post_data_cache)) and !isset($_GET['load_more_ajaxing'])) {
|
1596 |
$response_post_array = $this->fts_get_feed_cache($fb_post_data_cache);
|
1597 |
-
}
|
1598 |
-
else {
|
1599 |
//Build the big post counter.
|
1600 |
$fb_post_array = array();
|
1601 |
//Single Events Array
|
@@ -1647,7 +1624,7 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1647 |
}
|
1648 |
|
1649 |
} //End else
|
1650 |
-
|
1651 |
// print_r($response_post_array);
|
1652 |
// echo'</pre>';
|
1653 |
return $response_post_array;
|
@@ -1673,8 +1650,7 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1673 |
$fb_event_post_data_cache = 'fbe_' . $FB_Shortcode['type'] . '_post_' . $FB_Shortcode['id'] . '_num' . $FB_Shortcode['posts'] . '';
|
1674 |
if (false !== ($transient_exists = $this->fts_check_feed_cache_exists($fb_event_post_data_cache)) and !isset($_GET['load_more_ajaxing'])) {
|
1675 |
$response_event_post_array = $this->fts_get_feed_cache($fb_event_post_data_cache);
|
1676 |
-
}
|
1677 |
-
else {
|
1678 |
//Single Events Array
|
1679 |
$fb_single_events_array = array();
|
1680 |
$set_zero = 0;
|
@@ -1700,13 +1676,11 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1700 |
}
|
1701 |
|
1702 |
|
1703 |
-
|
1704 |
$response_event_post_array = $this->fts_get_feed_json($fb_single_events_array);
|
1705 |
//Create Cache
|
1706 |
$this->fts_create_feed_cache($fb_event_post_data_cache, $response_event_post_array);
|
1707 |
|
1708 |
|
1709 |
-
|
1710 |
} //End else
|
1711 |
// echo'<pre>';
|
1712 |
// print_r($response_event_post_array);
|
@@ -1911,9 +1885,9 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1911 |
|
1912 |
$next_url = isset($feed_data->paging->next) ? $feed_data->paging->next : "";
|
1913 |
$posts = isset($FB_Shortcode['posts']) ? $FB_Shortcode['posts'] : "";
|
1914 |
-
$loadmore_count = isset($FB_Shortcode['loadmore_count']) && $FB_Shortcode['loadmore_count'] !=='' ? $FB_Shortcode['loadmore_count'] :'';
|
1915 |
// we check to see if the loadmore count number is set and if so pass that as the new count number when fetching the next set of posts
|
1916 |
-
$_REQUEST['next_url'] = $loadmore_count !== '' ? str_replace("limit=$posts","limit=$loadmore_count"
|
1917 |
|
1918 |
|
1919 |
//If events array Flip it so it's in proper order
|
@@ -1958,14 +1932,14 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
1958 |
$LOADMORE_OUPUT .= 'var fts_time = "' . $time . '";';
|
1959 |
|
1960 |
$LOADMORE_OUPUT .= 'var feed_name = "fts_facebook";';
|
1961 |
-
$LOADMORE_OUPUT .= 'var loadmore_count = "posts='
|
1962 |
$LOADMORE_OUPUT .= 'var feed_attributes = ' . json_encode($atts) . ';';
|
1963 |
|
1964 |
|
1965 |
$LOADMORE_OUPUT .= 'jQuery.ajax({';
|
1966 |
$LOADMORE_OUPUT .= 'data: {action: "my_fts_fb_load_more", next_url: nextURL_' . $fts_dynamic_name . ', fts_dynamic_name: fts_d_name, feed_name: feed_name, loadmore_count: loadmore_count, feed_attributes: feed_attributes, load_more_ajaxing: yes_ajax, fts_security: fts_security, fts_time: fts_time},';
|
1967 |
$LOADMORE_OUPUT .= 'type: "GET",';
|
1968 |
-
$LOADMORE_OUPUT .= 'url: "'.admin_url('admin-ajax.php').'",';
|
1969 |
$LOADMORE_OUPUT .= 'success: function( data ) {';
|
1970 |
$LOADMORE_OUPUT .= 'console.log("Well Done and got this from sever: " + data);';
|
1971 |
if ($FBtype && $FB_Shortcode['type'] == 'albums' || $FBtype && $FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['video_album'] !== 'yes' || $FB_Shortcode['grid'] == 'yes') {
|
@@ -2018,8 +1992,8 @@ style="margin:' . (isset($FB_Shortcode['slider_margin']) && $FB_Shortcode['slide
|
|
2018 |
//jQuery("#loadMore_'.$fts_dynamic_name.'").removeClass("flip360-fts-load-more");
|
2019 |
$LOADMORE_OUPUT .= 'jQuery("#loadMore_' . $fts_dynamic_name . '").removeClass("fts-fb-spinner");';
|
2020 |
if (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
2021 |
-
|
2022 |
-
|
2023 |
}
|
2024 |
//Reload the share each funcion otherwise you can't open share option.
|
2025 |
$LOADMORE_OUPUT .= 'jQuery.fn.ftsShare();slickremixImageResizingFacebook2();slickremixImageResizingFacebook3();';
|
36 |
}
|
37 |
|
38 |
// Date sort option for multiple feeds in a shortcode
|
39 |
+
function dateSort($a, $b) {
|
40 |
$dateA = strtotime($a->created_time);
|
41 |
$dateB = strtotime($b->created_time);
|
42 |
+
return ($dateB - $dateA);
|
43 |
}
|
44 |
|
45 |
|
69 |
include(WP_CONTENT_DIR . '/plugins/feed-them-premium/feeds/facebook/facebook-premium-feed.php');
|
70 |
//Load up some scripts for popup
|
71 |
$this->load_popup_scripts($FB_Shortcode);
|
72 |
+
} elseif (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php') && !is_plugin_active('feed-them-premium/feed-them-premium.php')) {
|
73 |
$FB_Shortcode = shortcode_atts(array(
|
74 |
'id' => '',
|
75 |
'type' => '',
|
93 |
'colmn_width' => '',
|
94 |
'space_between_posts' => '',
|
95 |
//new show media on top options
|
96 |
+
'show_media' => '',
|
97 |
+
'show_date' => '',
|
98 |
+
'show_name' => '',
|
99 |
|
100 |
), $atts);
|
101 |
if ($FB_Shortcode['posts'] == NULL)
|
102 |
$FB_Shortcode['posts'] = '6';
|
103 |
|
104 |
+
} else {
|
105 |
$FB_Shortcode = shortcode_atts(array(
|
106 |
'id' => '',
|
107 |
'type' => '',
|
125 |
$FB_Shortcode['posts'] = '6';
|
126 |
}
|
127 |
|
128 |
+
if ($FB_Shortcode['type'] == 'album_videos') {
|
129 |
$FB_Shortcode['type'] = 'album_photos';
|
130 |
$FB_Shortcode['video_album'] = 'yes';
|
131 |
$FB_Shortcode['album_id'] = 'photo_stream';
|
172 |
|
173 |
$feed_data_check = json_decode($response2['feed_data']);
|
174 |
|
175 |
+
// echo '<pre>';
|
176 |
+
// print_r($feed_data_check);
|
177 |
+
// echo '</pre>';
|
178 |
|
179 |
// $idNew = array();
|
180 |
// $idNew = explode(',', $FB_Shortcode['id']);
|
185 |
|
186 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php')) {
|
187 |
$ftsCountIds = substr_count($FB_Shortcode['id'], ",");
|
188 |
+
} else {
|
|
|
189 |
$ftsCountIds = '';
|
190 |
}
|
191 |
|
192 |
+
if (isset($feed_data_check->data)) {
|
193 |
+
if ($ftsCountIds >= 1 && $FB_Shortcode['type'] !== 'reviews') {
|
194 |
$fts_list_arrays = array();
|
195 |
foreach ($feed_data_check as $feed_data_name) {
|
196 |
|
197 |
+
if (isset($feed_data_name->data)) {
|
198 |
+
$fts_list_arrays = array_merge_recursive($fts_list_arrays, $feed_data_name->data);
|
199 |
}
|
200 |
//var_dump( $fts_list_arrays[$i]);
|
201 |
|
202 |
}
|
203 |
// we don't need to sort event feeds for this check because we already to that
|
204 |
+
if ($FB_Shortcode['type'] !== 'events') {
|
205 |
// Sort the array using the call back function
|
206 |
usort($fts_list_arrays, array($this, "dateSort"));
|
207 |
}
|
208 |
|
209 |
$merged_Array['data'] = $fts_list_arrays;
|
210 |
+
$feed_data_check = (object)$merged_Array;
|
211 |
}
|
212 |
|
213 |
// Test the created dataes are being sorted properly
|
248 |
}
|
249 |
|
250 |
|
251 |
+
// echo '<pre>';
|
252 |
+
// print_r($feed_data_check);
|
253 |
+
// echo '</pre>, ';
|
254 |
}
|
255 |
|
256 |
///////////////////////////////////////////////////
|
282 |
|
283 |
if (is_plugin_active('feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php') && get_option('fts_facebook_custom_api_token_biz') == TRUE && $FB_Shortcode['type'] == 'reviews') {
|
284 |
|
285 |
+
if ($FB_Shortcode['remove_reviews_no_description'] == 'yes' && !isset($_GET['load_more_ajaxing'])) {
|
286 |
|
287 |
+
$FTS_Facebook_Reviews = new FTS_Facebook_Reviews();
|
288 |
+
$no_description_count = $FTS_Facebook_Reviews->review_count_check($FB_Shortcode);
|
289 |
|
290 |
+
// testing purposes
|
291 |
+
// print ''. $no_description_count - $FB_Shortcode['posts'] .' = The amount of posts with no review text.';
|
292 |
|
293 |
+
// this count includes our original posts count + the amount of posts we found with no description
|
294 |
+
$FB_Shortcode['posts'] = $no_description_count;
|
295 |
+
}
|
296 |
+
$biz_access_token = get_option('fts_facebook_custom_api_token_biz');
|
297 |
+
//Get Response (AKA Page & Feed Information) ERROR CHECK inside this function
|
298 |
+
$response = $this->get_facebook_feed_response($FB_Shortcode, $fb_cache_name, $biz_access_token, $language);
|
299 |
|
300 |
+
$feed_data = json_decode($response['feed_data']);
|
301 |
// SHOW THE REVIEWS FEED PRINT_R
|
302 |
+
// echo '<pre>';
|
303 |
+
// print_r($feed_data );
|
304 |
+
// echo '</pre>';
|
305 |
+
|
306 |
+
|
307 |
+
if ($FB_Shortcode['remove_reviews_no_description'] == 'yes') {
|
308 |
+
// $no_description_count2 = 0;
|
309 |
+
foreach ($feed_data->data as $k => $v) {
|
310 |
+
if (!isset($v->review_text)) {
|
311 |
+
// print $v->reviewer->name . ' (Key# ' . $k . ') : Now Unset from array<br/>';
|
312 |
+
unset($feed_data->data[$k]);
|
313 |
+
// $no_description_count2++;
|
314 |
+
}
|
|
|
315 |
}
|
316 |
+
}
|
317 |
$ratings_data = json_decode($response['ratings_data']);
|
318 |
// SHOW THE REVIEWS RATING INFO PRINT_R
|
319 |
+
// echo '<pre>';
|
320 |
+
// print_r($ratings_data );
|
321 |
+
// echo '</pre>';
|
322 |
|
323 |
}
|
324 |
|
325 |
|
326 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php')) {
|
327 |
$ftsCountIds = substr_count($FB_Shortcode['id'], ",");
|
328 |
+
} else {
|
|
|
329 |
$ftsCountIds = '';
|
330 |
}
|
331 |
|
332 |
+
if ($ftsCountIds >= 1 && $FB_Shortcode['type'] !== 'reviews') {
|
333 |
|
334 |
$fts_list_arrays = array();
|
335 |
foreach ($feed_data as $feed_data_name) {
|
340 |
}
|
341 |
|
342 |
// we don't need to sort event feeds because we already to that
|
343 |
+
if ($FB_Shortcode['type'] !== 'events') {
|
344 |
// Sort the array using the call back function
|
345 |
usort($fts_list_arrays, array($this, "dateSort"));
|
346 |
}
|
406 |
//******************
|
407 |
// SOCIAL BUTTON
|
408 |
//******************
|
409 |
+
if (!$ftsCountIds >= 1) {
|
410 |
$FTS_FB_OUTPUT .= $this->fb_social_btn_placement($FB_Shortcode, $access_token, 'fb-like-top-above-title');
|
411 |
}
|
412 |
|
413 |
|
|
|
|
|
414 |
if ($FB_Shortcode['type'] !== 'reviews') {
|
415 |
$page_data->description = isset($page_data->description) ? $page_data->description : "";
|
416 |
$page_data->name = isset($page_data->name) ? $page_data->name : "";
|
439 |
|
440 |
|
441 |
}
|
442 |
+
if ($FB_Shortcode['type'] !== 'reviews') {
|
443 |
if (is_plugin_active('feed-them-premium/feed-them-premium.php')) {
|
444 |
// $FTS_FB_OUTPUT .= our Facebook Page Title or About Text. Commented out the group description because in the future we will be adding the about description.
|
445 |
$fts_align_title = isset($FB_Shortcode['title_align']) && $FB_Shortcode['title_align'] !== '' ? 'style="text-align:' . $FB_Shortcode['title_align'] . ';"' : '';
|
462 |
//******************
|
463 |
// SOCIAL BUTTON
|
464 |
//******************
|
465 |
+
if (!$ftsCountIds >= 1) {
|
466 |
$FTS_FB_OUTPUT .= $this->fb_social_btn_placement($FB_Shortcode, $access_token, 'fb-like-top-below-title');
|
467 |
}
|
468 |
|
474 |
if (!isset($_GET['load_more_ajaxing'])) {
|
475 |
|
476 |
|
477 |
+
$fts_mashup_media_top = isset($FB_Shortcode['show_media']) && $FB_Shortcode['show_media'] == 'top' ? 'fts-mashup-media-top ' : '';
|
478 |
+
$fts_mashup_show_name = isset($FB_Shortcode['show_name']) && $FB_Shortcode['show_name'] == 'no' ? ' fts-mashup-hide-name ' : '';
|
479 |
+
$fts_mashup_show_date = isset($FB_Shortcode['show_date']) && $FB_Shortcode['show_date'] == 'no' ? ' fts-mashup-hide-date ' : '';
|
480 |
+
$fts_mashup_show_thumbnail = isset($FB_Shortcode['show_thumbnail']) && $FB_Shortcode['show_thumbnail'] == 'no' ? ' fts-mashup-hide-thumbnail ' : '';
|
481 |
|
482 |
|
483 |
if (!isset($FBtype) && $FB_Shortcode['type'] == 'albums' || !isset($FBtype) && $FB_Shortcode['type'] == 'album_photos' || isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes') {
|
484 |
|
485 |
|
486 |
if (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes') {
|
487 |
+
} elseif (isset($FB_Shortcode['slider']) && $FB_Shortcode['slider'] !== 'yes' && $FB_Shortcode['image_stack_animation'] == 'yes' || isset($FB_Shortcode['grid']) && $FB_Shortcode['grid'] == 'yes' || isset($FB_Shortcode['image_stack_animation']) && $FB_Shortcode['image_stack_animation'] == 'yes') {
|
488 |
wp_enqueue_script('fts-masonry-pkgd', plugins_url('feed-them-social/feeds/js/masonry.pkgd.min.js'), array('jquery'));
|
489 |
$FTS_FB_OUTPUT .= '<script>';
|
490 |
$FTS_FB_OUTPUT .= 'jQuery(window).load(function(){';
|
497 |
|
498 |
|
499 |
if (!isset($FBtype) && $FB_Shortcode['type'] == 'albums' || !isset($FBtype) && $FB_Shortcode['type'] == 'album_photos' && !isset($FBtype) && !isset($FB_Shortcode['slider']) || !isset($FBtype) && $FB_Shortcode['type'] == 'album_photos' && !isset($FBtype) && isset($FB_Shortcode['slider']) && $FB_Shortcode['slider'] !== 'yes') {
|
500 |
+
$FTS_FB_OUTPUT .= '<div class="fts-slicker-facebook-photos fts-slicker-facebook-albums' . (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] && $FB_Shortcode['video_album'] == 'yes' ? ' popup-video-gallery-fb' : '') . (isset($FB_Shortcode['image_stack_animation']) && $FB_Shortcode['image_stack_animation'] == 'yes' ? ' masonry js-masonry' : '') . (isset($FB_Shortcode['images_align']) && $FB_Shortcode['images_align'] ? ' popup-video-gallery-align-' . $FB_Shortcode['images_align'] : '') . ' popup-gallery-fb ' . $fts_dynamic_class_name . '"';
|
501 |
+
if ($FB_Shortcode['image_stack_animation'] == 'yes') {
|
502 |
+
$FTS_FB_OUTPUT .= 'data-masonry-options=\'{ "isFitWidth": ' . ($FB_Shortcode['center_container'] == 'no' ? 'false' : 'true') . ' ' . ($FB_Shortcode['image_stack_animation'] == 'no' ? ', "transitionDuration": 0' : '') . '}\' style="margin:auto;"';
|
503 |
+
}
|
504 |
+
$FTS_FB_OUTPUT .= '>';
|
505 |
|
506 |
} // slideshow scrollHorz or carousel
|
507 |
elseif (!isset($FBtype) && isset($FB_Shortcode['slider']) && $FB_Shortcode['slider'] == 'yes') {
|
629 |
$FTS_FB_OUTPUT .= '<div class="fts-slicker-facebook-posts masonry js-masonry ' . $fts_mashup_media_top . $fts_mashup_show_name . $fts_mashup_show_date . $fts_mashup_show_thumbnail . ($FB_Shortcode['popup'] == 'yes' ? 'popup-gallery-fb-posts ' : '') . ($FB_Shortcode['type'] == 'reviews' ? 'fts-reviews-feed ' : '') . $fts_dynamic_class_name . ' " style="margin:auto;" data-masonry-options=\'{ "isFitWidth": ' . ($FB_Shortcode['center_container'] == 'no' ? 'false' : 'true') . ' ' . ($FB_Shortcode['image_stack_animation'] == 'no' ? ', "transitionDuration": 0' : '') . '}\'>';
|
630 |
// $FTS_FB_OUTPUT .= '<div class="fts-slicker-facebook-photos fts-slicker-facebook-posts masonry js-masonry ' . ($FB_Shortcode['popup'] == 'yes' ? 'popup-gallery-fb-posts ' : '') . ($FB_Shortcode['type'] == 'reviews' ? 'fts-reviews-feed ' : '') . $fts_dynamic_class_name . ' " style="margin:auto;" data-masonry-options=\'{ "isFitWidth": ' . ($FB_Shortcode['center_container'] == 'no' ? 'false' : 'true') . ' ' . ($FB_Shortcode['image_stack_animation'] == 'no' ? ', "transitionDuration": 0' : '') . '}\'>';
|
631 |
}
|
632 |
+
} else {
|
|
|
633 |
$FTS_FB_OUTPUT .= '<div class="fts-jal-fb-group-display fts-simple-fb-wrapper ' . $fts_mashup_media_top . $fts_mashup_show_name . $fts_mashup_show_date . $fts_mashup_show_thumbnail . (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes' ? ' popup-gallery-fb-posts ' : '') . ($FB_Shortcode['type'] == 'reviews' ? 'fts-reviews-feed ' : '') . $fts_dynamic_class_name . ' ' . ($FB_Shortcode['height'] !== 'auto' && empty($FB_Shortcode['height']) == NULL ? 'fts-fb-scrollable" style="height:' . $FB_Shortcode['height'] . '"' : '"') . '>';
|
634 |
}
|
635 |
} //End ajaxing Check
|
822 |
}
|
823 |
|
824 |
|
|
|
825 |
unset($_REQUEST['next_url']);
|
826 |
|
827 |
|
828 |
//******************
|
829 |
// SOCIAL BUTTON
|
830 |
//******************
|
831 |
+
if (!$ftsCountIds >= 1) {
|
832 |
$FTS_FB_OUTPUT .= $this->fb_social_btn_placement($FB_Shortcode, $access_token, 'fb-like-below');
|
833 |
}
|
834 |
|
886 |
*/
|
887 |
function fts_facebook_post_photo($FBlink, $FB_Shortcode, $photo_from, $photo_source) {
|
888 |
if ($FB_Shortcode['type'] == 'album_photos' || $FB_Shortcode['type'] == 'albums') {
|
889 |
+
$output = '<a href="' . $FBlink . '" target="_blank" class="fts-jal-fb-picture album-photo-fts" style="width:' . $FB_Shortcode['image_width'] . ';height:' . $FB_Shortcode['image_height'] . ';';
|
|
|
|
|
|
|
|
|
890 |
if ($FB_Shortcode['type'] == 'albums') {
|
891 |
+
$output .= 'background-image:url(https://graph.facebook.com/' . $photo_source . '/picture);">';
|
|
|
|
|
892 |
} else {
|
893 |
+
$output .= 'background-image:url('. $photo_source .');">';
|
|
|
894 |
}
|
895 |
$output .= '</a>';
|
896 |
} else {
|
897 |
$FB_ShortcodePopup = isset($FB_Shortcode['popup']) ? $FB_Shortcode['popup'] : '';
|
898 |
if ($FB_ShortcodePopup == 'yes' && $FBlink !== 'javascript:;') {
|
|
|
|
|
899 |
$output = '<a href="' . $photo_source . '" target="_blank" class="fts-facebook-link-target fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . $photo_from . '" src="' . $photo_source . '"/></a>';
|
900 |
|
901 |
} else {
|
1106 |
}
|
1107 |
if ($FBpost_comments_count == '1') {
|
1108 |
$LSC_array['comments'] = "<i class='icon-comments'></i> 1";
|
1109 |
+
$LSC_array['comments_thread'] = $comment_count_data;
|
1110 |
|
1111 |
}
|
1112 |
if ($FBpost_comments_count > '1') {
|
1113 |
$LSC_array['comments'] = "<i class='icon-comments'></i> " . $FBpost_comments_count;
|
1114 |
+
$LSC_array['comments_thread'] = $comment_count_data;
|
1115 |
}
|
1116 |
}
|
1117 |
}
|
1129 |
}
|
1130 |
|
1131 |
|
|
|
1132 |
/**
|
1133 |
* FTS Facebook Post See More
|
1134 |
*
|
1158 |
case 'events':
|
1159 |
$single_event_id = 'https://facebook.com/events/' . $single_event_id;
|
1160 |
$fts_share_option = $share_this->fts_share_option($single_event_id, $description);
|
1161 |
+
$output = '<div class="fts-likes-shares-etc-wrap">' . $fts_share_option . '<a href="' . $single_event_id . '" target="_blank" class="fts-jal-fb-see-more">' . __('View on Facebook', 'feed-them-social') . '</a></div>';
|
1162 |
return $output;
|
1163 |
case 'photo':
|
1164 |
if (!empty($FBlink)) {
|
1165 |
$fts_share_option = $share_this->fts_share_option($FBlink, $description);
|
1166 |
+
$output = '<div class="fts-likes-shares-etc-wrap">' . $fts_share_option . '<a href="' . $FBlink . '" target="_blank" class="fts-jal-fb-see-more">';
|
1167 |
} // exception for videos
|
1168 |
else {
|
1169 |
$single_video_id = 'https://facebook.com/' . $FBpost_id;
|
1170 |
$fts_share_option = $share_this->fts_share_option($single_video_id, $description);
|
1171 |
+
$output = '<div class="fts-likes-shares-etc-wrap">' . $fts_share_option . '<a href="' . $single_video_id . '" target="_blank" class="fts-jal-fb-see-more">';
|
1172 |
}
|
1173 |
if ($FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['hide_date_likes_comments'] == 'yes') {
|
1174 |
$output .= '<div class="hide-date-likes-comments-etc">' . $lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ' . $lcs_array['shares'] . ' </div>';
|
1191 |
|
1192 |
$fts_share_option = $share_this->fts_share_option($new_album_url, $description);
|
1193 |
|
1194 |
+
$output = '<div class="fts-likes-shares-etc-wrap">' . $fts_share_option . '<a href="' . $new_album_url . '" target="_blank" class="fts-jal-fb-see-more">';
|
1195 |
if ($FB_Shortcode['type'] = 'albums' && $FB_Shortcode['hide_date_likes_comments'] == 'yes') {
|
1196 |
} else {
|
1197 |
$output .= '' . $lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ';
|
1207 |
$fb_reviews_see_more_reviews_language = get_option('fb_reviews_see_more_reviews_language') ? get_option('fb_reviews_see_more_reviews_language') : 'See More Reviews';
|
1208 |
|
1209 |
$hide_see_more = isset($FB_Shortcode['hide_see_more_reviews_link']) ? $FB_Shortcode['hide_see_more_reviews_link'] : 'yes';
|
1210 |
+
if ($hide_see_more !== 'yes') {
|
1211 |
$output .= ' <a href="https://facebook.com/' . $FB_Shortcode['id'] . '/reviews" target="_blank" class="fts-jal-fb-see-more">' . __($fb_reviews_see_more_reviews_language, 'feed-them-social') . '</a>';
|
1212 |
}
|
1213 |
} else {
|
1214 |
$post_single_id = 'https://facebook.com/' . $FBpost_user_id . '/posts/' . $FBpost_single_id;
|
1215 |
$fts_share_option = $share_this->fts_share_option($post_single_id, $description);
|
1216 |
+
$output = '<div class="fts-likes-shares-etc-wrap">' . $fts_share_option . '<a href="' . $post_single_id . '" target="_blank" class="fts-jal-fb-see-more">';
|
1217 |
$output .= '' . $lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ' . __('View on Facebook', 'feed-them-social') . '</a></div>';
|
1218 |
}
|
1219 |
+
if (get_option('fb_reviews_remove_see_reviews_link') !== 'yes') {
|
1220 |
return $output;
|
1221 |
}
|
1222 |
}
|
1230 |
*/
|
1231 |
function get_access_token() {
|
1232 |
//API Access Token
|
1233 |
+
// $custom_access_token = get_option('fts_facebook_custom_api_token');
|
1234 |
+
// if (!empty($custom_access_token)) {
|
1235 |
+
$access_token = get_option('fts_facebook_custom_api_token');
|
1236 |
+
// return $access_token;
|
1237 |
+
// } else {
|
1238 |
+
//Randomizer
|
1239 |
+
// $values = array(
|
1240 |
+
// '431287540548931|4A23YYIFqhd-gpz_E4Fy6U_Seo0',
|
1241 |
+
// '1748446362151826|epVUmLiKT8QhLN63iRvvXXHwxqk',
|
1242 |
+
// '1875381106044241|KmWz3mtzGye0M5HTdX0SK7rqpIU',
|
1243 |
+
// '754106341419549|AMruxCJ_ly8825VXeLhBKo_kOfs',
|
1244 |
+
// '438563519819257|1GJ8GLl1AQ7ZTvXV_Xpok_QpH6s',
|
1245 |
+
// '753693994788276|xm_PXoNRWW8WPQdcQArRpBgWn5Q',
|
1246 |
+
// '644818402385988|sABEvG0QiOaJRlNLC2NphfQLlfg',
|
1247 |
+
// '292500071162951|9MA-kzWVs6HTEybpdxKjgF_gqeo',
|
1248 |
+
// '263710677420086|Jpui2CFig7RbtdHaHPN_fiEa77U',
|
1249 |
+
// '1850081601881384|u2JcPCn7TH40MY5BwC-i4PMHGm8',
|
1250 |
+
// );
|
1251 |
+
// $access_token = $values[array_rand($values, 1)];
|
1252 |
+
return $access_token;
|
1253 |
+
// }
|
1254 |
}
|
1255 |
|
1256 |
/**
|
1288 |
$fts_view_fb_link = 'https://www.facebook.com/' . $FB_Shortcode['id'] . '/reviews/';
|
1289 |
break;
|
1290 |
}
|
1291 |
+
$fts_view_fb_link = isset($fts_view_fb_link) ? $fts_view_fb_link : '';
|
1292 |
return $fts_view_fb_link;
|
1293 |
}
|
1294 |
|
1303 |
//URL to get page info
|
1304 |
$rCount = substr_count($FB_Shortcode['id'], ",");
|
1305 |
|
1306 |
+
if ($rCount >= 1) {
|
1307 |
$result = preg_replace('/[ ,]+/', '-', trim($FB_Shortcode['id']));
|
1308 |
$FB_Shortcode['id'] = $result;
|
1309 |
}
|
1392 |
|
1393 |
if (is_plugin_active('feed-them-social-combined-streams/feed-them-social-combined-streams.php')) {
|
1394 |
$ftsCountIds = substr_count($FB_Shortcode['id'], ",");
|
1395 |
+
} else {
|
|
|
1396 |
$ftsCountIds = '';
|
1397 |
}
|
1398 |
|
1403 |
if ($FB_Shortcode['type'] == 'page' && $FB_Shortcode['posts_displayed'] == 'page_only') {
|
1404 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name,description&access_token=' . $access_token . $language . '');
|
1405 |
|
1406 |
+
if (!$ftsCountIds >= 1) {
|
1407 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/posts?fields=id,caption,attachments,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1408 |
+
} else {
|
|
|
1409 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/posts?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,attachments,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1410 |
}
|
1411 |
|
1415 |
$date = date('Y-m-d');
|
1416 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name&access_token=' . $access_token . $language . '');
|
1417 |
//Check If Ajax next URL needs to be used
|
1418 |
+
if (!$ftsCountIds >= 1) {
|
1419 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/events?since=' . $date . '&access_token=' . $access_token . $language . '';
|
1420 |
+
} else {
|
|
|
1421 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/events?ids=' . $FB_Shortcode['id'] . '&since=' . $date . '&access_token=' . $access_token . $language . '';
|
1422 |
}
|
1423 |
} //Albums
|
1424 |
elseif ($FB_Shortcode['type'] == 'albums') {
|
1425 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name,description,link&access_token=' . $access_token . $language . '');
|
1426 |
//Check If Ajax next URL needs to be used
|
1427 |
+
if (!$ftsCountIds >= 1) {
|
1428 |
+
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/albums?fields=id,photos,created_time,name,from,link,cover_photo,count,updated_time,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1429 |
+
} else {
|
1430 |
+
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/albums?ids=' . $FB_Shortcode['id'] . '&fields=id,photos,created_time,name,from,link,cover_photo,count,updated_time,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
|
|
1431 |
}
|
1432 |
|
1433 |
// $mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/albums?fields=id,created_time,name,from,link,cover_photo,count,updated_time,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1437 |
//Check If Ajax next URL needs to be used
|
1438 |
//The reason I did not create a whole new else if for the video album is because I did not want to duplicate all the code required to make the video because the videos gallery comes from the photo albums on facebook.
|
1439 |
if (isset($FB_Shortcode['video_album']) && $FB_Shortcode['video_album'] == 'yes') {
|
1440 |
+
if (!$ftsCountIds >= 1) {
|
1441 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/videos?fields=id,created_time,description,from,icon,link,message,object_id,picture,place,shares,source,to,type,format,embed_html&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1442 |
+
} else {
|
|
|
1443 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/videos?ids=' . $FB_Shortcode['id'] . '&fields=id,created_time,description,from,icon,link,message,object_id,picture,place,shares,source,to,type,format,embed_html&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1444 |
}
|
1445 |
} elseif (isset($FB_Shortcode['album_id']) && $FB_Shortcode['album_id'] == 'photo_stream') {
|
1446 |
+
if (!$ftsCountIds >= 1) {
|
1447 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/photos?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&type=uploaded&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1448 |
+
} else {
|
|
|
1449 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/photos?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&type=uploaded&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1450 |
}
|
1451 |
} else {
|
1452 |
+
if (!$ftsCountIds >= 1) {
|
1453 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['album_id'] . '/photos?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1454 |
+
} else {
|
|
|
1455 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/photos?ids=' . $FB_Shortcode['album_id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1456 |
}
|
1457 |
}
|
1467 |
elseif ($FB_Shortcode['type'] == 'group') {
|
1468 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=id,name,description&access_token=' . $access_token . $language . '');
|
1469 |
//Check If Ajax next URL needs to be used
|
1470 |
+
if (!$ftsCountIds >= 1) {
|
1471 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/feed?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1472 |
+
} else {
|
|
|
1473 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/feed?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1474 |
}
|
1475 |
} //Reviews
|
1487 |
} else {
|
1488 |
$mulit_data = array('page_data' => 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '?fields=feed,id,name,description&access_token=' . $access_token . $language . '');
|
1489 |
//Check If Ajax next URL needs to be used
|
1490 |
+
if (!$ftsCountIds >= 1) {
|
1491 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/' . $FB_Shortcode['id'] . '/feed?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1492 |
+
} else {
|
|
|
1493 |
$mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? $_REQUEST['next_url'] : 'https://graph.facebook.com/feed?ids=' . $FB_Shortcode['id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,full_picture,place,shares,source,status_type,story,to,type&limit=' . $FB_Shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1494 |
}
|
1495 |
}
|
1496 |
$response = $this->fts_get_feed_json($mulit_data);
|
1497 |
|
1498 |
if (!isset($_GET['load_more_ajaxing'])) {
|
1499 |
+
//Error Check
|
1500 |
+
$feed_data = json_decode($response['feed_data']);
|
1501 |
+
$fts_error_check = new fts_error_handler();
|
1502 |
+
$fts_error_check_complete = $fts_error_check->facebook_error_check($FB_Shortcode, $feed_data);
|
1503 |
+
if (is_array($fts_error_check_complete) && $fts_error_check_complete[0] == true) {
|
1504 |
+
return array(false, $fts_error_check_complete[1]);
|
1505 |
+
}
|
1506 |
}
|
1507 |
|
1508 |
//Make sure it's not ajaxing
|
1565 |
|
1566 |
if ($FB_Shortcode['type'] == 'album_photos') {
|
1567 |
$fb_post_data_cache = 'fb_' . $FB_Shortcode['type'] . '_post_' . $FB_Shortcode['album_id'] . '_num' . $FB_Shortcode['posts'] . '';
|
1568 |
+
} else {
|
|
|
1569 |
$fb_post_data_cache = 'fb_' . $FB_Shortcode['type'] . '_post_' . $FB_Shortcode['id'] . '_num' . $FB_Shortcode['posts'] . '';
|
1570 |
}
|
1571 |
|
1572 |
// if (file_exists($fb_post_data_cache) && !filesize($fb_post_data_cache) == 0 && filemtime($fb_post_data_cache) > time() - 900 && false !== strpos($fb_post_data_cache, '-num' . $FB_Shortcode['posts'] . '') && !isset($_GET['load_more_ajaxing']) && $developer_mode !== '1') {
|
1573 |
if (false !== ($transient_exists = $this->fts_check_feed_cache_exists($fb_post_data_cache)) and !isset($_GET['load_more_ajaxing'])) {
|
1574 |
$response_post_array = $this->fts_get_feed_cache($fb_post_data_cache);
|
1575 |
+
} else {
|
|
|
1576 |
//Build the big post counter.
|
1577 |
$fb_post_array = array();
|
1578 |
//Single Events Array
|
1624 |
}
|
1625 |
|
1626 |
} //End else
|
1627 |
+
// echo'<pre>';
|
1628 |
// print_r($response_post_array);
|
1629 |
// echo'</pre>';
|
1630 |
return $response_post_array;
|
1650 |
$fb_event_post_data_cache = 'fbe_' . $FB_Shortcode['type'] . '_post_' . $FB_Shortcode['id'] . '_num' . $FB_Shortcode['posts'] . '';
|
1651 |
if (false !== ($transient_exists = $this->fts_check_feed_cache_exists($fb_event_post_data_cache)) and !isset($_GET['load_more_ajaxing'])) {
|
1652 |
$response_event_post_array = $this->fts_get_feed_cache($fb_event_post_data_cache);
|
1653 |
+
} else {
|
|
|
1654 |
//Single Events Array
|
1655 |
$fb_single_events_array = array();
|
1656 |
$set_zero = 0;
|
1676 |
}
|
1677 |
|
1678 |
|
|
|
1679 |
$response_event_post_array = $this->fts_get_feed_json($fb_single_events_array);
|
1680 |
//Create Cache
|
1681 |
$this->fts_create_feed_cache($fb_event_post_data_cache, $response_event_post_array);
|
1682 |
|
1683 |
|
|
|
1684 |
} //End else
|
1685 |
// echo'<pre>';
|
1686 |
// print_r($response_event_post_array);
|
1885 |
|
1886 |
$next_url = isset($feed_data->paging->next) ? $feed_data->paging->next : "";
|
1887 |
$posts = isset($FB_Shortcode['posts']) ? $FB_Shortcode['posts'] : "";
|
1888 |
+
$loadmore_count = isset($FB_Shortcode['loadmore_count']) && $FB_Shortcode['loadmore_count'] !== '' ? $FB_Shortcode['loadmore_count'] : '';
|
1889 |
// we check to see if the loadmore count number is set and if so pass that as the new count number when fetching the next set of posts
|
1890 |
+
$_REQUEST['next_url'] = $loadmore_count !== '' ? str_replace("limit=$posts", "limit=$loadmore_count", $next_url) : $next_url;
|
1891 |
|
1892 |
|
1893 |
//If events array Flip it so it's in proper order
|
1932 |
$LOADMORE_OUPUT .= 'var fts_time = "' . $time . '";';
|
1933 |
|
1934 |
$LOADMORE_OUPUT .= 'var feed_name = "fts_facebook";';
|
1935 |
+
$LOADMORE_OUPUT .= 'var loadmore_count = "posts=' . $FB_Shortcode['loadmore_count'] . '";';
|
1936 |
$LOADMORE_OUPUT .= 'var feed_attributes = ' . json_encode($atts) . ';';
|
1937 |
|
1938 |
|
1939 |
$LOADMORE_OUPUT .= 'jQuery.ajax({';
|
1940 |
$LOADMORE_OUPUT .= 'data: {action: "my_fts_fb_load_more", next_url: nextURL_' . $fts_dynamic_name . ', fts_dynamic_name: fts_d_name, feed_name: feed_name, loadmore_count: loadmore_count, feed_attributes: feed_attributes, load_more_ajaxing: yes_ajax, fts_security: fts_security, fts_time: fts_time},';
|
1941 |
$LOADMORE_OUPUT .= 'type: "GET",';
|
1942 |
+
$LOADMORE_OUPUT .= 'url: "' . admin_url('admin-ajax.php') . '",';
|
1943 |
$LOADMORE_OUPUT .= 'success: function( data ) {';
|
1944 |
$LOADMORE_OUPUT .= 'console.log("Well Done and got this from sever: " + data);';
|
1945 |
if ($FBtype && $FB_Shortcode['type'] == 'albums' || $FBtype && $FB_Shortcode['type'] == 'album_photos' && $FB_Shortcode['video_album'] !== 'yes' || $FB_Shortcode['grid'] == 'yes') {
|
1992 |
//jQuery("#loadMore_'.$fts_dynamic_name.'").removeClass("flip360-fts-load-more");
|
1993 |
$LOADMORE_OUPUT .= 'jQuery("#loadMore_' . $fts_dynamic_name . '").removeClass("fts-fb-spinner");';
|
1994 |
if (isset($FB_Shortcode['popup']) && $FB_Shortcode['popup'] == 'yes') {
|
1995 |
+
// We return this function again otherwise the popup won't work correctly for the newly loaded items
|
1996 |
+
$LOADMORE_OUPUT .= 'jQuery.fn.slickFacebookPopUpFunction();';
|
1997 |
}
|
1998 |
//Reload the share each funcion otherwise you can't open share option.
|
1999 |
$LOADMORE_OUPUT .= 'jQuery.fn.ftsShare();slickremixImageResizingFacebook2();slickremixImageResizingFacebook3();';
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
=== Feed Them Social - Facebook, Instagram, Twitter, YouTube
|
2 |
Contributors: slickremix
|
3 |
Tags: Facebook, Instagram, Twitter, YouTube, Feed
|
4 |
Requires at least: 3.6.0
|
5 |
Tested up to: 4.9.6
|
6 |
-
Stable tag: 2.4.
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Custom feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
|
@@ -76,6 +76,9 @@ Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](h
|
|
76 |
* Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
|
77 |
|
78 |
== Changelog ==
|
|
|
|
|
|
|
79 |
= Version 2.4.3 Wednesday, June 27th, 2018 =
|
80 |
* FIX: Facebook Feed: Remove with_tags depreciated call in app vs 2.7. Ths was causing many feeds to show an Error #100 message. This will also fix anyone encountering this error with the Combined Streams plugin.
|
81 |
* EDIT: Facebook Options: Remove a few overlooked style options for Events
|
1 |
+
=== Feed Them Social - Facebook, Instagram, Twitter, YouTube & Pinterest ===
|
2 |
Contributors: slickremix
|
3 |
Tags: Facebook, Instagram, Twitter, YouTube, Feed
|
4 |
Requires at least: 3.6.0
|
5 |
Tested up to: 4.9.6
|
6 |
+
Stable tag: 2.4.4
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Custom feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
|
76 |
* Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
|
77 |
|
78 |
== Changelog ==
|
79 |
+
= Version 2.4.4 Friday, June 29th, 2018 =
|
80 |
+
* FIX: Facebook Cover photos, Album photos and Video Albums to have proper image file types to work in Firefox and Safari.
|
81 |
+
|
82 |
= Version 2.4.3 Wednesday, June 27th, 2018 =
|
83 |
* FIX: Facebook Feed: Remove with_tags depreciated call in app vs 2.7. Ths was causing many feeds to show an Error #100 message. This will also fix anyone encountering this error with the Combined Streams plugin.
|
84 |
* EDIT: Facebook Options: Remove a few overlooked style options for Events
|