Version Description
- Happy New Year!
- 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. - 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
- Tweak: Increased the accuracy of the character count when links are included in the Facebook text
- Tweak: Improved the efficiency of the post caching
- Tweak: Replaced the rel attribute with the HTML5 data attribute when storing data on an element
- Tweak: Added HTTPS stream wrapper check to the System Info to aid in troubleshooting
- Tweak: Updated the plugin's icon font to the latest version
- Tweak: Added the Smash Balloon logo to the credit link which can be optionally displayed at the bottom of your feed. The setting for this is at the bottom of the Misc tab on the Customize page.
- Tweak: Added a shortcode option to only show the Smash Balloon credit link on certain feeds:
[custom-facebook-feed credit=true]
- Fix: Fixed an issue with quotes being escaped in custom/translated text
- Fix: Display an error message if WPHTTP function isn't working correctly
- Fix: The
postbgcolor
shortcode option is now working correctly
Download this release
Release Info
Developer | smashballoon |
Plugin | Custom Facebook Feed |
Version | 2.3 |
Comparing to | |
See all releases |
Code changes from version 2.2.1 to 2.3
- README.txt +16 -1
- css/cff-style.css +85 -4
- custom-facebook-feed-admin.php +71 -29
- custom-facebook-feed.php +132 -62
- img/pro.png +0 -0
- js/cff-scripts.js +13 -3
README.txt
CHANGED
@@ -3,7 +3,7 @@ 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.1
|
6 |
-
Stable tag: 2.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -271,6 +271,21 @@ 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.2.1 =
|
275 |
* Fix: Fixed a minor JavaScript error which occurs if a Facebook post doesn't contain any text
|
276 |
|
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.1
|
6 |
+
Stable tag: 2.3
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
271 |
9. It's super easy to display your Facebook feed in any page or post
|
272 |
|
273 |
== Changelog ==
|
274 |
+
= 2.3 =
|
275 |
+
* Happy New Year!
|
276 |
+
* 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.
|
277 |
+
* 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
|
278 |
+
* Tweak: Increased the accuracy of the character count when links are included in the Facebook text
|
279 |
+
* Tweak: Improved the efficiency of the post caching
|
280 |
+
* Tweak: Replaced the rel attribute with the HTML5 data attribute when storing data on an element
|
281 |
+
* Tweak: Added HTTPS stream wrapper check to the System Info to aid in troubleshooting
|
282 |
+
* Tweak: Updated the plugin's icon font to the latest version
|
283 |
+
* Tweak: Added the Smash Balloon logo to the credit link which can be optionally displayed at the bottom of your feed. The setting for this is at the bottom of the Misc tab on the Customize page.
|
284 |
+
* Tweak: Added a shortcode option to only show the Smash Balloon credit link on certain feeds: `[custom-facebook-feed credit=true]`
|
285 |
+
* Fix: Fixed an issue with quotes being escaped in custom/translated text
|
286 |
+
* Fix: Display an error message if WPHTTP function isn't working correctly
|
287 |
+
* Fix: The `postbgcolor` shortcode option is now working correctly
|
288 |
+
|
289 |
= 2.2.1 =
|
290 |
* Fix: Fixed a minor JavaScript error which occurs if a Facebook post doesn't contain any text
|
291 |
|
css/cff-style.css
CHANGED
@@ -254,15 +254,92 @@
|
|
254 |
}
|
255 |
|
256 |
/* View on Facebook / View Link text */
|
257 |
-
#cff .cff-
|
258 |
-
#cff .cff-viewpost-facebook{
|
259 |
float: left;
|
260 |
clear: none;
|
261 |
-
padding:
|
262 |
margin: 0;
|
263 |
font-size: 11px;
|
264 |
}
|
265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
/* Like box */
|
267 |
.cff-likebox{
|
268 |
float: left;
|
@@ -336,7 +413,11 @@
|
|
336 |
#cff .cff-credit a{
|
337 |
text-decoration: none;
|
338 |
}
|
|
|
|
|
|
|
|
|
339 |
#cff .cff-credit .fa{
|
340 |
padding-right: 5px;
|
341 |
font-size: 13px;
|
342 |
-
}
|
254 |
}
|
255 |
|
256 |
/* View on Facebook / View Link text */
|
257 |
+
#cff .cff-post-links{
|
|
|
258 |
float: left;
|
259 |
clear: none;
|
260 |
+
padding: 5px 0 0 0;
|
261 |
margin: 0;
|
262 |
font-size: 11px;
|
263 |
}
|
264 |
|
265 |
+
|
266 |
+
#cff .cff-post-links.cff-left{
|
267 |
+
float: left;
|
268 |
+
margin: 8px 0;
|
269 |
+
}
|
270 |
+
#cff .cff-post-links a{
|
271 |
+
font-size: 11px;
|
272 |
+
}
|
273 |
+
#cff .cff-post-links a:first-child{
|
274 |
+
padding-left: 0;
|
275 |
+
margin: 0;
|
276 |
+
}
|
277 |
+
#cff .cff-dot{
|
278 |
+
padding: 0 5px;
|
279 |
+
}
|
280 |
+
|
281 |
+
/* Share tooltip*/
|
282 |
+
#cff .cff-share-container{
|
283 |
+
position: relative;
|
284 |
+
display: inline;
|
285 |
+
}
|
286 |
+
#cff .cff-share-tooltip{
|
287 |
+
display: none;
|
288 |
+
position: absolute;
|
289 |
+
z-index: 1000;
|
290 |
+
bottom: 22px;
|
291 |
+
right: -41px;
|
292 |
+
width: 110px;
|
293 |
+
padding: 5px 5px 4px 5px;
|
294 |
+
margin: 0;
|
295 |
+
background: #333;
|
296 |
+
color: #eee;
|
297 |
+
font-size: 12px;
|
298 |
+
line-height: 1.3;
|
299 |
+
|
300 |
+
-webkit-box-sizing: border-box;
|
301 |
+
-moz-box-sizing: border-box;
|
302 |
+
box-sizing: border-box;
|
303 |
+
}
|
304 |
+
#cff .cff-share-tooltip .fa-play{
|
305 |
+
position: absolute;
|
306 |
+
font-size: 8px;
|
307 |
+
bottom: -6px;
|
308 |
+
left: 50%;
|
309 |
+
margin-left: -3px;
|
310 |
+
color: #333;
|
311 |
+
}
|
312 |
+
#cff .cff-share-tooltip a .fa{
|
313 |
+
font-size: 16px;
|
314 |
+
margin: 0;
|
315 |
+
padding: 5px;
|
316 |
+
}
|
317 |
+
#cff .cff-share-tooltip a#sbi_facebook_icon .fa,
|
318 |
+
#cff .cff-share-tooltip a#sbi_twitter_icon .fa,
|
319 |
+
#cff .cff-share-tooltip a#sbi_pinterest_icon .fa{
|
320 |
+
padding-top: 4px;
|
321 |
+
font-size: 18px;
|
322 |
+
}
|
323 |
+
#cff .cff-share-tooltip a{
|
324 |
+
display: block;
|
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;
|
332 |
+
border-radius: 4px;
|
333 |
+
}
|
334 |
+
#cff .cff-share-tooltip a:hover{
|
335 |
+
color: #fff;
|
336 |
+
}
|
337 |
+
#cff .cff-share-tooltip #cff-facebook-icon:hover{ background: #3b5998; }
|
338 |
+
#cff .cff-share-tooltip #cff-twitter-icon:hover{ background: #00aced; }
|
339 |
+
#cff .cff-share-tooltip #cff-google-icon:hover{ background: #dd4b39; }
|
340 |
+
#cff .cff-share-tooltip #cff-linkedin-icon:hover{ background: #007bb6; }
|
341 |
+
#cff .cff-share-tooltip #cff-pinterest-icon:hover{ background: #cb2027; }
|
342 |
+
|
343 |
/* Like box */
|
344 |
.cff-likebox{
|
345 |
float: left;
|
413 |
#cff .cff-credit a{
|
414 |
text-decoration: none;
|
415 |
}
|
416 |
+
#cff .cff-credit img{
|
417 |
+
float: left;
|
418 |
+
margin: -2px 5px 0 0;
|
419 |
+
}
|
420 |
#cff .cff-credit .fa{
|
421 |
padding-right: 5px;
|
422 |
font-size: 13px;
|
423 |
+
}
|
custom-facebook-feed-admin.php
CHANGED
@@ -147,10 +147,10 @@ function cff_settings_page() {
|
|
147 |
</tr>
|
148 |
|
149 |
<tr valign="top">
|
150 |
-
<th scope="row" style="padding-bottom: 10px;"><?php _e('Enter my own Access Token <i style="font-weight: normal; font-size: 12px;">This is
|
151 |
<td>
|
152 |
<input name="cff_show_access_token" type="checkbox" id="cff_show_access_token" <?php if($show_access_token_val == true) echo "checked"; ?> /> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("What is this?"); ?></a>
|
153 |
-
<p class="cff-tooltip cff-more-info"><?php _e("A Facebook Access Token is not required to use this plugin, but
|
154 |
</td>
|
155 |
</tr>
|
156 |
|
@@ -408,6 +408,7 @@ Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
|
|
408 |
PHP allow_url_fopen: <?php echo ini_get( 'allow_url_fopen' ) ? "Yes" . "\n" : "No" . "\n"; ?>
|
409 |
PHP cURL: <?php echo is_callable('curl_init') ? "Yes" . "\n" : "No" . "\n"; ?>
|
410 |
JSON: <?php echo function_exists("json_decode") ? "Yes" . "\n" : "No" . "\n" ?>
|
|
|
411 |
|
412 |
## ACTIVE PLUGINS: ##
|
413 |
<?php
|
@@ -604,6 +605,9 @@ function cff_style_page() {
|
|
604 |
'cff_see_more_text' => 'See More',
|
605 |
'cff_see_less_text' => 'See Less',
|
606 |
'cff_facebook_link_text' => 'View on Facebook',
|
|
|
|
|
|
|
607 |
|
608 |
'cff_translate_photos_text' => 'photos',
|
609 |
|
@@ -725,6 +729,9 @@ function cff_style_page() {
|
|
725 |
$cff_facebook_link_text = $options[ 'cff_facebook_link_text' ];
|
726 |
$cff_view_link_text = $options[ 'cff_view_link_text' ];
|
727 |
$cff_link_to_timeline = $options[ 'cff_link_to_timeline' ];
|
|
|
|
|
|
|
728 |
//Meta
|
729 |
$cff_icon_style = $options[ 'cff_icon_style' ];
|
730 |
$cff_meta_text_color = $options[ 'cff_meta_text_color' ];
|
@@ -907,7 +914,8 @@ function cff_style_page() {
|
|
907 |
if (isset($_POST[ 'cff_link_url_color' ]) ) $cff_link_url_color = $_POST[ 'cff_link_url_color' ];
|
908 |
if (isset($_POST[ 'cff_link_bg_color' ]) ) $cff_link_bg_color = $_POST[ 'cff_link_bg_color' ];
|
909 |
if (isset($_POST[ 'cff_link_border_color' ]) ) $cff_link_border_color = $_POST[ 'cff_link_border_color' ];
|
910 |
-
$cff_disable_link_box = $_POST[ 'cff_disable_link_box' ];
|
|
|
911 |
|
912 |
//Event title
|
913 |
if (isset($_POST[ 'cff_event_title_format' ]) ) $cff_event_title_format = $_POST[ 'cff_event_title_format' ];
|
@@ -960,6 +968,9 @@ function cff_style_page() {
|
|
960 |
if (isset($_POST[ 'cff_link_weight' ]) ) $cff_link_weight = $_POST[ 'cff_link_weight' ];
|
961 |
if (isset($_POST[ 'cff_link_color' ]) ) $cff_link_color = $_POST[ 'cff_link_color' ];
|
962 |
if (isset($_POST[ 'cff_facebook_link_text' ]) ) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
|
|
|
|
|
|
|
963 |
if (isset($_POST[ 'cff_view_link_text' ]) ) $cff_view_link_text = $_POST[ 'cff_view_link_text' ];
|
964 |
if (isset($_POST[ 'cff_link_to_timeline' ]) ) $cff_link_to_timeline = $_POST[ 'cff_link_to_timeline' ];
|
965 |
|
@@ -1052,6 +1063,9 @@ function cff_style_page() {
|
|
1052 |
$options[ 'cff_link_weight' ] = $cff_link_weight;
|
1053 |
$options[ 'cff_link_color' ] = $cff_link_color;
|
1054 |
$options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
|
|
|
|
|
|
|
1055 |
$options[ 'cff_view_link_text' ] = $cff_view_link_text;
|
1056 |
$options[ 'cff_link_to_timeline' ] = $cff_link_to_timeline;
|
1057 |
}
|
@@ -1124,6 +1138,7 @@ function cff_style_page() {
|
|
1124 |
if (isset($_POST[ 'cff_see_more_text' ])) $cff_see_more_text = $_POST[ 'cff_see_more_text' ];
|
1125 |
if (isset($_POST[ 'cff_see_less_text' ])) $cff_see_less_text = $_POST[ 'cff_see_less_text' ];
|
1126 |
if (isset($_POST[ 'cff_facebook_link_text' ])) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
|
|
|
1127 |
|
1128 |
//Social translate
|
1129 |
if (isset($_POST[ 'cff_translate_photos_text' ])) $cff_translate_photos_text = $_POST[ 'cff_translate_photos_text' ];
|
@@ -1149,6 +1164,8 @@ function cff_style_page() {
|
|
1149 |
$options[ 'cff_see_more_text' ] = $cff_see_more_text;
|
1150 |
$options[ 'cff_see_less_text' ] = $cff_see_less_text;
|
1151 |
$options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
|
|
|
|
|
1152 |
//Social translate
|
1153 |
$options[ 'cff_translate_photos_text' ] = $cff_translate_photos_text;
|
1154 |
|
@@ -2322,7 +2339,28 @@ function cff_style_page() {
|
|
2322 |
<tr>
|
2323 |
<th><label for="cff_facebook_link_text" class="bump-left"><?php _e('Text'); ?></label></th>
|
2324 |
<td>
|
2325 |
-
<input name="cff_facebook_link_text" type="text" value="<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2326 |
</td>
|
2327 |
</tr>
|
2328 |
|
@@ -2522,29 +2560,33 @@ function cff_style_page() {
|
|
2522 |
<tr class="cff-table-header"><th colspan="3"><?php _e('Post Text'); ?></th></tr>
|
2523 |
<tr>
|
2524 |
<td><label for="cff_see_more_text" class="bump-left"><?php _e('See More'); ?></label></td>
|
2525 |
-
<td><input name="cff_see_more_text" type="text" value="<?php
|
2526 |
<td class="cff-context"><?php _e('Used when truncating the post text'); ?></td>
|
2527 |
</tr>
|
2528 |
|
2529 |
<tr>
|
2530 |
<td><label for="cff_see_less_text" class="bump-left"><?php _e('See Less'); ?></label></td>
|
2531 |
-
<td><input name="cff_see_less_text" type="text" value="<?php
|
2532 |
<td class="cff-context"><?php _e('Used when truncating the post text'); ?></td>
|
2533 |
</tr>
|
2534 |
|
|
|
2535 |
<tr>
|
2536 |
-
<td><label for="
|
2537 |
-
<td><input name="
|
2538 |
-
<td class="cff-context"><?php _e('
|
2539 |
</tr>
|
2540 |
-
|
2541 |
-
<tr class="cff-table-header"><th colspan="3"><?php _e('Link to Facebook'); ?></th></tr>
|
2542 |
<tr>
|
2543 |
-
<td><label for="
|
2544 |
-
<td><input name="
|
2545 |
-
<td class="cff-context"><?php _e('
|
2546 |
</tr>
|
2547 |
|
|
|
|
|
|
|
|
|
|
|
2548 |
|
2549 |
<tr class="cff-table-header"><th colspan="3"><?php _e('Date'); ?></th></tr>
|
2550 |
<tr>
|
@@ -2552,49 +2594,49 @@ function cff_style_page() {
|
|
2552 |
<td class="cff-translate-date">
|
2553 |
|
2554 |
<label for="cff_translate_second"><?php _e("second"); ?></label>
|
2555 |
-
<input name="cff_translate_second" type="text" value="<?php
|
2556 |
<br />
|
2557 |
<label for="cff_translate_seconds"><?php _e("seconds"); ?></label>
|
2558 |
-
<input name="cff_translate_seconds" type="text" value="<?php
|
2559 |
<br />
|
2560 |
<label for="cff_translate_minute"><?php _e("minute"); ?></label>
|
2561 |
-
<input name="cff_translate_minute" type="text" value="<?php
|
2562 |
<br />
|
2563 |
<label for="cff_translate_minutes"><?php _e("minutes"); ?></label>
|
2564 |
-
<input name="cff_translate_minutes" type="text" value="<?php
|
2565 |
<br />
|
2566 |
<label for="cff_translate_hour"><?php _e("hour"); ?></label>
|
2567 |
-
<input name="cff_translate_hour" type="text" value="<?php
|
2568 |
<br />
|
2569 |
<label for="cff_translate_hours"><?php _e("hours"); ?></label>
|
2570 |
-
<input name="cff_translate_hours" type="text" value="<?php
|
2571 |
<br />
|
2572 |
<label for="cff_translate_day"><?php _e("day"); ?></label>
|
2573 |
-
<input name="cff_translate_day" type="text" value="<?php
|
2574 |
<br />
|
2575 |
<label for="cff_translate_days"><?php _e("days"); ?></label>
|
2576 |
-
<input name="cff_translate_days" type="text" value="<?php
|
2577 |
<br />
|
2578 |
<label for="cff_translate_week"><?php _e("week"); ?></label>
|
2579 |
-
<input name="cff_translate_week" type="text" value="<?php
|
2580 |
<br />
|
2581 |
<label for="cff_translate_weeks"><?php _e("weeks"); ?></label>
|
2582 |
-
<input name="cff_translate_weeks" type="text" value="<?php
|
2583 |
<br />
|
2584 |
<label for="cff_translate_month"><?php _e("month"); ?></label>
|
2585 |
-
<input name="cff_translate_month" type="text" value="<?php
|
2586 |
<br />
|
2587 |
<label for="cff_translate_months"><?php _e("months"); ?></label>
|
2588 |
-
<input name="cff_translate_months" type="text" value="<?php
|
2589 |
<br />
|
2590 |
<label for="cff_translate_year"><?php _e("year"); ?></label>
|
2591 |
-
<input name="cff_translate_year" type="text" value="<?php
|
2592 |
<br />
|
2593 |
<label for="cff_translate_years"><?php _e("years"); ?></label>
|
2594 |
-
<input name="cff_translate_years" type="text" value="<?php
|
2595 |
<br />
|
2596 |
<label for="cff_translate_ago"><?php _e("ago"); ?></label>
|
2597 |
-
<input name="cff_translate_ago" type="text" value="<?php
|
2598 |
</td>
|
2599 |
<td class="cff-context"><?php _e('Used to translate the "Posted _ days ago" date text'); ?></td>
|
2600 |
</tr>
|
147 |
</tr>
|
148 |
|
149 |
<tr valign="top">
|
150 |
+
<th scope="row" style="padding-bottom: 10px;"><?php _e('Enter my own Access Token <i style="font-weight: normal; font-size: 12px;">This is Recommended</i>'); ?></th>
|
151 |
<td>
|
152 |
<input name="cff_show_access_token" type="checkbox" id="cff_show_access_token" <?php if($show_access_token_val == true) echo "checked"; ?> /> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("What is this?"); ?></a>
|
153 |
+
<p class="cff-tooltip cff-more-info"><?php _e("A Facebook Access Token is not required to use this plugin, but we recommend it so that you're not reliant on the token built into the plugin. If you have your own token then you can check this box and enter it here. To get your own Access Token you can follow these <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>"); ?>.</p>
|
154 |
</td>
|
155 |
</tr>
|
156 |
|
408 |
PHP allow_url_fopen: <?php echo ini_get( 'allow_url_fopen' ) ? "Yes" . "\n" : "No" . "\n"; ?>
|
409 |
PHP cURL: <?php echo is_callable('curl_init') ? "Yes" . "\n" : "No" . "\n"; ?>
|
410 |
JSON: <?php echo function_exists("json_decode") ? "Yes" . "\n" : "No" . "\n" ?>
|
411 |
+
SSL Stream: <?php echo in_array('https', stream_get_wrappers()) ? "Yes" . "\n" : "No" . "\n" ?>
|
412 |
|
413 |
## ACTIVE PLUGINS: ##
|
414 |
<?php
|
605 |
'cff_see_more_text' => 'See More',
|
606 |
'cff_see_less_text' => 'See Less',
|
607 |
'cff_facebook_link_text' => 'View on Facebook',
|
608 |
+
'cff_facebook_share_text' => 'Share',
|
609 |
+
'cff_show_facebook_link' => true,
|
610 |
+
'cff_show_facebook_share' => true,
|
611 |
|
612 |
'cff_translate_photos_text' => 'photos',
|
613 |
|
729 |
$cff_facebook_link_text = $options[ 'cff_facebook_link_text' ];
|
730 |
$cff_view_link_text = $options[ 'cff_view_link_text' ];
|
731 |
$cff_link_to_timeline = $options[ 'cff_link_to_timeline' ];
|
732 |
+
$cff_facebook_share_text = $options[ 'cff_facebook_share_text' ];
|
733 |
+
$cff_show_facebook_link = $options[ 'cff_show_facebook_link' ];
|
734 |
+
$cff_show_facebook_share = $options[ 'cff_show_facebook_share' ];
|
735 |
//Meta
|
736 |
$cff_icon_style = $options[ 'cff_icon_style' ];
|
737 |
$cff_meta_text_color = $options[ 'cff_meta_text_color' ];
|
914 |
if (isset($_POST[ 'cff_link_url_color' ]) ) $cff_link_url_color = $_POST[ 'cff_link_url_color' ];
|
915 |
if (isset($_POST[ 'cff_link_bg_color' ]) ) $cff_link_bg_color = $_POST[ 'cff_link_bg_color' ];
|
916 |
if (isset($_POST[ 'cff_link_border_color' ]) ) $cff_link_border_color = $_POST[ 'cff_link_border_color' ];
|
917 |
+
(isset($_POST[ 'cff_disable_link_box' ]) ) ? $cff_disable_link_box = $_POST[ 'cff_disable_link_box' ] : $cff_disable_link_box = '';
|
918 |
+
|
919 |
|
920 |
//Event title
|
921 |
if (isset($_POST[ 'cff_event_title_format' ]) ) $cff_event_title_format = $_POST[ 'cff_event_title_format' ];
|
968 |
if (isset($_POST[ 'cff_link_weight' ]) ) $cff_link_weight = $_POST[ 'cff_link_weight' ];
|
969 |
if (isset($_POST[ 'cff_link_color' ]) ) $cff_link_color = $_POST[ 'cff_link_color' ];
|
970 |
if (isset($_POST[ 'cff_facebook_link_text' ]) ) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
|
971 |
+
if (isset($_POST[ 'cff_facebook_share_text' ]) ) $cff_facebook_share_text = $_POST[ 'cff_facebook_share_text' ];
|
972 |
+
(isset($_POST[ 'cff_show_facebook_link' ]) ) ? $cff_show_facebook_link = $_POST[ 'cff_show_facebook_link' ] : $cff_show_facebook_link = '';
|
973 |
+
(isset($_POST[ 'cff_show_facebook_share' ]) ) ? $cff_show_facebook_share = $_POST[ 'cff_show_facebook_share' ] : $cff_show_facebook_share = '';
|
974 |
if (isset($_POST[ 'cff_view_link_text' ]) ) $cff_view_link_text = $_POST[ 'cff_view_link_text' ];
|
975 |
if (isset($_POST[ 'cff_link_to_timeline' ]) ) $cff_link_to_timeline = $_POST[ 'cff_link_to_timeline' ];
|
976 |
|
1063 |
$options[ 'cff_link_weight' ] = $cff_link_weight;
|
1064 |
$options[ 'cff_link_color' ] = $cff_link_color;
|
1065 |
$options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
|
1066 |
+
$options[ 'cff_facebook_share_text' ] = $cff_facebook_share_text;
|
1067 |
+
$options[ 'cff_show_facebook_link' ] = $cff_show_facebook_link;
|
1068 |
+
$options[ 'cff_show_facebook_share' ] = $cff_show_facebook_share;
|
1069 |
$options[ 'cff_view_link_text' ] = $cff_view_link_text;
|
1070 |
$options[ 'cff_link_to_timeline' ] = $cff_link_to_timeline;
|
1071 |
}
|
1138 |
if (isset($_POST[ 'cff_see_more_text' ])) $cff_see_more_text = $_POST[ 'cff_see_more_text' ];
|
1139 |
if (isset($_POST[ 'cff_see_less_text' ])) $cff_see_less_text = $_POST[ 'cff_see_less_text' ];
|
1140 |
if (isset($_POST[ 'cff_facebook_link_text' ])) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
|
1141 |
+
if (isset($_POST[ 'cff_facebook_share_text' ])) $cff_facebook_share_text = $_POST[ 'cff_facebook_share_text' ];
|
1142 |
|
1143 |
//Social translate
|
1144 |
if (isset($_POST[ 'cff_translate_photos_text' ])) $cff_translate_photos_text = $_POST[ 'cff_translate_photos_text' ];
|
1164 |
$options[ 'cff_see_more_text' ] = $cff_see_more_text;
|
1165 |
$options[ 'cff_see_less_text' ] = $cff_see_less_text;
|
1166 |
$options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
|
1167 |
+
$options[ 'cff_facebook_share_text' ] = $cff_facebook_share_text;
|
1168 |
+
|
1169 |
//Social translate
|
1170 |
$options[ 'cff_translate_photos_text' ] = $cff_translate_photos_text;
|
1171 |
|
2339 |
<tr>
|
2340 |
<th><label for="cff_facebook_link_text" class="bump-left"><?php _e('Text'); ?></label></th>
|
2341 |
<td>
|
2342 |
+
<input name="cff_facebook_link_text" type="text" value="<?php echo stripslashes( esc_attr( $cff_facebook_link_text ) ); ?>" size="25" />
|
2343 |
+
</td>
|
2344 |
+
</tr>
|
2345 |
+
|
2346 |
+
<tr>
|
2347 |
+
<th><label for="cff_facebook_share_text" class="bump-left"><?php _e('"Share" Text'); ?></label></th>
|
2348 |
+
<td>
|
2349 |
+
<input name="cff_facebook_share_text" type="text" value="<?php echo stripslashes( esc_attr( $cff_facebook_share_text ) ); ?>" size="25" />
|
2350 |
+
</td>
|
2351 |
+
</tr>
|
2352 |
+
|
2353 |
+
<tr>
|
2354 |
+
<th><label for="cff_show_facebook_link" class="bump-left"><?php _e('Show "View on Facebook" link'); ?></label></th>
|
2355 |
+
<td>
|
2356 |
+
<input type="checkbox" name="cff_show_facebook_link" id="cff_show_facebook_link" <?php if($cff_show_facebook_link == true) echo 'checked="checked"' ?> /> <?php _e('Yes'); ?>
|
2357 |
+
</td>
|
2358 |
+
</tr>
|
2359 |
+
|
2360 |
+
<tr>
|
2361 |
+
<th><label for="cff_show_facebook_share" class="bump-left"><?php _e('Show "Share" link'); ?></label></th>
|
2362 |
+
<td>
|
2363 |
+
<input type="checkbox" name="cff_show_facebook_share" id="cff_show_facebook_share" <?php if($cff_show_facebook_share == true) echo 'checked="checked"' ?> /> <?php _e('Yes'); ?>
|
2364 |
</td>
|
2365 |
</tr>
|
2366 |
|
2560 |
<tr class="cff-table-header"><th colspan="3"><?php _e('Post Text'); ?></th></tr>
|
2561 |
<tr>
|
2562 |
<td><label for="cff_see_more_text" class="bump-left"><?php _e('See More'); ?></label></td>
|
2563 |
+
<td><input name="cff_see_more_text" type="text" value="<?php echo stripslashes( esc_attr( $cff_see_more_text ) ); ?>" /></td>
|
2564 |
<td class="cff-context"><?php _e('Used when truncating the post text'); ?></td>
|
2565 |
</tr>
|
2566 |
|
2567 |
<tr>
|
2568 |
<td><label for="cff_see_less_text" class="bump-left"><?php _e('See Less'); ?></label></td>
|
2569 |
+
<td><input name="cff_see_less_text" type="text" value="<?php echo stripslashes( esc_attr( $cff_see_less_text ) ); ?>" /></td>
|
2570 |
<td class="cff-context"><?php _e('Used when truncating the post text'); ?></td>
|
2571 |
</tr>
|
2572 |
|
2573 |
+
<tr class="cff-table-header"><th colspan="3"><?php _e('Post Action Links'); ?></th></tr>
|
2574 |
<tr>
|
2575 |
+
<td><label for="cff_facebook_link_text" class="bump-left"><?php _e('View on Facebook'); ?></label></td>
|
2576 |
+
<td><input name="cff_facebook_link_text" type="text" value="<?php echo stripslashes( esc_attr( $cff_facebook_link_text ) ); ?>" /></td>
|
2577 |
+
<td class="cff-context"><?php _e('Used for the link to the post on Facebook'); ?></td>
|
2578 |
</tr>
|
|
|
|
|
2579 |
<tr>
|
2580 |
+
<td><label for="cff_facebook_share_text" class="bump-left"><?php _e('Share'); ?></label></td>
|
2581 |
+
<td><input name="cff_facebook_share_text" type="text" value="<?php echo stripslashes( esc_attr( $cff_facebook_share_text ) ); ?>" /></td>
|
2582 |
+
<td class="cff-context"><?php _e('Used for sharing the Facebook post via Social Media'); ?></td>
|
2583 |
</tr>
|
2584 |
|
2585 |
+
<tr>
|
2586 |
+
<td><label for="cff_translate_photos_text" class="bump-left"><?php _e('photos'); ?></label></td>
|
2587 |
+
<td><input name="cff_translate_photos_text" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_photos_text ) ); ?>" /></td>
|
2588 |
+
<td class="cff-context"><?php _e('Added to the end of an album name. Eg. (6 photos)'); ?></td>
|
2589 |
+
</tr>
|
2590 |
|
2591 |
<tr class="cff-table-header"><th colspan="3"><?php _e('Date'); ?></th></tr>
|
2592 |
<tr>
|
2594 |
<td class="cff-translate-date">
|
2595 |
|
2596 |
<label for="cff_translate_second"><?php _e("second"); ?></label>
|
2597 |
+
<input name="cff_translate_second" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_second ) ); ?>" size="20" />
|
2598 |
<br />
|
2599 |
<label for="cff_translate_seconds"><?php _e("seconds"); ?></label>
|
2600 |
+
<input name="cff_translate_seconds" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_seconds ) ); ?>" size="20" />
|
2601 |
<br />
|
2602 |
<label for="cff_translate_minute"><?php _e("minute"); ?></label>
|
2603 |
+
<input name="cff_translate_minute" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_minute ) ); ?>" size="20" />
|
2604 |
<br />
|
2605 |
<label for="cff_translate_minutes"><?php _e("minutes"); ?></label>
|
2606 |
+
<input name="cff_translate_minutes" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_minutes ) ); ?>" size="20" />
|
2607 |
<br />
|
2608 |
<label for="cff_translate_hour"><?php _e("hour"); ?></label>
|
2609 |
+
<input name="cff_translate_hour" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_hour ) ); ?>" size="20" />
|
2610 |
<br />
|
2611 |
<label for="cff_translate_hours"><?php _e("hours"); ?></label>
|
2612 |
+
<input name="cff_translate_hours" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_hours ) ); ?>" size="20" />
|
2613 |
<br />
|
2614 |
<label for="cff_translate_day"><?php _e("day"); ?></label>
|
2615 |
+
<input name="cff_translate_day" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_day ) ); ?>" size="20" />
|
2616 |
<br />
|
2617 |
<label for="cff_translate_days"><?php _e("days"); ?></label>
|
2618 |
+
<input name="cff_translate_days" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_days ) ); ?>" size="20" />
|
2619 |
<br />
|
2620 |
<label for="cff_translate_week"><?php _e("week"); ?></label>
|
2621 |
+
<input name="cff_translate_week" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_week ) ); ?>" size="20" />
|
2622 |
<br />
|
2623 |
<label for="cff_translate_weeks"><?php _e("weeks"); ?></label>
|
2624 |
+
<input name="cff_translate_weeks" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_weeks ) ); ?>" size="20" />
|
2625 |
<br />
|
2626 |
<label for="cff_translate_month"><?php _e("month"); ?></label>
|
2627 |
+
<input name="cff_translate_month" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_month ) ); ?>" size="20" />
|
2628 |
<br />
|
2629 |
<label for="cff_translate_months"><?php _e("months"); ?></label>
|
2630 |
+
<input name="cff_translate_months" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_months ) ); ?>" size="20" />
|
2631 |
<br />
|
2632 |
<label for="cff_translate_year"><?php _e("year"); ?></label>
|
2633 |
+
<input name="cff_translate_year" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_year ) ); ?>" size="20" />
|
2634 |
<br />
|
2635 |
<label for="cff_translate_years"><?php _e("years"); ?></label>
|
2636 |
+
<input name="cff_translate_years" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_years ) ); ?>" size="20" />
|
2637 |
<br />
|
2638 |
<label for="cff_translate_ago"><?php _e("ago"); ?></label>
|
2639 |
+
<input name="cff_translate_ago" type="text" value="<?php echo stripslashes( esc_attr( $cff_translate_ago ) ); ?>" size="20" />
|
2640 |
</td>
|
2641 |
<td class="cff-context"><?php _e('Used to translate the "Posted _ days ago" date text'); ?></td>
|
2642 |
</tr>
|
custom-facebook-feed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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.
|
7 |
Author: Smash Balloon
|
8 |
Author URI: http://smashballoon.com/
|
9 |
License: GPLv2 or later
|
@@ -167,10 +167,15 @@ function display_cff($atts) {
|
|
167 |
'sepsize' => isset($options[ 'cff_sep_size' ]) ? $options[ 'cff_sep_size' ] : '',
|
168 |
|
169 |
//Translate
|
170 |
-
'seemoretext' => isset($options[ 'cff_see_more_text' ]) ? $options[ 'cff_see_more_text' ] : '',
|
171 |
-
'seelesstext' => isset($options[ 'cff_see_less_text' ]) ? $options[ 'cff_see_less_text' ] : '',
|
172 |
-
'
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
174 |
), $atts);
|
175 |
|
176 |
/********** GENERAL **********/
|
@@ -193,6 +198,14 @@ function display_cff($atts) {
|
|
193 |
if ( empty($cff_locale) || !isset($cff_locale) || $cff_locale == '' ) $cff_locale = 'en_US';
|
194 |
if (!isset($cff_cache_time)) $cff_cache_time = 0;
|
195 |
$cff_cache_time_unit = $atts[ 'cacheunit' ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
$cff_class = $atts['class'];
|
197 |
//Compile feed styles
|
198 |
$cff_feed_styles = 'style="';
|
@@ -296,6 +309,8 @@ function display_cff($atts) {
|
|
296 |
$cff_title_styles .= '"';
|
297 |
$cff_title_link = $atts[ 'textlink' ];
|
298 |
|
|
|
|
|
299 |
( $cff_title_link == 'on' || $cff_title_link == 'true' || $cff_title_link == true ) ? $cff_title_link = true : $cff_title_link = false;
|
300 |
if( $atts[ 'textlink' ] == 'false' ) $cff_title_link = false;
|
301 |
|
@@ -321,7 +336,7 @@ function display_cff($atts) {
|
|
321 |
$cff_link_title_format = $atts[ 'linktitleformat' ];
|
322 |
if (empty($cff_link_title_format)) $cff_link_title_format = 'p';
|
323 |
$cff_link_title_size = $atts[ 'linktitlesize' ];
|
324 |
-
$cff_link_title_color = $atts[ 'linktitlecolor' ];
|
325 |
$cff_link_url_color = $atts[ 'linkurlcolor' ];
|
326 |
|
327 |
$cff_link_title_styles = 'style="';
|
@@ -399,7 +414,24 @@ function display_cff($atts) {
|
|
399 |
if ( !empty($cff_link_weight) && $cff_link_weight != 'inherit' ) $cff_link_styles .= 'font-weight:' . $cff_link_weight . '; ';
|
400 |
if ( !empty($cff_link_color) ) $cff_link_styles .= 'color:#' . str_replace('#', '', $cff_link_color) . ';';
|
401 |
$cff_link_styles .= '"';
|
|
|
|
|
402 |
$cff_facebook_link_text = $atts[ 'facebooklinktext' ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
$cff_view_link_text = $atts[ 'viewlinktext' ];
|
404 |
$cff_link_to_timeline = $atts[ 'linktotimeline' ];
|
405 |
/********** MISC **********/
|
@@ -471,7 +503,7 @@ function display_cff($atts) {
|
|
471 |
$cff_sep_color = 'fff';
|
472 |
}
|
473 |
|
474 |
-
$cff_post_bg_color = $atts['postbgcolor'];
|
475 |
$cff_post_rounded = $atts['postcorners'];
|
476 |
($cff_post_bg_color !== '#' && $cff_post_bg_color !== '') ? $cff_post_bg_color_check = true : $cff_post_bg_color_check = false;
|
477 |
($cff_sep_color !== '#' && $cff_sep_color !== '') ? $cff_sep_color_check = true : $cff_sep_color_check = false;
|
@@ -481,7 +513,7 @@ function display_cff($atts) {
|
|
481 |
if( $cff_sep_color_check || $cff_post_bg_color_check ){
|
482 |
$cff_item_styles = 'style="';
|
483 |
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) . '; ';
|
484 |
-
if($cff_post_bg_color_check) $cff_item_styles .= 'background-color: ' . $cff_post_bg_color . '; ';
|
485 |
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; ';
|
486 |
$cff_item_styles .= '"';
|
487 |
}
|
@@ -516,17 +548,18 @@ function display_cff($atts) {
|
|
516 |
//If the 'Enter my own Access Token' box is unchecked then don't use the user's access token, even if there's one in the field
|
517 |
get_option('cff_show_access_token') ? $cff_show_access_token = true : $cff_show_access_token = false;
|
518 |
|
519 |
-
//If there's no Access Token then use
|
520 |
-
// if ($access_token == '' || !$cff_show_access_token) $access_token = '1436737606570258|MGh1BX4_b_D9HzJtKe702cwMRPI';
|
521 |
$access_token_array = array(
|
522 |
'1489500477999288|KFys5ppNi3sreihdreqPkU2ChIE',
|
523 |
'859332767418162|BR-YU8zjzvonNrszlll_1a4y_xE',
|
524 |
'360558880785446|4jyruti_VkxxK7gS7JeyX-EuSXs',
|
525 |
'1487072591579718|0KQzP-O2E4mvFCPxTLWP1b87I4Q',
|
526 |
-
'640861236031365|2rENQzxtWtG12DtlZwqfZ6Vu6BE'
|
|
|
|
|
|
|
527 |
);
|
528 |
-
if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0,
|
529 |
-
|
530 |
|
531 |
|
532 |
//Check whether a Page ID has been defined
|
@@ -645,7 +678,7 @@ function display_cff($atts) {
|
|
645 |
|
646 |
//Create CFF container HTML
|
647 |
$cff_content .= '<div class="cff-wrapper">';
|
648 |
-
$cff_content .= '<div id="cff"
|
649 |
if( !empty($cff_class) ) $cff_content .= $cff_class . ' ';
|
650 |
if ( !empty($cff_feed_height) ) $cff_content .= 'cff-fixed-height ';
|
651 |
$cff_content .= '" ' . $cff_feed_styles . '>';
|
@@ -869,7 +902,7 @@ function display_cff($atts) {
|
|
869 |
$cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
|
870 |
|
871 |
//Start HTML for post text
|
872 |
-
$cff_post_text .= '<span class="cff-text"
|
873 |
if ($cff_title_link) $cff_post_text .= '<a class="cff-post-text-link" '.$cff_title_styles.' href="'.$link.'" '.$target.'>';
|
874 |
|
875 |
//Which content should we use?
|
@@ -922,7 +955,7 @@ function display_cff($atts) {
|
|
922 |
//Loop through the tags
|
923 |
foreach($text_tags as $message_tag ) {
|
924 |
$tag_name = $message_tag[0]->name;
|
925 |
-
$tag_link = '<a href="http://facebook.com/' . $message_tag[0]->id . '" style="color: #'.
|
926 |
|
927 |
$post_text = str_replace($tag_name, $tag_link, $post_text);
|
928 |
}
|
@@ -949,7 +982,7 @@ function display_cff($atts) {
|
|
949 |
|
950 |
for($i = count($message_tags_arr); $i >= 1; $i--) {
|
951 |
|
952 |
-
$b = '<a href="http://facebook.com/' . $message_tags_arr[$i]['id'] . '" style="color: #'.
|
953 |
$c = $message_tags_arr[$i]['offset'];
|
954 |
$d = $message_tags_arr[$i]['length'];
|
955 |
|
@@ -972,13 +1005,13 @@ function display_cff($atts) {
|
|
972 |
$cff_post_text .= cff_wrap_span( $post_text ) . ' ';
|
973 |
} else {
|
974 |
//Don't use htmlspecialchars for post_text as it's added above so that it doesn't mess up the message_tag offsets
|
975 |
-
$cff_post_text .= cff_autolink( $post_text
|
976 |
}
|
977 |
|
978 |
if ($cff_title_link) $cff_post_text .= '</a>';
|
979 |
$cff_post_text .= '</span>';
|
980 |
//'See More' link
|
981 |
-
$cff_post_text .= '<span class="cff-expand">... <a href="#" style="color: #'.
|
982 |
$cff_post_text .= '</' . $cff_title_format . '>';
|
983 |
|
984 |
//DESCRIPTION
|
@@ -996,7 +1029,7 @@ function display_cff($atts) {
|
|
996 |
if (!empty($body_limit)) {
|
997 |
if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
|
998 |
}
|
999 |
-
$cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_autolink( htmlspecialchars($description_text), $link_color
|
1000 |
|
1001 |
//If the post text and description/caption are the same then don't show the description
|
1002 |
if($post_text == $description_text) $cff_description = '';
|
@@ -1017,7 +1050,7 @@ function display_cff($atts) {
|
|
1017 |
$cff_shared_link .= '<div class="cff-text-link ';
|
1018 |
$cff_shared_link .= 'cff-no-image';
|
1019 |
//The link title:
|
1020 |
-
$cff_shared_link .= '"><'.$cff_link_title_format.' class="cff-link-title" '.$cff_link_title_styles.'><a href="'.$link.'" '.$target.' style="color:#' .
|
1021 |
//The link source:
|
1022 |
(!empty($news->caption)) ? $cff_link_caption = $news->caption : $cff_link_caption = '';
|
1023 |
if(!empty($cff_link_caption)) $cff_shared_link .= '<p class="cff-link-caption" style="color:#' . str_replace('#', '', $cff_link_url_color) . ';">'.$cff_link_caption.'</p>';
|
@@ -1140,7 +1173,7 @@ function display_cff($atts) {
|
|
1140 |
if(!$cff_disable_link_box) $cff_description .= '" ' . $cff_link_box_styles;
|
1141 |
$cff_description .= '>';
|
1142 |
|
1143 |
-
if( isset($news->name) ) $cff_description .= '<'.$cff_link_title_format.' class="cff-link-title" '.$cff_link_title_styles.'><a href="'.$link.'" '.$target.' style="color:#' .
|
1144 |
|
1145 |
if (!empty($body_limit)) {
|
1146 |
if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
|
@@ -1149,7 +1182,7 @@ function display_cff($atts) {
|
|
1149 |
$cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_autolink( htmlspecialchars($description_text) ) . '</span></p></div>';
|
1150 |
} else {
|
1151 |
isset($news->name) ? $video_name = $news->name : $video_name = $link;
|
1152 |
-
if( isset($news->name) ) $cff_description .= '<'.$cff_link_title_format.' class="cff-link-title" '.$cff_link_title_styles.'><a href="'.$link.'" '.$target.' style="color:#' .
|
1153 |
}
|
1154 |
}
|
1155 |
|
@@ -1164,8 +1197,35 @@ function display_cff($atts) {
|
|
1164 |
//Link to the Facebook post if it's a link or a video
|
1165 |
if($cff_post_type == 'link' || $cff_post_type == 'video') $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
|
1166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1167 |
if ($cff_post_type == 'offer') $link_text = 'View Offer';
|
1168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1169 |
|
1170 |
|
1171 |
//**************************//
|
@@ -1243,7 +1303,7 @@ function display_cff($atts) {
|
|
1243 |
$cff_show_credit = $atts['credit'];
|
1244 |
($cff_show_credit == 'true' || $cff_show_credit == 'on') ? $cff_show_credit = true : $cff_show_credit = false;
|
1245 |
|
1246 |
-
if($cff_show_credit) $cff_content .= '<p class="cff-credit"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank" style="color: #'.$link_color=
|
1247 |
//End the feed
|
1248 |
$cff_content .= '</div><div class="cff-clear"></div>';
|
1249 |
//Add the Like Box outside
|
@@ -1263,6 +1323,8 @@ function display_cff($atts) {
|
|
1263 |
|
1264 |
$cff_content .= '</div>';
|
1265 |
|
|
|
|
|
1266 |
//Return our feed HTML to display
|
1267 |
return $cff_content;
|
1268 |
}
|
@@ -1278,6 +1340,7 @@ function cff_fetchUrl($url){
|
|
1278 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
1279 |
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
|
1280 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
1281 |
$feedData = curl_exec($ch);
|
1282 |
curl_close($ch);
|
1283 |
//If not then use file_get_contents
|
@@ -1285,10 +1348,15 @@ function cff_fetchUrl($url){
|
|
1285 |
$feedData = @file_get_contents($url);
|
1286 |
//Or else use the WP HTTP API
|
1287 |
} else {
|
1288 |
-
if( !class_exists( 'WP_Http' ) ) include_once( ABSPATH . WPINC. '/class-http.php' );
|
1289 |
$request = new WP_Http;
|
1290 |
-
$
|
1291 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
1292 |
}
|
1293 |
|
1294 |
return $feedData;
|
@@ -1382,49 +1450,49 @@ function cff_getdate($original, $date_format, $custom_date) {
|
|
1382 |
|
1383 |
$options = get_option('cff_style_settings');
|
1384 |
|
1385 |
-
$cff_second = isset($options['cff_translate_second']) ? $options['cff_translate_second'] : '';
|
1386 |
if ( empty($cff_second) ) $cff_second = 'second';
|
1387 |
|
1388 |
-
$cff_seconds = isset($options['cff_translate_seconds']) ? $options['cff_translate_seconds'] : '';
|
1389 |
if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
|
1390 |
|
1391 |
-
$cff_minute = isset($options['cff_translate_minute']) ? $options['cff_translate_minute'] : '';
|
1392 |
if ( empty($cff_minute) ) $cff_minute = 'minute';
|
1393 |
|
1394 |
-
$cff_minutes = isset($options['cff_translate_minutes']) ? $options['cff_translate_minutes'] : '';
|
1395 |
if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
|
1396 |
|
1397 |
-
$cff_hour = isset($options['cff_translate_hour']) ? $options['cff_translate_hour'] : '';
|
1398 |
if ( empty($cff_hour) ) $cff_hour = 'hour';
|
1399 |
|
1400 |
-
$cff_hours = isset($options['cff_translate_hours']) ? $options['cff_translate_hours'] : '';
|
1401 |
if ( empty($cff_hours) ) $cff_hours = 'hours';
|
1402 |
|
1403 |
-
$cff_day = isset($options['cff_translate_day']) ? $options['cff_translate_day'] : '';
|
1404 |
if ( empty($cff_day) ) $cff_day = 'day';
|
1405 |
|
1406 |
-
$cff_days = isset($options['cff_translate_days']) ? $options['cff_translate_days'] : '';
|
1407 |
if ( empty($cff_days) ) $cff_days = 'days';
|
1408 |
|
1409 |
-
$cff_week = isset($options['cff_translate_week']) ? $options['cff_translate_week'] : '';
|
1410 |
if ( empty($cff_week) ) $cff_week = 'week';
|
1411 |
|
1412 |
-
$cff_weeks = isset($options['cff_translate_weeks']) ? $options['cff_translate_weeks'] : '';
|
1413 |
if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
|
1414 |
|
1415 |
-
$cff_month = isset($options['cff_translate_month']) ? $options['cff_translate_month'] : '';
|
1416 |
if ( empty($cff_month) ) $cff_month = 'month';
|
1417 |
|
1418 |
-
$cff_months = isset($options['cff_translate_months']) ? $options['cff_translate_months'] : '';
|
1419 |
if ( empty($cff_months) ) $cff_months = 'months';
|
1420 |
|
1421 |
-
$cff_year = isset($options['cff_translate_year']) ? $options['cff_translate_year'] : '';
|
1422 |
if ( empty($cff_year) ) $cff_year = 'year';
|
1423 |
|
1424 |
-
$cff_years = isset($options['cff_translate_years']) ? $options['cff_translate_years'] : '';
|
1425 |
if ( empty($cff_years) ) $cff_years = 'years';
|
1426 |
|
1427 |
-
$cff_ago = isset($options['cff_translate_ago']) ? $options['cff_translate_ago'] : '';
|
1428 |
if ( empty($cff_ago) ) $cff_ago = 'ago';
|
1429 |
|
1430 |
|
@@ -1515,49 +1583,49 @@ function cff_timesince($original) {
|
|
1515 |
|
1516 |
$options = get_option('cff_style_settings');
|
1517 |
|
1518 |
-
$cff_second = isset($options['cff_translate_second']) ? $options['cff_translate_second'] : '';
|
1519 |
if ( empty($cff_second) ) $cff_second = 'second';
|
1520 |
|
1521 |
-
$cff_seconds = isset($options['cff_translate_seconds']) ? $options['cff_translate_seconds'] : '';
|
1522 |
if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
|
1523 |
|
1524 |
-
$cff_minute = isset($options['cff_translate_minute']) ? $options['cff_translate_minute'] : '';
|
1525 |
if ( empty($cff_minute) ) $cff_minute = 'minute';
|
1526 |
|
1527 |
-
$cff_minutes = isset($options['cff_translate_minutes']) ? $options['cff_translate_minutes'] : '';
|
1528 |
if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
|
1529 |
|
1530 |
-
$cff_hour = isset($options['cff_translate_hour']) ? $options['cff_translate_hour'] : '';
|
1531 |
if ( empty($cff_hour) ) $cff_hour = 'hour';
|
1532 |
|
1533 |
-
$cff_hours = isset($options['cff_translate_hours']) ? $options['cff_translate_hours'] : '';
|
1534 |
if ( empty($cff_hours) ) $cff_hours = 'hours';
|
1535 |
|
1536 |
-
$cff_day = isset($options['cff_translate_day']) ? $options['cff_translate_day'] : '';
|
1537 |
if ( empty($cff_day) ) $cff_day = 'day';
|
1538 |
|
1539 |
-
$cff_days = isset($options['cff_translate_days']) ? $options['cff_translate_days'] : '';
|
1540 |
if ( empty($cff_days) ) $cff_days = 'days';
|
1541 |
|
1542 |
-
$cff_week = isset($options['cff_translate_week']) ? $options['cff_translate_week'] : '';
|
1543 |
if ( empty($cff_week) ) $cff_week = 'week';
|
1544 |
|
1545 |
-
$cff_weeks = isset($options['cff_translate_weeks']) ? $options['cff_translate_weeks'] : '';
|
1546 |
if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
|
1547 |
|
1548 |
-
$cff_month = isset($options['cff_translate_month']) ? $options['cff_translate_month'] : '';
|
1549 |
if ( empty($cff_month) ) $cff_month = 'month';
|
1550 |
|
1551 |
-
$cff_months = isset($options['cff_translate_months']) ? $options['cff_translate_months'] : '';
|
1552 |
if ( empty($cff_months) ) $cff_months = 'months';
|
1553 |
|
1554 |
-
$cff_year = isset($options['cff_translate_year']) ? $options['cff_translate_year'] : '';
|
1555 |
if ( empty($cff_year) ) $cff_year = 'year';
|
1556 |
|
1557 |
-
$cff_years = isset($options['cff_translate_years']) ? $options['cff_translate_years'] : '';
|
1558 |
if ( empty($cff_years) ) $cff_years = 'years';
|
1559 |
|
1560 |
-
$cff_ago = isset($options['cff_translate_ago']) ? $options['cff_translate_ago'] : '';
|
1561 |
if ( empty($cff_ago) ) $cff_ago = 'ago';
|
1562 |
|
1563 |
|
@@ -1659,7 +1727,7 @@ function cff_add_my_stylesheet() {
|
|
1659 |
// Respects SSL, Style.css is relative to the current file
|
1660 |
wp_register_style( 'cff', plugins_url('css/cff-style.css?10', __FILE__) );
|
1661 |
wp_enqueue_style( 'cff' );
|
1662 |
-
wp_enqueue_style( 'cff-font-awesome', '//
|
1663 |
}
|
1664 |
//Enqueue scripts
|
1665 |
add_action( 'wp_enqueue_scripts', 'cff_scripts_method' );
|
@@ -1688,6 +1756,8 @@ function cff_activate() {
|
|
1688 |
$options[ 'cff_show_meta' ] = true;
|
1689 |
$options[ 'cff_show_link' ] = true;
|
1690 |
$options[ 'cff_show_like_box' ] = true;
|
|
|
|
|
1691 |
update_option( 'cff_style_settings', $options );
|
1692 |
|
1693 |
get_option('cff_show_access_token');
|
@@ -1711,8 +1781,8 @@ function cff_uninstall()
|
|
1711 |
delete_option( 'cff_num_show' );
|
1712 |
delete_option( 'cff_post_limit' );
|
1713 |
delete_option( 'cff_show_others' );
|
1714 |
-
delete_option('cff_cache_time');
|
1715 |
-
delete_option('cff_cache_time_unit');
|
1716 |
delete_option( 'cff_locale' );
|
1717 |
delete_option( 'cff_ajax' );
|
1718 |
delete_option( 'cff_preserve_settings' );
|
@@ -1927,7 +1997,7 @@ function cff_autolink_do($text, $link_color, $sub, $limit, $tagfill, $auto_title
|
|
1927 |
|
1928 |
|
1929 |
if( substr( $link_url_enc, 0, 4 ) !== "http" ) $link_url_enc = 'http://' . $link_url_enc;
|
1930 |
-
$buffer .= "<a
|
1931 |
|
1932 |
|
1933 |
}else{
|
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
|
7 |
Author: Smash Balloon
|
8 |
Author URI: http://smashballoon.com/
|
9 |
License: GPLv2 or later
|
167 |
'sepsize' => isset($options[ 'cff_sep_size' ]) ? $options[ 'cff_sep_size' ] : '',
|
168 |
|
169 |
//Translate
|
170 |
+
'seemoretext' => isset( $options[ 'cff_see_more_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_see_more_text' ] ) ) : '',
|
171 |
+
'seelesstext' => isset( $options[ 'cff_see_less_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_see_less_text' ] ) ) : '',
|
172 |
+
'photostext' => isset( $options[ 'cff_translate_photos_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_photos_text' ] ) ) : '',
|
173 |
+
|
174 |
+
'facebooklinktext' => isset( $options[ 'cff_facebook_link_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_facebook_link_text' ] ) ) : '',
|
175 |
+
'sharelinktext' => isset( $options[ 'cff_facebook_share_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_facebook_share_text' ] ) ) : '',
|
176 |
+
'showfacebooklink' => isset($options[ 'cff_show_facebook_link' ]) ? $options[ 'cff_show_facebook_link' ] : '',
|
177 |
+
'showsharelink' => isset($options[ 'cff_show_facebook_share' ]) ? $options[ 'cff_show_facebook_share' ] : ''
|
178 |
+
|
179 |
), $atts);
|
180 |
|
181 |
/********** GENERAL **********/
|
198 |
if ( empty($cff_locale) || !isset($cff_locale) || $cff_locale == '' ) $cff_locale = 'en_US';
|
199 |
if (!isset($cff_cache_time)) $cff_cache_time = 0;
|
200 |
$cff_cache_time_unit = $atts[ 'cacheunit' ];
|
201 |
+
|
202 |
+
//Don't allow cache time to be zero - set to 1 minute instead to minimize API requests
|
203 |
+
if(!isset($cff_cache_time) || $cff_cache_time == '0'){
|
204 |
+
$cff_cache_time = 1;
|
205 |
+
$cff_cache_time_unit = 'minutes';
|
206 |
+
}
|
207 |
+
if($cff_cache_time == 'none') $cff_cache_time = 0;
|
208 |
+
|
209 |
$cff_class = $atts['class'];
|
210 |
//Compile feed styles
|
211 |
$cff_feed_styles = 'style="';
|
309 |
$cff_title_styles .= '"';
|
310 |
$cff_title_link = $atts[ 'textlink' ];
|
311 |
|
312 |
+
$cff_posttext_link_color = str_replace('#', '', $atts['textlinkcolor']);
|
313 |
+
|
314 |
( $cff_title_link == 'on' || $cff_title_link == 'true' || $cff_title_link == true ) ? $cff_title_link = true : $cff_title_link = false;
|
315 |
if( $atts[ 'textlink' ] == 'false' ) $cff_title_link = false;
|
316 |
|
336 |
$cff_link_title_format = $atts[ 'linktitleformat' ];
|
337 |
if (empty($cff_link_title_format)) $cff_link_title_format = 'p';
|
338 |
$cff_link_title_size = $atts[ 'linktitlesize' ];
|
339 |
+
$cff_link_title_color = str_replace('#', '', $atts[ 'linktitlecolor' ]);
|
340 |
$cff_link_url_color = $atts[ 'linkurlcolor' ];
|
341 |
|
342 |
$cff_link_title_styles = 'style="';
|
414 |
if ( !empty($cff_link_weight) && $cff_link_weight != 'inherit' ) $cff_link_styles .= 'font-weight:' . $cff_link_weight . '; ';
|
415 |
if ( !empty($cff_link_color) ) $cff_link_styles .= 'color:#' . str_replace('#', '', $cff_link_color) . ';';
|
416 |
$cff_link_styles .= '"';
|
417 |
+
|
418 |
+
//Link custom text
|
419 |
$cff_facebook_link_text = $atts[ 'facebooklinktext' ];
|
420 |
+
$cff_facebook_share_text = $atts[ 'sharelinktext' ];
|
421 |
+
if ($cff_facebook_share_text == '') $cff_facebook_share_text = 'Share';
|
422 |
+
|
423 |
+
|
424 |
+
//Show Facebook link
|
425 |
+
$cff_show_facebook_link = $atts[ 'showfacebooklink' ];
|
426 |
+
( $cff_show_facebook_link == 'on' || $cff_show_facebook_link == 'true' || $cff_show_facebook_link == true ) ? $cff_show_facebook_link = true : $cff_show_facebook_link = false;
|
427 |
+
if( $atts[ 'showfacebooklink' ] === 'false' ) $cff_show_facebook_link = false;
|
428 |
+
|
429 |
+
|
430 |
+
//Show Share link
|
431 |
+
$cff_show_facebook_share = $atts[ 'showsharelink' ];
|
432 |
+
( $cff_show_facebook_share == 'on' || $cff_show_facebook_share == 'true' || $cff_show_facebook_share == true ) ? $cff_show_facebook_share = true : $cff_show_facebook_share = false;
|
433 |
+
if( $atts[ 'showsharelink' ] === 'false' ) $cff_show_facebook_share = false;
|
434 |
+
|
435 |
$cff_view_link_text = $atts[ 'viewlinktext' ];
|
436 |
$cff_link_to_timeline = $atts[ 'linktotimeline' ];
|
437 |
/********** MISC **********/
|
503 |
$cff_sep_color = 'fff';
|
504 |
}
|
505 |
|
506 |
+
$cff_post_bg_color = str_replace('#', '', $atts['postbgcolor']);
|
507 |
$cff_post_rounded = $atts['postcorners'];
|
508 |
($cff_post_bg_color !== '#' && $cff_post_bg_color !== '') ? $cff_post_bg_color_check = true : $cff_post_bg_color_check = false;
|
509 |
($cff_sep_color !== '#' && $cff_sep_color !== '') ? $cff_sep_color_check = true : $cff_sep_color_check = false;
|
513 |
if( $cff_sep_color_check || $cff_post_bg_color_check ){
|
514 |
$cff_item_styles = 'style="';
|
515 |
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) . '; ';
|
516 |
+
if($cff_post_bg_color_check) $cff_item_styles .= 'background-color: #' . $cff_post_bg_color . '; ';
|
517 |
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; ';
|
518 |
$cff_item_styles .= '"';
|
519 |
}
|
548 |
//If the 'Enter my own Access Token' box is unchecked then don't use the user's access token, even if there's one in the field
|
549 |
get_option('cff_show_access_token') ? $cff_show_access_token = true : $cff_show_access_token = false;
|
550 |
|
551 |
+
//If there's no Access Token then use a default
|
|
|
552 |
$access_token_array = array(
|
553 |
'1489500477999288|KFys5ppNi3sreihdreqPkU2ChIE',
|
554 |
'859332767418162|BR-YU8zjzvonNrszlll_1a4y_xE',
|
555 |
'360558880785446|4jyruti_VkxxK7gS7JeyX-EuSXs',
|
556 |
'1487072591579718|0KQzP-O2E4mvFCPxTLWP1b87I4Q',
|
557 |
+
'640861236031365|2rENQzxtWtG12DtlZwqfZ6Vu6BE',
|
558 |
+
'334487440086538|hI_NNy1NvxQiQxm-TtXsrmoCVaE',
|
559 |
+
'755471677869105|Jxv8xVDad7vUUTauk8K2o71wG2w',
|
560 |
+
'518353204973067|dA7YTe-k8eSvgZ8lqa51xSm16DA'
|
561 |
);
|
562 |
+
if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0, 7)];
|
|
|
563 |
|
564 |
|
565 |
//Check whether a Page ID has been defined
|
678 |
|
679 |
//Create CFF container HTML
|
680 |
$cff_content .= '<div class="cff-wrapper">';
|
681 |
+
$cff_content .= '<div id="cff" data-char="'.$title_limit.'" class="';
|
682 |
if( !empty($cff_class) ) $cff_content .= $cff_class . ' ';
|
683 |
if ( !empty($cff_feed_height) ) $cff_content .= 'cff-fixed-height ';
|
684 |
$cff_content .= '" ' . $cff_feed_styles . '>';
|
902 |
$cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
|
903 |
|
904 |
//Start HTML for post text
|
905 |
+
$cff_post_text .= '<span class="cff-text" data-color="'.$cff_posttext_link_color.'">';
|
906 |
if ($cff_title_link) $cff_post_text .= '<a class="cff-post-text-link" '.$cff_title_styles.' href="'.$link.'" '.$target.'>';
|
907 |
|
908 |
//Which content should we use?
|
955 |
//Loop through the tags
|
956 |
foreach($text_tags as $message_tag ) {
|
957 |
$tag_name = $message_tag[0]->name;
|
958 |
+
$tag_link = '<a href="http://facebook.com/' . $message_tag[0]->id . '" style="color: #'.$cff_posttext_link_color.';" target="_blank">' . $message_tag[0]->name . '</a>';
|
959 |
|
960 |
$post_text = str_replace($tag_name, $tag_link, $post_text);
|
961 |
}
|
982 |
|
983 |
for($i = count($message_tags_arr); $i >= 1; $i--) {
|
984 |
|
985 |
+
$b = '<a href="http://facebook.com/' . $message_tags_arr[$i]['id'] . '" style="color: #'.$cff_posttext_link_color.';" target="_blank">' . $message_tags_arr[$i]['name'] . '</a>';
|
986 |
$c = $message_tags_arr[$i]['offset'];
|
987 |
$d = $message_tags_arr[$i]['length'];
|
988 |
|
1005 |
$cff_post_text .= cff_wrap_span( $post_text ) . ' ';
|
1006 |
} else {
|
1007 |
//Don't use htmlspecialchars for post_text as it's added above so that it doesn't mess up the message_tag offsets
|
1008 |
+
$cff_post_text .= cff_autolink( $post_text ) . ' ';
|
1009 |
}
|
1010 |
|
1011 |
if ($cff_title_link) $cff_post_text .= '</a>';
|
1012 |
$cff_post_text .= '</span>';
|
1013 |
//'See More' link
|
1014 |
+
$cff_post_text .= '<span class="cff-expand">... <a href="#" style="color: #'.$cff_posttext_link_color.'"><span class="cff-more">' . $cff_see_more_text . '</span><span class="cff-less">' . $cff_see_less_text . '</span></a></span>';
|
1015 |
$cff_post_text .= '</' . $cff_title_format . '>';
|
1016 |
|
1017 |
//DESCRIPTION
|
1029 |
if (!empty($body_limit)) {
|
1030 |
if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
|
1031 |
}
|
1032 |
+
$cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_autolink( htmlspecialchars($description_text), $link_color=$cff_posttext_link_color) . ' </span></p>';
|
1033 |
|
1034 |
//If the post text and description/caption are the same then don't show the description
|
1035 |
if($post_text == $description_text) $cff_description = '';
|
1050 |
$cff_shared_link .= '<div class="cff-text-link ';
|
1051 |
$cff_shared_link .= 'cff-no-image';
|
1052 |
//The link title:
|
1053 |
+
$cff_shared_link .= '"><'.$cff_link_title_format.' class="cff-link-title" '.$cff_link_title_styles.'><a href="'.$link.'" '.$target.' style="color:#' . $cff_link_title_color . ';">'. $news->name . '</a></'.$cff_link_title_format.'>';
|
1054 |
//The link source:
|
1055 |
(!empty($news->caption)) ? $cff_link_caption = $news->caption : $cff_link_caption = '';
|
1056 |
if(!empty($cff_link_caption)) $cff_shared_link .= '<p class="cff-link-caption" style="color:#' . str_replace('#', '', $cff_link_url_color) . ';">'.$cff_link_caption.'</p>';
|
1173 |
if(!$cff_disable_link_box) $cff_description .= '" ' . $cff_link_box_styles;
|
1174 |
$cff_description .= '>';
|
1175 |
|
1176 |
+
if( isset($news->name) ) $cff_description .= '<'.$cff_link_title_format.' class="cff-link-title" '.$cff_link_title_styles.'><a href="'.$link.'" '.$target.' style="color:#' . $cff_link_title_color . ';">'. $news->name . '</a></'.$cff_link_title_format.'>';
|
1177 |
|
1178 |
if (!empty($body_limit)) {
|
1179 |
if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
|
1182 |
$cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_autolink( htmlspecialchars($description_text) ) . '</span></p></div>';
|
1183 |
} else {
|
1184 |
isset($news->name) ? $video_name = $news->name : $video_name = $link;
|
1185 |
+
if( isset($news->name) ) $cff_description .= '<'.$cff_link_title_format.' class="cff-link-title" '.$cff_link_title_styles.'><a href="'.$link.'" '.$target.' style="color:#' . $cff_link_title_color . ';">'. $news->name . '</a></'.$cff_link_title_format.'>';
|
1186 |
}
|
1187 |
}
|
1188 |
|
1197 |
//Link to the Facebook post if it's a link or a video
|
1198 |
if($cff_post_type == 'link' || $cff_post_type == 'video') $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
|
1199 |
|
1200 |
+
//Social media sharing URLs
|
1201 |
+
$cff_share_facebook = 'https://www.facebook.com/sharer/sharer.php?u=' . $link;
|
1202 |
+
$cff_share_twitter = 'https://twitter.com/intent/tweet?text=' . $link;
|
1203 |
+
$cff_share_google = 'https://plus.google.com/share?url=' . $link;
|
1204 |
+
$cff_share_linkedin = 'https://www.linkedin.com/shareArticle?mini=true&url=' . $link . '&title=' . strip_tags($cff_post_text);
|
1205 |
+
|
1206 |
+
|
1207 |
+
//If it's an offer post then change the text
|
1208 |
if ($cff_post_type == 'offer') $link_text = 'View Offer';
|
1209 |
+
|
1210 |
+
//Create post action links HTML
|
1211 |
+
$cff_link = '';
|
1212 |
+
if($cff_show_facebook_link || $cff_show_facebook_share){
|
1213 |
+
$cff_link .= '<div class="cff-post-links">';
|
1214 |
+
|
1215 |
+
//View on Facebook link
|
1216 |
+
if($cff_show_facebook_link) $cff_link .= '<a class="' . $cff_viewpost_class . '" href="' . $link . '" title="' . $link_text . '" ' . $target . ' ' . $cff_link_styles . '>' . $link_text . '</a>';
|
1217 |
+
|
1218 |
+
//Share link
|
1219 |
+
if($cff_show_facebook_share){
|
1220 |
+
$cff_link .= '<div class="cff-share-container">';
|
1221 |
+
//Only show separating dot if both links are enabled
|
1222 |
+
if($cff_show_facebook_link) $cff_link .= '<span class="cff-dot" ' . $cff_link_styles . '>·</span>';
|
1223 |
+
$cff_link .= '<a class="cff-share-link" href="javascript:void(0);" title="' . $cff_facebook_share_text . '" ' . $cff_link_styles . '>' . $cff_facebook_share_text . '</a>';
|
1224 |
+
$cff_link .= "<p class='cff-share-tooltip'><a href='".$cff_share_facebook."' target='_blank' id='cff-facebook-icon'><i class='fa fa-facebook-square'></i></a><a href='".$cff_share_twitter."' target='_blank' id='cff-twitter-icon'><i class='fa fa-twitter'></i></a><a href='".$cff_share_google."' target='_blank' id='cff-google-icon'><i class='fa fa-google-plus'></i></a><a href='".$cff_share_linkedin."' target='_blank' id='cff-linkedin-icon'><i class='fa fa-linkedin'></i></a><i class='fa fa-play fa-rotate-90'></i></p></div>";
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
$cff_link .= '</div>';
|
1228 |
+
}
|
1229 |
|
1230 |
|
1231 |
//**************************//
|
1303 |
$cff_show_credit = $atts['credit'];
|
1304 |
($cff_show_credit == 'true' || $cff_show_credit == 'on') ? $cff_show_credit = true : $cff_show_credit = false;
|
1305 |
|
1306 |
+
if($cff_show_credit) $cff_content .= '<p class="cff-credit"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank" style="color: #'.$link_color=$cff_posttext_link_color.'" title="Smash Balloon Custom Facebook Feed WordPress Plugin"><img src="'.plugins_url( '/img/smashballoon-tiny.png' , __FILE__ ).'" alt="Smash Balloon Custom Facebook Feed WordPress Plugin" />The Custom Facebook Feed plugin</a></p>';
|
1307 |
//End the feed
|
1308 |
$cff_content .= '</div><div class="cff-clear"></div>';
|
1309 |
//Add the Like Box outside
|
1323 |
|
1324 |
$cff_content .= '</div>';
|
1325 |
|
1326 |
+
if( isset( $cff_posttext_link_color ) && !empty( $cff_posttext_link_color ) ) $cff_content .= '<style>#cff .cff-post-text a{ color: #'.$cff_posttext_link_color.'; }</style>';
|
1327 |
+
|
1328 |
//Return our feed HTML to display
|
1329 |
return $cff_content;
|
1330 |
}
|
1340 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
1341 |
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
|
1342 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
1343 |
+
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate,sdch');
|
1344 |
$feedData = curl_exec($ch);
|
1345 |
curl_close($ch);
|
1346 |
//If not then use file_get_contents
|
1348 |
$feedData = @file_get_contents($url);
|
1349 |
//Or else use the WP HTTP API
|
1350 |
} else {
|
|
|
1351 |
$request = new WP_Http;
|
1352 |
+
$response = $request->request($url, array('timeout' => 60, 'sslverify' => false));
|
1353 |
+
if( is_wp_error( $response ) ) {
|
1354 |
+
$feedData = '';
|
1355 |
+
//Don't display an error, just use the Server config Error Reference message
|
1356 |
+
echo '';
|
1357 |
+
} else {
|
1358 |
+
$feedData = wp_remote_retrieve_body($response);
|
1359 |
+
}
|
1360 |
}
|
1361 |
|
1362 |
return $feedData;
|
1450 |
|
1451 |
$options = get_option('cff_style_settings');
|
1452 |
|
1453 |
+
$cff_second = isset( $options['cff_translate_second'] ) ? stripslashes( esc_attr( $options['cff_translate_second'] ) ) : '';
|
1454 |
if ( empty($cff_second) ) $cff_second = 'second';
|
1455 |
|
1456 |
+
$cff_seconds = isset( $options['cff_translate_seconds'] ) ? stripslashes( esc_attr( $options['cff_translate_seconds'] ) ) : '';
|
1457 |
if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
|
1458 |
|
1459 |
+
$cff_minute = isset( $options['cff_translate_minute'] ) ? stripslashes( esc_attr( $options['cff_translate_minute'] ) ) : '';
|
1460 |
if ( empty($cff_minute) ) $cff_minute = 'minute';
|
1461 |
|
1462 |
+
$cff_minutes = isset( $options['cff_translate_minutes'] ) ? stripslashes( esc_attr( $options['cff_translate_minutes'] ) ) : '';
|
1463 |
if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
|
1464 |
|
1465 |
+
$cff_hour = isset( $options['cff_translate_hour'] ) ? stripslashes( esc_attr( $options['cff_translate_hour'] ) ) : '';
|
1466 |
if ( empty($cff_hour) ) $cff_hour = 'hour';
|
1467 |
|
1468 |
+
$cff_hours = isset( $options['cff_translate_hours'] ) ? stripslashes( esc_attr( $options['cff_translate_hours'] ) ) : '';
|
1469 |
if ( empty($cff_hours) ) $cff_hours = 'hours';
|
1470 |
|
1471 |
+
$cff_day = isset( $options['cff_translate_day'] ) ? stripslashes( esc_attr( $options['cff_translate_day'] ) ) : '';
|
1472 |
if ( empty($cff_day) ) $cff_day = 'day';
|
1473 |
|
1474 |
+
$cff_days = isset( $options['cff_translate_days'] ) ? stripslashes( esc_attr( $options['cff_translate_days'] ) ) : '';
|
1475 |
if ( empty($cff_days) ) $cff_days = 'days';
|
1476 |
|
1477 |
+
$cff_week = isset( $options['cff_translate_week'] ) ? stripslashes( esc_attr( $options['cff_translate_week'] ) ) : '';
|
1478 |
if ( empty($cff_week) ) $cff_week = 'week';
|
1479 |
|
1480 |
+
$cff_weeks = isset( $options['cff_translate_weeks'] ) ? stripslashes( esc_attr( $options['cff_translate_weeks'] ) ) : '';
|
1481 |
if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
|
1482 |
|
1483 |
+
$cff_month = isset( $options['cff_translate_month'] ) ? stripslashes( esc_attr( $options['cff_translate_month'] ) ) : '';
|
1484 |
if ( empty($cff_month) ) $cff_month = 'month';
|
1485 |
|
1486 |
+
$cff_months = isset( $options['cff_translate_months'] ) ? stripslashes( esc_attr( $options['cff_translate_months'] ) ) : '';
|
1487 |
if ( empty($cff_months) ) $cff_months = 'months';
|
1488 |
|
1489 |
+
$cff_year = isset( $options['cff_translate_year'] ) ? stripslashes( esc_attr( $options['cff_translate_year'] ) ) : '';
|
1490 |
if ( empty($cff_year) ) $cff_year = 'year';
|
1491 |
|
1492 |
+
$cff_years = isset( $options['cff_translate_years'] ) ? stripslashes( esc_attr( $options['cff_translate_years'] ) ) : '';
|
1493 |
if ( empty($cff_years) ) $cff_years = 'years';
|
1494 |
|
1495 |
+
$cff_ago = isset( $options['cff_translate_ago'] ) ? stripslashes( esc_attr( $options['cff_translate_ago'] ) ) : '';
|
1496 |
if ( empty($cff_ago) ) $cff_ago = 'ago';
|
1497 |
|
1498 |
|
1583 |
|
1584 |
$options = get_option('cff_style_settings');
|
1585 |
|
1586 |
+
$cff_second = isset( $options['cff_translate_second'] ) ? stripslashes( esc_attr( $options['cff_translate_second'] ) ) : '';
|
1587 |
if ( empty($cff_second) ) $cff_second = 'second';
|
1588 |
|
1589 |
+
$cff_seconds = isset( $options['cff_translate_seconds'] ) ? stripslashes( esc_attr( $options['cff_translate_seconds'] ) ) : '';
|
1590 |
if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
|
1591 |
|
1592 |
+
$cff_minute = isset( $options['cff_translate_minute'] ) ? stripslashes( esc_attr( $options['cff_translate_minute'] ) ) : '';
|
1593 |
if ( empty($cff_minute) ) $cff_minute = 'minute';
|
1594 |
|
1595 |
+
$cff_minutes = isset( $options['cff_translate_minutes'] ) ? stripslashes( esc_attr( $options['cff_translate_minutes'] ) ) : '';
|
1596 |
if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
|
1597 |
|
1598 |
+
$cff_hour = isset( $options['cff_translate_hour'] ) ? stripslashes( esc_attr( $options['cff_translate_hour'] ) ) : '';
|
1599 |
if ( empty($cff_hour) ) $cff_hour = 'hour';
|
1600 |
|
1601 |
+
$cff_hours = isset( $options['cff_translate_hours'] ) ? stripslashes( esc_attr( $options['cff_translate_hours'] ) ) : '';
|
1602 |
if ( empty($cff_hours) ) $cff_hours = 'hours';
|
1603 |
|
1604 |
+
$cff_day = isset( $options['cff_translate_day'] ) ? stripslashes( esc_attr( $options['cff_translate_day'] ) ) : '';
|
1605 |
if ( empty($cff_day) ) $cff_day = 'day';
|
1606 |
|
1607 |
+
$cff_days = isset( $options['cff_translate_days'] ) ? stripslashes( esc_attr( $options['cff_translate_days'] ) ) : '';
|
1608 |
if ( empty($cff_days) ) $cff_days = 'days';
|
1609 |
|
1610 |
+
$cff_week = isset( $options['cff_translate_week'] ) ? stripslashes( esc_attr( $options['cff_translate_week'] ) ) : '';
|
1611 |
if ( empty($cff_week) ) $cff_week = 'week';
|
1612 |
|
1613 |
+
$cff_weeks = isset( $options['cff_translate_weeks'] ) ? stripslashes( esc_attr( $options['cff_translate_weeks'] ) ) : '';
|
1614 |
if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
|
1615 |
|
1616 |
+
$cff_month = isset( $options['cff_translate_month'] ) ? stripslashes( esc_attr( $options['cff_translate_month'] ) ) : '';
|
1617 |
if ( empty($cff_month) ) $cff_month = 'month';
|
1618 |
|
1619 |
+
$cff_months = isset( $options['cff_translate_months'] ) ? stripslashes( esc_attr( $options['cff_translate_months'] ) ) : '';
|
1620 |
if ( empty($cff_months) ) $cff_months = 'months';
|
1621 |
|
1622 |
+
$cff_year = isset( $options['cff_translate_year'] ) ? stripslashes( esc_attr( $options['cff_translate_year'] ) ) : '';
|
1623 |
if ( empty($cff_year) ) $cff_year = 'year';
|
1624 |
|
1625 |
+
$cff_years = isset( $options['cff_translate_years'] ) ? stripslashes( esc_attr( $options['cff_translate_years'] ) ) : '';
|
1626 |
if ( empty($cff_years) ) $cff_years = 'years';
|
1627 |
|
1628 |
+
$cff_ago = isset( $options['cff_translate_ago'] ) ? stripslashes( esc_attr( $options['cff_translate_ago'] ) ) : '';
|
1629 |
if ( empty($cff_ago) ) $cff_ago = 'ago';
|
1630 |
|
1631 |
|
1727 |
// Respects SSL, Style.css is relative to the current file
|
1728 |
wp_register_style( 'cff', plugins_url('css/cff-style.css?10', __FILE__) );
|
1729 |
wp_enqueue_style( 'cff' );
|
1730 |
+
wp_enqueue_style( 'cff-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', array(), '4.0.3' );
|
1731 |
}
|
1732 |
//Enqueue scripts
|
1733 |
add_action( 'wp_enqueue_scripts', 'cff_scripts_method' );
|
1756 |
$options[ 'cff_show_meta' ] = true;
|
1757 |
$options[ 'cff_show_link' ] = true;
|
1758 |
$options[ 'cff_show_like_box' ] = true;
|
1759 |
+
$options[ 'cff_show_facebook_link' ] = true;
|
1760 |
+
$options[ 'cff_show_facebook_share' ] = true;
|
1761 |
update_option( 'cff_style_settings', $options );
|
1762 |
|
1763 |
get_option('cff_show_access_token');
|
1781 |
delete_option( 'cff_num_show' );
|
1782 |
delete_option( 'cff_post_limit' );
|
1783 |
delete_option( 'cff_show_others' );
|
1784 |
+
delete_option( 'cff_cache_time' );
|
1785 |
+
delete_option( 'cff_cache_time_unit' );
|
1786 |
delete_option( 'cff_locale' );
|
1787 |
delete_option( 'cff_ajax' );
|
1788 |
delete_option( 'cff_preserve_settings' );
|
1997 |
|
1998 |
|
1999 |
if( substr( $link_url_enc, 0, 4 ) !== "http" ) $link_url_enc = 'http://' . $link_url_enc;
|
2000 |
+
$buffer .= "<a href=\"{$link_url_enc}\">{$display_url_enc}</a>";
|
2001 |
|
2002 |
|
2003 |
}else{
|
img/pro.png
CHANGED
Binary file
|
js/cff-scripts.js
CHANGED
@@ -18,7 +18,7 @@ jQuery(document).ready(function() {
|
|
18 |
//Expand post
|
19 |
var expanded = false,
|
20 |
$post_text = $self.find('.cff-post-text .cff-text'),
|
21 |
-
text_limit = $self.closest('#cff').attr('
|
22 |
if (typeof text_limit === 'undefined' || text_limit == '') text_limit = 99999;
|
23 |
|
24 |
//If the text is linked then use the text within the link
|
@@ -62,7 +62,7 @@ jQuery(document).ready(function() {
|
|
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('
|
66 |
|
67 |
function replacer(hash){
|
68 |
//Remove white space at beginning of hash
|
@@ -89,6 +89,16 @@ jQuery(document).ready(function() {
|
|
89 |
if( $self.find('.cff-post-desc').length > 0 ) $self.find('.cff-post-desc').html( cffDescStr.replace( regex , replacer ) );
|
90 |
}
|
91 |
cffLinkHashtags();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
-
});
|
94 |
});
|
18 |
//Expand post
|
19 |
var expanded = false,
|
20 |
$post_text = $self.find('.cff-post-text .cff-text'),
|
21 |
+
text_limit = $self.closest('#cff').attr('data-char');
|
22 |
if (typeof text_limit === 'undefined' || text_limit == '') text_limit = 99999;
|
23 |
|
24 |
//If the text is linked then use the text within the link
|
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){
|
68 |
//Remove white space at beginning of hash
|
89 |
if( $self.find('.cff-post-desc').length > 0 ) $self.find('.cff-post-desc').html( cffDescStr.replace( regex , replacer ) );
|
90 |
}
|
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('target', '_blank');
|
95 |
+
|
96 |
+
|
97 |
+
//Share toolip function
|
98 |
+
$self.find('.cff-share-link').unbind().bind('click', function(){
|
99 |
+
$self.find('.cff-share-tooltip').toggle();
|
100 |
+
});
|
101 |
+
|
102 |
|
103 |
+
}); //End .cff-item each
|
104 |
});
|