Custom Facebook Feed - Version 2.3.6

Version Description

  • New: Added a couple of new customization options for the Facebook Like Box/Page Plugin which allow you to select a small/slim header for the Like Box and hide the call-to-action button (if available)
  • Fix: The plugin now works with Access Tokens which use the new recently-released version 2.4 of the Facebook API
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Custom Facebook Feed
Version 2.3.6
Comparing to
See all releases

Code changes from version 2.3.4 to 2.3.6

README.txt CHANGED
@@ -1,13 +1,13 @@
1
  === Custom Facebook Feed ===
2
  Contributors: smashballoon
3
- Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook Like box, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social media
4
  Requires at least: 3.0
5
- Tested up to: 4.2
6
- Stable tag: 2.3.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- The Custom Facebook Feed allows you to display a completely customizable Facebook feed of any public Facebook page or group on your website
11
 
12
  == Description ==
13
 
@@ -116,6 +116,96 @@ It sure is. Unlike other Facebook plugins which use iframes to embed your Facebo
116
 
117
  You can embed your Facebook feed directly into a template file by using the WordPress [do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode "WordPress.org do_shortcode reference") function: `<?php echo do_shortcode('[custom-facebook-feed]'); ?>`.
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  == Other Notes ==
120
 
121
  **"The best dang Facebook plugin this side of the Mississippi!"**
@@ -226,7 +316,7 @@ Paul (Young Focus)" - paulvw
226
 
227
  A few years back when Mark Zuckerberg came up with his concept of a social networking site and named it Facebook, he had no idea what it would become in the time to come. Facebook has quite literally revolutionized the way we look at social networking. With over 700 million active Facebook users, it is definitely the biggest platform you can get if you seek to engage with many people simultaneously. Though Facebook is the premiere social networking platform, it also holds a lot of potential for businesses. The fact that Facebook can help businesses in growing and reaching out to a new customer base has added to Facebook's popularity.
228
 
229
- Today when you look at Facebook and the Facebook groups or Facebook pages that exist on the site, you will find that every popular brand is there. They are not only there but are active on Facebook on almost a daily basis. For the present generation, who spend a lot more time on the internet than on the TV, brands needed to change their approach. Facebook provides the best possible solution in this scenario. However, it is not only the big brands that make the full use of Facebooks social media power. Even small businesses can benefit greatly from using Facebook if they make optimal use of the various features that Facebook has to offer.
230
 
231
  **Why Use Facebook for Your Business?**
232
 
@@ -242,7 +332,7 @@ SEO: Search Engine Optimization is a key aspect for anyone who wants to build a
242
 
243
  Beat your competition: One of the biggest reasons for you to make sure that you are on Facebook is that your competition might already be there. In this cut throat environment, lagging behind will make it really hard for your business to succeed.
244
 
245
- Viral promotion: If someone ends up liking your page then it appears in their Facebook news feed. This makes it possible for your business to be in their eyes on a regular basis through Facebook status updates or content posting. Whats more, if they comment on your Facebook post, their Facebook friends will also see your Facebook post and this will help in viral promotion of your business.
246
 
247
  Facebook Ads: Your business at Facebook is not just limited to a Facebook page or Facebook group. Facebook also offers you a chance to put up Facebook advertising campaigns. You can build your Facebook advertisements, and as per your budget requirements, go for a Facebook campaign suitable for your business. You can also choose the set of people to whom these Facebook ads will be visible. You can target your Facebook ads on the basis of demographics, educational level, interests etc. It is also up to you to decide how often these Facebook ads will appear.
248
 
@@ -271,9 +361,25 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
271
  9. It's super easy to display your Facebook feed in any page or post
272
 
273
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  = 2.3.4 =
275
- * Fix: The event description is no longer shown twice in event posts. It was previously shown in the post text itself and in the event details.
276
- * Fix: Fixed a rare bug which would occur if your Facebook page or group name contained a number
277
 
278
  = 2.3.3 =
279
  * Fix: Removed a PHP notice which was missed in the last update. Apologies for the two updates in quick succession.
@@ -286,12 +392,12 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
286
  * New: Added a shortcode option to allow you to offset the number of posts to be shown. Eg: offset=2
287
  * New: Added an email link to the sharing icons
288
  * New: Added a setting to load a local copy of the icon font instead of the CDN version. This can be found at the bottom of the 'Misc' settings page.
289
- * Tweak: Added a prefix to the IDs on all posts so that they can now be targeted via CSS
290
  * Tweak: Added "nofollow" to all links by default. This can be disabled by using `nofollow=false` in the shortcode.
291
  * Tweak: Added some missing settings to the System Info section
292
  * Tweak: Added the 'Timezone' setting to the main Settings page so that it's easier to find
293
  * Fix: Added a workaround for Facebook changing the event URLs in their API from absolute to relative URLs
294
- * Fix: Facebook removed the 'relevant_count' parameter from their API so added a workaround to get the number of photos attached to a post
295
  * Fix: Fixed a minor bug in the WP_Http fallback method
296
  * Fix: Removed duplicate IDs on the share icons and replaced with classes
297
  * Fix: Added a check to the file_get_contents data retrieval method to check whether the Open SSL wrapper is enabled
@@ -301,10 +407,10 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
301
 
302
  = 2.3 =
303
  * Happy New Year!
304
- * New: Added a share link which allows you to share posts to Facebook, Twitter, Google+ or LinkedIn. This can be disabled at the very bottom of the Typography tab, or by using `showsharelink=false` in the shortcode.
305
  * Tweak: Using your own Facebook Access Token in the plugin is still optional but is now recommended in order to protect yourself against future Access Token related issues
306
  * Tweak: Increased the accuracy of the character count when links are included in the Facebook text
307
- * Tweak: Improved the efficiency of the post caching
308
  * Tweak: Replaced the rel attribute with the HTML5 data attribute when storing data on an element
309
  * Tweak: Added HTTPS stream wrapper check to the System Info to aid in troubleshooting
310
  * Tweak: Updated the plugin's icon font to the latest version
@@ -332,7 +438,7 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
332
  * Fix: Fixed an issue with the Facebook Access Token used in the plugin hitting its request limit
333
 
334
  = 2.1.2 =
335
- * Fix: Added in a missing closing div tag to the feed when an error is being displayed
336
 
337
  = 2.1.1 =
338
  * Fix: Fixed an issue with the date not being hidden when unchecked in the Show/Hide section
1
  === Custom Facebook Feed ===
2
  Contributors: smashballoon
3
+ Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook groups, Facebook fans, Facebook likes, Facebook followers, Facebooks, Face book, posts, Facebook postings, Facebook feeds, Facebook pages, Facebook Like Box, Facebook plugin, Facebook plug-in, Facebook walls, Facebook hashtag, Facebook embed, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social media
4
  Requires at least: 3.0
5
+ Tested up to: 4.3
6
+ Stable tag: 2.3.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ The Custom Facebook Feed allows you to display completely customizable Facebook feeds of any public Facebook page or group on your website
11
 
12
  == Description ==
13
 
116
 
117
  You can embed your Facebook feed directly into a template file by using the WordPress [do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode "WordPress.org do_shortcode reference") function: `<?php echo do_shortcode('[custom-facebook-feed]'); ?>`.
118
 
