Version Description
MUST update to make it work with latest facebook API.
Download this release
Release Info
Developer | jwebsol |
Plugin | Easy Facebook Like Box (Facebook Page Plugin) – Custom Facebook Feed – Auto PopUp |
Version | 4.3.0 |
Comparing to | |
See all releases |
Code changes from version 4.2.6 to 4.3.0
- README.txt +23 -8
- easy-facebook-likebox.php +1 -1
- public/assets/css/public.css +5 -2
- public/easy-facebook-likebox.php +1 -1
- public/views/feed.php +49 -30
README.txt
CHANGED
@@ -1,22 +1,26 @@
|
|
1 |
-
=== Easy Facebook Like Box - Custom Facebook Feed - Auto PopUp ===
|
2 |
Contributors: sjaved, DaNish Ali, jwebsol
|
3 |
-
Tags:
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=sjaved786%40gmail%2ecom&lc=US&item_name=Easy%20Facebook%20Like%20Box%20WordPress%20Plugin&item_number=efbl¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv2 or later
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
Easy facebook like box WordPress plugin allows to display custom facebook feed, page plugin (like box), like button, using widget, shortcode, PopUp.
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
|
16 |
|
17 |
[Custom facebook feed demo](https://jwebsol.com/custom-facebook-feed/ "See this plugin in action (Custom facebook feed demo)") | [Fixed width demo](https://jwebsol.com/easy-facebook-like-box-plugin-demo/ "See this plugin in action (Fixed width)") | [Responsive demo](https://jwebsol.com/easy-facebook-like-box-responsive-demo/ "See this plugin in action (Responsive)") |
|
18 |
[Auto PopUp demo](https://jwebsol.com/easy-facebook-like-box-auto-popup-demo/ "See this plugin in action (Auto PopUp)")
|
19 |
|
|
|
|
|
|
|
|
|
20 |
### Features:
|
21 |
|
22 |
1. Now support custom facebook feed **NEW**.
|
@@ -39,7 +43,11 @@ Displays a Facebook Like Box. The Facebook Like Box is a social plugin that enab
|
|
39 |
1. Show PopUp if visitors are not logged in.
|
40 |
1. Close button act as never show again (show only once).
|
41 |
1. Hide on mobile devices.
|
42 |
-
1. **And a
|
|
|
|
|
|
|
|
|
43 |
|
44 |
### How to use easy custom facebook feed **(New)**
|
45 |
|
@@ -83,6 +91,9 @@ Thanks to *Marek Sierociński* for translating this plugin into polish language
|
|
83 |
3. Navigate to "Appearance > Widgets" and drag and drop "Easy Facebook Likebox" in desired widget area or use the shortcode in page/post generated by widget.
|
84 |
|
85 |
== Upgrade Notice ==
|
|
|
|
|
|
|
86 |
= 4.2.5 =
|
87 |
Recent update with open external links in new tab option and little improvements here and there.
|
88 |
|
@@ -146,6 +157,10 @@ http://wordpress.org/support/topic/need-feed-back-on-plugin-feature/
|
|
146 |
|
147 |
|
148 |
== Changelog ==
|
|
|
|
|
|
|
|
|
149 |
= 4.2.6 =
|
150 |
* Added: Open links in new tab option.
|
151 |
* Added: Polish translation files (thanks to a user)
|
1 |
+
=== Easy Facebook Like Box (Page Plugin) - Custom Facebook Feed - Auto PopUp ===
|
2 |
Contributors: sjaved, DaNish Ali, jwebsol
|
3 |
+
Tags: custom facebook feed, facebook feed, facebook page plugin, page plugin, adoptive, facebook, facebook like box,, like box, facebook like box, facebook like box widget, facebook like box shortcodes, shortcodes, facebook like box plugin, facebook like box wordpress plugin, plugin, responsive facebook like box, responsive, facebook like box in 75 locales, facebook like box in 75 languages, facebook like box in PopUp, PopUp, Auto PopUp, like box in PopUp, social media, Facebook fan page, facebook share, advanced responsive facebook likebox, facebook wall, facebook sidebar, facebook recommend, open graph, facebook page, facebook group
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=sjaved786%40gmail%2ecom&lc=US&item_name=Easy%20Facebook%20Like%20Box%20WordPress%20Plugin&item_number=efbl¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
5 |
Requires at least: 3.3
|
6 |
+
Tested up to: 4.7.2
|
7 |
+
Stable tag: 4.3.0
|
8 |
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
Easy facebook like box WordPress plugin allows to display custom facebook feed, page plugin (like box), like button, using widget, shortcode, PopUp.
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
There are **three** main features of this plugin, **Custom Facebook Feed**, **Faceook Page Plugin** (previously Like Box) and **Auto PopUp**.
|
16 |
|
17 |
[Custom facebook feed demo](https://jwebsol.com/custom-facebook-feed/ "See this plugin in action (Custom facebook feed demo)") | [Fixed width demo](https://jwebsol.com/easy-facebook-like-box-plugin-demo/ "See this plugin in action (Fixed width)") | [Responsive demo](https://jwebsol.com/easy-facebook-like-box-responsive-demo/ "See this plugin in action (Responsive)") |
|
18 |
[Auto PopUp demo](https://jwebsol.com/easy-facebook-like-box-auto-popup-demo/ "See this plugin in action (Auto PopUp)")
|
19 |
|
20 |
+
*"Cool plugin – Fast Support too! Plugin works like magic! And you won’t see anyone around here that provides fast support like sjaved..EASY indeed!"* - [aolaso0914](https://wordpress.org/support/topic/cool-plugin-fast-support-too/)
|
21 |
+
|
22 |
+
Displays a Facebook Page Plugin (previously Facebook Like Box). The Facebook Page Plugin is a social plugin that enables Facebook Page owners to attract and gain Likes from their own website. Easy facebook like box display fan page posts, like button, and connections on your website using widget, shortcode or in Auto PopUp.
|
23 |
+
|
24 |
### Features:
|
25 |
|
26 |
1. Now support custom facebook feed **NEW**.
|
43 |
1. Show PopUp if visitors are not logged in.
|
44 |
1. Close button act as never show again (show only once).
|
45 |
1. Hide on mobile devices.
|
46 |
+
1. **And a lot more inside the pack...**
|
47 |
+
|
48 |
+
*"Very easy to use and works great! I’ve used this plugin on two different client sites with different requirements and it has worked perfectly in both cases."* - [modsnap](https://wordpress.org/support/topic/very-easy-to-use-and-works-great-1/)
|
49 |
+
|
50 |
+
*"Easiest Set Up! Everything is so easy to set up with this plugin, highly recommended."* - [functional](https://wordpress.org/support/topic/easiest-set-up/)
|
51 |
|
52 |
### How to use easy custom facebook feed **(New)**
|
53 |
|
91 |
3. Navigate to "Appearance > Widgets" and drag and drop "Easy Facebook Likebox" in desired widget area or use the shortcode in page/post generated by widget.
|
92 |
|
93 |
== Upgrade Notice ==
|
94 |
+
= 4.3.0 =
|
95 |
+
MUST update to make it work with latest facebook API.
|
96 |
+
|
97 |
= 4.2.5 =
|
98 |
Recent update with open external links in new tab option and little improvements here and there.
|
99 |
|
157 |
|
158 |
|
159 |
== Changelog ==
|
160 |
+
= 4.3.0 =
|
161 |
+
* Fixed: Migrating from Facebook API 2.1 to 2.8
|
162 |
+
* Some other minor improvements and fixes
|
163 |
+
|
164 |
= 4.2.6 =
|
165 |
* Added: Open links in new tab option.
|
166 |
* Added: Polish translation files (thanks to a user)
|
easy-facebook-likebox.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Easy Facebook Likebox
|
4 |
* Plugin URI: httt://wordpress.org/plugins/easy-facebook-likebox
|
5 |
* Description: Easy Facebook like box WordPress plugin allows you to easly display facebook like box fan page on your website using either widget or shortcode to increase facbook fan page likes. You can use the shortcode generated after saving the facebook like box widget. Additionally it also now allows you to dipslay the cusetomized facebook feed on your website using the same color scheme of your website. Its completely customizable with lots of optional settings. Its also responsive facebook like box at the same time.
|
6 |
-
* Version: 4.
|
7 |
* Author: Sajid Javed
|
8 |
* Author URI: http://jwebsol.com
|
9 |
* Text Domain: easy-facebook-likebox
|
3 |
* Plugin Name: Easy Facebook Likebox
|
4 |
* Plugin URI: httt://wordpress.org/plugins/easy-facebook-likebox
|
5 |
* Description: Easy Facebook like box WordPress plugin allows you to easly display facebook like box fan page on your website using either widget or shortcode to increase facbook fan page likes. You can use the shortcode generated after saving the facebook like box widget. Additionally it also now allows you to dipslay the cusetomized facebook feed on your website using the same color scheme of your website. Its completely customizable with lots of optional settings. Its also responsive facebook like box at the same time.
|
6 |
+
* Version: 4.3.0
|
7 |
* Author: Sajid Javed
|
8 |
* Author URI: http://jwebsol.com
|
9 |
* Text Domain: easy-facebook-likebox
|
public/assets/css/public.css
CHANGED
@@ -128,11 +128,13 @@
|
|
128 |
#efblcf .efbl_story_photo iframe {
|
129 |
margin:0px;
|
130 |
padding:0px;
|
|
|
|
|
131 |
}
|
132 |
#efblcf.fullwidth .efbl_youtube_video, #efblcf.fullwidth .efbl_vimeo_video {
|
133 |
-
|
134 |
height:400px;
|
135 |
-
|
136 |
}
|
137 |
|
138 |
#efblcf.halfwidth .efbl_story_photo{
|
@@ -276,6 +278,7 @@
|
|
276 |
#efblcf_holder img, #efblcf_holder video, #efblcf_holder iframe {
|
277 |
width:100%;
|
278 |
height:auto;
|
|
|
279 |
}
|
280 |
#efblcf_holder .efbl_popup_image, #efblcf_holder .efbl_popup_if_video, #efblcf_holder .efbl_popup_video, #efblcf_holder .efbl_popupp_footer{
|
281 |
display:none;
|
128 |
#efblcf .efbl_story_photo iframe {
|
129 |
margin:0px;
|
130 |
padding:0px;
|
131 |
+
width: 100%;
|
132 |
+
border: 0px;
|
133 |
}
|
134 |
#efblcf.fullwidth .efbl_youtube_video, #efblcf.fullwidth .efbl_vimeo_video {
|
135 |
+
|
136 |
height:400px;
|
137 |
+
|
138 |
}
|
139 |
|
140 |
#efblcf.halfwidth .efbl_story_photo{
|
278 |
#efblcf_holder img, #efblcf_holder video, #efblcf_holder iframe {
|
279 |
width:100%;
|
280 |
height:auto;
|
281 |
+
border: 0px;
|
282 |
}
|
283 |
#efblcf_holder .efbl_popup_image, #efblcf_holder .efbl_popup_if_video, #efblcf_holder .efbl_popup_video, #efblcf_holder .efbl_popupp_footer{
|
284 |
display:none;
|
public/easy-facebook-likebox.php
CHANGED
@@ -34,7 +34,7 @@ class Easy_Facebook_Likebox {
|
|
34 |
*
|
35 |
* @var string
|
36 |
*/
|
37 |
-
const VERSION = '4.
|
38 |
|
39 |
/**
|
40 |
* @TODO - Rename "plugin-name" to the name your your plugin
|
34 |
*
|
35 |
* @var string
|
36 |
*/
|
37 |
+
const VERSION = '4.3.0';
|
38 |
|
39 |
/**
|
40 |
* @TODO - Rename "plugin-name" to the name your your plugin
|
public/views/feed.php
CHANGED
@@ -11,8 +11,10 @@
|
|
11 |
* @copyright 2015 jwebsol
|
12 |
*/
|
13 |
|
|
|
14 |
extract($instance);
|
15 |
-
error_reporting(
|
|
|
16 |
//Switch to test mode to disable cache
|
17 |
$test_mode = false;
|
18 |
if(empty($fanpage_url)){
|
@@ -21,8 +23,10 @@ if(empty($fanpage_url)){
|
|
21 |
$page_id = efbl_parse_url( $fanpage_url );
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
|
|
|
|
|
26 |
|
27 |
$post_limit = ($post_limit) ? $post_limit : '10';
|
28 |
$number_of_posts = ($post_number) ? $post_number : '10';
|
@@ -54,15 +58,19 @@ if($post_by == 'onlyothers'){
|
|
54 |
$others_only = true;
|
55 |
}
|
56 |
|
|
|
|
|
57 |
$trasneint_name = 'efbl_'.$query.'_'.$page_id;
|
58 |
|
59 |
//delete_transient($trasneint_name);
|
60 |
|
61 |
$posts_json = get_transient( $trasneint_name );
|
62 |
|
63 |
-
if(
|
64 |
//build query
|
65 |
$jws_api_url = 'https://graph.facebook.com/' .$page_id. '/'.$query.'?access_token='. $access_token . '&limit=' . $post_limit . '&locale=en_us';
|
|
|
|
|
66 |
|
67 |
//set json data
|
68 |
$posts_json = jws_fetchUrl($jws_api_url);
|
@@ -81,13 +89,14 @@ if($posts_json == false || $posts_json == ''){
|
|
81 |
|
82 |
//Interpret data with JSON
|
83 |
$fbData = json_decode($posts_json);
|
84 |
-
|
85 |
if( !empty($fbData->data) ) {
|
86 |
|
87 |
//Start wraper of feed
|
88 |
echo '<div class="efbl_feed_wraper">';
|
89 |
|
90 |
$i = 1;
|
|
|
91 |
foreach($fbData->data as $story){
|
92 |
|
93 |
//reset variables
|
@@ -107,6 +116,7 @@ if( !empty($fbData->data) ) {
|
|
107 |
|
108 |
//get the feed type
|
109 |
$feed_type = $story->type;
|
|
|
110 |
//getting number of likes
|
111 |
if(count($story->likes->data) > 24){
|
112 |
$like_url = "https://graph.facebook.com/" . $full_story_id . "/likes?summary=true&access_token=" . $access_token;
|
@@ -120,7 +130,8 @@ if( !empty($fbData->data) ) {
|
|
120 |
//getting number of comments
|
121 |
if(count($story->comments->data) >= 25){
|
122 |
$comments_data = jws_fetchUrl("https://graph.facebook.com/" . $full_story_id . "/comments?summary=true&access_token=" . $access_token);
|
123 |
-
$efbl_comments_count = json_decode($comments_data)
|
|
|
124 |
|
125 |
}else{
|
126 |
$efbl_comments_count = count($story->comments->data);
|
@@ -163,11 +174,13 @@ if( !empty($fbData->data) ) {
|
|
163 |
//always use the text replace method
|
164 |
if( ecff_stripos_arr($post_text, $html_check_array) !== false ) {
|
165 |
//Loop through the tags
|
166 |
-
if($text_tags) {
|
167 |
-
$
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
171 |
|
172 |
}else{
|
173 |
//not html found now use manaul loop
|
@@ -178,8 +191,8 @@ if( !empty($fbData->data) ) {
|
|
178 |
foreach($text_tags as $message_tag ) {
|
179 |
$j++;
|
180 |
|
181 |
-
$tag_name = $message_tag
|
182 |
-
$tag_link = '<a href="https://facebook.com/' . $message_tag
|
183 |
$post_text = str_replace($tag_name, $tag_link, $post_text);
|
184 |
}
|
185 |
}
|
@@ -189,13 +202,18 @@ if( !empty($fbData->data) ) {
|
|
189 |
//Get the image suource of author
|
190 |
$auth_img_src = 'https://graph.facebook.com/' . $page_id . '/picture?type=large';
|
191 |
|
|
|
192 |
//get author image src
|
193 |
$author_image ='<a href="https://facebook.com/'.$page_id.'" target="'.$link_target.'"><img src="'.$auth_img_src.'" title="'. $story->from->name .'" width="40" height="40" /></a>';
|
|
|
|
|
194 |
if($story->object_id and $show_image){
|
|
|
195 |
//Get story image
|
196 |
-
$pic =
|
197 |
-
|
198 |
-
$
|
|
|
199 |
}else{
|
200 |
$pic_class = 'efbl_no_image';
|
201 |
}
|
@@ -212,13 +230,13 @@ if( !empty($fbData->data) ) {
|
|
212 |
if($instance['layout'] == 'half' || $instance['layout'] == 'halfwidth'){ $layout = 'halfwidth'; }elseif($instance['layout'] == 'full' || $instance['layout'] == 'fullwidth' ){$instance['layout'] = 'fullwidth';}else{$layout = 'thumbnail';}
|
213 |
}
|
214 |
//Start generating html
|
215 |
-
echo '<div id="efblcf" class="efbl_fb_story '.$layout.' '.$feed_type.' '.$pic_class.' '.$message_class.' ">';
|
216 |
if($story->object_id and $show_image and $feed_type != 'video' and !isset($story->source) ){
|
217 |
|
218 |
//if image attached
|
219 |
echo '<div class="efbl_story_photo">';
|
220 |
echo '<img src="' .$pic. '" width="'.$img_width.'" height="'.$img_height.'" />';
|
221 |
-
echo '<a href="#efblcf_holder" data-imagelink="' .$full_img_url. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.$
|
222 |
echo '</div>';
|
223 |
|
224 |
}elseif( $feed_type == 'video' and $story->source){
|
@@ -230,7 +248,7 @@ if( !empty($fbData->data) ) {
|
|
230 |
$video_url = preg_replace('/\?.*/', '', $story->source);
|
231 |
|
232 |
echo '<iframe src="'.$video_url.'" class="efbl_youtube_video"></iframe>';
|
233 |
-
echo '<a href="#efblcf_holder" data-videolink="' .$story->source. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.$
|
234 |
|
235 |
|
236 |
}elseif (strpos($story->source, 'vimeo') > 0){
|
@@ -239,13 +257,13 @@ if( !empty($fbData->data) ) {
|
|
239 |
|
240 |
echo '<iframe src="'.$video_url.'" class="efbl_vimeo_video"></iframe>';
|
241 |
|
242 |
-
echo '<a href="#efblcf_holder" data-videolink="' .$story->source. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.$
|
243 |
}else{
|
244 |
|
245 |
echo '<video src="'.$story->source.'" controls>
|
246 |
Your browser does not support HTML5 video.
|
247 |
</video>';
|
248 |
-
echo '<a href="#efblcf_holder" data-video="' .$story->source. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.$
|
249 |
}
|
250 |
|
251 |
|
@@ -287,8 +305,8 @@ if( !empty($fbData->data) ) {
|
|
287 |
|
288 |
}
|
289 |
|
290 |
-
if( $feed_type
|
291 |
-
|
292 |
if( $story->picture){
|
293 |
$link_image = 'efbl_has_link_image';
|
294 |
}else{
|
@@ -318,10 +336,7 @@ if( !empty($fbData->data) ) {
|
|
318 |
|
319 |
//end post content
|
320 |
echo '</div>';
|
321 |
-
|
322 |
-
/*echo "<pre>";
|
323 |
-
print_r($story);
|
324 |
-
exit;*/
|
325 |
//Story meta
|
326 |
|
327 |
echo '<div class="efbl_story_meta">';
|
@@ -482,12 +497,15 @@ if( !empty($fbData->data) ) {
|
|
482 |
echo '</div>';
|
483 |
//Incrrement the counter
|
484 |
$i++;
|
485 |
-
|
|
|
|
|
|
|
486 |
|
487 |
//Display like box here if enabled
|
488 |
if($show_like_box){
|
489 |
|
490 |
-
echo '<div class="efbl_custom_likebox">'.do_shortcode('[efb_likebox fanpage_url="'.$page_id.'" box_width="
|
491 |
}
|
492 |
|
493 |
//prepare for inline popup
|
@@ -499,6 +517,7 @@ if( !empty($fbData->data) ) {
|
|
499 |
<img src="" class="efbl_popup_image" />
|
500 |
<iframe src="" class="efbl_popup_if_video" ></iframe>
|
501 |
<video src="" class="efbl_popup_video" id="html_video" controls></video>
|
|
|
502 |
</div>
|
503 |
|
504 |
<div class="efbl_popupp_footer">
|
@@ -509,7 +528,7 @@ if( !empty($fbData->data) ) {
|
|
509 |
</div>';
|
510 |
|
511 |
//End wraper
|
512 |
-
echo '
|
513 |
}
|
514 |
else
|
515 |
_e(apply_filters('efbl_error_message', 'Error occured while retrieving the facebook feed'), 'easy-facebook-likebox');
|
11 |
* @copyright 2015 jwebsol
|
12 |
*/
|
13 |
|
14 |
+
|
15 |
extract($instance);
|
16 |
+
//error_reporting( E_ERROR | E_PARSE );
|
17 |
+
error_reporting( 0 );
|
18 |
//Switch to test mode to disable cache
|
19 |
$test_mode = false;
|
20 |
if(empty($fanpage_url)){
|
23 |
$page_id = efbl_parse_url( $fanpage_url );
|
24 |
}
|
25 |
|
26 |
+
if(!isset( $access_token ) ){
|
27 |
+
$access_token = '395202813876688|73e8ede72008b231a0322e40f0072fe6'; //Use default token if not provided
|
28 |
+
//$access_token = ($access_token) ? $access_token : '1489500477999288|KFys5ppNi3sreihdreqPkU2ChIE';
|
29 |
+
}
|
30 |
|
31 |
$post_limit = ($post_limit) ? $post_limit : '10';
|
32 |
$number_of_posts = ($post_number) ? $post_number : '10';
|
58 |
$others_only = true;
|
59 |
}
|
60 |
|
61 |
+
$enable_popup_for = array('photo' , 'video');
|
62 |
+
|
63 |
$trasneint_name = 'efbl_'.$query.'_'.$page_id;
|
64 |
|
65 |
//delete_transient($trasneint_name);
|
66 |
|
67 |
$posts_json = get_transient( $trasneint_name );
|
68 |
|
69 |
+
if( !$posts_json || '' == $posts_json || $test_mode ){
|
70 |
//build query
|
71 |
$jws_api_url = 'https://graph.facebook.com/' .$page_id. '/'.$query.'?access_token='. $access_token . '&limit=' . $post_limit . '&locale=en_us';
|
72 |
+
|
73 |
+
$jws_api_url = 'https://graph.facebook.com/v2.8/' .$page_id. '/'.$query.'?fields=id,from{name,id},message,message_tags,story,story_tags,picture,full_picture,link,source,name,caption,description,type,status_type,object_id,created_time,attachments{subattachments},shares,likes{id,name},comments{id,from,message,message_tags,created_time,like_count,comment_count,attachment}&access_token='. $access_token . '&limit=' . $post_limit . '&locale=en_us';
|
74 |
|
75 |
//set json data
|
76 |
$posts_json = jws_fetchUrl($jws_api_url);
|
89 |
|
90 |
//Interpret data with JSON
|
91 |
$fbData = json_decode($posts_json);
|
92 |
+
|
93 |
if( !empty($fbData->data) ) {
|
94 |
|
95 |
//Start wraper of feed
|
96 |
echo '<div class="efbl_feed_wraper">';
|
97 |
|
98 |
$i = 1;
|
99 |
+
$pi = 1; // increment counter for popup gallery
|
100 |
foreach($fbData->data as $story){
|
101 |
|
102 |
//reset variables
|
116 |
|
117 |
//get the feed type
|
118 |
$feed_type = $story->type;
|
119 |
+
|
120 |
//getting number of likes
|
121 |
if(count($story->likes->data) > 24){
|
122 |
$like_url = "https://graph.facebook.com/" . $full_story_id . "/likes?summary=true&access_token=" . $access_token;
|
130 |
//getting number of comments
|
131 |
if(count($story->comments->data) >= 25){
|
132 |
$comments_data = jws_fetchUrl("https://graph.facebook.com/" . $full_story_id . "/comments?summary=true&access_token=" . $access_token);
|
133 |
+
$efbl_comments_count = json_decode($comments_data);
|
134 |
+
$efbl_comments_count = $efbl_comments_count->summary->total_count;
|
135 |
|
136 |
}else{
|
137 |
$efbl_comments_count = count($story->comments->data);
|
174 |
//always use the text replace method
|
175 |
if( ecff_stripos_arr($post_text, $html_check_array) !== false ) {
|
176 |
//Loop through the tags
|
177 |
+
if($text_tags) {
|
178 |
+
foreach($text_tags as $message_tag ) {
|
179 |
+
$tag_name = $message_tag->name;
|
180 |
+
$tag_link = '<a href="https://facebook.com/' . $message_tag->id . '" target="'.$link_target.'">' . $tag_name . '</a>';
|
181 |
+
$post_text = str_replace($tag_name, $tag_link, $post_text);
|
182 |
+
}
|
183 |
+
}
|
184 |
|
185 |
}else{
|
186 |
//not html found now use manaul loop
|
191 |
foreach($text_tags as $message_tag ) {
|
192 |
$j++;
|
193 |
|
194 |
+
$tag_name = $message_tag->name;
|
195 |
+
$tag_link = '<a href="https://facebook.com/' . $message_tag->id . '" target="'.$link_target.'">' . $message_tag->name . '</a>';
|
196 |
$post_text = str_replace($tag_name, $tag_link, $post_text);
|
197 |
}
|
198 |
}
|
202 |
//Get the image suource of author
|
203 |
$auth_img_src = 'https://graph.facebook.com/' . $page_id . '/picture?type=large';
|
204 |
|
205 |
+
if( !isset( $author_image ) ){
|
206 |
//get author image src
|
207 |
$author_image ='<a href="https://facebook.com/'.$page_id.'" target="'.$link_target.'"><img src="'.$auth_img_src.'" title="'. $story->from->name .'" width="40" height="40" /></a>';
|
208 |
+
}
|
209 |
+
|
210 |
if($story->object_id and $show_image){
|
211 |
+
|
212 |
//Get story image
|
213 |
+
$pic = $story->full_picture;
|
214 |
+
|
215 |
+
$full_img_url = $story->full_picture;
|
216 |
+
$pic_class = 'efbl_has_image';
|
217 |
}else{
|
218 |
$pic_class = 'efbl_no_image';
|
219 |
}
|
230 |
if($instance['layout'] == 'half' || $instance['layout'] == 'halfwidth'){ $layout = 'halfwidth'; }elseif($instance['layout'] == 'full' || $instance['layout'] == 'fullwidth' ){$instance['layout'] = 'fullwidth';}else{$layout = 'thumbnail';}
|
231 |
}
|
232 |
//Start generating html
|
233 |
+
echo '<div id="efblcf" class="efbl_fb_story '.$layout.' '.$feed_type.' '.$pic_class.' '.$message_class.' '.$popup_gallery_class.' ">';
|
234 |
if($story->object_id and $show_image and $feed_type != 'video' and !isset($story->source) ){
|
235 |
|
236 |
//if image attached
|
237 |
echo '<div class="efbl_story_photo">';
|
238 |
echo '<img src="' .$pic. '" width="'.$img_width.'" height="'.$img_height.'" />';
|
239 |
+
echo '<a href="#efblcf_holder" data-imagelink="' .$full_img_url. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.htmlentities($post_text).'" data-itemnumber="'.$pi.'" class="efbl_feed_popup efbl-cff-item_number-'.$pi.'"><span class="efbl_hover"></span></a>';
|
240 |
echo '</div>';
|
241 |
|
242 |
}elseif( $feed_type == 'video' and $story->source){
|
248 |
$video_url = preg_replace('/\?.*/', '', $story->source);
|
249 |
|
250 |
echo '<iframe src="'.$video_url.'" class="efbl_youtube_video"></iframe>';
|
251 |
+
echo '<a href="#efblcf_holder" data-videolink="' .$story->source. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.htmlentities($post_text).'" data-itemnumber="'.$pi.'" class="efbl_iframe_popup_video efbl_feed_popup efbl-cff-item_number-'.$pi.'"><span class="efbl_hover"></span></a>';
|
252 |
|
253 |
|
254 |
}elseif (strpos($story->source, 'vimeo') > 0){
|
257 |
|
258 |
echo '<iframe src="'.$video_url.'" class="efbl_vimeo_video"></iframe>';
|
259 |
|
260 |
+
echo '<a href="#efblcf_holder" data-videolink="' .$story->source. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.htmlentities($post_text).'" data-itemnumber="'.$pi.'" class="efbl_iframe_popup_video efbl_feed_popup efbl-cff-item_number-'.$pi.'"><span class="efbl_hover"></span></a>';
|
261 |
}else{
|
262 |
|
263 |
echo '<video src="'.$story->source.'" controls>
|
264 |
Your browser does not support HTML5 video.
|
265 |
</video>';
|
266 |
+
echo '<a href="#efblcf_holder" data-video="' .$story->source. '" data-storylink="'.$story_link.'" data-linktext="'.__('Read full story', 'easy-facebook-likebox').'" data-caption="'.htmlentities($post_text).'" data-itemnumber="'.$pi.'" class="efbl_iframe_popup_video efbl_feed_popup efbl-cff-item_number-'.$pi.'"><span class="efbl_hover"></span></a>';
|
267 |
}
|
268 |
|
269 |
|
305 |
|
306 |
}
|
307 |
|
308 |
+
if( 'link' == $feed_type ){
|
309 |
+
|
310 |
if( $story->picture){
|
311 |
$link_image = 'efbl_has_link_image';
|
312 |
}else{
|
336 |
|
337 |
//end post content
|
338 |
echo '</div>';
|
339 |
+
|
|
|
|
|
|
|
340 |
//Story meta
|
341 |
|
342 |
echo '<div class="efbl_story_meta">';
|
497 |
echo '</div>';
|
498 |
//Incrrement the counter
|
499 |
$i++;
|
500 |
+
if( 'link' != $story->type ) {
|
501 |
+
$pi++; // Increment for popup gallery
|
502 |
+
}
|
503 |
+
}
|
504 |
|
505 |
//Display like box here if enabled
|
506 |
if($show_like_box){
|
507 |
|
508 |
+
echo '<div class="efbl_custom_likebox">'.do_shortcode('[efb_likebox fanpage_url="'.$page_id.'" box_width="" box_height="500" colorscheme="light" locale="en_US" responsive="1" show_faces="0" show_header="0" show_stream="0" show_border="0" ]').'</div>';
|
509 |
}
|
510 |
|
511 |
//prepare for inline popup
|
517 |
<img src="" class="efbl_popup_image" />
|
518 |
<iframe src="" class="efbl_popup_if_video" ></iframe>
|
519 |
<video src="" class="efbl_popup_video" id="html_video" controls></video>
|
520 |
+
|
521 |
</div>
|
522 |
|
523 |
<div class="efbl_popupp_footer">
|
528 |
</div>';
|
529 |
|
530 |
//End wraper
|
531 |
+
echo '<input type="hidden" id="item_number" value=""></div>';
|
532 |
}
|
533 |
else
|
534 |
_e(apply_filters('efbl_error_message', 'Error occured while retrieving the facebook feed'), 'easy-facebook-likebox');
|