Custom Facebook Feed - Version 2.4.2

Version Description

  • Tweak: Group wall feed posts are now ordered based on recent activity, rather than by the date they were created, to better reflect the order on the Facebook Group wall.
  • Tweak: The "5 hours ago" date text strings can now be translated directly in the shortcode if you're displaying different feeds in different languages. See the bottom of the Shortcode Options table for more information.
  • Tweak: Created some specific setup directions for the free version.
  • Fix: Minor bug fixes
Download this release

Release Info

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

Code changes from version 2.4.1.2 to 2.4.2

README.txt CHANGED
@@ -2,8 +2,8 @@
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.5
6
- Stable tag: 2.4.1.2
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -361,6 +361,12 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
361
9. It's super easy to display your Facebook feed in any page or post
362
363
== Changelog ==
364
= 2.4.1.2 =
365
* Updated to be compatible with Facebook API version 2.6
366
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.5.3
6
+ Stable tag: 2.4.2
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
361
9. It's super easy to display your Facebook feed in any page or post
362
363
== Changelog ==
364
+ = 2.4.2 =
365
+ * Tweak: Group wall feed posts are now ordered based on recent activity, rather than by the date they were created, to better reflect the order on the Facebook Group wall.
366
+ * Tweak: The "5 hours ago" date text strings can now be translated directly in the shortcode if you're displaying different feeds in different languages. See the bottom of the [Shortcode Options table](https://smashballoon.com/custom-facebook-feed/docs/shortcodes/) for more information.
367
+ * Tweak: Created some specific [setup directions](https://smashballoon.com/custom-facebook-feed/docs/free/) for the free version.
368
+ * Fix: Minor bug fixes
369
+
370
= 2.4.1.2 =
371
* Updated to be compatible with Facebook API version 2.6
372
css/cff-admin-style.css CHANGED
@@ -290,4 +290,94 @@
290
width: auto;
291
font-size: 11px;
292
margin-left: 5px;
293
}
290
width: auto;
291
font-size: 11px;
292
margin-left: 5px;
293
+ }
294
+
295
+ /* Update notice */
296
+ /*.sb_instagram_notice{
297
+ position: relative;
298
+ clear: both;
299
+ width: 96%;
300
+ margin: 20px 0;
301
+ background: #F7E6E6;
302
+ padding: 15px 1.5%;
303
+ border: 1px solid #BA7B7B;
304
+ color: #592626;
305
+
306
+ -moz-border-radius: 3px;
307
+ -webkit-border-radius: 3px;
308
+ border-radius: 3px;
309
+ }
310
+ .sb_instagram_notice .sb_instagram_notice_title{
311
+ font-size: 18px;
312
+ padding-bottom: 5px;
313
+ }
314
+ .sb_instagram_notice p{
315
+ padding: 0;
316
+ margin: 0;
317
+ font-size: 14px;
318
+ }
319
+ .sb_instagram_dismiss{
320
+ position: absolute;
321
+ top: 10px;
322
+ right: 10px;
323
+ color: #dd3d36;
324
+ text-decoration: none;
325
+ }*/
326
+
327
+ /* Review notice */
328
+ .cff_review_notice{
329
+ position: relative;
330
+ overflow: hidden;
331
+ max-width: 870px;
332
+ margin-top: 10px;
333
+ padding: 10px 10px 7px 10px;
334
+
335
+ background: #E6F0E8;
336
+ border: 1px solid #6AB074;
337
+ color: #214F28;
338
+ }
339
+ .cff_review_notice img{
340
+ width: 84px;
341
+ margin: 0 0 0 -100% !important;
342
+
343
+ -moz-border-radius: 4px;
344
+ -webkit-border-radius: 4px;
345
+ border-radius: 4px;
346
+ }
347
+ .cff_review_notice .cff-notice-text{
348
+ float: left;
349
+ clear: none;
350
+ width: 100%;
351
+ padding: 4px 0;
352
+ }
353
+ .cff_review_notice p{
354
+ float: left;
355
+ clear: both;
356
+ width: auto;
357
+ margin: 0 0 0 100px !important;
358
+ padding: 4px 40px 4px 0;
359
+ }
360
+ .cff_review_notice a{
361
+ display: inline-block;
362
+ padding: 0 8px;
363
+ color: #178529;
364
+ }
365
+ .cff_review_notice a:hover,
366
+ .cff_review_notice a:focus{
367
+ color: #0c7abf;
368
+ }
369
+ .cff_review_notice .cff-links{
370
+ margin: 0 0 0 92px !important;
371
+ padding: 4px 0 0 0;
372
+ }
373
+ .cff_review_notice .cff_notice_close{
374
+ position: absolute;
375
+ top: 0;
376
+ right: 0;
377
+ padding: 10px;
378
+ line-height: 1;
379
+ }
380
+ .cff_review_notice .cff_notice_close:hover,
381
+ .cff_review_notice .cff_notice_close:focus{
382
+ color: #a34100;
383
}
custom-facebook-feed-admin.php CHANGED
@@ -481,21 +481,21 @@ function cff_settings_page() {
481
482
<?php if( $cff_active_tab == 'support' ) { //Start Support tab ?>
483
484
- <br />
485
- <h3><?php _e('FAQs and Troubleshooting', 'custom-facebook-feed'); ?></h3>
486
- <p>Having trouble getting the plugin to work? Try the links below:</p>
487
- <ul>
488
- <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/faq/general/" target="_blank">General Questions</a>', 'custom-facebook-feed'); ?></li>
489
- <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/faq/setup/" target="_blank">Setting Up &amp; Displaying your Feed</a>', 'custom-facebook-feed'); ?></li>
490
- <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/faq/troubleshooting/" target="_blank">Troubleshooting &amp; Common Support Questions</a>', 'custom-facebook-feed'); ?></li>
491
- </ul>
492
<br />
493
<h3>Documentation</h3>
494
<p>Need help setting up, configuring or customizing the plugin? Check out the links below:</p>
495
<ul>
496
- <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/wordpress/" target="_blank">Installation and Configuration</a>', 'custom-facebook-feed'); ?></li>
497
<li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank">Shortcode Reference</a>', 'custom-facebook-feed'); ?></li>
498
- <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank">Custom CSS and JavaScript Snippets</a>', 'custom-facebook-feed'); ?></li>
499
</ul>
500
501
<br />
@@ -1509,62 +1509,10 @@ function cff_style_page() {
1509
1510
<input type="hidden" name="<?php echo $style_post_layout_hidden_field_name; ?>" value="Y">
1511
<br />
1512
- <h3><?php _e('Post Layout', 'custom-facebook-feed'); ?></h3>
1513
- <table class="form-table">
1514
-
1515
- <tbody>
1516
- <tr>
1517
- <td>
1518
- <p><?php _e("Choose a layout from the 3 below.", 'custom-facebook-feed'); ?>
1519
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable post layouts', 'custom-facebook-feed'); ?></a></i>
1520
- </p>
1521
- </td>
1522
- </tr>
1523
- </tbody>
1524
- </table>
1525
1526
- <div class="cff-layouts cff-disabled">
1527
- <div class="cff-layout">
1528
- <h3><input type="radio" name="cff_preset_layout" id="cff_preset_layout" value="thumb" />&nbsp;<?php _e('Thumbnail', 'custom-facebook-feed'); ?></h3>
1529
- <img src="<?php echo plugins_url( 'img/layout-thumb.png' , __FILE__ ) ?>" alt="Thumbnail Layout" />
1530
-
1531
- </div>
1532
- <div class="cff-layout">
1533
- <h3><input type="radio" name="cff_preset_layout" id="cff_preset_layout" value="half" />&nbsp;<?php _e('Half-width', 'custom-facebook-feed'); ?></h3>
1534
- <img src="<?php echo plugins_url( 'img/layout-half.png' , __FILE__ ) ?>" alt="Half Width Layout" />
1535
-
1536
- </div>
1537
- <div class="cff-layout">
1538
- <h3><input type="radio" name="cff_preset_layout" id="cff_preset_layout" value="full" />&nbsp;<?php _e('Full-width', 'custom-facebook-feed'); ?></h3>
1539
- <img src="<?php echo plugins_url( 'img/layout-full.png' , __FILE__ ) ?>" alt="Full Width Layout" />
1540
-
1541
- </div>
1542
- </div>
1543
-
1544
- <table class="form-table cff-disabled">
1545
- <tbody>
1546
- <tr class="cff-media-position">
1547
- <th><label class="bump-left"><?php _e('Photo/Video Position', 'custom-facebook-feed'); ?></label></th>
1548
- <td>
1549
- <select name="cff_media_position" disabled>
1550
- <option>Below Text</option>
1551
- <option>Above Text</option>
1552
- </select>
1553
- <i style="color: #666; font-size: 11px; margin-left: 5px;">Only applies to Full-width layout</i>
1554
- </td>
1555
- </tr>
1556
- <tr>
1557
- <th><label class="bump-left"><?php _e('Always use the Full-width layout when feed is narrow?', 'custom-facebook-feed'); ?></label></th>
1558
- <td>
1559
- <input type="checkbox" id="cff_enable_narrow" disabled />
1560
- <label for="cff_enable_narrow"><?php _e('Yes', 'custom-facebook-feed'); ?></label>
1561
- <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'custom-facebook-feed'); ?></a>
1562
- <p class="cff-tooltip cff-more-info"><?php _e("When displaying posts in either a narrow column or on a mobile device the plugin will automatically default to using the 'Full-width' layout as it's better suited to narrow sizes.", 'custom-facebook-feed'); ?></p>
1563
- </td>
1564
- </tr>
1565
- <tr id="showhide"><!-- Quick link --></tr>
1566
- </tbody>
1567
- </table>
1568
1569
<hr />
1570
<h3><?php _e('Show/Hide', 'custom-facebook-feed'); ?></h3>
@@ -1590,7 +1538,7 @@ function cff_style_page() {
1590
<input type="checkbox" name="cff_show_date" id="cff_show_date" <?php if($cff_show_date == true) echo 'checked="checked"' ?> />
1591
<label for="cff_show_date"><?php _e('Date', 'custom-facebook-feed'); ?></label>
1592
</div>
1593
- <div>
1594
<input type="checkbox" id="cff_show_media" disabled />
1595
<label for="cff_show_media"><?php _e('Photos/videos', 'custom-facebook-feed'); ?></label>
1596
</div>
@@ -1615,7 +1563,7 @@ function cff_style_page() {
1615
<input type="checkbox" name="cff_show_event_details" id="cff_show_event_details" <?php if($cff_show_event_details == true) echo 'checked="checked"' ?> />
1616
<label for="cff_show_event_details"><?php _e('Event details', 'custom-facebook-feed'); ?></label>
1617
</div>
1618
- <div>
1619
<input type="checkbox" id="cff_show_meta" disabled />
1620
<label for="cff_show_meta"><?php _e('Like/shares/comments', 'custom-facebook-feed'); ?></label>
1621
</div>
@@ -3127,4 +3075,81 @@ function cff_cron_clear_cache() {
3127
" );
3128
}
3129
3130
?>
481
482
<?php if( $cff_active_tab == 'support' ) { //Start Support tab ?>
483
484
<br />
485
<h3>Documentation</h3>
486
<p>Need help setting up, configuring or customizing the plugin? Check out the links below:</p>
487
<ul>
488
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/free/" target="_blank">Installation and Configuration</a>', 'custom-facebook-feed'); ?></li>
489
<li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank">Shortcode Reference</a>', 'custom-facebook-feed'); ?></li>
490
+ <li>- <?php _e('<a href="https://smashballoon.com/category/custom-facebook-feed/customizations/snippets/?cat=18" target="_blank">Custom CSS and JavaScript Snippets</a>', 'custom-facebook-feed'); ?></li>
491
+ </ul>
492
+ <br />
493
+ <h3><?php _e('FAQs and Troubleshooting', 'custom-facebook-feed'); ?></h3>
494
+ <p>Having trouble getting the plugin to work? Try the links below:</p>
495
+ <ul>
496
+ <li>- <?php _e('<a href="https://smashballoon.com/category/custom-facebook-feed/faq/?cat=18" target="_blank">General Questions</a>', 'custom-facebook-feed'); ?></li>
497
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/faq/setup/" target="_blank">Setting Up &amp; Displaying your Feed</a>', 'custom-facebook-feed'); ?></li>
498
+ <li>- <?php _e('<a href="https://smashballoon.com/category/custom-facebook-feed/troubleshooting/?cat=18" target="_blank">Troubleshooting &amp; Common Support Questions</a>', 'custom-facebook-feed'); ?></li>
499
</ul>
500
501
<br />
1509
1510
<input type="hidden" name="<?php echo $style_post_layout_hidden_field_name; ?>" value="Y">
1511
<br />
1512
+ <h3><?php _e('Post Layouts', 'custom-facebook-feed'); ?></h3>
1513
+ <p><i style="color: #666; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable post layouts', 'custom-facebook-feed'); ?></a></i></p>
1514
1515
+ <table class="form-table">
1516
1517
<hr />
1518
<h3><?php _e('Show/Hide', 'custom-facebook-feed'); ?></h3>
1538
<input type="checkbox" name="cff_show_date" id="cff_show_date" <?php if($cff_show_date == true) echo 'checked="checked"' ?> />
1539
<label for="cff_show_date"><?php _e('Date', 'custom-facebook-feed'); ?></label>
1540
</div>
1541
+ <div class="cff-disabled">
1542
<input type="checkbox" id="cff_show_media" disabled />
1543
<label for="cff_show_media"><?php _e('Photos/videos', 'custom-facebook-feed'); ?></label>
1544
</div>
1563
<input type="checkbox" name="cff_show_event_details" id="cff_show_event_details" <?php if($cff_show_event_details == true) echo 'checked="checked"' ?> />
1564
<label for="cff_show_event_details"><?php _e('Event details', 'custom-facebook-feed'); ?></label>
1565
</div>
1566
+ <div class="cff-disabled">
1567
<input type="checkbox" id="cff_show_meta" disabled />
1568
<label for="cff_show_meta"><?php _e('Like/shares/comments', 'custom-facebook-feed'); ?></label>
1569
</div>
3075
" );
3076
}
3077
3078
+
3079
+
3080
+ //REVIEW REQUEST NOTICE
3081
+
3082
+ // checks $_GET to see if the nag variable is set and what it's value is
3083
+ function cff_check_nag_get( $get, $nag, $option, $transient ) {
3084
+ if ( isset( $_GET[$nag] ) && $get[$nag] == 1 ) {
3085
+ update_option( $option, 'dismissed' );
3086
+ } elseif ( isset( $_GET[$nag] ) && $get[$nag] == 'later' ) {
3087
+ $time = 4 * WEEK_IN_SECONDS;
3088
+ set_transient( $transient, 'waiting', $time );
3089
+ update_option( $option, 'pending' );
3090
+ }
3091
+ }
3092
+
3093
+ // will set a transient if the notice hasn't been dismissed or hasn't been set yet
3094
+ function cff_maybe_set_transient( $transient, $option ) {
3095
+ $cff_rating_notice_waiting = get_transient( $transient );
3096
+ $notice_status = get_option( $option, false );
3097
+
3098
+ if ( ! $cff_rating_notice_waiting && !( $notice_status === 'dismissed' || $notice_status === 'pending' ) ) {
3099
+ $time = 4 * WEEK_IN_SECONDS;
3100
+ set_transient( $transient, 'waiting', $time );
3101
+ update_option( $option, 'pending' );
3102
+ }
3103
+ }
3104
+
3105
+ // generates the html for the admin notice
3106
+ function cff_rating_notice_html() {
3107
+
3108
+ //Only show to admins
3109
+ if ( current_user_can( 'manage_options' ) ){
3110
+
3111
+ global $current_user;
3112
+ $user_id = $current_user->ID;
3113
+
3114
+ /* Check that the user hasn't already clicked to ignore the message */
3115
+ if ( ! get_user_meta( $user_id, 'cff_ignore_rating_notice') ) {
3116
+
3117
+ _e("
3118
+ <div class='cff_notice cff_review_notice'>
3119
+ <img src='". plugins_url( 'custom-facebook-feed/img/cff-icon.png' ) ."' alt='Custom Facebook Feed'>
3120
+ <div class='cff-notice-text'>
3121
+ <p>It's great to see that you've been using the <strong>Custom Facebook Feed</strong> plugin for a while now. Hopefully you're happy with it!&nbsp; If so, would you consider leaving a positive review? It really helps to support the plugin and helps others to discover it too!</p>
3122
+ <p class='cff-links'>
3123
+ <a class='cff_notice_dismiss' href='https://wordpress.org/support/view/plugin-reviews/custom-facebook-feed' target='_blank'>Sure, I'd love to!</a>
3124
+ &middot;
3125
+ <a class='cff_notice_dismiss' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', '1' ) ). "'>No thanks</a>
3126
+ &middot;
3127
+ <a class='cff_notice_dismiss' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', '1' ) ). "'>I've already given a review</a>
3128
+ &middot;
3129
+ <a class='cff_notice_dismiss' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', 'later' ) ). "'>Ask Me Later</a>
3130
+ </p>
3131
+ </div>
3132
+ <a class='cff_notice_close' href='" .esc_url( add_query_arg( 'cff_ignore_rating_notice_nag', '1' ) ). "'><i class='fa fa-close'></i></a>
3133
+ </div>
3134
+ ");
3135
+
3136
+ }
3137
+
3138
+ }
3139
+ }
3140
+
3141
+ // variables to define certain terms
3142
+ $transient = 'custom_facebook_rating_notice_waiting';
3143
+ $option = 'cff_rating_notice';
3144
+ $nag = 'cff_ignore_rating_notice_nag';
3145
+
3146
+ cff_check_nag_get( $_GET, $nag, $option, $transient );
3147
+ cff_maybe_set_transient( $transient, $option );
3148
+ $notice_status = get_option( $option, false );
3149
+
3150
+ // only display the notice if the time offset has passed and the user hasn't already dismissed it
3151
+ if ( get_transient( $transient ) !== 'waiting' && $notice_status !== 'dismissed' ) {
3152
+ add_action( 'admin_notices', 'cff_rating_notice_html' );
3153
+ }
3154
+
3155
?>
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 completely customizable Facebook feeds to your WordPress site
6
- Version: 2.4.1.2
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
//Include admin
27
include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
28
29
- define('CFFVER', '2.4.1.2');
30
31
// Add shortcodes
32
add_shortcode('custom-facebook-feed', 'display_cff');
@@ -194,7 +194,23 @@ function display_cff($atts) {
194
'facebooklinktext' => isset( $options[ 'cff_facebook_link_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_facebook_link_text' ] ) ) : '',
195
'sharelinktext' => isset( $options[ 'cff_facebook_share_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_facebook_share_text' ] ) ) : '',
196
'showfacebooklink' => isset($options[ 'cff_show_facebook_link' ]) ? $options[ 'cff_show_facebook_link' ] : '',
197
- 'showsharelink' => isset($options[ 'cff_show_facebook_share' ]) ? $options[ 'cff_show_facebook_share' ] : ''
198
199
), $atts);
200
@@ -457,6 +473,26 @@ function display_cff($atts) {
457
$cff_timezone = $atts['timezone'];
458
$cff_orig_timezone = date_default_timezone_get();
459
date_default_timezone_set($cff_timezone);
460
//Link to Facebook
461
$cff_link_size = $atts[ 'linksize' ];
462
$cff_link_weight = $atts[ 'linkweight' ];
@@ -1049,7 +1085,7 @@ function display_cff($atts) {
1049
$cff_date_custom = $atts[ 'datecustom' ];
1050
1051
$post_time = $news->created_time;
1052
- $cff_date = '<p class="cff-date" '.$cff_date_styles.'>'. $cff_date_before . ' ' . cff_getdate(strtotime($post_time), $cff_date_formatting, $cff_date_custom) . ' ' . $cff_date_after;
1053
if($cff_date_position == 'below' || (!$cff_show_author && $cff_date_position == 'author') ) $cff_date .= '<span class="cff-date-dot">&nbsp;&middot;&nbsp;&nbsp;</span>';
1054
$cff_date .= '</p>';
1055
@@ -1060,7 +1096,7 @@ function display_cff($atts) {
1060
$cff_author .= '<a href="https://facebook.com/' . $news->from->id . '" '.$target.$cff_nofollow.' title="'.$news->from->name.' on Facebook" '.$cff_author_styles.'><div class="cff-author-text">';
1061
1062
if($cff_show_date && $cff_date_position !== 'above' && $cff_date_position !== 'below'){
1063
- $cff_author .= '<p class="cff-page-name cff-author-date">'.$news->from->name.'</p>';
1064
$cff_author .= $cff_date;
1065
} else {
1066
$cff_author .= '<span class="cff-page-name">'.$news->from->name.'</span>';
@@ -1495,7 +1531,11 @@ function display_cff($atts) {
1495
$cff_post_item .= '</div>';
1496
1497
//PUSH TO ARRAY
1498
- $cff_posts_array = cff_array_push_assoc($cff_posts_array, strtotime($post_time), $cff_post_item);
1499
1500
} // End post type check
1501
@@ -1506,7 +1546,7 @@ function display_cff($atts) {
1506
} // End the loop
1507
1508
//Sort the array in reverse order (newest first)
1509
- krsort($cff_posts_array);
1510
1511
} // End ALL POSTS
1512
@@ -1689,7 +1729,7 @@ function cff_wrap_span_callback($matches) {
1689
1690
//2013-04-28T21:06:56+0000
1691
//Time stamp function - used for posts
1692
- function cff_getdate($original, $date_format, $custom_date) {
1693
switch ($date_format) {
1694
1695
case '2':
@@ -1730,52 +1770,21 @@ function cff_getdate($original, $date_format, $custom_date) {
1730
break;
1731
default:
1732
1733
- $options = get_option('cff_style_settings');
1734
-
1735
- $cff_second = isset( $options['cff_translate_second'] ) ? stripslashes( esc_attr( $options['cff_translate_second'] ) ) : '';
1736
- if ( empty($cff_second) ) $cff_second = 'second';
1737
-
1738
- $cff_seconds = isset( $options['cff_translate_seconds'] ) ? stripslashes( esc_attr( $options['cff_translate_seconds'] ) ) : '';
1739
- if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
1740
-
1741
- $cff_minute = isset( $options['cff_translate_minute'] ) ? stripslashes( esc_attr( $options['cff_translate_minute'] ) ) : '';
1742
- if ( empty($cff_minute) ) $cff_minute = 'minute';
1743
-
1744
- $cff_minutes = isset( $options['cff_translate_minutes'] ) ? stripslashes( esc_attr( $options['cff_translate_minutes'] ) ) : '';
1745
- if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
1746
-
1747
- $cff_hour = isset( $options['cff_translate_hour'] ) ? stripslashes( esc_attr( $options['cff_translate_hour'] ) ) : '';
1748
- if ( empty($cff_hour) ) $cff_hour = 'hour';
1749
-
1750
- $cff_hours = isset( $options['cff_translate_hours'] ) ? stripslashes( esc_attr( $options['cff_translate_hours'] ) ) : '';
1751
- if ( empty($cff_hours) ) $cff_hours = 'hours';
1752
-
1753
- $cff_day = isset( $options['cff_translate_day'] ) ? stripslashes( esc_attr( $options['cff_translate_day'] ) ) : '';
1754
- if ( empty($cff_day) ) $cff_day = 'day';
1755
-
1756
- $cff_days = isset( $options['cff_translate_days'] ) ? stripslashes( esc_attr( $options['cff_translate_days'] ) ) : '';
1757
- if ( empty($cff_days) ) $cff_days = 'days';
1758
-
1759
- $cff_week = isset( $options['cff_translate_week'] ) ? stripslashes( esc_attr( $options['cff_translate_week'] ) ) : '';
1760
- if ( empty($cff_week) ) $cff_week = 'week';
1761
-
1762
- $cff_weeks = isset( $options['cff_translate_weeks'] ) ? stripslashes( esc_attr( $options['cff_translate_weeks'] ) ) : '';
1763
- if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
1764
-
1765
- $cff_month = isset( $options['cff_translate_month'] ) ? stripslashes( esc_attr( $options['cff_translate_month'] ) ) : '';
1766
- if ( empty($cff_month) ) $cff_month = 'month';
1767
-
1768
- $cff_months = isset( $options['cff_translate_months'] ) ? stripslashes( esc_attr( $options['cff_translate_months'] ) ) : '';
1769
- if ( empty($cff_months) ) $cff_months = 'months';
1770
-
1771
- $cff_year = isset( $options['cff_translate_year'] ) ? stripslashes( esc_attr( $options['cff_translate_year'] ) ) : '';
1772
- if ( empty($cff_year) ) $cff_year = 'year';
1773
-
1774
- $cff_years = isset( $options['cff_translate_years'] ) ? stripslashes( esc_attr( $options['cff_translate_years'] ) ) : '';
1775
- if ( empty($cff_years) ) $cff_years = 'years';
1776
-
1777
- $cff_ago = isset( $options['cff_translate_ago'] ) ? stripslashes( esc_attr( $options['cff_translate_ago'] ) ) : '';
1778
- if ( empty($cff_ago) ) $cff_ago = 'ago';
1779
1780
1781
$periods = array($cff_second, $cff_minute, $cff_hour, $cff_day, $cff_week, $cff_month, $cff_year, "decade");
@@ -1860,83 +1869,6 @@ function cff_eventdate($original, $date_format, $custom_date) {
1860
}
1861
return $print;
1862
}
1863
- //Time stamp function - used for comments
1864
- function cff_timesince($original) {
1865
-
1866
- $options = get_option('cff_style_settings');
1867
-
1868
- $cff_second = isset( $options['cff_translate_second'] ) ? stripslashes( esc_attr( $options['cff_translate_second'] ) ) : '';
1869
- if ( empty($cff_second) ) $cff_second = 'second';
1870
-
1871
- $cff_seconds = isset( $options['cff_translate_seconds'] ) ? stripslashes( esc_attr( $options['cff_translate_seconds'] ) ) : '';
1872
- if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
1873
-
1874
- $cff_minute = isset( $options['cff_translate_minute'] ) ? stripslashes( esc_attr( $options['cff_translate_minute'] ) ) : '';
1875
- if ( empty($cff_minute) ) $cff_minute = 'minute';
1876
-
1877
- $cff_minutes = isset( $options['cff_translate_minutes'] ) ? stripslashes( esc_attr( $options['cff_translate_minutes'] ) ) : '';
1878
- if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
1879
-
1880
- $cff_hour = isset( $options['cff_translate_hour'] ) ? stripslashes( esc_attr( $options['cff_translate_hour'] ) ) : '';
1881
- if ( empty($cff_hour) ) $cff_hour = 'hour';
1882
-
1883
- $cff_hours = isset( $options['cff_translate_hours'] ) ? stripslashes( esc_attr( $options['cff_translate_hours'] ) ) : '';
1884
- if ( empty($cff_hours) ) $cff_hours = 'hours';
1885
-
1886
- $cff_day = isset( $options['cff_translate_day'] ) ? stripslashes( esc_attr( $options['cff_translate_day'] ) ) : '';
1887
- if ( empty($cff_day) ) $cff_day = 'day';
1888
-
1889
- $cff_days = isset( $options['cff_translate_days'] ) ? stripslashes( esc_attr( $options['cff_translate_days'] ) ) : '';
1890
- if ( empty($cff_days) ) $cff_days = 'days';
1891
-
1892
- $cff_week = isset( $options['cff_translate_week'] ) ? stripslashes( esc_attr( $options['cff_translate_week'] ) ) : '';
1893
- if ( empty($cff_week) ) $cff_week = 'week';
1894
-
1895
- $cff_weeks = isset( $options['cff_translate_weeks'] ) ? stripslashes( esc_attr( $options['cff_translate_weeks'] ) ) : '';
1896
- if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
1897
-
1898
- $cff_month = isset( $options['cff_translate_month'] ) ? stripslashes( esc_attr( $options['cff_translate_month'] ) ) : '';
1899
- if ( empty($cff_month) ) $cff_month = 'month';
1900
-
1901
- $cff_months = isset( $options['cff_translate_months'] ) ? stripslashes( esc_attr( $options['cff_translate_months'] ) ) : '';
1902
- if ( empty($cff_months) ) $cff_months = 'months';
1903
-
1904
- $cff_year = isset( $options['cff_translate_year'] ) ? stripslashes( esc_attr( $options['cff_translate_year'] ) ) : '';
1905
- if ( empty($cff_year) ) $cff_year = 'year';
1906
-
1907
- $cff_years = isset( $options['cff_translate_years'] ) ? stripslashes( esc_attr( $options['cff_translate_years'] ) ) : '';
1908
- if ( empty($cff_years) ) $cff_years = 'years';
1909
-
1910
- $cff_ago = isset( $options['cff_translate_ago'] ) ? stripslashes( esc_attr( $options['cff_translate_ago'] ) ) : '';
1911
- if ( empty($cff_ago) ) $cff_ago = 'ago';
1912
-
1913
-
1914
- $periods = array($cff_second, $cff_minute, $cff_hour, $cff_day, $cff_week, $cff_month, $cff_year, "decade");
1915
- $periods_plural = array($cff_seconds, $cff_minutes, $cff_hours, $cff_days, $cff_weeks, $cff_months, $cff_years, "decade");
1916
-
1917
- $lengths = array("60","60","24","7","4.35","12","10");
1918
- $now = time();
1919
-
1920
- // is it future date or past date
1921
- if($now > $original) {
1922
- $difference = $now - $original;
1923
- $tense = $cff_ago;
1924
- } else {
1925
- $difference = $original - $now;
1926
- $tense = $cff_ago;
1927
- }
1928
- for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
1929
- $difference /= $lengths[$j];
1930
- }
1931
-
1932
- $difference = round($difference);
1933
-
1934
- if($difference != 1) {
1935
- $periods[$j] = $periods_plural[$j];
1936
- }
1937
- return "$difference $periods[$j] {$tense}";
1938
-
1939
- }
1940
//Use custom stripos function if it's not available (only available in PHP 5+)
1941
if(!is_callable('stripos')){
1942
function stripos($haystack, $needle){
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.4.2
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
26
//Include admin
27
include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
28
29
+ define('CFFVER', '2.4.2');
30
31
// Add shortcodes
32
add_shortcode('custom-facebook-feed', 'display_cff');
194
'facebooklinktext' => isset( $options[ 'cff_facebook_link_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_facebook_link_text' ] ) ) : '',
195
'sharelinktext' => isset( $options[ 'cff_facebook_share_text' ] ) ? stripslashes( esc_attr( $options[ 'cff_facebook_share_text' ] ) ) : '',
196
'showfacebooklink' => isset($options[ 'cff_show_facebook_link' ]) ? $options[ 'cff_show_facebook_link' ] : '',
197
+ 'showsharelink' => isset($options[ 'cff_show_facebook_share' ]) ? $options[ 'cff_show_facebook_share' ] : '',
198
+
199
+ 'secondtext' => isset( $options[ 'cff_translate_second' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_second' ] ) ) : 'second',
200
+ 'secondstext' => isset( $options[ 'cff_translate_seconds' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_seconds' ] ) ) : 'seconds',
201
+ 'minutetext' => isset( $options[ 'cff_translate_minute' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_minute' ] ) ) : 'minute',
202
+ 'minutestext' => isset( $options[ 'cff_translate_minutes' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_minutes' ] ) ) : 'minutes',
203
+ 'hourtext' => isset( $options[ 'cff_translate_hour' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_hour' ] ) ) : 'hour',
204
+ 'hourstext' => isset( $options[ 'cff_translate_hours' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_hours' ] ) ) : 'hours',
205
+ 'daytext' => isset( $options[ 'cff_translate_day' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_day' ] ) ) : 'day',
206
+ 'daystext' => isset( $options[ 'cff_translate_days' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_days' ] ) ) : 'days',
207
+ 'weektext' => isset( $options[ 'cff_translate_week' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_week' ] ) ) : 'week',
208
+ 'weekstext' => isset( $options[ 'cff_translate_weeks' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_weeks' ] ) ) : 'weeks',
209
+ 'monthtext' => isset( $options[ 'cff_translate_month' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_month' ] ) ) : 'month',
210
+ 'monthstext' => isset( $options[ 'cff_translate_months' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_months' ] ) ) : 'months',
211
+ 'yeartext' => isset( $options[ 'cff_translate_year' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_year' ] ) ) : 'year',
212
+ 'yearstext' => isset( $options[ 'cff_translate_years' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_years' ] ) ) : 'years',
213
+ 'agotext' => isset( $options[ 'cff_translate_ago' ] ) ? stripslashes( esc_attr( $options[ 'cff_translate_ago' ] ) ) : 'ago'
214
215
), $atts);
216
473
$cff_timezone = $atts['timezone'];
474
$cff_orig_timezone = date_default_timezone_get();
475
date_default_timezone_set($cff_timezone);
476
+
477
+ //Posted ago strings
478
+ $cff_date_translate_strings = array(
479
+ 'cff_translate_second' => $atts['secondtext'],
480
+ 'cff_translate_seconds' => $atts['secondstext'],
481
+ 'cff_translate_minute' => $atts['minutetext'],
482
+ 'cff_translate_minutes' => $atts['minutestext'],
483
+ 'cff_translate_hour' => $atts['hourtext'],
484
+ 'cff_translate_hours' => $atts['hourstext'],
485
+ 'cff_translate_day' => $atts['daytext'],
486
+ 'cff_translate_days' => $atts['daystext'],
487
+ 'cff_translate_week' => $atts['weektext'],
488
+ 'cff_translate_weeks' => $atts['weekstext'],
489
+ 'cff_translate_month' => $atts['monthtext'],
490
+ 'cff_translate_months' => $atts['monthstext'],
491
+ 'cff_translate_year' => $atts['yeartext'],
492
+ 'cff_translate_years' => $atts['yearstext'],
493
+ 'cff_translate_ago' => $atts['agotext']
494
+ );
495
+
496
//Link to Facebook
497
$cff_link_size = $atts[ 'linksize' ];
498
$cff_link_weight = $atts[ 'linkweight' ];
1085
$cff_date_custom = $atts[ 'datecustom' ];
1086
1087
$post_time = $news->created_time;
1088
+ $cff_date = '<p class="cff-date" '.$cff_date_styles.'>'. $cff_date_before . ' ' . cff_getdate(strtotime($post_time), $cff_date_formatting, $cff_date_custom, $cff_date_translate_strings) . ' ' . $cff_date_after;
1089
if($cff_date_position == 'below' || (!$cff_show_author && $cff_date_position == 'author') ) $cff_date .= '<span class="cff-date-dot">&nbsp;&middot;&nbsp;&nbsp;</span>';
1090
$cff_date .= '</p>';
1091
1096
$cff_author .= '<a href="https://facebook.com/' . $news->from->id . '" '.$target.$cff_nofollow.' title="'.$news->from->name.' on Facebook" '.$cff_author_styles.'><div class="cff-author-text">';
1097
1098
if($cff_show_date && $cff_date_position !== 'above' && $cff_date_position !== 'below'){
1099
+ $cff_author .= '<p class="cff-page-name cff-author-date" '.$cff_author_styles.'>'.$news->from->name.'</p>';
1100
$cff_author .= $cff_date;
1101
} else {
1102
$cff_author .= '<span class="cff-page-name">'.$news->from->name.'</span>';
1531
$cff_post_item .= '</div>';
1532
1533
//PUSH TO ARRAY
1534
+ if(!$cff_is_group){
1535
+ $cff_posts_array = cff_array_push_assoc($cff_posts_array, strtotime($post_time), $cff_post_item);
1536
+ } else {
1537
+ $cff_posts_array = cff_array_push_assoc($cff_posts_array, $i, $cff_post_item);
1538
+ }
1539
1540
} // End post type check
1541
1546
} // End the loop
1547
1548
//Sort the array in reverse order (newest first)
1549
+ if(!$cff_is_group) krsort($cff_posts_array);
1550
1551
} // End ALL POSTS
1552
1729
1730
//2013-04-28T21:06:56+0000
1731
//Time stamp function - used for posts
1732
+ function cff_getdate($original, $date_format, $custom_date, $cff_date_translate_strings) {
1733
switch ($date_format) {
1734
1735
case '2':
1770
break;
1771
default:
1772
1773
+ $cff_second = $cff_date_translate_strings['cff_translate_second'];
1774
+ $cff_seconds = $cff_date_translate_strings['cff_translate_seconds'];
1775
+ $cff_minute = $cff_date_translate_strings['cff_translate_minute'];
1776
+ $cff_minutes = $cff_date_translate_strings['cff_translate_minutes'];
1777
+ $cff_hour = $cff_date_translate_strings['cff_translate_hour'];
1778
+ $cff_hours = $cff_date_translate_strings['cff_translate_hours'];
1779
+ $cff_day = $cff_date_translate_strings['cff_translate_day'];
1780
+ $cff_days = $cff_date_translate_strings['cff_translate_days'];
1781
+ $cff_week = $cff_date_translate_strings['cff_translate_week'];
1782
+ $cff_weeks = $cff_date_translate_strings['cff_translate_weeks'];
1783
+ $cff_month = $cff_date_translate_strings['cff_translate_month'];
1784
+ $cff_months = $cff_date_translate_strings['cff_translate_months'];
1785
+ $cff_year = $cff_date_translate_strings['cff_translate_years'];
1786
+ $cff_years = $cff_date_translate_strings['cff_translate_years'];
1787
+ $cff_ago = $cff_date_translate_strings['cff_translate_ago'];
1788
1789
1790
$periods = array($cff_second, $cff_minute, $cff_hour, $cff_day, $cff_week, $cff_month, $cff_year, "decade");
1869
}
1870
return $print;
1871
}
1872
//Use custom stripos function if it's not available (only available in PHP 5+)
1873
if(!is_callable('stripos')){
1874
function stripos($haystack, $needle){
img/cff-icon.png ADDED
Binary file
img/smashballoon-tiny.png ADDED
Binary file