119
+ = My Facebook feed posts are not showing up, or all I can see is the Facebook Like box but no posts =
120
+
121
+ Please refer to [this FAQ](https://smashballoon.com/facebook-feed-doesnt-show-can-see-like-box-posts-gives/ "My Facebook feed posts are not showing up, or all I can see is the Facebook Like box but no posts") for potential solutions on how to resolve this issue.
122
+
123
+ = Create a basic slideshow from your Facebook posts =
124
+
125
+ The Custom Facebook Feed plugin doesn't currently have a slideshow feature built into it, but it's possible to achieve a basic slideshow by doing the following:
126
+
127
+ 1) Add a class to the shortcode of the Facebook feed that you want to convert into a slideshow:
128
+
129
+ `[custom-facebook-feed class="slideshow"]`
130
+
131
+ 2) Set the number of posts to display to be the number of Facebook posts you want to include in the slideshow (10 for example). You can do this by using the `num` shortcode option:
132
+
133
+ `[custom-facebook-feed class="slideshow" num=10]`
134
+
135
+ 3) Add the following to the plugin's **Custom JavaScript** section, which is under the 'Misc' tab on the plugin's 'Customize' page. Please note, if you change the class option in the shortcode above to be anything but "slideshow" then make sure to change that on the first line of the snippet below:
136
+
137
+ `var shortcodeClass = 'slideshow',
138
+ cffSpeed = 5000,
139
+ $cff = $('#cff.'+ shortcodeClass);
140
+ $cffItem = $cff.find('.cff-item'),
141
+ cffNum = $cffItem.length,
142
+ cffCur = 0;
143
+ $cffItem.hide();
144
+ setTimeout(function(){ $cff.find('.cff-item').eq(0).show(); }, 200);
145
+ setInterval(function(){
146
+ $cff.find('.cff-item').eq(cffCur).fadeOut( "fast", function() {
147
+ if( cffCur == cffNum-1 ) cffCur = -1;
148
+ cffCur++;
149
+ $cff.find('.cff-item').eq(cffCur).fadeIn();
150
+ });
151
+ }, cffSpeed);`
152
+
153
+ 4) You can change the speed of the transition by editing the **cffSpeed = 5000** value at the top of the snippet. 5000 is equal to 5 seconds (5000ms).
154
+
155
+ = Changing the font in your Facebook feed and using Google Fonts =
156
+
157
+ Please refer to [this FAQ](https://smashballoon.com/changing-the-font-in-your-facebook-feed-using-google-fonts/ "Changing the font in your Facebook feed and using Google Fonts") for directions on how to use Google fonts in your Facebook posts.
158
+
159
+ = Can I display my Facebook posts horizontally or in multiple columns? =
160
+
161
+ Please refer to [this FAQ](https://smashballoon.com/can-display-facebook-post-horizontally-multiple-columns/ "Can I display my Facebook posts horizontally or in multiple columns?") for directions on how to display your Facebook posts in multiple columns.
162
+
163
+ = My Facebook feed appears to have stopped updating / working =
164
+
165
+ If your Facebook feed doesn't appear to be showing the most recent Facebook posts then the most likely explanation is that the recent Facebook posts in your feed may be shared from a user's personal Facebook profile. Facebook's privacy policy doesn't allow posts that you share from personal Facebook profiles to be shared outside of Facebook as the posts don't technically belong to your Facebook page, they belong to the user who posted it to their personal Facebook profile. There's an example of a post shared from a user's personal Facebook profile [here](https://smashballoon.com/wp-content/uploads/2014/11/sharing-photo-facebook-profile.jpg "Example of Facebook post shared from personal Faceboo profile").
166
+
167
+ Please note, this isn't a limitation of our plugin, it's a restriction which Facebook places on it's content in order to protect the privacy of their Facebook users.
168
+
169
+ **Potential solutions**
170
+
171
+ * You could re-post the Facebook post to your page rather than sharing it to your Facebook page. If you re-post the content as your own post on your Facebook page then the content now originates from your Facebook page and will be displayed in the Facebook feed on your website.
172
+
173
+ * If you were to share a post from another Facebook page or public source, rather than sharing it from someone's personal Facebook profile, then it would show up in your feed outside of Facebook, but by default any posts that originate from a personal Facebook profile are protected by Facebook's privacy policy and is the private content of that Facebook profile owner.
174
+
175
+ = I'm receiving an error message when trying to display my Facebook posts =
176
+
177
+ Please refer to our [Error Message Reference page](https://smashballoon.com/custom-facebook-feed/docs/errors/ "I'm receiving an error message when trying to display my Facebook posts") for information on how to resolve common error messages.
178
+
179
+ = Creating a Masonry grid layout from your Facebook posts =
180
+
181
+ Please refer to [this FAQ](https://smashballoon.com/creating-a-masonry-grid-layout-from-your-facebook-posts/ "Creating a Masonry grid layout from your Facebook posts") for directions on how to create a Masonry grid layout from your Facebook feed posts.
182
+
183
+ = How do I customize my Facebook feed? =
184
+
185
+ You can customize the Facebook feed by setting the options on the Customize page, which can be found under the Facebook Feed menu in your left hand WordPress admin menu. If you need even deeper customization than the built in options allow then you can add your own CSS to the plugin in the Custom CSS section under the Misc tab to further customize your Facebook feed.
186
+
187
+ You can also override these styles for individual Facebook feeds by setting options within the shortcode. For example, you can change the height of a specific Facebook feed like so: `[custom-facebook-feed height=500px]`.
188
+
189
+ = The Custom Facebook Feed shortcode options aren't working =
190
+
191
+ The most common causes of this are:
192
+
193
+ 1) There's HTML tags within the [custom-facebook-feed] shortcode which are preventing it from working correctly
194
+
195
+ If you copied and pasted the shortcode into the Visual editor on your WordPress page/post editor then it may have inadvertently included some HTML tags from the page that you copied it from. The easiest way to check this is to view the 'Text' view in your WordPress editor and see whether there are any stray HTML tags in the shortcode itself.
196
+
197
+ 2) The shortcode includes curly single quote characters
198
+
199
+ If your shortcode includes single quotes then check that they are the standard single quotes and not the curly kind.
200
+
201
+ 3) Typo in the shortcode option
202
+
203
+ Ensure that there aren't any spelling errors in the shortcode options that you're using and that the format is consistent with that demonstrated on the [Shortcode Options reference page](https://smashballoon.com/custom-facebook-feed/docs/shortcodes/ "The shortcode options aren't working").
204
+
205
+ = Facebook avatar pictures aren't showing up in my Facebook feed =
206
+
207
+ The most common reason for this is that an add-on or extension you have installed in your web browser is blocking the pictures being loaded from Facebook. Try checking to see whether you have any add-ons or extensions installed in your browser and, if so, try disabling them to see whether that solves the problem and displays the pictures from Facebook.
208
+
209
  == Other Notes ==
210
 
211
  **"The best dang Facebook plugin this side of the Mississippi!"**
316
 
317
  A few years back when Mark Zuckerberg came up with his concept of a social networking site and named it Facebook, he had no idea what it would become in the time to come. Facebook has quite literally revolutionized the way we look at social networking. With over 700 million active Facebook users, it is definitely the biggest platform you can get if you seek to engage with many people simultaneously. Though Facebook is the premiere social networking platform, it also holds a lot of potential for businesses. The fact that Facebook can help businesses in growing and reaching out to a new customer base has added to Facebook's popularity.
318
 
319
+ Today when you look at Facebook and the Facebook groups or Facebook pages that exist on the site, you will find that every popular brand is there. They are not only there but are active on Facebook on almost a daily basis. For the present generation, who spend a lot more time on the internet than on the TV, brands needed to change their approach. Facebook provides the best possible solution in this scenario. However, it is not only the big brands that make the full use of Facebook's social media power. Even small businesses can benefit greatly from using Facebook if they make optimal use of the various features that Facebook has to offer.
320
 
321
  **Why Use Facebook for Your Business?**
322
 
332
 
333
  Beat your competition: One of the biggest reasons for you to make sure that you are on Facebook is that your competition might already be there. In this cut throat environment, lagging behind will make it really hard for your business to succeed.
334
 
335
+ Viral promotion: If someone ends up liking your page then it appears in their Facebook news feed. This makes it possible for your business to be in their eyes on a regular basis through Facebook status updates or content posting. What's more, if they comment on your Facebook post, their Facebook friends will also see your Facebook post and this will help in viral promotion of your business.
336
 
337
  Facebook Ads: Your business at Facebook is not just limited to a Facebook page or Facebook group. Facebook also offers you a chance to put up Facebook advertising campaigns. You can build your Facebook advertisements, and as per your budget requirements, go for a Facebook campaign suitable for your business. You can also choose the set of people to whom these Facebook ads will be visible. You can target your Facebook ads on the basis of demographics, educational level, interests etc. It is also up to you to decide how often these Facebook ads will appear.
338
 
361
  9. It's super easy to display your Facebook feed in any page or post
362
 
363
  == Changelog ==
364
+ = 2.3.6 =
365
+ * New: Added a couple of new customization options for the Facebook Like Box/Page Plugin which allow you to select a small/slim header for the Like Box and hide the call-to-action button (if available)
366
+ * Fix: The plugin now works with Access Tokens which use the new recently-released version 2.4 of the Facebook API
367
+
368
+ = 2.3.5 =
369
+ * New: Replace the Facebook 'Like Box' with the new Facebook 'Page Plugin' as the Facebook Like Box will be deprecated on June 23rd, 2015. Settings can be found under the Misc tab on the plugin's Customize page.
370
+ * Fix: Hashtags which contain foreign characters are now correctly linked to the hashtag on Facebook
371
+ * Fix: Links within Facebook post descriptions weren't opening in a new tab
372
+ * Fix: Removed empty style tags from some elements
373
+ * Fix: The URLs used for the 'Share' icons are now encoded to prevent any HTML validation errors
374
+ * Fix: Shared Facebook posts now link to the new shared post and not to the original post that was shared on Facebook
375
+ * Fix: Corrected a minor issue with the plugin caching string
376
+ * Fix: Fixed a minor issue with tags in the Facebook post text when creating/sharing an event
377
+ * Tweak: Add some stricter CSS to some parts of the feed to prevent theme conflicts
378
+ * Tweak: Automatically link the Facebook event name to the event now rather than it having to be enabled on the plugin's 'Typography' settings page
379
+
380
  = 2.3.4 =
381
+ * Fix: The Facebook event description is no longer shown twice in event posts. It was previously shown in the post text itself and in the Facebook event details.
382
+ * Fix: Fixed a rare bug which would occur if your Facebook page or Facebook group name contained a number
383
 
384
  = 2.3.3 =
385
  * Fix: Removed a PHP notice which was missed in the last update. Apologies for the two updates in quick succession.
392
  * New: Added a shortcode option to allow you to offset the number of posts to be shown. Eg: offset=2
393
  * New: Added an email link to the sharing icons
394
  * New: Added a setting to load a local copy of the icon font instead of the CDN version. This can be found at the bottom of the 'Misc' settings page.
395
+ * Tweak: Added a prefix to the IDs on all Facebook posts so that they can now be targeted via CSS
396
  * Tweak: Added "nofollow" to all links by default. This can be disabled by using `nofollow=false` in the shortcode.
397
  * Tweak: Added some missing settings to the System Info section
398
  * Tweak: Added the 'Timezone' setting to the main Settings page so that it's easier to find
399
  * Fix: Added a workaround for Facebook changing the event URLs in their API from absolute to relative URLs
400
+ * Fix: Facebook removed the 'relevant_count' parameter from their API so added a workaround to get the number of photos attached to a Facebook post
401
  * Fix: Fixed a minor bug in the WP_Http fallback method
402
  * Fix: Removed duplicate IDs on the share icons and replaced with classes
403
  * Fix: Added a check to the file_get_contents data retrieval method to check whether the Open SSL wrapper is enabled
407
 
408
  = 2.3 =
409
  * Happy New Year!
410
+ * New: Added a share link which allows you to share posts to Facebook, Twitter, Google+ or LinkedIn. This can be disabled at the very bottom of the Typography tab, or by using `showsharelink=false` in the [custom-facebook-feed] shortcode.
411
  * Tweak: Using your own Facebook Access Token in the plugin is still optional but is now recommended in order to protect yourself against future Access Token related issues
412
  * Tweak: Increased the accuracy of the character count when links are included in the Facebook text
413
+ * Tweak: Improved the efficiency of the Facebook post caching
414
  * Tweak: Replaced the rel attribute with the HTML5 data attribute when storing data on an element
415
  * Tweak: Added HTTPS stream wrapper check to the System Info to aid in troubleshooting
416
  * Tweak: Updated the plugin's icon font to the latest version
438
  * Fix: Fixed an issue with the Facebook Access Token used in the plugin hitting its request limit
439
 
440
  = 2.1.2 =
441
+ * Fix: Added in a missing closing div tag to the Facebook feed when an error is being displayed
442
 
443
  = 2.1.1 =
444
  * Fix: Fixed an issue with the date not being hidden when unchecked in the Show/Hide section
css/cff-style.css CHANGED
@@ -325,7 +325,7 @@
325
  float: left;
326
  margin: 0 !important;
327
  padding: 0 !important;
328
- color: #eee;
329
 
330
  -moz-border-radius: 4px;
331
  -webkit-border-radius: 4px;
@@ -346,7 +346,7 @@
346
  float: left;
347
  width: 100%;
348
  position: relative;
349
- margin-left: -10px;
350
  }
351
  .cff-likebox .fb_iframe_widget{
352
  width: 100%;
325
  float: left;
326
  margin: 0 !important;
327
  padding: 0 !important;
328
+ color: #eee !important;
329
 
330
  -moz-border-radius: 4px;
331
  -webkit-border-radius: 4px;
346
  float: left;
347
  width: 100%;
348
  position: relative;
349
+ margin: 20px 0 0 0;
350
  }
351
  .cff-likebox .fb_iframe_widget{
352
  width: 100%;
custom-facebook-feed-admin.php CHANGED
@@ -672,6 +672,9 @@ function cff_style_page() {
672
  'cff_likebox_height' => '',
673
  'cff_like_box_faces' => false,
674
  'cff_like_box_border' => false,
 
 
 
675
 
676
  'cff_bg_color' => '',
677
  'cff_likebox_bg_color' => '',
@@ -686,7 +689,7 @@ function cff_style_page() {
686
  'cff_title_link' => false,
687
  'cff_post_tags' => true,
688
  'cff_link_hashtags' => true,
689
- 'cff_event_title_link' => false,
690
  'cff_video_action' => 'post',
691
  'cff_app_id' => '',
692
  'cff_show_credit' => '',
@@ -858,6 +861,10 @@ function cff_style_page() {
858
  $cff_likebox_height = $options[ 'cff_likebox_height' ];
859
  $cff_like_box_faces = $options[ 'cff_like_box_faces' ];
860
  $cff_like_box_border = $options[ 'cff_like_box_border' ];
 
 
 
 
861
 
862
  $cff_show_media = $options[ 'cff_show_media' ];
863
  $cff_bg_color = $options[ 'cff_bg_color' ];
@@ -1202,6 +1209,10 @@ function cff_style_page() {
1202
  if (isset($_POST[ 'cff_likebox_height' ])) $cff_likebox_height = $_POST[ 'cff_likebox_height' ];
1203
  (isset($_POST[ 'cff_like_box_faces' ])) ? $cff_like_box_faces = $_POST[ 'cff_like_box_faces' ] : $cff_like_box_faces = '';
1204
  (isset($_POST[ 'cff_like_box_border' ])) ? $cff_like_box_border = $_POST[ 'cff_like_box_border' ] : $cff_like_box_border = '';
 
 
 
 
1205
 
1206
  if (isset($_POST[ 'cff_video_height' ])) $cff_video_height = $_POST[ 'cff_video_height' ];
1207
  if (isset($_POST[ 'cff_video_action' ])) $cff_video_action = $_POST[ 'cff_video_action' ];
@@ -1233,6 +1244,10 @@ function cff_style_page() {
1233
  $options[ 'cff_likebox_height' ] = $cff_likebox_height;
1234
  $options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
1235
  $options[ 'cff_like_box_border' ] = $cff_like_box_border;
 
 
 
 
1236
 
1237
  $options[ 'cff_video_height' ] = $cff_video_height;
1238
  $options[ 'cff_video_action' ] = $cff_video_action;
@@ -2496,23 +2511,21 @@ function cff_style_page() {
2496
  <h3><?php _e('Likes, Shares and Comments'); ?></h3><i style="color: #666; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable likes, shares and comments'); ?></a></i>
2497
 
2498
  <hr />
2499
- <h3><?php _e('Like Box'); ?></h3>
2500
  <table class="form-table">
2501
  <tbody>
2502
  <tr valign="top">
2503
  <th class="bump-left" scope="row"><label><?php _e('Show the Like Box'); ?></label></th>
2504
  <td>
2505
  <input type="checkbox" name="cff_show_like_box" id="cff_show_like_box" <?php if($cff_show_like_box == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
2506
- <i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("Why isn't the Like Box showing up?"); ?></a></i>
2507
- <p class="cff-tooltip cff-more-info"><?php _e("The most common reason is that you may have an extension installed in your web browser which is blocking the plugin from loading the Like Box from Facebook."); ?></p>
2508
  </td>
2509
  </tr>
2510
  <tr valign="top">
2511
  <th class="bump-left" scope="row"><label><?php _e('Position'); ?></label></th>
2512
  <td>
2513
  <select name="cff_like_box_position">
2514
- <option value="bottom" <?php if($cff_like_box_position == "bottom") echo 'selected="selected"' ?> ><?php _e('Below posts'); ?></option>
2515
- <option value="top" <?php if($cff_like_box_position == "top") echo 'selected="selected"' ?> ><?php _e('Above posts'); ?></option>
2516
  </select>
2517
  </td>
2518
  </tr>
@@ -2520,54 +2533,52 @@ function cff_style_page() {
2520
  <th class="bump-left" scope="row"><label><?php _e('Display outside the scrollable area'); ?></label></th>
2521
  <td>
2522
  <input type="checkbox" name="cff_like_box_outside" id="cff_like_box_outside" <?php if($cff_like_box_outside == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
2523
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('(Only applicable if you have set a height on the feed)'); ?></i>
2524
  </td>
2525
  </tr>
 
2526
  <tr valign="top">
2527
- <th class="bump-left" scope="row"><label><?php _e('Background Color'); ?></label></th>
2528
  <td>
2529
- <input name="cff_likebox_bg_color" value="#<?php esc_attr_e( str_replace('#', '', $cff_likebox_bg_color) ); ?>" class="cff-colorpicker" />
 
2530
  </td>
2531
  </tr>
2532
  <tr valign="top">
2533
- <th class="bump-left" scope="row"><label><?php _e('Color of page name'); ?></label></th>
2534
  <td>
2535
- <select name="cff_like_box_text_color">
2536
- <option value="blue" <?php if($cff_like_box_text_color == "blue") echo 'selected="selected"' ?> ><?php _e('Blue'); ?></option>
2537
- <option value="white" <?php if($cff_like_box_text_color == "white") echo 'selected="selected"' ?> ><?php _e('White'); ?></option>
2538
- </select>
2539
- <i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('Why only these 2 colors?'); ?></a></i>
2540
- <p class="cff-tooltip cff-more-info"><?php _e("The styling of the Facebook Like box widget is restricted by Facebook. This means that the only two text colors available are blue and white, intended for either a light of dark color scheme respectively."); ?></p>
2541
  </td>
2542
  </tr>
2543
  <tr valign="top">
2544
- <th class="bump-left" scope="row"><label for="cff_likebox_width"><?php _e('Custom Like Box Width'); ?></label></th>
2545
  <td>
2546
- <input name="cff_likebox_width" type="text" value="<?php esc_attr_e( $cff_likebox_width ); ?>" size="6" />
2547
- <span><span>Eg. 50%, 300px</span> <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Default is 100%'); ?></i></span>
2548
  </td>
2549
  </tr>
2550
  <tr valign="top">
2551
- <th class="bump-left" for="cff_likebox_height" scope="row"><label><?php _e('Custom Like Box Height'); ?></label></th>
2552
  <td>
2553
- <input name="cff_likebox_height" type="text" value="<?php esc_attr_e( $cff_likebox_height ); ?>" size="3" />
2554
- <span>px</span>
2555
  </td>
2556
  </tr>
 
 
2557
  <tr valign="top">
2558
- <th class="bump-left" scope="row"><label><?php _e('Show faces of fans'); ?></label></th>
2559
  <td>
2560
- <input type="checkbox" name="cff_like_box_faces" id="cff_like_box_faces" <?php if($cff_like_box_faces == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
2561
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Show thumbnail photos of fans who like your page'); ?></i>
2562
  </td>
2563
  </tr>
2564
- <tr valign="top">
2565
- <th class="bump-left" scope="row"><label><?php _e('Show the Like Box border'); ?></label></th>
2566
  <td>
2567
- <input type="checkbox" name="cff_like_box_border" id="cff_like_box_outside" <?php if($cff_like_box_border == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
2568
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Only applicable if you are showing faces of fans'); ?></i>
2569
  </td>
2570
- </tr>
 
2571
  </tbody>
2572
  </table>
2573
 
672
  'cff_likebox_height' => '',
673
  'cff_like_box_faces' => false,
674
  'cff_like_box_border' => false,
675
+ 'cff_like_box_cover' => true,
676
+ 'cff_like_box_small_header' => false,
677
+ 'cff_like_box_hide_cta' => false,
678
 
679
  'cff_bg_color' => '',
680
  'cff_likebox_bg_color' => '',
689
  'cff_title_link' => false,
690
  'cff_post_tags' => true,
691
  'cff_link_hashtags' => true,
692
+ 'cff_event_title_link' => true,
693
  'cff_video_action' => 'post',
694
  'cff_app_id' => '',
695
  'cff_show_credit' => '',
861
  $cff_likebox_height = $options[ 'cff_likebox_height' ];
862
  $cff_like_box_faces = $options[ 'cff_like_box_faces' ];
863
  $cff_like_box_border = $options[ 'cff_like_box_border' ];
864
+ $cff_like_box_cover = $options[ 'cff_like_box_cover' ];
865
+ $cff_like_box_small_header = $options[ 'cff_like_box_small_header' ];
866
+ $cff_like_box_hide_cta = $options[ 'cff_like_box_hide_cta' ];
867
+
868
 
869
  $cff_show_media = $options[ 'cff_show_media' ];
870
  $cff_bg_color = $options[ 'cff_bg_color' ];
1209
  if (isset($_POST[ 'cff_likebox_height' ])) $cff_likebox_height = $_POST[ 'cff_likebox_height' ];
1210
  (isset($_POST[ 'cff_like_box_faces' ])) ? $cff_like_box_faces = $_POST[ 'cff_like_box_faces' ] : $cff_like_box_faces = '';
1211
  (isset($_POST[ 'cff_like_box_border' ])) ? $cff_like_box_border = $_POST[ 'cff_like_box_border' ] : $cff_like_box_border = '';
1212
+ (isset($_POST[ 'cff_like_box_cover' ])) ? $cff_like_box_cover = $_POST[ 'cff_like_box_cover' ] : $cff_like_box_cover = '';
1213
+ (isset($_POST[ 'cff_like_box_small_header' ])) ? $cff_like_box_small_header = $_POST[ 'cff_like_box_small_header' ] : $cff_like_box_small_header = '';
1214
+ (isset($_POST[ 'cff_like_box_hide_cta' ])) ? $cff_like_box_hide_cta = $_POST[ 'cff_like_box_hide_cta' ] : $cff_like_box_hide_cta = '';
1215
+
1216
 
1217
  if (isset($_POST[ 'cff_video_height' ])) $cff_video_height = $_POST[ 'cff_video_height' ];
1218
  if (isset($_POST[ 'cff_video_action' ])) $cff_video_action = $_POST[ 'cff_video_action' ];
1244
  $options[ 'cff_likebox_height' ] = $cff_likebox_height;
1245
  $options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
1246
  $options[ 'cff_like_box_border' ] = $cff_like_box_border;
1247
+ $options[ 'cff_like_box_cover' ] = $cff_like_box_cover;
1248
+ $options[ 'cff_like_box_small_header' ] = $cff_like_box_small_header;
1249
+ $options[ 'cff_like_box_hide_cta' ] = $cff_like_box_hide_cta;
1250
+
1251
 
1252
  $options[ 'cff_video_height' ] = $cff_video_height;
1253
  $options[ 'cff_video_action' ] = $cff_video_action;
2511
  <h3><?php _e('Likes, Shares and Comments'); ?></h3><i style="color: #666; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable likes, shares and comments'); ?></a></i>
2512
 
2513
  <hr />
2514
+ <h3><?php _e('Like Box / Page Plugin'); ?></h3>
2515
  <table class="form-table">
2516
  <tbody>
2517
  <tr valign="top">
2518
  <th class="bump-left" scope="row"><label><?php _e('Show the Like Box'); ?></label></th>
2519
  <td>
2520
  <input type="checkbox" name="cff_show_like_box" id="cff_show_like_box" <?php if($cff_show_like_box == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
 
 
2521
  </td>
2522
  </tr>
2523
  <tr valign="top">
2524
  <th class="bump-left" scope="row"><label><?php _e('Position'); ?></label></th>
2525
  <td>
2526
  <select name="cff_like_box_position">
2527
+ <option value="bottom" <?php if($cff_like_box_position == "bottom") echo 'selected="selected"' ?> ><?php _e('Bottom'); ?></option>
2528
+ <option value="top" <?php if($cff_like_box_position == "top") echo 'selected="selected"' ?> ><?php _e('Top'); ?></option>
2529
  </select>
2530
  </td>
2531
  </tr>
2533
  <th class="bump-left" scope="row"><label><?php _e('Display outside the scrollable area'); ?></label></th>
2534
  <td>
2535
  <input type="checkbox" name="cff_like_box_outside" id="cff_like_box_outside" <?php if($cff_like_box_outside == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
2536
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Only applicable if you have set a height on the feed'); ?></i>
2537
  </td>
2538
  </tr>
2539
+
2540
  <tr valign="top">
2541
+ <th class="bump-left" scope="row"><label><?php _e('Show faces of fans'); ?></label></th>
2542
  <td>
2543
+ <input type="checkbox" name="cff_like_box_faces" id="cff_like_box_faces" <?php if($cff_like_box_faces == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
2544
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Show thumbnail photos of fans who like your page'); ?></i>
2545
  </td>
2546
  </tr>
2547
  <tr valign="top">
2548
+ <th class="bump-left" scope="row"><label><?php _e('Include the Cover Photo'); ?></label></th>
2549
  <td>
2550
+ <input type="checkbox" name="cff_like_box_cover" id="cff_like_box_cover" <?php if($cff_like_box_cover == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
 
 
 
 
 
2551
  </td>
2552
  </tr>
2553
  <tr valign="top">
2554
+ <th class="bump-left" scope="row"><label><?php _e('Use a small header'); ?></label></th>
2555
  <td>
2556
+ <input type="checkbox" name="cff_like_box_small_header" id="cff_like_box_small_header" <?php if($cff_like_box_small_header == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
 
2557
  </td>
2558
  </tr>
2559
  <tr valign="top">
2560
+ <th class="bump-left" scope="row"><label><?php _e('Hide the call to action button (if available)'); ?></label></th>
2561
  <td>
2562
+ <input type="checkbox" name="cff_like_box_hide_cta" id="cff_like_box_hide_cta" <?php if($cff_like_box_hide_cta == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
 
2563
  </td>
2564
  </tr>
2565
+
2566
+
2567
  <tr valign="top">
2568
+ <th class="bump-left" for="cff_likebox_width" scope="row"><label><?php _e('Custom Like Box Width'); ?></label></th>
2569
  <td>
2570
+ <input name="cff_likebox_width" type="text" value="<?php esc_attr_e( $cff_likebox_width ); ?>" size="3" />
2571
+ <span>px <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Default: 340, Min: 280, Max: 500'); ?></i></span>
2572
  </td>
2573
  </tr>
2574
+ <!-- <tr valign="top">
2575
+ <th class="bump-left" for="cff_likebox_height" scope="row"><label><?php _e('Custom Like Box Height'); ?></label></th>
2576
  <td>
2577
+ <input name="cff_likebox_height" type="text" value="<?php esc_attr_e( $cff_likebox_height ); ?>" size="3" />
2578
+ <span>px <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Default: 500, Min: 130'); ?></i></span>
2579
  </td>
2580
+ </tr> -->
2581
+
2582
  </tbody>
2583
  </table>
2584
 
custom-facebook-feed.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
- Description: Add a completely customizable Facebook feed to your WordPress site
6
- Version: 2.3.4
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  //Include admin
26
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
27
 
28
- define('CFFVER', '2.3.4');
29
 
30
  // Add shortcodes
31
  add_shortcode('custom-facebook-feed', 'display_cff');
@@ -151,6 +151,10 @@ function display_cff($atts) {
151
  'likeboxheight' => isset($options[ 'cff_likebox_height' ]) ? $options[ 'cff_likebox_height' ] : '',
152
  'likeboxfaces' => isset($options[ 'cff_like_box_faces' ]) ? $options[ 'cff_like_box_faces' ] : '',
153
  'likeboxborder' => isset($options[ 'cff_like_box_border' ]) ? $options[ 'cff_like_box_border' ] : '',
 
 
 
 
154
  'credit' => isset($options[ 'cff_show_credit' ]) ? $options[ 'cff_show_credit' ] : '',
155
  'nofollow' => 'true',
156
 
@@ -214,12 +218,13 @@ function display_cff($atts) {
214
 
215
  $cff_class = $atts['class'];
216
  //Compile feed styles
217
- $cff_feed_styles = 'style="';
 
218
  if ( !empty($cff_feed_width) ) $cff_feed_styles .= 'width:' . $cff_feed_width . '; ';
219
  if ( !empty($cff_feed_height) ) $cff_feed_styles .= 'height:' . $cff_feed_height . '; ';
220
  if ( !empty($cff_feed_padding) ) $cff_feed_styles .= 'padding:' . $cff_feed_padding . '; ';
221
- if ( !empty($cff_bg_color) ) $cff_feed_styles .= 'background-color:#' . str_replace('#', '', $cff_bg_color) . '; ';
222
- $cff_feed_styles .= '"';
223
  //Like box
224
  $cff_like_box_position = $atts[ 'likeboxpos' ];
225
  $cff_like_box_outside = $atts[ 'likeboxoutside' ];
@@ -290,10 +295,11 @@ function display_cff($atts) {
290
  $cff_icon_style = $atts[ 'iconstyle' ];
291
  $cff_meta_text_color = $atts[ 'socialtextcolor' ];
292
  $cff_meta_bg_color = $atts[ 'socialbgcolor' ];
293
- $cff_meta_styles = 'style="';
 
294
  if ( !empty($cff_meta_text_color) ) $cff_meta_styles .= 'color:#' . str_replace('#', '', $cff_meta_text_color) . ';';
295
- if ( !empty($cff_meta_bg_color) ) $cff_meta_styles .= 'background-color:#' . str_replace('#', '', $cff_meta_bg_color) . ';';
296
- $cff_meta_styles .= '"';
297
  $cff_nocomments_text = isset($options[ 'cff_nocomments_text' ]) ? $options[ 'cff_nocomments_text' ] : '';
298
  $cff_hide_comments = isset($options[ 'cff_hide_comments' ]) ? $options[ 'cff_hide_comments' ] : '';
299
  if (!isset($cff_nocomments_text) || empty($cff_nocomments_text)) $cff_hide_comments = true;
@@ -308,11 +314,14 @@ function display_cff($atts) {
308
  $cff_title_size = $atts[ 'textsize' ];
309
  $cff_title_weight = $atts[ 'textweight' ];
310
  $cff_title_color = $atts[ 'textcolor' ];
311
- $cff_title_styles = 'style="';
312
- if ( !empty($cff_title_size) && $cff_title_size != 'inherit' ) $cff_title_styles .= 'font-size:' . $cff_title_size . 'px; ';
313
- if ( !empty($cff_title_weight) && $cff_title_weight != 'inherit' ) $cff_title_styles .= 'font-weight:' . $cff_title_weight . '; ';
314
- if ( !empty($cff_title_color) ) $cff_title_styles .= 'color:#' . str_replace('#', '', $cff_title_color) . ';';
315
- $cff_title_styles .= '"';
 
 
 
316
  $cff_title_link = $atts[ 'textlink' ];
317
 
318
  $cff_posttext_link_color = str_replace('#', '', $atts['textlinkcolor']);
@@ -323,20 +332,24 @@ function display_cff($atts) {
323
  //Author
324
  $cff_author_size = $atts[ 'authorsize' ];
325
  $cff_author_color = $atts[ 'authorcolor' ];
326
- $cff_author_styles = 'style="';
327
- if ( !empty($cff_author_size) && $cff_author_size != 'inherit' ) $cff_author_styles .= 'font-size:' . $cff_author_size . 'px; ';
328
- if ( !empty($cff_author_color) ) $cff_author_styles .= 'color:#' . str_replace('#', '', $cff_author_color) . ';';
329
- $cff_author_styles .= '"';
 
 
330
 
331
  //Description
332
  $cff_body_size = $atts[ 'descsize' ];
333
  $cff_body_weight = $atts[ 'descweight' ];
334
  $cff_body_color = $atts[ 'desccolor' ];
335
- $cff_body_styles = 'style="';
336
- if ( !empty($cff_body_size) && $cff_body_size != 'inherit' ) $cff_body_styles .= 'font-size:' . $cff_body_size . 'px; ';
337
- if ( !empty($cff_body_weight) && $cff_body_weight != 'inherit' ) $cff_body_styles .= 'font-weight:' . $cff_body_weight . '; ';
338
- if ( !empty($cff_body_color) ) $cff_body_styles .= 'color:#' . str_replace('#', '', $cff_body_color) . ';';
339
- $cff_body_styles .= '"';
 
 
340
 
341
  //Shared link title
342
  $cff_link_title_format = $atts[ 'linktitleformat' ];
@@ -345,9 +358,8 @@ function display_cff($atts) {
345
  $cff_link_title_color = str_replace('#', '', $atts[ 'linktitlecolor' ]);
346
  $cff_link_url_color = $atts[ 'linkurlcolor' ];
347
 
348
- $cff_link_title_styles = 'style="';
349
- if ( !empty($cff_link_title_size) && $cff_link_title_size != 'inherit' ) $cff_link_title_styles .= 'font-size:' . $cff_link_title_size . 'px;';
350
- $cff_link_title_styles .= '"';
351
 
352
  //Shared link box
353
  $cff_link_bg_color = $atts[ 'linkbgcolor' ];
@@ -355,10 +367,11 @@ function display_cff($atts) {
355
  $cff_disable_link_box = $atts['disablelinkbox'];
356
  ($cff_disable_link_box == 'true' || $cff_disable_link_box == 'on') ? $cff_disable_link_box = true : $cff_disable_link_box = false;
357
 
358
- $cff_link_box_styles = 'style="';
359
- if ( !empty($cff_link_border_color) ) $cff_link_box_styles .= 'border: 1px solid #' . str_replace('#', '', $cff_link_border_color) . '; ';
360
- if ( !empty($cff_link_bg_color) ) $cff_link_box_styles .= 'background-color: #' . str_replace('#', '', $cff_link_bg_color) . ';';
361
- $cff_link_box_styles .= '"';
 
362
 
363
  //Event Title
364
  $cff_event_title_format = $atts[ 'eventtitleformat' ];
@@ -366,11 +379,13 @@ function display_cff($atts) {
366
  $cff_event_title_size = $atts[ 'eventtitlesize' ];
367
  $cff_event_title_weight = $atts[ 'eventtitleweight' ];
368
  $cff_event_title_color = $atts[ 'eventtitlecolor' ];
369
- $cff_event_title_styles = 'style="';
370
- if ( !empty($cff_event_title_size) && $cff_event_title_size != 'inherit' ) $cff_event_title_styles .= 'font-size:' . $cff_event_title_size . 'px; ';
371
- if ( !empty($cff_event_title_weight) && $cff_event_title_weight != 'inherit' ) $cff_event_title_styles .= 'font-weight:' . $cff_event_title_weight . '; ';
372
- if ( !empty($cff_event_title_color) ) $cff_event_title_styles .= 'color:#' . str_replace('#', '', $cff_event_title_color) . ';';
373
- $cff_event_title_styles .= '"';
 
 
374
 
375
  $cff_event_title_link = $atts[ 'eventtitlelink' ];
376
  ( $cff_event_title_link == 'on' || $cff_event_title_link == 'true' || $cff_event_title_link == true ) ? $cff_event_title_link = true : $cff_event_title_link = false;
@@ -383,32 +398,41 @@ function display_cff($atts) {
383
  $cff_event_date_position = $atts[ 'eventdatepos' ];
384
  $cff_event_date_formatting = $atts[ 'eventdateformat' ];
385
  $cff_event_date_custom = $atts[ 'eventdatecustom' ];
386
- $cff_event_date_styles = 'style="';
387
- if ( !empty($cff_event_date_size) && $cff_event_date_size != 'inherit' ) $cff_event_date_styles .= 'font-size:' . $cff_event_date_size . 'px; ';
388
- if ( !empty($cff_event_date_weight) && $cff_event_date_weight != 'inherit' ) $cff_event_date_styles .= 'font-weight:' . $cff_event_date_weight . '; ';
389
- if ( !empty($cff_event_date_color) ) $cff_event_date_styles .= 'color:#' . str_replace('#', '', $cff_event_date_color) . ';';
390
- $cff_event_date_styles .= '"';
 
 
 
391
  //Event Details
392
  $cff_event_details_size = $atts[ 'eventdetailssize' ];
393
  $cff_event_details_weight = $atts[ 'eventdetailsweight' ];
394
  $cff_event_details_color = $atts[ 'eventdetailscolor' ];
395
  $cff_event_link_color = $atts[ 'eventlinkcolor' ];
396
- $cff_event_details_styles = 'style="';
397
- if ( !empty($cff_event_details_size) && $cff_event_details_size != 'inherit' ) $cff_event_details_styles .= 'font-size:' . $cff_event_details_size . 'px; ';
398
- if ( !empty($cff_event_details_weight) && $cff_event_details_weight != 'inherit' ) $cff_event_details_styles .= 'font-weight:' . $cff_event_details_weight . '; ';
399
- if ( !empty($cff_event_details_color) ) $cff_event_details_styles .= 'color:#' . str_replace('#', '', $cff_event_details_color) . ';';
400
- $cff_event_details_styles .= '"';
 
 
 
401
  //Date
402
  $cff_date_position = $atts[ 'datepos' ];
403
  if (!isset($cff_date_position)) $cff_date_position = 'below';
404
  $cff_date_size = $atts[ 'datesize' ];
405
  $cff_date_weight = $atts[ 'dateweight' ];
406
  $cff_date_color = $atts[ 'datecolor' ];
407
- $cff_date_styles = 'style="';
408
- if ( !empty($cff_date_size) && $cff_date_size != 'inherit' ) $cff_date_styles .= 'font-size:' . $cff_date_size . 'px; ';
409
- if ( !empty($cff_date_weight) && $cff_date_weight != 'inherit' ) $cff_date_styles .= 'font-weight:' . $cff_date_weight . '; ';
410
- if ( !empty($cff_date_color) ) $cff_date_styles .= 'color:#' . str_replace('#', '', $cff_date_color) . ';';
411
- $cff_date_styles .= '"';
 
 
 
412
  $cff_date_before = isset($options[ 'cff_date_before' ]) ? $options[ 'cff_date_before' ] : '';
413
  $cff_date_after = isset($options[ 'cff_date_after' ]) ? $options[ 'cff_date_after' ] : '';
414
  //Set user's timezone based on setting
@@ -419,11 +443,13 @@ function display_cff($atts) {
419
  $cff_link_size = $atts[ 'linksize' ];
420
  $cff_link_weight = $atts[ 'linkweight' ];
421
  $cff_link_color = $atts[ 'linkcolor' ];
422
- $cff_link_styles = 'style="';
423
- if ( !empty($cff_link_size) && $cff_link_size != 'inherit' ) $cff_link_styles .= 'font-size:' . $cff_link_size . 'px; ';
424
- if ( !empty($cff_link_weight) && $cff_link_weight != 'inherit' ) $cff_link_styles .= 'font-weight:' . $cff_link_weight . '; ';
425
- if ( !empty($cff_link_color) ) $cff_link_styles .= 'color:#' . str_replace('#', '', $cff_link_color) . ';';
426
- $cff_link_styles .= '"';
 
 
427
 
428
  //Link custom text
429
  $cff_facebook_link_text = $atts[ 'facebooklinktext' ];
@@ -460,7 +486,12 @@ function display_cff($atts) {
460
 
461
  if ( !isset($cff_likebox_width) || empty($cff_likebox_width) || $cff_likebox_width == '' ) $cff_likebox_width = '100%';
462
  $cff_like_box_faces = $atts[ 'likeboxfaces' ];
463
- if ( !isset($cff_like_box_faces) || empty($cff_like_box_faces) ) $cff_like_box_faces = 'false';
 
 
 
 
 
464
  $cff_like_box_border = $atts[ 'likeboxborder' ];
465
  if ($cff_like_box_border) {
466
  $cff_like_box_border = 'true';
@@ -468,6 +499,27 @@ function display_cff($atts) {
468
  $cff_like_box_border = 'false';
469
  }
470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  //Compile Like box styles
472
  $cff_likebox_styles = 'style="width: ' . $cff_likebox_width . ';';
473
  if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= ' background-color: #' . str_replace('#', '', $cff_likebox_bg_color) . ';';
@@ -487,13 +539,14 @@ function display_cff($atts) {
487
  $cff_header_text_color = $atts['headertextcolor'];
488
 
489
  //Compile feed header styles
490
- $cff_header_styles = 'style="';
491
- if ( !empty($cff_header_bg_color) ) $cff_header_styles .= 'background-color: #' . str_replace('#', '', $cff_header_bg_color) . ';';
492
- if ( !empty($cff_header_padding) ) $cff_header_styles .= ' padding: ' . $cff_header_padding . ';';
493
- if ( !empty($cff_header_text_size) ) $cff_header_styles .= ' font-size: ' . $cff_header_text_size . 'px;';
494
- if ( !empty($cff_header_text_weight) ) $cff_header_styles .= ' font-weight: ' . $cff_header_text_weight . ';';
495
- if ( !empty($cff_header_text_color) ) $cff_header_styles .= ' color: #' . str_replace('#', '', $cff_header_text_color) . ';';
496
- $cff_header_styles .= '"';
 
497
 
498
  //Video
499
  //Dimensions
@@ -515,6 +568,7 @@ function display_cff($atts) {
515
 
516
  $cff_post_bg_color = str_replace('#', '', $atts['postbgcolor']);
517
  $cff_post_rounded = $atts['postcorners'];
 
518
  ($cff_post_bg_color !== '#' && $cff_post_bg_color !== '') ? $cff_post_bg_color_check = true : $cff_post_bg_color_check = false;
519
  ($cff_sep_color !== '#' && $cff_sep_color !== '') ? $cff_sep_color_check = true : $cff_sep_color_check = false;
520
 
@@ -524,7 +578,7 @@ function display_cff($atts) {
524
  $cff_item_styles = 'style="';
525
  if($cff_sep_color_check && !$cff_post_bg_color_check) $cff_item_styles .= 'border-bottom: ' . $cff_sep_size . 'px solid #' . str_replace('#', '', $cff_sep_color) . '; ';
526
  if($cff_post_bg_color_check) $cff_item_styles .= 'background-color: #' . $cff_post_bg_color . '; ';
527
- if(isset($cff_post_rounded)) $cff_item_styles .= '-webkit-border-radius: ' . $cff_post_rounded . 'px; -moz-border-radius: ' . $cff_post_rounded . 'px; border-radius: ' . $cff_post_rounded . 'px; ';
528
  $cff_item_styles .= '"';
529
  }
530
 
@@ -567,9 +621,13 @@ function display_cff($atts) {
567
  '640861236031365|2rENQzxtWtG12DtlZwqfZ6Vu6BE',
568
  '334487440086538|hI_NNy1NvxQiQxm-TtXsrmoCVaE',
569
  '755471677869105|Jxv8xVDad7vUUTauk8K2o71wG2w',
570
- '518353204973067|dA7YTe-k8eSvgZ8lqa51xSm16DA'
 
 
 
 
571
  );
572
- if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0, 7)];
573
 
574
 
575
  //Check whether a Page ID has been defined
@@ -633,19 +691,18 @@ function display_cff($atts) {
633
  //Get like box vars
634
  $cff_likebox_width = $atts[ 'likeboxwidth' ];
635
  if ( !isset($cff_likebox_width) || empty($cff_likebox_width) || $cff_likebox_width == '' ) $cff_likebox_width = 300;
636
- $cff_like_box_faces = $atts[ 'likeboxfaces' ];
637
- if ( !isset($cff_like_box_faces) || empty($cff_like_box_faces) ) $cff_like_box_faces = 'false';
638
 
639
  //Set like box variable
640
  isset( $options[ 'cff_app_id' ] ) ? $cff_app_id = $options[ 'cff_app_id' ] : $cff_app_id = '';
641
- ( isset($cff_app_id) && !empty($cff_app_id) ) ? $cff_like_box_params = '&appId=' .$cff_app_id : $cff_like_box_params = '';
642
  $like_box = '<div class="cff-likebox';
643
  if ($cff_like_box_outside) $like_box .= ' cff-outside';
644
  $like_box .= ($cff_like_box_position == 'top') ? ' cff-top' : ' cff-bottom';
645
- $like_box .= '" ' . $cff_likebox_styles . '><script src="https://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1 '.$cff_like_box_params.'"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" show_faces="'.$cff_like_box_faces.'" stream="false" header="false" colorscheme="'. $cff_like_box_colorscheme .'" show_border="'. $cff_like_box_border .'" data-height="'.$cff_likebox_height.'"></fb:like-box><div id="fb-root"></div></div>';
646
 
647
- //New like box:
648
- // $like_box .= '" ' . $cff_likebox_styles . '><div id="fb-root"></div><script src="https://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1 '.$cff_like_box_params.'"></script><div class="fb-page" data-href="https://www.facebook.com/' . $page_id . '" data-height="'.$cff_likebox_height.'" data-hide-cover="true" data-show-facepile="'.$cff_like_box_faces.'" data-show-posts="false"></div></div>';
 
649
 
650
  //Don't show like box if it's a group
651
  if($cff_is_group) $like_box = '';
@@ -698,10 +755,15 @@ function display_cff($atts) {
698
 
699
  //Create CFF container HTML
700
  $cff_content .= '<div class="cff-wrapper">';
701
- $cff_content .= '<div id="cff" data-char="'.$title_limit.'" class="';
702
- if( !empty($cff_class) ) $cff_content .= $cff_class . ' ';
703
- if ( !empty($cff_feed_height) ) $cff_content .= 'cff-fixed-height ';
704
- $cff_content .= '" ' . $cff_feed_styles . '>';
 
 
 
 
 
705
 
706
  //Add the page header to the inside of the top of feed
707
  if ($cff_show_header && !$cff_header_outside) $cff_content .= $cff_header;
@@ -717,12 +779,14 @@ function display_cff($atts) {
717
  //ALL POSTS
718
  if (!$cff_events_only){
719
 
720
- $cff_posts_json_url = 'https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?access_token=' . $access_token . '&limit=' . $cff_post_limit . '&locale=' . $cff_locale . $cff_ssl;
 
 
721
 
722
  //Don't use caching if the cache time is set to zero
723
  if ($cff_cache_time != 0){
724
  // Get any existing copy of our transient data
725
- $transient_name = 'cff_'. $graph_query .'_json_' . $page_id;
726
  if ( false === ( $posts_json = get_transient( $transient_name ) ) || $posts_json === null ) {
727
  //Get the contents of the Facebook page
728
  $posts_json = cff_fetchUrl($cff_posts_json_url);
@@ -775,7 +839,13 @@ function display_cff($atts) {
775
  foreach ($FBdata->data as $news )
776
  {
777
  //Explode News and Page ID's into 2 values
778
- $PostID = explode("_", $news->id);
 
 
 
 
 
 
779
  //Check the post type
780
  $cff_post_type = $news->type;
781
  if ($cff_post_type == 'link') {
@@ -785,6 +855,7 @@ function display_cff($atts) {
785
  $event_link_check = stripos($news->link, $event_link_check);
786
  if ( $event_link_check ) $cff_post_type = 'event';
787
  }
 
788
  //Should we show this post or not?
789
  $cff_show_post = false;
790
  switch ($cff_post_type) {
@@ -816,7 +887,7 @@ function display_cff($atts) {
816
  //ONLY show posts by others
817
  if ( $cff_show_only_others ) {
818
  //Get the numeric ID of the page
819
- $page_object = cff_fetchUrl('https://graph.facebook.com/' . $page_id);
820
  $page_object = json_decode($page_object);
821
  $numeric_page_id = $page_object->id;
822
 
@@ -890,25 +961,43 @@ function display_cff($atts) {
890
  $cff_album = false;
891
  $num_photos = 0;
892
 
893
- if( $news->status_type == 'added_photos' ){
894
- //Check 'story' to see whether it contains a number
895
- (isset($news->story)) ? $str = $news->story : $str = '';
896
-
897
- //Only matches number with a space after them
898
- preg_match('!\d+ !', $str, $matches);
 
899
 
900
- (isset($matches[0])) ? $num_photos = $matches[0] : $num_photos = 0;
901
 
902
- if ( $num_photos > 1 ) {
903
- $cff_album = true;
904
-
905
- //Link to the album instead of the photo
906
- $album_link = str_replace('photo.php?','media/set/?',$link);
907
- $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
 
 
 
 
 
908
 
909
- //If the album link is a new format then link it to the post
910
- $album_link_check = 'media/set/?';
911
- if( stripos($album_link, $album_link_check) !== true ) $album_link = $link;
 
 
 
 
 
 
 
 
 
 
 
 
 
912
  }
913
  }
914
 
@@ -982,23 +1071,24 @@ function display_cff($atts) {
982
  $post_text = htmlspecialchars($news->name);
983
  $cff_post_text_type = 'name';
984
  }
985
- if ($cff_album) {
986
- if (!empty($news->name)) {
987
- $post_text = htmlspecialchars($news->name);
988
- $cff_post_text_type = 'name';
989
- }
990
- if (!empty($news->message) && empty($news->name)) {
991
- $post_text = htmlspecialchars($news->message);
992
- $cff_post_text_type = 'message';
993
- }
994
- $post_text .= ' (' . $num_photos . ' '.$cff_translate_photos_text.')';
995
- }
996
 
997
 
998
  //MESSAGE TAGS
999
  $cff_post_tags = $atts[ 'posttags' ];
1000
  //If the post tags option doesn't exist yet (ie. on plugin update) then set them as true
1001
  if ( !array_key_exists( 'cff_post_tags', $options ) ) $cff_post_tags = true;
 
1002
  //Add message and story tags if there are any and the post text is the message or the story
1003
  if( $cff_post_tags && ( isset($news->message_tags) || isset($news->story_tags) ) && ($cff_post_text_type == 'message' || $cff_post_text_type == 'story') && !$cff_title_link){
1004
  //Use message_tags or story_tags?
@@ -1008,7 +1098,7 @@ function display_cff($atts) {
1008
  if( ( $cff_post_text_type == 'message' && isset($news->message_tags) ) || ( $cff_post_text_type == 'story' && !isset($news->message_tags) ) ) {
1009
 
1010
  //Does the Post Text contain any html tags? - the & symbol is the best indicator of this
1011
- $cff_html_check_array = array('&lt;', '’', '“', '&quot;', '&amp;');
1012
 
1013
  //always use the text replace method
1014
  if( cff_stripos_arr($post_text, $cff_html_check_array) !== false ) {
@@ -1045,11 +1135,16 @@ function display_cff($atts) {
1045
  //If the name is blank (aka the story tag doesn't work properly) then don't use it
1046
  if( $message_tags_arr[$i]['name'] !== '' ) {
1047
 
1048
- $b = '<a href="http://facebook.com/' . $message_tags_arr[$i]['id'] . '">' . $message_tags_arr[$i]['name'] . '</a>';
1049
- $c = $message_tags_arr[$i]['offset'];
1050
- $d = $message_tags_arr[$i]['length'];
 
 
 
 
 
 
1051
 
1052
- $post_text = cff_mb_substr_replace( $post_text, $b, $c, $d);
1053
  }
1054
 
1055
  }
@@ -1265,12 +1360,17 @@ function display_cff($atts) {
1265
  //Link to the Facebook post if it's a link or a video
1266
  if($cff_post_type == 'link' || $cff_post_type == 'video') $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
1267
 
 
 
 
 
 
1268
  //Social media sharing URLs
1269
- $cff_share_facebook = 'https://www.facebook.com/sharer/sharer.php?u=' . $link;
1270
- $cff_share_twitter = 'https://twitter.com/intent/tweet?text=' . $link;
1271
- $cff_share_google = 'https://plus.google.com/share?url=' . $link;
1272
- $cff_share_linkedin = 'https://www.linkedin.com/shareArticle?mini=true&url=' . $link . '&title=' . strip_tags($cff_post_text);
1273
- $cff_share_email = 'mailto:?subject=Facebook&body=' . $link . ' - ' . strip_tags($cff_post_text);
1274
 
1275
 
1276
  //If it's an offer post then change the text
@@ -1311,7 +1411,7 @@ function display_cff($atts) {
1311
  if ($cff_post_type == 'offer') $cff_post_item .= 'cff-offer-post';
1312
  if ($cff_album) $cff_post_item .= ' cff-album';
1313
  if ($cff_post_bg_color_check) $cff_post_item .= ' cff-box';
1314
- $cff_post_item .= ' author-'. cff_to_slug($news->from->name) .'" id="cff_'. $news->id .'" ' . $cff_item_styles . '>';
1315
 
1316
  //POST AUTHOR
1317
  if($cff_show_author) $cff_post_item .= $cff_author;
@@ -1409,7 +1509,7 @@ function cff_fetchUrl($url){
1409
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1410
  curl_setopt($ch, CURLOPT_TIMEOUT, 20);
1411
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
1412
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate,sdch');
1413
  $feedData = curl_exec($ch);
1414
  curl_close($ch);
1415
  //If not then use file_get_contents
@@ -1843,6 +1943,7 @@ function cff_activate() {
1843
  $options[ 'cff_show_like_box' ] = true;
1844
  $options[ 'cff_show_facebook_link' ] = true;
1845
  $options[ 'cff_show_facebook_share' ] = true;
 
1846
  update_option( 'cff_style_settings', $options );
1847
 
1848
  get_option('cff_show_access_token');
2
  /*
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
+ Description: Add completely customizable Facebook feeds to your WordPress site
6
+ Version: 2.3.6
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
25
  //Include admin
26
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
27
 
28
+ define('CFFVER', '2.3.6');
29
 
30
  // Add shortcodes
31
  add_shortcode('custom-facebook-feed', 'display_cff');
151
  'likeboxheight' => isset($options[ 'cff_likebox_height' ]) ? $options[ 'cff_likebox_height' ] : '',
152
  'likeboxfaces' => isset($options[ 'cff_like_box_faces' ]) ? $options[ 'cff_like_box_faces' ] : '',
153
  'likeboxborder' => isset($options[ 'cff_like_box_border' ]) ? $options[ 'cff_like_box_border' ] : '',
154
+ 'likeboxcover' => isset($options[ 'cff_like_box_cover' ]) ? $options[ 'cff_like_box_cover' ] : '',
155
+ 'likeboxsmallheader' => isset($options[ 'cff_like_box_small_header' ]) ? $options[ 'cff_like_box_small_header' ] : '',
156
+ 'likeboxhidebtn' => isset($options[ 'cff_like_box_hide_cta' ]) ? $options[ 'cff_like_box_hide_cta' ] : '',
157
+
158
  'credit' => isset($options[ 'cff_show_credit' ]) ? $options[ 'cff_show_credit' ] : '',
159
  'nofollow' => 'true',
160
 
218
 
219
  $cff_class = $atts['class'];
220
  //Compile feed styles
221
+ $cff_feed_styles = '';
222
+ if( !empty($cff_feed_width) || !empty($cff_feed_height) || !empty($cff_feed_padding) || (!empty($cff_bg_color) && $cff_bg_color !== '#') ) $cff_feed_styles = 'style="';
223
  if ( !empty($cff_feed_width) ) $cff_feed_styles .= 'width:' . $cff_feed_width . '; ';
224
  if ( !empty($cff_feed_height) ) $cff_feed_styles .= 'height:' . $cff_feed_height . '; ';
225
  if ( !empty($cff_feed_padding) ) $cff_feed_styles .= 'padding:' . $cff_feed_padding . '; ';
226
+ if ( !empty($cff_bg_color) && $cff_bg_color !== '#' ) $cff_feed_styles .= 'background-color:#' . str_replace('#', '', $cff_bg_color) . '; ';
227
+ if( !empty($cff_feed_width) || !empty($cff_feed_height) || !empty($cff_feed_padding) || (!empty($cff_bg_color) && $cff_bg_color !== '#') ) $cff_feed_styles .= '"';
228
  //Like box
229
  $cff_like_box_position = $atts[ 'likeboxpos' ];
230
  $cff_like_box_outside = $atts[ 'likeboxoutside' ];
295
  $cff_icon_style = $atts[ 'iconstyle' ];
296
  $cff_meta_text_color = $atts[ 'socialtextcolor' ];
297
  $cff_meta_bg_color = $atts[ 'socialbgcolor' ];
298
+ $cff_meta_styles = '';
299
+ if ( !empty($cff_meta_text_color) || ( !empty($cff_meta_bg_color) && $cff_meta_bg_color !== '#' ) ) $cff_meta_styles = 'style="';
300
  if ( !empty($cff_meta_text_color) ) $cff_meta_styles .= 'color:#' . str_replace('#', '', $cff_meta_text_color) . ';';
301
+ if ( !empty($cff_meta_bg_color) && $cff_meta_bg_color !== '#' ) $cff_meta_styles .= 'background-color:#' . str_replace('#', '', $cff_meta_bg_color) . ';';
302
+ if ( !empty($cff_meta_text_color) || ( !empty($cff_meta_bg_color) && $cff_meta_bg_color !== '#' ) ) $cff_meta_styles .= '"';
303
  $cff_nocomments_text = isset($options[ 'cff_nocomments_text' ]) ? $options[ 'cff_nocomments_text' ] : '';
304
  $cff_hide_comments = isset($options[ 'cff_hide_comments' ]) ? $options[ 'cff_hide_comments' ] : '';
305
  if (!isset($cff_nocomments_text) || empty($cff_nocomments_text)) $cff_hide_comments = true;
314
  $cff_title_size = $atts[ 'textsize' ];
315
  $cff_title_weight = $atts[ 'textweight' ];
316
  $cff_title_color = $atts[ 'textcolor' ];
317
+
318
+ $cff_title_styles = '';
319
+ if( ( !empty($cff_title_size) && $cff_title_size != 'inherit' ) || ( !empty($cff_title_weight) && $cff_title_weight != 'inherit' ) || ( !empty($cff_title_color) && $cff_title_color !== '#' ) ) $cff_title_styles = 'style="';
320
+ if ( !empty($cff_title_size) && $cff_title_size != 'inherit' ) $cff_title_styles .= 'font-size:' . $cff_title_size . 'px; ';
321
+ if ( !empty($cff_title_weight) && $cff_title_weight != 'inherit' ) $cff_title_styles .= 'font-weight:' . $cff_title_weight . '; ';
322
+ if ( !empty($cff_title_color) && $cff_title_color !== '#' ) $cff_title_styles .= 'color:#' . str_replace('#', '', $cff_title_color) . ';';
323
+ if( ( !empty($cff_title_size) && $cff_title_size != 'inherit' ) || ( !empty($cff_title_weight) && $cff_title_weight != 'inherit' ) || ( !empty($cff_title_color) && $cff_title_color !== '#' ) ) $cff_title_styles .= '"';
324
+
325
  $cff_title_link = $atts[ 'textlink' ];
326
 
327
  $cff_posttext_link_color = str_replace('#', '', $atts['textlinkcolor']);
332
  //Author
333
  $cff_author_size = $atts[ 'authorsize' ];
334
  $cff_author_color = $atts[ 'authorcolor' ];
335
+
336
+ $cff_author_styles = '';
337
+ if( ( !empty($cff_author_size) && $cff_author_size != 'inherit' ) || ( !empty($cff_author_color) && $cff_author_color !== '#' ) ) $cff_author_styles = 'style="';
338
+ if ( !empty($cff_author_size) && $cff_author_size != 'inherit' ) $cff_author_styles .= 'font-size:' . $cff_author_size . 'px; ';
339
+ if ( !empty($cff_author_color) && $cff_author_color !== '#' ) $cff_author_styles .= 'color:#' . str_replace('#', '', $cff_author_color) . ';';
340
+ if( ( !empty($cff_author_size) && $cff_author_size != 'inherit' ) || ( !empty($cff_author_color) && $cff_author_color !== '#' ) ) $cff_author_styles .= '"';
341
 
342
  //Description
343
  $cff_body_size = $atts[ 'descsize' ];
344
  $cff_body_weight = $atts[ 'descweight' ];
345
  $cff_body_color = $atts[ 'desccolor' ];
346
+
347
+ $cff_body_styles = '';
348
+ if( ( !empty($cff_body_size) && $cff_body_size != 'inherit' ) || ( !empty($cff_body_weight) && $cff_body_weight != 'inherit' ) || ( !empty($cff_body_color) && $cff_body_color !== '#' ) ) $cff_body_styles = 'style="';
349
+ if ( !empty($cff_body_size) && $cff_body_size != 'inherit' ) $cff_body_styles .= 'font-size:' . $cff_body_size . 'px; ';
350
+ if ( !empty($cff_body_weight) && $cff_body_weight != 'inherit' ) $cff_body_styles .= 'font-weight:' . $cff_body_weight . '; ';
351
+ if ( !empty($cff_body_color) && $cff_body_color !== '#' ) $cff_body_styles .= 'color:#' . str_replace('#', '', $cff_body_color) . ';';
352
+ if( ( !empty($cff_body_size) && $cff_body_size != 'inherit' ) || ( !empty($cff_body_weight) && $cff_body_weight != 'inherit' ) || ( !empty($cff_body_color) && $cff_body_color !== '#' ) ) $cff_body_styles .= '"';
353
 
354
  //Shared link title
355
  $cff_link_title_format = $atts[ 'linktitleformat' ];
358
  $cff_link_title_color = str_replace('#', '', $atts[ 'linktitlecolor' ]);
359
  $cff_link_url_color = $atts[ 'linkurlcolor' ];
360
 
361
+ $cff_link_title_styles = '';
362
+ if ( !empty($cff_link_title_size) && $cff_link_title_size != 'inherit' ) $cff_link_title_styles = 'style="font-size:' . $cff_link_title_size . 'px;"';
 
363
 
364
  //Shared link box
365
  $cff_link_bg_color = $atts[ 'linkbgcolor' ];
367
  $cff_disable_link_box = $atts['disablelinkbox'];
368
  ($cff_disable_link_box == 'true' || $cff_disable_link_box == 'on') ? $cff_disable_link_box = true : $cff_disable_link_box = false;
369
 
370
+ $cff_link_box_styles = '';
371
+ if( !empty($cff_link_border_color) || (!empty($cff_link_bg_color) && $cff_link_bg_color !== '#') ) $cff_link_box_styles = 'style="';
372
+ if ( !empty($cff_link_border_color) ) $cff_link_box_styles .= 'border: 1px solid #' . str_replace('#', '', $cff_link_border_color) . '; ';
373
+ if ( !empty($cff_link_bg_color) && $cff_link_bg_color !== '#' ) $cff_link_box_styles .= 'background-color: #' . str_replace('#', '', $cff_link_bg_color) . ';';
374
+ if( !empty($cff_link_border_color) || (!empty($cff_link_bg_color) && $cff_link_bg_color !== '#') ) $cff_link_box_styles .= '"';
375
 
376
  //Event Title
377
  $cff_event_title_format = $atts[ 'eventtitleformat' ];
379
  $cff_event_title_size = $atts[ 'eventtitlesize' ];
380
  $cff_event_title_weight = $atts[ 'eventtitleweight' ];
381
  $cff_event_title_color = $atts[ 'eventtitlecolor' ];
382
+
383
+ $cff_event_title_styles = '';
384
+ if( ( !empty($cff_event_title_size) && $cff_event_title_size != 'inherit' ) || ( !empty($cff_event_title_weight) && $cff_event_title_weight != 'inherit' ) || ( !empty($cff_event_title_color) && $cff_event_title_color !== '#' ) ) $cff_event_title_styles = 'style="';
385
+ if ( !empty($cff_event_title_size) && $cff_event_title_size != 'inherit' ) $cff_event_title_styles .= 'font-size:' . $cff_event_title_size . 'px; ';
386
+ if ( !empty($cff_event_title_weight) && $cff_event_title_weight != 'inherit' ) $cff_event_title_styles .= 'font-weight:' . $cff_event_title_weight . '; ';
387
+ if ( !empty($cff_event_title_color) && $cff_event_title_color !== '#' ) $cff_event_title_styles .= 'color:#' . str_replace('#', '', $cff_event_title_color) . ';';
388
+ if( ( !empty($cff_event_title_size) && $cff_event_title_size != 'inherit' ) || ( !empty($cff_event_title_weight) && $cff_event_title_weight != 'inherit' ) || ( !empty($cff_event_title_color) && $cff_event_title_color !== '#' ) ) $cff_event_title_styles .= '"';
389
 
390
  $cff_event_title_link = $atts[ 'eventtitlelink' ];
391
  ( $cff_event_title_link == 'on' || $cff_event_title_link == 'true' || $cff_event_title_link == true ) ? $cff_event_title_link = true : $cff_event_title_link = false;
398
  $cff_event_date_position = $atts[ 'eventdatepos' ];
399
  $cff_event_date_formatting = $atts[ 'eventdateformat' ];
400
  $cff_event_date_custom = $atts[ 'eventdatecustom' ];
401
+
402
+ $cff_event_date_styles = '';
403
+ if( ( !empty($cff_event_date_size) && $cff_event_date_size != 'inherit' ) || ( !empty($cff_event_date_weight) && $cff_event_date_weight != 'inherit' ) || ( !empty($cff_event_date_color) && $cff_event_date_color !== '#' ) ) $cff_event_date_styles = 'style="';
404
+ if ( !empty($cff_event_date_size) && $cff_event_date_size != 'inherit' ) $cff_event_date_styles .= 'font-size:' . $cff_event_date_size . 'px; ';
405
+ if ( !empty($cff_event_date_weight) && $cff_event_date_weight != 'inherit' ) $cff_event_date_styles .= 'font-weight:' . $cff_event_date_weight . '; ';
406
+ if ( !empty($cff_event_date_color) && $cff_event_date_color !== '#' ) $cff_event_date_styles .= 'color:#' . str_replace('#', '', $cff_event_date_color) . ';';
407
+ if( ( !empty($cff_event_date_size) && $cff_event_date_size != 'inherit' ) || ( !empty($cff_event_date_weight) && $cff_event_date_weight != 'inherit' ) || ( !empty($cff_event_date_color) && $cff_event_date_color !== '#' ) ) $cff_event_date_styles .= '"';
408
+
409
  //Event Details
410
  $cff_event_details_size = $atts[ 'eventdetailssize' ];
411
  $cff_event_details_weight = $atts[ 'eventdetailsweight' ];
412
  $cff_event_details_color = $atts[ 'eventdetailscolor' ];
413
  $cff_event_link_color = $atts[ 'eventlinkcolor' ];
414
+
415
+ $cff_event_details_styles = '';
416
+ if( ( !empty($cff_event_details_size) && $cff_event_details_size != 'inherit' ) || ( !empty($cff_event_details_weight) && $cff_event_details_weight != 'inherit' ) || ( !empty($cff_event_details_color) && $cff_event_details_color !== '#' ) ) $cff_event_details_styles = 'style="';
417
+ if ( !empty($cff_event_details_size) && $cff_event_details_size != 'inherit' ) $cff_event_details_styles .= 'font-size:' . $cff_event_details_size . 'px; ';
418
+ if ( !empty($cff_event_details_weight) && $cff_event_details_weight != 'inherit' ) $cff_event_details_styles .= 'font-weight:' . $cff_event_details_weight . '; ';
419
+ if ( !empty($cff_event_details_color) && $cff_event_details_color !== '#' ) $cff_event_details_styles .= 'color:#' . str_replace('#', '', $cff_event_details_color) . ';';
420
+ if( ( !empty($cff_event_details_size) && $cff_event_details_size != 'inherit' ) || ( !empty($cff_event_details_weight) && $cff_event_details_weight != 'inherit' ) || ( !empty($cff_event_details_color) && $cff_event_details_color !== '#' ) ) $cff_event_details_styles .= '"';
421
+
422
  //Date
423
  $cff_date_position = $atts[ 'datepos' ];
424
  if (!isset($cff_date_position)) $cff_date_position = 'below';
425
  $cff_date_size = $atts[ 'datesize' ];
426
  $cff_date_weight = $atts[ 'dateweight' ];
427
  $cff_date_color = $atts[ 'datecolor' ];
428
+
429
+ $cff_date_styles = '';
430
+ if( ( !empty($cff_date_size) && $cff_date_size != 'inherit' ) || ( !empty($cff_date_weight) && $cff_date_weight != 'inherit' ) || ( !empty($cff_date_color) && $cff_date_color !== '#' ) ) $cff_date_styles = 'style="';
431
+ if ( !empty($cff_date_size) && $cff_date_size != 'inherit' ) $cff_date_styles .= 'font-size:' . $cff_date_size . 'px; ';
432
+ if ( !empty($cff_date_weight) && $cff_date_weight != 'inherit' ) $cff_date_styles .= 'font-weight:' . $cff_date_weight . '; ';
433
+ if ( !empty($cff_date_color) && $cff_date_color !== '#' ) $cff_date_styles .= 'color:#' . str_replace('#', '', $cff_date_color) . ';';
434
+ if( ( !empty($cff_date_size) && $cff_date_size != 'inherit' ) || ( !empty($cff_date_weight) && $cff_date_weight != 'inherit' ) || ( !empty($cff_date_color) && $cff_date_color !== '#' ) ) $cff_date_styles .= '"';
435
+
436
  $cff_date_before = isset($options[ 'cff_date_before' ]) ? $options[ 'cff_date_before' ] : '';
437
  $cff_date_after = isset($options[ 'cff_date_after' ]) ? $options[ 'cff_date_after' ] : '';
438
  //Set user's timezone based on setting
443
  $cff_link_size = $atts[ 'linksize' ];
444
  $cff_link_weight = $atts[ 'linkweight' ];
445
  $cff_link_color = $atts[ 'linkcolor' ];
446
+
447
+ $cff_link_styles = '';
448
+ if( ( !empty($cff_link_size) && $cff_link_size != 'inherit' ) || ( !empty($cff_link_weight) && $cff_link_weight != 'inherit' ) || ( !empty($cff_link_color) && $cff_link_color !== '#' ) ) $cff_link_styles = 'style="';
449
+ if ( !empty($cff_link_size) && $cff_link_size != 'inherit' ) $cff_link_styles .= 'font-size:' . $cff_link_size . 'px; ';
450
+ if ( !empty($cff_link_weight) && $cff_link_weight != 'inherit' ) $cff_link_styles .= 'font-weight:' . $cff_link_weight . '; ';
451
+ if ( !empty($cff_link_color) && $cff_link_color !== '#' ) $cff_link_styles .= 'color:#' . str_replace('#', '', $cff_link_color) . ';';
452
+ if( ( !empty($cff_link_size) && $cff_link_size != 'inherit' ) || ( !empty($cff_link_weight) && $cff_link_weight != 'inherit' ) || ( !empty($cff_link_color) && $cff_link_color !== '#' ) ) $cff_link_styles .= '"';
453
 
454
  //Link custom text
455
  $cff_facebook_link_text = $atts[ 'facebooklinktext' ];
486
 
487
  if ( !isset($cff_likebox_width) || empty($cff_likebox_width) || $cff_likebox_width == '' ) $cff_likebox_width = '100%';
488
  $cff_like_box_faces = $atts[ 'likeboxfaces' ];
489
+ if ( !isset($cff_like_box_faces) || empty($cff_like_box_faces) ){
490
+ $cff_like_box_faces = 'false';
491
+ } else {
492
+ $cff_like_box_faces = 'true';
493
+ }
494
+
495
  $cff_like_box_border = $atts[ 'likeboxborder' ];
496
  if ($cff_like_box_border) {
497
  $cff_like_box_border = 'true';
499
  $cff_like_box_border = 'false';
500
  }
501
 
502
+ $cff_like_box_cover = $atts[ 'likeboxcover' ];
503
+ if ($cff_like_box_cover) {
504
+ $cff_like_box_cover = 'false';
505
+ } else {
506
+ $cff_like_box_cover = 'true';
507
+ }
508
+
509
+ $cff_like_box_small_header = $atts[ 'likeboxsmallheader' ];
510
+ if ($cff_like_box_small_header) {
511
+ $cff_like_box_small_header = 'true';
512
+ } else {
513
+ $cff_like_box_small_header = 'false';
514
+ }
515
+
516
+ $cff_like_box_hide_cta = $atts[ 'likeboxhidebtn' ];
517
+ if ($cff_like_box_hide_cta) {
518
+ $cff_like_box_hide_cta = 'true';
519
+ } else {
520
+ $cff_like_box_hide_cta = 'false';
521
+ }
522
+
523
  //Compile Like box styles
524
  $cff_likebox_styles = 'style="width: ' . $cff_likebox_width . ';';
525
  if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= ' background-color: #' . str_replace('#', '', $cff_likebox_bg_color) . ';';
539
  $cff_header_text_color = $atts['headertextcolor'];
540
 
541
  //Compile feed header styles
542
+ $cff_header_styles = '';
543
+ if( ( !empty($cff_header_bg_color) && $cff_header_bg_color !== '#' ) || !empty($cff_header_padding) || ( !empty($cff_header_text_size) && $cff_header_text_size != 'inherit' ) || ( !empty($cff_header_text_weight) && $cff_header_text_weight != 'inherit' ) || (!empty($cff_header_text_color) && $cff_header_text_color !== '#') ) $cff_header_styles = 'style="';
544
+ if ( !empty($cff_header_bg_color) && $cff_header_bg_color !== '#' ) $cff_header_styles .= 'background-color: #' . str_replace('#', '', $cff_header_bg_color) . '; ';
545
+ if ( !empty($cff_header_padding) ) $cff_header_styles .= 'padding: ' . $cff_header_padding . '; ';
546
+ if ( !empty($cff_header_text_size) && $cff_header_text_size != 'inherit' ) $cff_header_styles .= 'font-size: ' . $cff_header_text_size . 'px; ';
547
+ if ( !empty($cff_header_text_weight) && $cff_header_text_weight != 'inherit' ) $cff_header_styles .= 'font-weight: ' . $cff_header_text_weight . '; ';
548
+ if ( !empty($cff_header_text_color) && $cff_header_text_color !== '#' ) $cff_header_styles .= 'color: #' . str_replace('#', '', $cff_header_text_color) . '; ';
549
+ if( ( !empty($cff_header_bg_color) && $cff_header_bg_color !== '#' ) || !empty($cff_header_padding) || ( !empty($cff_header_text_size) && $cff_header_text_size != 'inherit' ) || ( !empty($cff_header_text_weight) && $cff_header_text_weight != 'inherit' ) || (!empty($cff_header_text_color) && $cff_header_text_color !== '#') ) $cff_header_styles .= '"';
550
 
551
  //Video
552
  //Dimensions
568
 
569
  $cff_post_bg_color = str_replace('#', '', $atts['postbgcolor']);
570
  $cff_post_rounded = $atts['postcorners'];
571
+
572
  ($cff_post_bg_color !== '#' && $cff_post_bg_color !== '') ? $cff_post_bg_color_check = true : $cff_post_bg_color_check = false;
573
  ($cff_sep_color !== '#' && $cff_sep_color !== '') ? $cff_sep_color_check = true : $cff_sep_color_check = false;
574
 
578
  $cff_item_styles = 'style="';
579
  if($cff_sep_color_check && !$cff_post_bg_color_check) $cff_item_styles .= 'border-bottom: ' . $cff_sep_size . 'px solid #' . str_replace('#', '', $cff_sep_color) . '; ';
580
  if($cff_post_bg_color_check) $cff_item_styles .= 'background-color: #' . $cff_post_bg_color . '; ';
581
+ if(isset($cff_post_rounded) && $cff_post_rounded !== '0') $cff_item_styles .= '-webkit-border-radius: ' . $cff_post_rounded . 'px; -moz-border-radius: ' . $cff_post_rounded . 'px; border-radius: ' . $cff_post_rounded . 'px; ';
582
  $cff_item_styles .= '"';
583
  }
584
 
621
  '640861236031365|2rENQzxtWtG12DtlZwqfZ6Vu6BE',
622
  '334487440086538|hI_NNy1NvxQiQxm-TtXsrmoCVaE',
623
  '755471677869105|Jxv8xVDad7vUUTauk8K2o71wG2w',
624
+ '518353204973067|dA7YTe-k8eSvgZ8lqa51xSm16DA',
625
+ '444286039063163|5qkYu2qxpERWO3gcs2f3nxeqhpg',
626
+ '944793728885704|XJ6QqKK8Ldsssr4n5Qrs2tVr7rs',
627
+ '1444667452511509|wU7tzWiuj6NadfpHfgkIGLGO86o',
628
+ '1574171666165548|ZL9tXNXxpnCdAvdUjCX5HtRnsR8'
629
  );
630
+ if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0, 11)];
631
 
632
 
633
  //Check whether a Page ID has been defined
691
  //Get like box vars
692
  $cff_likebox_width = $atts[ 'likeboxwidth' ];
693
  if ( !isset($cff_likebox_width) || empty($cff_likebox_width) || $cff_likebox_width == '' ) $cff_likebox_width = 300;
 
 
694
 
695
  //Set like box variable
696
  isset( $options[ 'cff_app_id' ] ) ? $cff_app_id = $options[ 'cff_app_id' ] : $cff_app_id = '';
697
+ ( isset($cff_app_id) && !empty($cff_app_id) ) ? $cff_like_box_params = '&app_id=' .$cff_app_id : $cff_like_box_params = '';
698
  $like_box = '<div class="cff-likebox';
699
  if ($cff_like_box_outside) $like_box .= ' cff-outside';
700
  $like_box .= ($cff_like_box_position == 'top') ? ' cff-top' : ' cff-bottom';
701
+ // $like_box .= '" ' . $cff_likebox_styles . '><script src="https://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1 '.$cff_like_box_params.'"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" show_faces="'.$cff_like_box_faces.'" stream="false" header="false" colorscheme="'. $cff_like_box_colorscheme .'" show_border="'. $cff_like_box_border .'" data-height="'.$cff_likebox_height.'"></fb:like-box><div id="fb-root"></div></div>';
702
 
703
+ $like_box_page_id = explode(",", str_replace(' ', '', $page_id) );
704
+
705
+ $like_box .= '" ><script src="https://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1'.$cff_like_box_params.'"></script><div class="fb-page" data-href="https://www.facebook.com/'.$like_box_page_id[0].'" data-width="'.$cff_likebox_width.'" data-hide-cover="'.$cff_like_box_cover.'" data-show-facepile="'.$cff_like_box_faces.'" data-small-header="'.$cff_like_box_small_header.'" data-hide-cta="'.$cff_like_box_hide_cta.'" data-show-posts="false" data-adapt-container-width="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/'.$like_box_page_id[0].'"><a href="https://www.facebook.com/'.$like_box_page_id[0].'">'.$cff_facebook_link_text.'</a></blockquote></div></div><div id="fb-root"></div></div>';
706
 
707
  //Don't show like box if it's a group
708
  if($cff_is_group) $like_box = '';
755
 
756
  //Create CFF container HTML
757
  $cff_content .= '<div class="cff-wrapper">';
758
+ $cff_content .= '<div id="cff" data-char="'.$title_limit.'"';
759
+
760
+ //If there's a class then add it here
761
+ if( !empty($cff_class) || !empty($cff_feed_height) ) $cff_content .= ' class="';
762
+ if( !empty($cff_class) ) $cff_content .= $cff_class . ' ';
763
+ if ( !empty($cff_feed_height) ) $cff_content .= 'cff-fixed-height ';
764
+ if( !empty($cff_class) || !empty($cff_feed_height) ) $cff_content .= '"';
765
+
766
+ $cff_content .= ' ' . $cff_feed_styles . '>';
767
 
768
  //Add the page header to the inside of the top of feed
769
  if ($cff_show_header && !$cff_header_outside) $cff_content .= $cff_header;
779
  //ALL POSTS
780
  if (!$cff_events_only){
781
 
782
+ // $cff_posts_json_url = 'https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?access_token=' . $access_token . '&limit=' . $cff_post_limit . '&locale=' . $cff_locale . $cff_ssl;
783
+
784
+ $cff_posts_json_url = 'https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?fields=id,from,message,message_tags,story,story_tags,link,source,name,caption,description,type,status_type,object_id,created_time&access_token=' . $access_token . '&limit=' . $cff_post_limit . '&locale=' . $cff_locale . $cff_ssl;
785
 
786
  //Don't use caching if the cache time is set to zero
787
  if ($cff_cache_time != 0){
788
  // Get any existing copy of our transient data
789
+ $transient_name = 'cff_'. $graph_query .'_json_' . $page_id . $cff_post_limit . $show_posts_by;
790
  if ( false === ( $posts_json = get_transient( $transient_name ) ) || $posts_json === null ) {
791
  //Get the contents of the Facebook page
792
  $posts_json = cff_fetchUrl($cff_posts_json_url);
839
  foreach ($FBdata->data as $news )
840
  {
841
  //Explode News and Page ID's into 2 values
842
+ $PostID = '';
843
+ $cff_post_id = '';
844
+ if( isset($news->id) ){
845
+ $cff_post_id = $news->id;
846
+ $PostID = explode("_", $cff_post_id);
847
+ }
848
+
849
  //Check the post type
850
  $cff_post_type = $news->type;
851
  if ($cff_post_type == 'link') {
855
  $event_link_check = stripos($news->link, $event_link_check);
856
  if ( $event_link_check ) $cff_post_type = 'event';
857
  }
858
+
859
  //Should we show this post or not?
860
  $cff_show_post = false;
861
  switch ($cff_post_type) {
887
  //ONLY show posts by others
888
  if ( $cff_show_only_others ) {
889
  //Get the numeric ID of the page
890
+ $page_object = cff_fetchUrl('https://graph.facebook.com/' . $page_id . '?access_token=' . $access_token);
891
  $page_object = json_decode($page_object);
892
  $numeric_page_id = $page_object->id;
893
 
961
  $cff_album = false;
962
  $num_photos = 0;
963
 
964
+ if( isset($news->status_type) ){
965
+ if( $news->status_type == 'added_photos' ){
966
+ //Check 'story' to see whether it contains a number
967
+ (isset($news->story)) ? $str = $news->story : $str = '';
968
+
969
+ //Only matches number with a space after them
970
+ preg_match('!\d+ !', $str, $matches);
971
 
 
972
 
973
+ (isset($matches[0])) ? $num_photos = $matches[0] : $num_photos = 0;
974
+
975
+ //If the story contains a number...
976
+ if ( $num_photos > 1 ) {
977
+
978
+ //... and the link is to an album then it most likely has photo attachments
979
+ $albumLinkArr1 = explode('photos/a.', $link);
980
+ $albumLinkArr2 = explode('.', $albumLinkArr1[1]);
981
+
982
+ //If it has an album link then set the post type to be album
983
+ if( isset($albumLinkArr1[1]) ){
984
 
985
+ $cff_album = true;
986
+
987
+ //Change the Post ID to be to the post about adding photos to the album
988
+ $cff_post_id = $PostID[0] . '_' . $albumLinkArr2[0];
989
+
990
+ //Link to the album instead of the photo
991
+ $album_link = str_replace('photo.php?','media/set/?',$link);
992
+ $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
993
+
994
+ //If the album link is a new format then link it to the post
995
+ $album_link_check = 'media/set/?';
996
+ if( stripos($album_link, $album_link_check) !== true ) $album_link = $link;
997
+
998
+ }
999
+
1000
+ }
1001
  }
1002
  }
1003
 
1071
  $post_text = htmlspecialchars($news->name);
1072
  $cff_post_text_type = 'name';
1073
  }
1074
+ // if ($cff_album) {
1075
+ // if (!empty($news->name)) {
1076
+ // $post_text = htmlspecialchars($news->name);
1077
+ // $cff_post_text_type = 'name';
1078
+ // }
1079
+ // if (!empty($news->message) && empty($news->name)) {
1080
+ // $post_text = htmlspecialchars($news->message);
1081
+ // $cff_post_text_type = 'message';
1082
+ // }
1083
+ // if ($num_photos > 1) $post_text .= ' (' . trim($num_photos) . ' '.$cff_translate_photos_text.')';
1084
+ // }
1085
 
1086
 
1087
  //MESSAGE TAGS
1088
  $cff_post_tags = $atts[ 'posttags' ];
1089
  //If the post tags option doesn't exist yet (ie. on plugin update) then set them as true
1090
  if ( !array_key_exists( 'cff_post_tags', $options ) ) $cff_post_tags = true;
1091
+
1092
  //Add message and story tags if there are any and the post text is the message or the story
1093
  if( $cff_post_tags && ( isset($news->message_tags) || isset($news->story_tags) ) && ($cff_post_text_type == 'message' || $cff_post_text_type == 'story') && !$cff_title_link){
1094
  //Use message_tags or story_tags?
1098
  if( ( $cff_post_text_type == 'message' && isset($news->message_tags) ) || ( $cff_post_text_type == 'story' && !isset($news->message_tags) ) ) {
1099
 
1100
  //Does the Post Text contain any html tags? - the & symbol is the best indicator of this
1101
+ $cff_html_check_array = array('&lt;', '’', '“', '&quot;', '&amp;', '&gt;&gt;');
1102
 
1103
  //always use the text replace method
1104
  if( cff_stripos_arr($post_text, $cff_html_check_array) !== false ) {
1135
  //If the name is blank (aka the story tag doesn't work properly) then don't use it
1136
  if( $message_tags_arr[$i]['name'] !== '' ) {
1137
 
1138
+ if( $cff_post_text_type == 'story' && $message_tags_arr[$i]['type'] == 'event' ){
1139
+ //Don't use the story tag in this case otherwise it changes '__ created an event' to '__ created an Name Of Event'
1140
+ } else {
1141
+ $b = '<a href="http://facebook.com/' . $message_tags_arr[$i]['id'] . '">' . $message_tags_arr[$i]['name'] . '</a>';
1142
+ $c = $message_tags_arr[$i]['offset'];
1143
+ $d = $message_tags_arr[$i]['length'];
1144
+
1145
+ $post_text = cff_mb_substr_replace( $post_text, $b, $c, $d);
1146
+ }
1147
 
 
1148
  }
1149
 
1150
  }
1360
  //Link to the Facebook post if it's a link or a video
1361
  if($cff_post_type == 'link' || $cff_post_type == 'video') $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
1362
 
1363
+ //If it's a shared post then change the link to use the Post ID so that it links to the shared post and not the original post that's being shared
1364
+ if( isset($news->status_type) ){
1365
+ if( $news->status_type == 'shared_story' ) $link = "https://www.facebook.com/" . $cff_post_id;
1366
+ }
1367
+
1368
  //Social media sharing URLs
1369
+ $cff_share_facebook = 'https://www.facebook.com/sharer/sharer.php?u=' . urlencode($link);
1370
+ $cff_share_twitter = 'https://twitter.com/intent/tweet?text=' . urlencode($link);
1371
+ $cff_share_google = 'https://plus.google.com/share?url=' . urlencode($link);
1372
+ $cff_share_linkedin = 'https://www.linkedin.com/shareArticle?mini=true&amp;url=' . urlencode($link) . '&amp;title=' . rawurlencode( strip_tags($cff_post_text) );
1373
+ $cff_share_email = 'mailto:?subject=Facebook&amp;body=' . urlencode($link) . '%20-%20' . rawurlencode( strip_tags($cff_post_text) );
1374
 
1375
 
1376
  //If it's an offer post then change the text
1411
  if ($cff_post_type == 'offer') $cff_post_item .= 'cff-offer-post';
1412
  if ($cff_album) $cff_post_item .= ' cff-album';
1413
  if ($cff_post_bg_color_check) $cff_post_item .= ' cff-box';
1414
+ $cff_post_item .= ' author-'. cff_to_slug($news->from->name) .'" id="cff_'. $cff_post_id .'" ' . $cff_item_styles . '>';
1415
 
1416
  //POST AUTHOR
1417
  if($cff_show_author) $cff_post_item .= $cff_author;
1509
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1510
  curl_setopt($ch, CURLOPT_TIMEOUT, 20);
1511
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
1512
+ curl_setopt($ch, CURLOPT_ENCODING, '');
1513
  $feedData = curl_exec($ch);
1514
  curl_close($ch);
1515
  //If not then use file_get_contents
1943
  $options[ 'cff_show_like_box' ] = true;
1944
  $options[ 'cff_show_facebook_link' ] = true;
1945
  $options[ 'cff_show_facebook_share' ] = true;
1946
+ $options[ 'cff_event_title_link' ] = true;
1947
  update_option( 'cff_style_settings', $options );
1948
 
1949
  get_option('cff_show_access_token');
js/cff-scripts.js CHANGED
@@ -48,6 +48,11 @@ jQuery(document).ready(function() {
48
  $more.show();
49
  $less.hide();
50
  }
 
 
 
 
 
51
  cffLinkHashtags();
52
  });
53
 
@@ -61,7 +66,7 @@ jQuery(document).ready(function() {
61
  //Link hashtags
62
  var cffTextStr = $self.find('.cff-text').html(),
63
  cffDescStr = $self.find('.cff-post-desc').html(),
64
- regex = /(^|\s)#(\w*[a-zA-Z_]+\w*)/gi,
65
  linkcolor = $self.find('.cff-text').attr('data-color');
66
 
67
  function replacer(hash){
@@ -91,7 +96,7 @@ jQuery(document).ready(function() {
91
  cffLinkHashtags();
92
 
93
  //Add target attr to post text links via JS so aren't included in char count
94
- $self.find('.cff-text a').attr({
95
  'target' : '_blank',
96
  'rel' : 'nofollow'
97
  });
48
  $more.show();
49
  $less.hide();
50
  }
51
+ //Add target attr to post text links via JS so aren't included in char count
52
+ $self.find('.cff-text a').add( $self.find('.cff-post-desc a') ).attr({
53
+ 'target' : '_blank',
54
+ 'rel' : 'nofollow'
55
+ });
56
  cffLinkHashtags();
57
  });
58
 
66
  //Link hashtags
67
  var cffTextStr = $self.find('.cff-text').html(),
68
  cffDescStr = $self.find('.cff-post-desc').html(),
69
+ regex = /(^|\s)#(\w*[a-z\u00E0-\u00FC]+\w*)/gi,
70
  linkcolor = $self.find('.cff-text').attr('data-color');
71
 
72
  function replacer(hash){
96
  cffLinkHashtags();
97
 
98
  //Add target attr to post text links via JS so aren't included in char count
99
+ $self.find('.cff-text a').add( $self.find('.cff-post-desc a') ).attr({
100
  'target' : '_blank',
101
  'rel' : 'nofollow'
102
  });