Custom Facebook Feed - Version 1.7.0

Version Description

  • New: Added ability to add a customizable header to your feed
  • New: Added a Custom JavaScript section to allow you to add your own JS or jQuery functionality to the feed
  • New: Added a 'Custom Text / Translate' tab to house all customizable text
  • New: You can now choose to show posts only by other people on your page
  • New: Set your timezone so that dates/times are displayed in your local time
  • New: When a post contains a link to multiple images it now states the number of photos after the post text and links to the album
  • Tweak: Plugin now detects whether the page is using SSL and pulls https resources
  • Tweak: Added a button to test the connection to Facebook's API for easier troubleshooting
  • Fix: Now using HTML encoding to parse any raw HTML tags in the post text or descriptions
  • Fix: Added a protocol to the beginning of links which don't include one
  • Fix: Fixed date width issue in IE7
  • Fix: Removed stray PHP notices
  • Fix: Added a space between the Like Box attributes
Download this release

Release Info

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

Code changes from version 1.6.8.2 to 1.7.0

README.txt CHANGED
@@ -2,8 +2,8 @@
2
Contributors: smashballoon
3
Tags: facebook, custom, customizable, feed, events, seo, search engine, responsive, mobile, shortcode, social, status, posts
4
Requires at least: 3.0
5
- Tested up to: 3.8
6
- Stable tag: 1.6.8.2
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -15,9 +15,9 @@ Display a **completely customizable**, **responsive** and **search engine crawla
15
16
*"The perfect plugin with amazing support! What else do you want? Get it!"* - [JoeJeffries](http://wordpress.org/support/topic/you-dont-already-have-this)
17
18
- *"Loving the Facebook feed plugin from @smashballoon. It's gonna transform my work's website! Great customer service too :)"* - [Grace Snow](https://twitter.com/GraceSnow/statuses/365915197149429760)
19
20
- *"I tried a few other Facebook plugins but this was by far the simplest and easiest to use. The others were quite confusing or didn't let you change even the simplest things. This plugin lets you change literally every part of it. Didn't have any issues setting it up at all and it's working great. Keep up the good work!"* - [Ben Donald](http://wordpress.org/support/topic/simple-to-set-up-and-looks-great)
21
22
= Features =
23
@@ -30,7 +30,7 @@ Display a **completely customizable**, **responsive** and **search engine crawla
30
* **Caching** means that your Facebook posts load lightning fast. Set your own caching time - check for new posts on Facebook every few seconds, minutes, hours or days. You decide.
31
* Show and hide certain parts of each Facebook post
32
* Choose to show the Facebook profile picture and name above each post
33
- * Select whether to display Facebook posts by just the page owner, or everyone who posts on your Facebook page
34
* Control the width, height, padding and background color of your Facebook feed
35
* Customize the size, weight and color of text
36
* Select from a range of date formats or enter your own
@@ -38,6 +38,7 @@ Display a **completely customizable**, **responsive** and **search engine crawla
38
* Use the shortcode options to style multiple Facebook feeds in completely different ways
39
* Select the number of Facebook posts to display
40
* Set a maximum character length for both the text and descriptions of your Facebook posts
41
* Localization/i18n support to allow every part of the feed to be displayed in your language
42
43
To display photos, videos, the number of likes, shares and comments for each Facebook post, multiple layout options, post filtering by type or #hashtag/string and more then [upgrade to the Pro version](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). Try out the [Pro demo](http://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo").
@@ -93,9 +94,9 @@ Once you've done so, the plugin will be able to retrieve and display all of your
93
94
= Can I show photos and videos in my Custom Facebook feed? =
95
96
- This free plugin only allows you to display textual updates from your Facebook feed. To display photos and videos in your feed you need to upgrade to the Pro version of the plugin. Try out a demo of the Pro version on the [Custom Facebook Feed website](http://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo"), and find out more about the Pro version [here](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro").
97
98
- = Can I show the comments associated with each Facebook post? =
99
100
For this feature please upgrade to the [Pro version of the plugin](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro").
101
@@ -105,7 +106,7 @@ It sure is. Unlike other Facebook plugins which use iframes to embed your Facebo
105
106
= How do I embed the Custom Facebook Feed directly into a WordPress page template? =
107
108
- You can embed your Facebook feed directly into a template file by using the WordPress do_shortcode function: `do_shortcode('[custom-facebook-feed]');`.
109
110
== Screenshots ==
111
@@ -121,6 +122,21 @@ You can embed your Facebook feed directly into a template file by using the Word
121
122
== Changelog ==
123
124
= 1.6.8.2 =
125
* Fix: Fixed a CSS bug in Firefox which was causing the page author name to bump down below the avatar
126
2
Contributors: smashballoon
3
Tags: facebook, custom, customizable, feed, events, seo, search engine, responsive, mobile, shortcode, social, status, posts
4
Requires at least: 3.0
5
+ Tested up to: 3.8.1
6
+ Stable tag: 1.7.0
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
15
16
*"The perfect plugin with amazing support! What else do you want? Get it!"* - [JoeJeffries](http://wordpress.org/support/topic/you-dont-already-have-this)
17
18
+ *"I honestly cannot recommend this plugin enough. The plugin itself is gorgeous and super customizable, and if you run into trouble...support will get you out of it. Five Stars across the board."* - [pamsavoybarnett](http://wordpress.org/support/topic/love-this-plugin-w-awesome-support?replies=2)
19
20
+ *"The positive reviews here say it all. John and SmashBalloon are delivering top-notch products and service -- something us website developers value greatly. If I could give them 10 Stars across the board I wouldn't hesitate. Cheers!"* - [AME Network](http://wordpress.org/support/topic/excellent-plugin-superior-support?replies=1)
21
22
= Features =
23
30
* **Caching** means that your Facebook posts load lightning fast. Set your own caching time - check for new posts on Facebook every few seconds, minutes, hours or days. You decide.
31
* Show and hide certain parts of each Facebook post
32
* Choose to show the Facebook profile picture and name above each post
33
+ * Display Facebook posts by just the page owner, everyone who posts on your Facebook page, or only other people
34
* Control the width, height, padding and background color of your Facebook feed
35
* Customize the size, weight and color of text
36
* Select from a range of date formats or enter your own
38
* Use the shortcode options to style multiple Facebook feeds in completely different ways
39
* Select the number of Facebook posts to display
40
* Set a maximum character length for both the text and descriptions of your Facebook posts
41
+ * Create a customizable header for your Custom Facebook Feed
42
* Localization/i18n support to allow every part of the feed to be displayed in your language
43
44
To display photos, videos, the number of likes, shares and comments for each Facebook post, multiple layout options, post filtering by type or #hashtag/string and more then [upgrade to the Pro version](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). Try out the [Pro demo](http://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo").
94
95
= Can I show photos and videos in my Custom Facebook feed? =
96
97
+ This free plugin only allows you to display text from your Facebook posts. To display photos and videos in your feed you need to upgrade to the Pro version of the plugin. Try out a demo of the Pro version on the [Custom Facebook Feed website](http://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo"), and find out more about the Pro version [here](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro").
98
99
+ = Can I show the comments, shares and likes associated with each Facebook post? =
100
101
For this feature please upgrade to the [Pro version of the plugin](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro").
102
106
107
= How do I embed the Custom Facebook Feed directly into a WordPress page template? =
108
109
+ You can embed your Facebook feed directly into a template file by using the WordPress [do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode "WordPress.org do_shortcode reference") function: `<?php echo do_shortcode('[custom-facebook-feed]'); ?>`.
110
111
== Screenshots ==
112
122
123
== Changelog ==
124
125
+ = 1.7.0 =
126
+ * New: Added ability to add a customizable header to your feed
127
+ * New: Added a Custom JavaScript section to allow you to add your own JS or jQuery functionality to the feed
128
+ * New: Added a 'Custom Text / Translate' tab to house all customizable text
129
+ * New: You can now choose to show posts only by other people on your page
130
+ * New: Set your timezone so that dates/times are displayed in your local time
131
+ * New: When a post contains a link to multiple images it now states the number of photos after the post text and links to the album
132
+ * Tweak: Plugin now detects whether the page is using SSL and pulls https resources
133
+ * Tweak: Added a button to test the connection to Facebook's API for easier troubleshooting
134
+ * Fix: Now using HTML encoding to parse any raw HTML tags in the post text or descriptions
135
+ * Fix: Added a protocol to the beginning of links which don't include one
136
+ * Fix: Fixed date width issue in IE7
137
+ * Fix: Removed stray PHP notices
138
+ * Fix: Added a space between the Like Box attributes
139
+
140
= 1.6.8.2 =
141
* Fix: Fixed a CSS bug in Firefox which was causing the page author name to bump down below the avatar
142
css/cff-admin-style.css CHANGED
@@ -51,4 +51,102 @@
51
/*background: #333;
52
color: #fff;*/
53
font-size: 16px;
54
}
51
/*background: #333;
52
color: #fff;*/
53
font-size: 16px;
54
+ }
55
+
56
+
57
+
58
+ #cff-admin #cff-header-icon-example{
59
+ font-size: 28px;
60
+ top: 6px;
61
+ margin-left: 5px;
62
+ position: relative;
63
+ }
64
+ #cff-admin #cff-api-test-result{
65
+ width: 50%;
66
+ clear: both;
67
+ margin: 10px 0 0 0;
68
+ position: relative;
69
+ }
70
+ #cff-admin #cff-api-test-result textarea{
71
+ width: 100%;
72
+ height: 250px;
73
+ display: none;
74
+ }
75
+ #cff-admin .cff-error{
76
+ background: #F7E6E6;
77
+ border: 1px solid #BA7B7B;
78
+ color: #592626;
79
+ }
80
+ #cff-admin .cff-success{
81
+ background: #f7faf1;
82
+ border: 1px solid #5c783e;
83
+ color: #3e5f1c;
84
+ }
85
+ /* Loader */
86
+ #cff-admin .cff-loader{
87
+ display: none;
88
+ position: absolute;
89
+ top: 50%;
90
+ left: 50%;
91
+ width: 16px;
92
+ height: 16px;
93
+ margin-top: -8px;
94
+ margin-left: -8px;
95
+
96
+ background: url('../img/loader-light.gif') no-repeat;
97
+ }
98
+
99
+ #cff-admin #cff-others-only{
100
+ margin-top: 8px;
101
+ display: none;
102
+ }
103
+
104
+ #cff-admin .cff-definition{
105
+ display: inline;
106
+ margin-left: 20px;
107
+ }
108
+
109
+
110
+ /* Translation table */
111
+ #cff-admin .cff-translate-table input{
112
+ width: 100%;
113
+ }
114
+ #cff-admin .cff-translate-table .cff-translate-date input{
115
+ width: 74%;
116
+ }
117
+ #cff-admin .cff-translate-table.form-table th,
118
+ #cff-admin .cff-translate-table.form-table td{
119
+ border: 1px solid #ddd;
120
+ padding: 8px 10px;
121
+ vertical-align: top;
122
+ }
123
+ #cff-admin .cff-translate-table.form-table thead th{
124
+ background: #333;
125
+ border: 1px solid #333;
126
+ border-right: 1px solid #999;
127
+ color: #fff;
128
+ }
129
+ #cff-admin .cff-translate-date label{
130
+ width: 25%;
131
+ float: left;
132
+ padding-top: 5px;
133
+ }
134
+ #cff-admin .cff-translate-table .cff-table-header{
135
+ background: #ddd;
136
+ }
137
+ #cff-admin .cff-translate-table.form-table .cff-context{
138
+ font-size: 13px;
139
+ }
140
+
141
+
142
+ #cff-admin .admin-notice a{
143
+ display: block;
144
+ color: #e24f0e;
145
+ text-decoration: none;
146
+ }
147
+ #cff-admin .admin-notice a:hover{
148
+ color: #333;
149
+ }
150
+ #cff-admin .admin-notice b{
151
+ font-size: 14px;
152
}
css/cff-style.css CHANGED
@@ -21,6 +21,15 @@
21
#cff .cff-item:first-child{
22
padding-top: 0;
23
}
24
/******************/
25
/*** TYPOGRAPHY ***/
26
/******************/
@@ -52,6 +61,7 @@
52
/* Date */
53
#cff .cff-date{
54
float: left;
55
width: auto;
56
font-size: 11px;
57
}
21
#cff .cff-item:first-child{
22
padding-top: 0;
23
}
24
+ /* Feed Header */
25
+ .cff-header{
26
+ width: 100%;
27
+ margin: 0 0 15px 0;
28
+ line-height: 1;
29
+ }
30
+ .cff-header .fa{
31
+ margin-right: 10px;
32
+ }
33
/******************/
34
/*** TYPOGRAPHY ***/
35
/******************/
61
/* Date */
62
#cff .cff-date{
63
float: left;
64
+ min-width: 50px;
65
width: auto;
66
font-size: 11px;
67
}
custom-facebook-feed-admin.php CHANGED
@@ -45,7 +45,7 @@ function cff_settings_page() {
45
// Read in existing option value from database
46
$access_token_val = get_option( $access_token );
47
$page_id_val = get_option( $page_id );
48
- $cff_page_type_val = get_option( $cff_page_type );
49
$num_show_val = get_option( $num_show, '5' );
50
$cff_post_limit_val = get_option( $cff_post_limit );
51
$cff_show_others_val = get_option( $cff_show_others );
@@ -106,6 +106,7 @@ function cff_settings_page() {
106
<div id="header">
107
<h1><?php _e('Custom Facebook Feed Settings'); ?></h1>
108
</div>
109
<form name="form1" method="post" action="">
110
<input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
111
<br />
@@ -132,7 +133,7 @@ function cff_settings_page() {
132
<tr valign="top">
133
<th scope="row"><?php _e('Facebook Page ID (or slug)'); ?><br /><i style="color: #666; font-size: 11px;"><?php _e('(This can usually be found in your <a class="cff-tooltip-link" href="JavaScript:void(0);">Facebook page URL</a>)</i>'); ?></th>
134
<td>
135
- <input name="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
136
&nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What\'s my Page ID?'); ?></a>
137
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123 or smashballoon</i>
138
<div class="cff-tooltip">
@@ -158,11 +159,18 @@ function cff_settings_page() {
158
</div>
159
</td>
160
</tr>
161
<tr valign="top" class="cff-page-options">
162
- <th scope="row"><?php _e('Show posts on my page by others'); ?></th>
163
<td>
164
- <input name="cff_show_others" type="checkbox" id="cff_show_others" <?php if($cff_show_others_val == true) echo "checked"; ?> />
165
- <i style="color: #666; font-size: 11px;"><?php _e('Check this box to also show posts by others on your page. By default only posts by the page owner will be shown.'); ?></i>
166
</td>
167
</tr>
168
@@ -285,6 +293,9 @@ function cff_settings_page() {
285
</table>
286
<?php submit_button(); ?>
287
</form>
288
<hr />
289
<h3><?php _e('Displaying your Feed'); ?></h3>
290
<p><?php _e('Copy and paste this shortcode directly into the page, post or widget where you\'d like the feed to show up:'); ?></p>
@@ -317,8 +328,12 @@ function cff_settings_page() {
317
<p>PHP cURL: <b><?php echo is_callable('curl_init') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
318
<p>JSON: <b><?php echo function_exists("json_decode") ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
319
320
-
321
-
322
323
324
<?php
@@ -331,6 +346,7 @@ function cff_style_page() {
331
$style_post_layout_hidden_field_name = 'cff_style_post_layout_submit_hidden';
332
$style_typography_hidden_field_name = 'cff_style_typography_submit_hidden';
333
$style_misc_hidden_field_name = 'cff_style_misc_submit_hidden';
334
$defaults = array(
335
//Post types
336
'cff_show_links_type' => true,
@@ -352,8 +368,6 @@ function cff_style_page() {
352
'cff_show_link' => true,
353
'cff_show_like_box' => true,
354
//Typography
355
- 'cff_see_more_text' => 'See More',
356
- 'cff_see_less_text' => 'See Less',
357
'cff_title_format' => 'p',
358
'cff_title_size' => 'inherit',
359
'cff_title_weight' => 'inherit',
@@ -386,22 +400,7 @@ function cff_style_page() {
386
'cff_date_custom' => '',
387
'cff_date_before' => '',
388
'cff_date_after' => '',
389
- //Date - translation
390
- 'cff_translate_second' => '',
391
- 'cff_translate_seconds' => '',
392
- 'cff_translate_minute' => '',
393
- 'cff_translate_minutes' => '',
394
- 'cff_translate_hour' => '',
395
- 'cff_translate_hours' => '',
396
- 'cff_translate_day' => '',
397
- 'cff_translate_days' => '',
398
- 'cff_translate_week' => '',
399
- 'cff_translate_weeks' => '',
400
- 'cff_translate_month' => '',
401
- 'cff_translate_months' => '',
402
- 'cff_translate_year' => '',
403
- 'cff_translate_years' => '',
404
- 'cff_translate_ago' => '',
405
406
//Link to Facebook
407
'cff_link_size' => 'inherit',
@@ -430,19 +429,59 @@ function cff_style_page() {
430
'cff_likebox_bg_color' => '',
431
'cff_like_box_text_color' => 'blue',
432
'cff_video_height' => '',
433
- 'cff_show_author' => false,
434
'cff_class' => '',
435
//New
436
'cff_custom_css' => '',
437
'cff_title_link' => false,
438
'cff_event_title_link' => false,
439
'cff_video_action' => 'file',
440
'cff_sep_color' => '',
441
- 'cff_sep_size' => '1'
442
);
443
//Save layout option in an array
444
$options = wp_parse_args(get_option('cff_style_settings'), $defaults);
445
add_option( 'cff_style_settings', $options );
446
//Set the page variables
447
//Post types
448
$cff_show_links_type = $options[ 'cff_show_links_type' ];
@@ -498,6 +537,8 @@ function cff_style_page() {
498
$cff_date_custom = $options[ 'cff_date_custom' ];
499
$cff_date_before = $options[ 'cff_date_before' ];
500
$cff_date_after = $options[ 'cff_date_after' ];
501
//Date translate
502
$cff_translate_second = $options[ 'cff_translate_second' ];
503
$cff_translate_seconds = $options[ 'cff_translate_seconds' ];
@@ -514,6 +555,8 @@ function cff_style_page() {
514
$cff_translate_year = $options[ 'cff_translate_year' ];
515
$cff_translate_years = $options[ 'cff_translate_years' ];
516
$cff_translate_ago = $options[ 'cff_translate_ago' ];
517
518
//View on Facebook link
519
$cff_link_size = $options[ 'cff_link_size' ];
@@ -545,9 +588,24 @@ function cff_style_page() {
545
$cff_video_height = $options[ 'cff_video_height' ];
546
$cff_show_author = $options[ 'cff_show_author' ];
547
$cff_class = $options[ 'cff_class' ];
548
549
//New
550
$cff_custom_css = $options[ 'cff_custom_css' ];
551
$cff_title_link = $options[ 'cff_title_link' ];
552
$cff_event_title_link = $options[ 'cff_event_title_link' ];
553
$cff_video_action = $options[ 'cff_video_action' ];
@@ -565,18 +623,18 @@ function cff_style_page() {
565
//Update the General options
566
if( isset($_POST[ $style_general_hidden_field_name ]) && $_POST[ $style_general_hidden_field_name ] == 'Y' ) {
567
//General
568
- $cff_feed_width = $_POST[ 'cff_feed_width' ];
569
- $cff_feed_height = $_POST[ 'cff_feed_height' ];
570
- $cff_feed_padding = $_POST[ 'cff_feed_padding' ];
571
- $cff_bg_color = $_POST[ 'cff_bg_color' ];
572
- $cff_show_author = $_POST[ 'cff_show_author' ];
573
- $cff_class = $_POST[ 'cff_class' ];
574
//Post types
575
- $cff_show_links_type = $_POST[ 'cff_show_links_type' ];
576
- $cff_show_event_type = $_POST[ 'cff_show_event_type' ];
577
- $cff_show_video_type = $_POST[ 'cff_show_video_type' ];
578
- $cff_show_photos_type = $_POST[ 'cff_show_photos_type' ];
579
- $cff_show_status_type = $_POST[ 'cff_show_status_type' ];
580
//General
581
$options[ 'cff_feed_width' ] = $cff_feed_width;
582
$options[ 'cff_feed_height' ] = $cff_feed_height;
@@ -584,7 +642,7 @@ function cff_style_page() {
584
$options[ 'cff_bg_color' ] = $cff_bg_color;
585
$options[ 'cff_show_author' ] = $cff_show_author;
586
$options[ 'cff_class' ] = $cff_class;
587
- //Post types
588
$options[ 'cff_show_links_type' ] = $cff_show_links_type;
589
$options[ 'cff_show_event_type' ] = $cff_show_event_type;
590
$options[ 'cff_show_video_type' ] = $cff_show_video_type;
@@ -594,17 +652,17 @@ function cff_style_page() {
594
//Update the Post Layout options
595
if( isset($_POST[ $style_post_layout_hidden_field_name ]) && $_POST[ $style_post_layout_hidden_field_name ] == 'Y' ) {
596
//Layout
597
- $cff_preset_layout = $_POST[ 'cff_preset_layout' ];
598
//Include
599
- $cff_show_text = $_POST[ 'cff_show_text' ];
600
- $cff_show_desc = $_POST[ 'cff_show_desc' ];
601
- $cff_show_shared_links = $_POST[ 'cff_show_shared_links' ];
602
- $cff_show_date = $_POST[ 'cff_show_date' ];
603
- $cff_show_media = $_POST[ 'cff_show_media' ];
604
- $cff_show_event_title = $_POST[ 'cff_show_event_title' ];
605
- $cff_show_event_details = $_POST[ 'cff_show_event_details' ];
606
- $cff_show_meta = $_POST[ 'cff_show_meta' ];
607
- $cff_show_link = $_POST[ 'cff_show_link' ];
608
//Layout
609
$options[ 'cff_preset_layout' ] = $cff_preset_layout;
610
//Include
@@ -621,74 +679,72 @@ function cff_style_page() {
621
//Update the Typography options
622
if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
623
//Character limits
624
- $cff_title_length_val = $_POST[ $cff_title_length ];
625
- $cff_body_length_val = $_POST[ $cff_body_length ];
626
- $cff_see_more_text = $_POST[ 'cff_see_more_text' ];
627
- $cff_see_less_text = $_POST[ 'cff_see_less_text' ];
628
//Typography
629
- $cff_title_format = $_POST[ 'cff_title_format' ];
630
- $cff_title_size = $_POST[ 'cff_title_size' ];
631
- $cff_title_weight = $_POST[ 'cff_title_weight' ];
632
- $cff_title_color = $_POST[ 'cff_title_color' ];
633
- $cff_title_link = $_POST[ 'cff_title_link' ];
634
$cff_body_size = $_POST[ 'cff_body_size' ];
635
- $cff_body_weight = $_POST[ 'cff_body_weight' ];
636
- $cff_body_color = $_POST[ 'cff_body_color' ];
637
//Event title
638
- $cff_event_title_format = $_POST[ 'cff_event_title_format' ];
639
- $cff_event_title_size = $_POST[ 'cff_event_title_size' ];
640
- $cff_event_title_weight = $_POST[ 'cff_event_title_weight' ];
641
- $cff_event_title_color = $_POST[ 'cff_event_title_color' ];
642
- $cff_event_title_link = $_POST[ 'cff_event_title_link' ];
643
//Event date
644
- $cff_event_date_size = $_POST[ 'cff_event_date_size' ];
645
- $cff_event_date_weight = $_POST[ 'cff_event_date_weight' ];
646
- $cff_event_date_color = $_POST[ 'cff_event_date_color' ];
647
- $cff_event_date_position = $_POST[ 'cff_event_date_position' ];
648
- $cff_event_date_formatting = $_POST[ 'cff_event_date_formatting' ];
649
- $cff_event_date_custom = $_POST[ 'cff_event_date_custom' ];
650
//Event details
651
- $cff_event_details_size = $_POST[ 'cff_event_details_size' ];
652
- $cff_event_details_weight = $_POST[ 'cff_event_details_weight' ];
653
- $cff_event_details_color = $_POST[ 'cff_event_details_color' ];
654
//Date
655
- $cff_date_position = $_POST[ 'cff_date_position' ];
656
- $cff_date_size = $_POST[ 'cff_date_size' ];
657
- $cff_date_weight = $_POST[ 'cff_date_weight' ];
658
- $cff_date_color = $_POST[ 'cff_date_color' ];
659
- $cff_date_formatting = $_POST[ 'cff_date_formatting' ];
660
- $cff_date_custom = $_POST[ 'cff_date_custom' ];
661
- $cff_date_before = $_POST[ 'cff_date_before' ];
662
- $cff_date_after = $_POST[ 'cff_date_after' ];
663
//Date translate
664
- $cff_translate_second = $_POST[ 'cff_translate_second' ];
665
- $cff_translate_seconds = $_POST[ 'cff_translate_seconds' ];
666
- $cff_translate_minute = $_POST[ 'cff_translate_minute' ];
667
- $cff_translate_minutes = $_POST[ 'cff_translate_minutes' ];
668
- $cff_translate_hour = $_POST[ 'cff_translate_hour' ];
669
- $cff_translate_hours = $_POST[ 'cff_translate_hours' ];
670
- $cff_translate_day = $_POST[ 'cff_translate_day' ];
671
- $cff_translate_days = $_POST[ 'cff_translate_days' ];
672
- $cff_translate_week = $_POST[ 'cff_translate_week' ];
673
- $cff_translate_weeks = $_POST[ 'cff_translate_weeks' ];
674
- $cff_translate_month = $_POST[ 'cff_translate_month' ];
675
- $cff_translate_months = $_POST[ 'cff_translate_months' ];
676
- $cff_translate_year = $_POST[ 'cff_translate_year' ];
677
- $cff_translate_years = $_POST[ 'cff_translate_years' ];
678
- $cff_translate_ago = $_POST[ 'cff_translate_ago' ];
679
680
//View on Facebook link
681
- $cff_link_size = $_POST[ 'cff_link_size' ];
682
- $cff_link_weight = $_POST[ 'cff_link_weight' ];
683
- $cff_link_color = $_POST[ 'cff_link_color' ];
684
- $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
685
- $cff_view_link_text = $_POST[ 'cff_view_link_text' ];
686
- $cff_link_to_timeline = $_POST[ 'cff_link_to_timeline' ];
687
//Character limits
688
update_option( $cff_title_length, $cff_title_length_val );
689
update_option( $cff_body_length, $cff_body_length_val );
690
- $options[ 'cff_see_more_text' ] = $cff_see_more_text;
691
- $options[ 'cff_see_less_text' ] = $cff_see_less_text;
692
//Typography
693
$options[ 'cff_title_format' ] = $cff_title_format;
694
$options[ 'cff_title_size' ] = $cff_title_size;
@@ -724,6 +780,8 @@ function cff_style_page() {
724
$options[ 'cff_date_custom' ] = $cff_date_custom;
725
$options[ 'cff_date_before' ] = $cff_date_before;
726
$options[ 'cff_date_after' ] = $cff_date_after;
727
//Date translate
728
$options[ 'cff_translate_second' ] = $cff_translate_second;
729
$options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
@@ -752,29 +810,43 @@ function cff_style_page() {
752
//Update the Misc options
753
if( isset($_POST[ $style_misc_hidden_field_name ]) && $_POST[ $style_misc_hidden_field_name ] == 'Y' ) {
754
//Meta
755
- $cff_icon_style = $_POST[ 'cff_icon_style' ];
756
- $cff_meta_text_color = $_POST[ 'cff_meta_text_color' ];
757
- $cff_meta_bg_color = $_POST[ 'cff_meta_bg_color' ];
758
- $cff_nocomments_text = $_POST[ 'cff_nocomments_text' ];
759
- $cff_hide_comments = $_POST[ 'cff_hide_comments' ];
760
//Custom CSS
761
- $cff_custom_css = $_POST[ 'cff_custom_css' ];
762
//Misc
763
- $cff_show_like_box = $_POST[ 'cff_show_like_box' ];
764
- $cff_like_box_position = $_POST[ 'cff_like_box_position' ];
765
- $cff_like_box_outside = $_POST[ 'cff_like_box_outside' ];
766
- $cff_likebox_bg_color = $_POST[ 'cff_likebox_bg_color' ];
767
- $cff_like_box_text_color = $_POST[ 'cff_like_box_text_color' ];
768
769
- $cff_likebox_width = $_POST[ 'cff_likebox_width' ];
770
- $cff_like_box_faces = $_POST[ 'cff_like_box_faces' ];
771
- $cff_like_box_border = $_POST[ 'cff_like_box_border' ];
772
773
- $cff_video_height = $_POST[ 'cff_video_height' ];
774
- $cff_video_action = $_POST[ 'cff_video_action' ];
775
- $cff_sep_color = $_POST[ 'cff_sep_color' ];
776
- $cff_sep_size = $_POST[ 'cff_sep_size' ];
777
- $cff_open_links = $_POST[ 'cff_open_links' ];
778
//Meta
779
$options[ 'cff_icon_style' ] = $cff_icon_style;
780
$options[ 'cff_meta_text_color' ] = $cff_meta_text_color;
@@ -783,6 +855,7 @@ function cff_style_page() {
783
$options[ 'cff_hide_comments' ] = $cff_hide_comments;
784
//Custom CSS
785
$options[ 'cff_custom_css' ] = $cff_custom_css;
786
//Misc
787
$options[ 'cff_show_like_box' ] = $cff_show_like_box;
788
$options[ 'cff_like_box_position' ] = $cff_like_box_position;
@@ -794,12 +867,78 @@ function cff_style_page() {
794
$options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
795
$options[ 'cff_like_box_border' ] = $cff_like_box_border;
796
797
$options[ 'cff_video_height' ] = $cff_video_height;
798
$options[ 'cff_video_action' ] = $cff_video_action;
799
$options[ 'cff_sep_color' ] = $cff_sep_color;
800
$options[ 'cff_sep_size' ] = $cff_sep_size;
801
$options[ 'cff_open_links' ] = $cff_open_links;
802
}
803
//Update the array
804
update_option( 'cff_style_settings', $options );
805
// Put an settings updated message on the screen
@@ -821,6 +960,7 @@ function cff_style_page() {
821
<a href="?page=cff-style&tab=post_layout" class="nav-tab <?php echo $active_tab == 'post_layout' ? 'nav-tab-active' : ''; ?>"><?php _e('Post Layout'); ?></a>
822
<a href="?page=cff-style&tab=typography" class="nav-tab <?php echo $active_tab == 'typography' ? 'nav-tab-active' : ''; ?>"><?php _e('Typography'); ?></a>
823
<a href="?page=cff-style&tab=misc" class="nav-tab <?php echo $active_tab == 'misc' ? 'nav-tab-active' : ''; ?>"><?php _e('Misc'); ?></a>
824
</h2>
825
<?php if( $active_tab == 'general' ) { //Start General tab ?>
826
<input type="hidden" name="<?php echo $style_general_hidden_field_name; ?>" value="Y">
@@ -1025,20 +1165,6 @@ function cff_style_page() {
1025
<input name="cff_body_length" type="text" value="<?php esc_attr_e( $cff_body_length_val ); ?>" size="4" /> <span><?php _e('Characters.'); ?></span> <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Leave empty to set no maximum length'); ?></i>
1026
</td>
1027
</tr>
1028
- <tr>
1029
- <th><label for="cff_see_more_text" class="bump-left"><?php _e('Custom "See More" text'); ?></label></th>
1030
- <td>
1031
- <input name="cff_see_more_text" type="text" value="<?php esc_attr_e( $cff_see_more_text ); ?>" size="20" />
1032
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Use different text in place of the default "See More" text'); ?></i>
1033
- </td>
1034
- </tr>
1035
- <tr>
1036
- <th><label for="cff_see_less_text" class="bump-left"><?php _e('Custom "See Less" text'); ?></label></th>
1037
- <td>
1038
- <input name="cff_see_less_text" type="text" value="<?php esc_attr_e( $cff_see_less_text ); ?>" size="20" />
1039
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Use different text in place of the default "See Less" text'); ?></i>
1040
- </td>
1041
- </tr>
1042
</tbody>
1043
</table>
1044
</div>
@@ -1224,7 +1350,7 @@ function cff_style_page() {
1224
<tr>
1225
<th><label for="cff_date_formatting" class="bump-left"><?php _e('Date formatting'); ?></label></th>
1226
<td>
1227
- <select name="cff_date_formatting">
1228
<?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
1229
<option value="1" <?php if($cff_date_formatting == "1") echo 'selected="selected"' ?> ><?php _e('2 days ago'); ?></option>
1230
<option value="2" <?php if($cff_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:i a', $original); ?></option>
@@ -1241,7 +1367,7 @@ function cff_style_page() {
1241
<option value="13" <?php if($cff_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y', $original); ?></option>
1242
</select>
1243
1244
- <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('Translate this'); ?></a>
1245
<div class="cff-tooltip">
1246
<div class="cff-tooltip-table">
1247
<p style="margin-bottom: 15px;"><?php _e('Translate the text below into the language you would like to use:'); ?></p>
@@ -1296,6 +1422,105 @@ function cff_style_page() {
1296
1297
</td>
1298
</tr>
1299
<tr>
1300
<th><label for="cff_date_custom" class="bump-left"><?php _e('Custom format'); ?></label></th>
1301
<td>
@@ -1613,6 +1838,22 @@ function cff_style_page() {
1613
</tr>
1614
</tbody>
1615
</table>
1616
<hr />
1617
<h3><?php _e('Like Box'); ?></h3>
1618
<table class="form-table">
@@ -1681,6 +1922,150 @@ function cff_style_page() {
1681
</tr>
1682
</tbody>
1683
</table>
1684
<hr />
1685
<h3><?php _e('Separating Line'); ?></h3>
1686
<table class="form-table">
@@ -1704,6 +2089,110 @@ function cff_style_page() {
1704
<?php submit_button(); ?>
1705
<a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
1706
<?php } //End Misc tab ?>
1707
</form>
1708
<?php
1709
} //End Style_Page
@@ -1711,6 +2200,7 @@ function cff_style_page() {
1711
function cff_admin_style() {
1712
wp_register_style( 'custom_wp_admin_css', plugin_dir_url( __FILE__ ) . 'css/cff-admin-style.css', false, '1.0.0' );
1713
wp_enqueue_style( 'custom_wp_admin_css' );
1714
}
1715
add_action( 'admin_enqueue_scripts', 'cff_admin_style' );
1716
//Enqueue admin scripts
45
// Read in existing option value from database
46
$access_token_val = get_option( $access_token );
47
$page_id_val = get_option( $page_id );
48
+ $cff_page_type_val = get_option( $cff_page_type, 'page' );
49
$num_show_val = get_option( $num_show, '5' );
50
$cff_post_limit_val = get_option( $cff_post_limit );
51
$cff_show_others_val = get_option( $cff_show_others );
106
<div id="header">
107
<h1><?php _e('Custom Facebook Feed Settings'); ?></h1>
108
</div>
109
+
110
<form name="form1" method="post" action="">
111
<input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
112
<br />
133
<tr valign="top">
134
<th scope="row"><?php _e('Facebook Page ID (or slug)'); ?><br /><i style="color: #666; font-size: 11px;"><?php _e('(This can usually be found in your <a class="cff-tooltip-link" href="JavaScript:void(0);">Facebook page URL</a>)</i>'); ?></th>
135
<td>
136
+ <input name="cff_page_id" id="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
137
&nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What\'s my Page ID?'); ?></a>
138
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123 or smashballoon</i>
139
<div class="cff-tooltip">
159
</div>
160
</td>
161
</tr>
162
+
163
<tr valign="top" class="cff-page-options">
164
+ <th scope="row"><?php _e('Show posts on my page by:'); ?></th>
165
<td>
166
+ <select name="cff_show_others" id="cff_show_others" style="width: 250px;">
167
+ <option value="me" <?php if($cff_show_others_val == 'me') echo 'selected="selected"' ?> ><?php _e('Only the page owner (me)'); ?></option>
168
+ <option value="others" <?php if($cff_show_others_val == 'others' || $cff_show_others_val == 'on') echo 'selected="selected"' ?> ><?php _e('Page owner + other people'); ?></option>
169
+ <option value="onlyothers" <?php if($cff_show_others_val == 'onlyothers') echo 'selected="selected"' ?> ><?php _e('Only other people'); ?></option>
170
+ </select>
171
+
172
+ <p id="cff-others-only" style="font-size: 12px;"><b>Note:</b> Only displaying posts by other people works by retrieving your posts from Facebook and then filtering out the posts by the page owner. If this option doesn't display many posts then you can retrieve more by setting the post limit option (below) to a higher number.</p>
173
+
174
</td>
175
</tr>
176
293
</table>
294
<?php submit_button(); ?>
295
</form>
296
+
297
+ <p class="admin-notice"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Users of this free plugin can now get <b><u>10% off</u></b> The Custom Facebook Feed Pro. Just use the coupon code <b><u>FREEUSER</u></b></a></p>
298
+
299
<hr />
300
<h3><?php _e('Displaying your Feed'); ?></h3>
301
<p><?php _e('Copy and paste this shortcode directly into the page, post or widget where you\'d like the feed to show up:'); ?></p>
328
<p>PHP cURL: <b><?php echo is_callable('curl_init') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
329
<p>JSON: <b><?php echo function_exists("json_decode") ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
330
331
+ <button class="button secondary-button" id="cff-api-test">Test connection to Facebook API</button>
332
+
333
+ <div id="cff-api-test-result">
334
+ <div class="cff-loader"></div>
335
+ <textarea readonly="readonly" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)."></textarea>
336
+ </div>
337
338
339
<?php
346
$style_post_layout_hidden_field_name = 'cff_style_post_layout_submit_hidden';
347
$style_typography_hidden_field_name = 'cff_style_typography_submit_hidden';
348
$style_misc_hidden_field_name = 'cff_style_misc_submit_hidden';
349
+ $style_custom_text_hidden_field_name = 'cff_style_custom_text_submit_hidden';
350
$defaults = array(
351
//Post types
352
'cff_show_links_type' => true,
368
'cff_show_link' => true,
369
'cff_show_like_box' => true,
370
//Typography
371
'cff_title_format' => 'p',
372
'cff_title_size' => 'inherit',
373
'cff_title_weight' => 'inherit',
400
'cff_date_custom' => '',
401
'cff_date_before' => '',
402
'cff_date_after' => '',
403
+ 'cff_timezone' => 'America/Chicago',
404
405
//Link to Facebook
406
'cff_link_size' => 'inherit',
429
'cff_likebox_bg_color' => '',
430
'cff_like_box_text_color' => 'blue',
431
'cff_video_height' => '',
432
+ 'cff_show_author' => true,
433
'cff_class' => '',
434
+ 'cff_open_links' => true,
435
//New
436
'cff_custom_css' => '',
437
+ 'cff_custom_js' => '',
438
'cff_title_link' => false,
439
'cff_event_title_link' => false,
440
'cff_video_action' => 'file',
441
'cff_sep_color' => '',
442
+ 'cff_sep_size' => '1',
443
+
444
+ //Feed Header
445
+ 'cff_show_header' => '',
446
+ 'cff_header_outside' => false,
447
+ 'cff_header_text' => '',
448
+ 'cff_header_bg_color' => '',
449
+ 'cff_header_padding' => '',
450
+ 'cff_header_text_size' => '',
451
+ 'cff_header_text_weight' => '',
452
+ 'cff_header_text_color' => '',
453
+ 'cff_header_icon' => '',
454
+ 'cff_header_icon_color' => '',
455
+ 'cff_header_icon_size' => '28',
456
+
457
+ //Translate - general
458
+ 'cff_see_more_text' => 'See More',
459
+ 'cff_see_less_text' => 'See Less',
460
+ 'cff_facebook_link_text' => 'View on Facebook',
461
+
462
+ 'cff_translate_photos_text' => 'photos',
463
+
464
+ //Translate - date
465
+ 'cff_translate_second' => 'second',
466
+ 'cff_translate_seconds' => 'seconds',
467
+ 'cff_translate_minute' => 'minute',
468
+ 'cff_translate_minutes' => 'minutes',
469
+ 'cff_translate_hour' => 'hour',
470
+ 'cff_translate_hours' => 'hours',
471
+ 'cff_translate_day' => 'day',
472
+ 'cff_translate_days' => 'days',
473
+ 'cff_translate_week' => 'week',
474
+ 'cff_translate_weeks' => 'weeks',
475
+ 'cff_translate_month' => 'month',
476
+ 'cff_translate_months' => 'months',
477
+ 'cff_translate_year' => 'year',
478
+ 'cff_translate_years' => 'years',
479
+ 'cff_translate_ago' => 'ago'
480
);
481
//Save layout option in an array
482
$options = wp_parse_args(get_option('cff_style_settings'), $defaults);
483
add_option( 'cff_style_settings', $options );
484
+
485
//Set the page variables
486
//Post types
487
$cff_show_links_type = $options[ 'cff_show_links_type' ];
537
$cff_date_custom = $options[ 'cff_date_custom' ];
538
$cff_date_before = $options[ 'cff_date_before' ];
539
$cff_date_after = $options[ 'cff_date_after' ];
540
+ $cff_timezone = $options[ 'cff_timezone' ];
541
+
542
//Date translate
543
$cff_translate_second = $options[ 'cff_translate_second' ];
544
$cff_translate_seconds = $options[ 'cff_translate_seconds' ];
555
$cff_translate_year = $options[ 'cff_translate_year' ];
556
$cff_translate_years = $options[ 'cff_translate_years' ];
557
$cff_translate_ago = $options[ 'cff_translate_ago' ];
558
+ //Photos translate
559
+ $cff_translate_photos_text = $options[ 'cff_translate_photos_text' ];
560
561
//View on Facebook link
562
$cff_link_size = $options[ 'cff_link_size' ];
588
$cff_video_height = $options[ 'cff_video_height' ];
589
$cff_show_author = $options[ 'cff_show_author' ];
590
$cff_class = $options[ 'cff_class' ];
591
+ $cff_open_links = $options[ 'cff_open_links' ];
592
+
593
+ //Page Header
594
+ $cff_show_header = $options[ 'cff_show_header' ];
595
+ $cff_header_outside = $options[ 'cff_header_outside' ];
596
+ $cff_header_text = $options[ 'cff_header_text' ];
597
+ $cff_header_bg_color = $options[ 'cff_header_bg_color' ];
598
+ $cff_header_padding = $options[ 'cff_header_padding' ];
599
+ $cff_header_text_size = $options[ 'cff_header_text_size' ];
600
+ $cff_header_text_weight = $options[ 'cff_header_text_weight' ];
601
+ $cff_header_text_color = $options[ 'cff_header_text_color' ];
602
+ $cff_header_icon = $options[ 'cff_header_icon' ];
603
+ $cff_header_icon_color = $options[ 'cff_header_icon_color' ];
604
+ $cff_header_icon_size = $options[ 'cff_header_icon_size' ];
605
606
//New
607
$cff_custom_css = $options[ 'cff_custom_css' ];
608
+ $cff_custom_js = $options[ 'cff_custom_js' ];
609
$cff_title_link = $options[ 'cff_title_link' ];
610
$cff_event_title_link = $options[ 'cff_event_title_link' ];
611
$cff_video_action = $options[ 'cff_video_action' ];
623
//Update the General options
624
if( isset($_POST[ $style_general_hidden_field_name ]) && $_POST[ $style_general_hidden_field_name ] == 'Y' ) {
625
//General
626
+ if (isset($_POST[ 'cff_feed_width' ]) ) $cff_feed_width = $_POST[ 'cff_feed_width' ];
627
+ if (isset($_POST[ 'cff_feed_height' ]) ) $cff_feed_height = $_POST[ 'cff_feed_height' ];
628
+ if (isset($_POST[ 'cff_feed_padding' ]) ) $cff_feed_padding = $_POST[ 'cff_feed_padding' ];
629
+ if (isset($_POST[ 'cff_bg_color' ]) ) $cff_bg_color = $_POST[ 'cff_bg_color' ];
630
+ (isset($_POST[ 'cff_show_author' ]) ) ? $cff_show_author = $_POST[ 'cff_show_author' ] : $cff_show_author = '';
631
+ if (isset($_POST[ 'cff_class' ]) ) $cff_class = $_POST[ 'cff_class' ];
632
//Post types
633
+ if (isset($_POST[ 'cff_show_links_type' ]) ) $cff_show_links_type = $_POST[ 'cff_show_links_type' ];
634
+ if (isset($_POST[ 'cff_show_event_type' ]) ) $cff_show_event_type = $_POST[ 'cff_show_event_type' ];
635
+ if (isset($_POST[ 'cff_show_video_type' ]) ) $cff_show_video_type = $_POST[ 'cff_show_video_type' ];
636
+ if (isset($_POST[ 'cff_show_photos_type' ]) ) $cff_show_photos_type = $_POST[ 'cff_show_photos_type' ];
637
+ if (isset($_POST[ 'cff_show_status_type' ]) ) $cff_show_status_type = $_POST[ 'cff_show_status_type' ];
638
//General
639
$options[ 'cff_feed_width' ] = $cff_feed_width;
640
$options[ 'cff_feed_height' ] = $cff_feed_height;
642
$options[ 'cff_bg_color' ] = $cff_bg_color;
643
$options[ 'cff_show_author' ] = $cff_show_author;
644
$options[ 'cff_class' ] = $cff_class;
645
+ //Post types
646
$options[ 'cff_show_links_type' ] = $cff_show_links_type;
647
$options[ 'cff_show_event_type' ] = $cff_show_event_type;
648
$options[ 'cff_show_video_type' ] = $cff_show_video_type;
652
//Update the Post Layout options
653
if( isset($_POST[ $style_post_layout_hidden_field_name ]) && $_POST[ $style_post_layout_hidden_field_name ] == 'Y' ) {
654
//Layout
655
+ if (isset($_POST[ 'cff_preset_layout' ]) ) $cff_preset_layout = $_POST[ 'cff_preset_layout' ];
656
//Include
657
+ (isset($_POST[ 'cff_show_text' ]) ) ? $cff_show_text = $_POST[ 'cff_show_text' ] : $cff_show_text = '';
658
+ (isset($_POST[ 'cff_show_desc' ]) ) ? $cff_show_desc = $_POST[ 'cff_show_desc' ] : $cff_show_desc = '';
659
+ (isset($_POST[ 'cff_show_shared_links' ]) ) ? $cff_show_shared_links = $_POST[ 'cff_show_shared_links' ] : $cff_show_shared_links = '';
660
+ (isset($_POST[ 'cff_show_date' ]) ) ? $cff_show_date = $_POST[ 'cff_show_date' ] : $cff_show_date = '';
661
+ (isset($_POST[ 'cff_show_media' ]) ) ? $cff_show_media = $_POST[ 'cff_show_media' ] : $cff_show_media = '';
662
+ (isset($_POST[ 'cff_show_event_title' ]) ) ? $cff_show_event_title = $_POST[ 'cff_show_event_title' ] : $cff_show_event_title = '';
663
+ (isset($_POST[ 'cff_show_event_details' ]) ) ? $cff_show_event_details = $_POST[ 'cff_show_event_details' ] : $cff_show_event_details = '';
664
+ (isset($_POST[ 'cff_show_meta' ]) ) ? $cff_show_meta = $_POST[ 'cff_show_meta' ] : $cff_show_meta = '';
665
+ (isset($_POST[ 'cff_show_link' ]) ) ? $cff_show_link = $_POST[ 'cff_show_link' ] : $cff_show_link = '';
666
//Layout
667
$options[ 'cff_preset_layout' ] = $cff_preset_layout;
668
//Include
679
//Update the Typography options
680
if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
681
//Character limits
682
+ if (isset($_POST[ 'cff_title_length' ]) ) $cff_title_length_val = $_POST[ $cff_title_length ];
683
+ if (isset($_POST[ 'cff_body_length' ]) ) $cff_body_length_val = $_POST[ $cff_body_length ];
684
//Typography
685
+ if (isset($_POST[ 'cff_title_format' ]) ) $cff_title_format = $_POST[ 'cff_title_format' ];
686
+ if (isset($_POST[ 'cff_title_size' ]) ) $cff_title_size = $_POST[ 'cff_title_size' ];
687
+ if (isset($_POST[ 'cff_title_weight' ]) ) $cff_title_weight = $_POST[ 'cff_title_weight' ];
688
+ if (isset($_POST[ 'cff_title_color' ]) ) $cff_title_color = $_POST[ 'cff_title_color' ];
689
+ (isset($_POST[ 'cff_title_link' ]) ) ? $cff_title_link = $_POST[ 'cff_title_link' ] : $cff_title_link = '';
690
$cff_body_size = $_POST[ 'cff_body_size' ];
691
+ if (isset($_POST[ 'cff_body_weight' ]) ) $cff_body_weight = $_POST[ 'cff_body_weight' ];
692
+ if (isset($_POST[ 'cff_body_color' ]) ) $cff_body_color = $_POST[ 'cff_body_color' ];
693
//Event title
694
+ if (isset($_POST[ 'cff_event_title_format' ]) ) $cff_event_title_format = $_POST[ 'cff_event_title_format' ];
695
+ if (isset($_POST[ 'cff_event_title_size' ]) ) $cff_event_title_size = $_POST[ 'cff_event_title_size' ];
696
+ if (isset($_POST[ 'cff_event_title_weight' ]) ) $cff_event_title_weight = $_POST[ 'cff_event_title_weight' ];
697
+ if (isset($_POST[ 'cff_event_title_color' ]) ) $cff_event_title_color = $_POST[ 'cff_event_title_color' ];
698
+ (isset($_POST[ 'cff_event_title_link' ]) ) ? $cff_event_title_link = $_POST[ 'cff_event_title_link' ] : $cff_event_title_link = '';
699
//Event date
700
+ if (isset($_POST[ 'cff_event_date_size' ]) ) $cff_event_date_size = $_POST[ 'cff_event_date_size' ];
701
+ if (isset($_POST[ 'cff_event_date_weight' ]) ) $cff_event_date_weight = $_POST[ 'cff_event_date_weight' ];
702
+ if (isset($_POST[ 'cff_event_date_color' ]) ) $cff_event_date_color = $_POST[ 'cff_event_date_color' ];
703
+ if (isset($_POST[ 'cff_event_date_position' ]) ) $cff_event_date_position = $_POST[ 'cff_event_date_position' ];
704
+ if (isset($_POST[ 'cff_event_date_formatting' ]) ) $cff_event_date_formatting = $_POST[ 'cff_event_date_formatting' ];
705
+ if (isset($_POST[ 'cff_event_date_custom' ]) ) $cff_event_date_custom = $_POST[ 'cff_event_date_custom' ];
706
//Event details
707
+ if (isset($_POST[ 'cff_event_details_size' ]) ) $cff_event_details_size = $_POST[ 'cff_event_details_size' ];
708
+ if (isset($_POST[ 'cff_event_details_weight' ]) ) $cff_event_details_weight = $_POST[ 'cff_event_details_weight' ];
709
+ if (isset($_POST[ 'cff_event_details_color' ]) ) $cff_event_details_color = $_POST[ 'cff_event_details_color' ];
710
//Date
711
+ if (isset($_POST[ 'cff_date_position' ]) ) $cff_date_position = $_POST[ 'cff_date_position' ];
712
+ if (isset($_POST[ 'cff_date_size' ]) ) $cff_date_size = $_POST[ 'cff_date_size' ];
713
+ if (isset($_POST[ 'cff_date_weight' ]) ) $cff_date_weight = $_POST[ 'cff_date_weight' ];
714
+ if (isset($_POST[ 'cff_date_color' ]) ) $cff_date_color = $_POST[ 'cff_date_color' ];
715
+ if (isset($_POST[ 'cff_date_formatting' ]) ) $cff_date_formatting = $_POST[ 'cff_date_formatting' ];
716
+ if (isset($_POST[ 'cff_date_custom' ]) ) $cff_date_custom = $_POST[ 'cff_date_custom' ];
717
+ if (isset($_POST[ 'cff_date_before' ]) ) $cff_date_before = $_POST[ 'cff_date_before' ];
718
+ if (isset($_POST[ 'cff_date_after' ]) ) $cff_date_after = $_POST[ 'cff_date_after' ];
719
+ if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = $_POST[ 'cff_timezone' ];
720
+
721
//Date translate
722
+ if (isset($_POST[ 'cff_translate_second' ]) ) $cff_translate_second = $_POST[ 'cff_translate_second' ];
723
+ if (isset($_POST[ 'cff_translate_seconds' ]) ) $cff_translate_seconds = $_POST[ 'cff_translate_seconds' ];
724
+ if (isset($_POST[ 'cff_translate_minute' ]) ) $cff_translate_minute = $_POST[ 'cff_translate_minute' ];
725
+ if (isset($_POST[ 'cff_translate_minutes' ]) ) $cff_translate_minutes = $_POST[ 'cff_translate_minutes' ];
726
+ if (isset($_POST[ 'cff_translate_hour' ]) ) $cff_translate_hour = $_POST[ 'cff_translate_hour' ];
727
+ if (isset($_POST[ 'cff_translate_hours' ]) ) $cff_translate_hours = $_POST[ 'cff_translate_hours' ];
728
+ if (isset($_POST[ 'cff_translate_day' ]) ) $cff_translate_day = $_POST[ 'cff_translate_day' ];
729
+ if (isset($_POST[ 'cff_translate_days' ]) ) $cff_translate_days = $_POST[ 'cff_translate_days' ];
730
+ if (isset($_POST[ 'cff_translate_week' ]) ) $cff_translate_week = $_POST[ 'cff_translate_week' ];
731
+ if (isset($_POST[ 'cff_translate_weeks' ]) ) $cff_translate_weeks = $_POST[ 'cff_translate_weeks' ];
732
+ if (isset($_POST[ 'cff_translate_month' ]) ) $cff_translate_month = $_POST[ 'cff_translate_month' ];
733
+ if (isset($_POST[ 'cff_translate_months' ]) ) $cff_translate_months = $_POST[ 'cff_translate_months' ];
734
+ if (isset($_POST[ 'cff_translate_year' ]) ) $cff_translate_year = $_POST[ 'cff_translate_year' ];
735
+ if (isset($_POST[ 'cff_translate_years' ]) ) $cff_translate_years = $_POST[ 'cff_translate_years' ];
736
+ if (isset($_POST[ 'cff_translate_ago' ]) ) $cff_translate_ago = $_POST[ 'cff_translate_ago' ];
737
738
//View on Facebook link
739
+ if (isset($_POST[ 'cff_link_size' ]) ) $cff_link_size = $_POST[ 'cff_link_size' ];
740
+ if (isset($_POST[ 'cff_link_weight' ]) ) $cff_link_weight = $_POST[ 'cff_link_weight' ];
741
+ if (isset($_POST[ 'cff_link_color' ]) ) $cff_link_color = $_POST[ 'cff_link_color' ];
742
+ if (isset($_POST[ 'cff_facebook_link_text' ]) ) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
743
+ if (isset($_POST[ 'cff_view_link_text' ]) ) $cff_view_link_text = $_POST[ 'cff_view_link_text' ];
744
+ if (isset($_POST[ 'cff_link_to_timeline' ]) ) $cff_link_to_timeline = $_POST[ 'cff_link_to_timeline' ];
745
//Character limits
746
update_option( $cff_title_length, $cff_title_length_val );
747
update_option( $cff_body_length, $cff_body_length_val );
748
//Typography
749
$options[ 'cff_title_format' ] = $cff_title_format;
750
$options[ 'cff_title_size' ] = $cff_title_size;
780
$options[ 'cff_date_custom' ] = $cff_date_custom;
781
$options[ 'cff_date_before' ] = $cff_date_before;
782
$options[ 'cff_date_after' ] = $cff_date_after;
783
+ $options[ 'cff_timezone' ] = $cff_timezone;
784
+
785
//Date translate
786
$options[ 'cff_translate_second' ] = $cff_translate_second;
787
$options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
810
//Update the Misc options
811
if( isset($_POST[ $style_misc_hidden_field_name ]) && $_POST[ $style_misc_hidden_field_name ] == 'Y' ) {
812
//Meta
813
+ if (isset($_POST[ 'cff_icon_style' ])) $cff_icon_style = $_POST[ 'cff_icon_style' ];
814
+ if (isset($_POST[ 'cff_meta_text_color' ])) $cff_meta_text_color = $_POST[ 'cff_meta_text_color' ];
815
+ if (isset($_POST[ 'cff_meta_bg_color' ])) $cff_meta_bg_color = $_POST[ 'cff_meta_bg_color' ];
816
+ if (isset($_POST[ 'cff_nocomments_text' ])) $cff_nocomments_text = $_POST[ 'cff_nocomments_text' ];
817
+ if (isset($_POST[ 'cff_hide_comments' ])) $cff_hide_comments = $_POST[ 'cff_hide_comments' ];
818
//Custom CSS
819
+ if (isset($_POST[ 'cff_custom_css' ])) $cff_custom_css = $_POST[ 'cff_custom_css' ];
820
+ if (isset($_POST[ 'cff_custom_js' ])) $cff_custom_js = $_POST[ 'cff_custom_js' ];
821
//Misc
822
+ (isset($_POST[ 'cff_show_like_box' ])) ? $cff_show_like_box = $_POST[ 'cff_show_like_box' ] : $cff_show_like_box = '';
823
+ if (isset($_POST[ 'cff_like_box_position' ])) $cff_like_box_position = $_POST[ 'cff_like_box_position' ];
824
+ (isset($_POST[ 'cff_like_box_outside' ])) ? $cff_like_box_outside = $_POST[ 'cff_like_box_outside' ] : $cff_like_box_outside = '';
825
+ if (isset($_POST[ 'cff_likebox_bg_color' ])) $cff_likebox_bg_color = $_POST[ 'cff_likebox_bg_color' ];
826
+ if (isset($_POST[ 'cff_like_box_text_color' ])) $cff_like_box_text_color = $_POST[ 'cff_like_box_text_color' ];
827
+
828
+ if (isset($_POST[ 'cff_likebox_width' ])) $cff_likebox_width = $_POST[ 'cff_likebox_width' ];
829
+ (isset($_POST[ 'cff_like_box_faces' ])) ? $cff_like_box_faces = $_POST[ 'cff_like_box_faces' ] : $cff_like_box_faces = '';
830
+ (isset($_POST[ 'cff_like_box_border' ])) ? $cff_like_box_border = $_POST[ 'cff_like_box_border' ] : $cff_like_box_border = '';
831
832
+ //Page Header
833
+ (isset($_POST[ 'cff_show_header' ])) ? $cff_show_header = $_POST[ 'cff_show_header' ] : $cff_show_header = '';
834
+ (isset($_POST[ 'cff_header_outside' ])) ? $cff_header_outside = $_POST[ 'cff_header_outside' ] : $cff_header_outside = '';
835
+ if (isset($_POST[ 'cff_header_text' ])) $cff_header_text = $_POST[ 'cff_header_text' ];
836
+ if (isset($_POST[ 'cff_header_bg_color' ])) $cff_header_bg_color = $_POST[ 'cff_header_bg_color' ];
837
+ if (isset($_POST[ 'cff_header_padding' ])) $cff_header_padding = $_POST[ 'cff_header_padding' ];
838
+ if (isset($_POST[ 'cff_header_text_size' ])) $cff_header_text_size = $_POST[ 'cff_header_text_size' ];
839
+ if (isset($_POST[ 'cff_header_text_weight' ])) $cff_header_text_weight = $_POST[ 'cff_header_text_weight' ];
840
+ if (isset($_POST[ 'cff_header_text_color' ])) $cff_header_text_color = $_POST[ 'cff_header_text_color' ];
841
+ if (isset($_POST[ 'cff_header_icon' ])) $cff_header_icon = $_POST[ 'cff_header_icon' ];
842
+ if (isset($_POST[ 'cff_header_icon_color' ])) $cff_header_icon_color = $_POST[ 'cff_header_icon_color' ];
843
+ if (isset($_POST[ 'cff_header_icon_size' ])) $cff_header_icon_size = $_POST[ 'cff_header_icon_size' ];
844
845
+ if (isset($_POST[ 'cff_video_height' ])) $cff_video_height = $_POST[ 'cff_video_height' ];
846
+ if (isset($_POST[ 'cff_video_action' ])) $cff_video_action = $_POST[ 'cff_video_action' ];
847
+ if (isset($_POST[ 'cff_sep_color' ])) $cff_sep_color = $_POST[ 'cff_sep_color' ];
848
+ if (isset($_POST[ 'cff_sep_size' ])) $cff_sep_size = $_POST[ 'cff_sep_size' ];
849
+ if (isset($_POST[ 'cff_open_links' ])) $cff_open_links = $_POST[ 'cff_open_links' ];
850
//Meta
851
$options[ 'cff_icon_style' ] = $cff_icon_style;
852
$options[ 'cff_meta_text_color' ] = $cff_meta_text_color;
855
$options[ 'cff_hide_comments' ] = $cff_hide_comments;
856
//Custom CSS
857
$options[ 'cff_custom_css' ] = $cff_custom_css;
858
+ $options[ 'cff_custom_js' ] = $cff_custom_js;
859
//Misc
860
$options[ 'cff_show_like_box' ] = $cff_show_like_box;
861
$options[ 'cff_like_box_position' ] = $cff_like_box_position;
867
$options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
868
$options[ 'cff_like_box_border' ] = $cff_like_box_border;
869
870
+ //Page Header
871
+ $options[ 'cff_show_header' ] = $cff_show_header;
872
+ $options[ 'cff_header_outside' ] = $cff_header_outside;
873
+ $options[ 'cff_header_text' ] = $cff_header_text;
874
+ $options[ 'cff_header_bg_color' ] = $cff_header_bg_color;
875
+ $options[ 'cff_header_padding' ] = $cff_header_padding;
876
+ $options[ 'cff_header_text_size' ] = $cff_header_text_size;
877
+ $options[ 'cff_header_text_weight' ] = $cff_header_text_weight;
878
+ $options[ 'cff_header_text_color' ] = $cff_header_text_color;
879
+ $options[ 'cff_header_icon' ] = $cff_header_icon;
880
+ $options[ 'cff_header_icon_color' ] = $cff_header_icon_color;
881
+ $options[ 'cff_header_icon_size' ] = $cff_header_icon_size;
882
+
883
$options[ 'cff_video_height' ] = $cff_video_height;
884
$options[ 'cff_video_action' ] = $cff_video_action;
885
$options[ 'cff_sep_color' ] = $cff_sep_color;
886
$options[ 'cff_sep_size' ] = $cff_sep_size;
887
$options[ 'cff_open_links' ] = $cff_open_links;
888
}
889
+ //Update the Custom Text / Translate options
890
+ if( isset($_POST[ $style_custom_text_hidden_field_name ]) && $_POST[ $style_custom_text_hidden_field_name ] == 'Y' ) {
891
+
892
+ //Translate
893
+ if (isset($_POST[ 'cff_see_more_text' ])) $cff_see_more_text = $_POST[ 'cff_see_more_text' ];
894
+ if (isset($_POST[ 'cff_see_less_text' ])) $cff_see_less_text = $_POST[ 'cff_see_less_text' ];
895
+ if (isset($_POST[ 'cff_facebook_link_text' ])) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
896
+
897
+ //Social translate
898
+ if (isset($_POST[ 'cff_translate_photos_text' ])) $cff_translate_photos_text = $_POST[ 'cff_translate_photos_text' ];
899
+
900
+ //Date translate
901
+ if (isset($_POST[ 'cff_translate_second' ])) $cff_translate_second = $_POST[ 'cff_translate_second' ];
902
+ if (isset($_POST[ 'cff_translate_seconds' ])) $cff_translate_seconds = $_POST[ 'cff_translate_seconds' ];
903
+ if (isset($_POST[ 'cff_translate_minute' ])) $cff_translate_minute = $_POST[ 'cff_translate_minute' ];
904
+ if (isset($_POST[ 'cff_translate_minutes' ])) $cff_translate_minutes = $_POST[ 'cff_translate_minutes' ];
905
+ if (isset($_POST[ 'cff_translate_hour' ])) $cff_translate_hour = $_POST[ 'cff_translate_hour' ];
906
+ if (isset($_POST[ 'cff_translate_hours' ])) $cff_translate_hours = $_POST[ 'cff_translate_hours' ];
907
+ if (isset($_POST[ 'cff_translate_day' ])) $cff_translate_day = $_POST[ 'cff_translate_day' ];
908
+ if (isset($_POST[ 'cff_translate_days' ])) $cff_translate_days = $_POST[ 'cff_translate_days' ];
909
+ if (isset($_POST[ 'cff_translate_week' ])) $cff_translate_week = $_POST[ 'cff_translate_week' ];
910
+ if (isset($_POST[ 'cff_translate_weeks' ])) $cff_translate_weeks = $_POST[ 'cff_translate_weeks' ];
911
+ if (isset($_POST[ 'cff_translate_month' ])) $cff_translate_month = $_POST[ 'cff_translate_month' ];
912
+ if (isset($_POST[ 'cff_translate_months' ])) $cff_translate_months = $_POST[ 'cff_translate_months' ];
913
+ if (isset($_POST[ 'cff_translate_year' ])) $cff_translate_year = $_POST[ 'cff_translate_year' ];
914
+ if (isset($_POST[ 'cff_translate_years' ])) $cff_translate_years = $_POST[ 'cff_translate_years' ];
915
+ if (isset($_POST[ 'cff_translate_ago' ])) $cff_translate_ago = $_POST[ 'cff_translate_ago' ];
916
+
917
+ //Translate
918
+ $options[ 'cff_see_more_text' ] = $cff_see_more_text;
919
+ $options[ 'cff_see_less_text' ] = $cff_see_less_text;
920
+ $options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
921
+ //Social translate
922
+ $options[ 'cff_translate_photos_text' ] = $cff_translate_photos_text;
923
+
924
+ //Date translate
925
+ $options[ 'cff_translate_second' ] = $cff_translate_second;
926
+ $options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
927
+ $options[ 'cff_translate_minute' ] = $cff_translate_minute;
928
+ $options[ 'cff_translate_minutes' ] = $cff_translate_minutes;
929
+ $options[ 'cff_translate_hour' ] = $cff_translate_hour;
930
+ $options[ 'cff_translate_hours' ] = $cff_translate_hours;
931
+ $options[ 'cff_translate_day' ] = $cff_translate_day;
932
+ $options[ 'cff_translate_days' ] = $cff_translate_days;
933
+ $options[ 'cff_translate_week' ] = $cff_translate_week;
934
+ $options[ 'cff_translate_weeks' ] = $cff_translate_weeks;
935
+ $options[ 'cff_translate_month' ] = $cff_translate_month;
936
+ $options[ 'cff_translate_months' ] = $cff_translate_months;
937
+ $options[ 'cff_translate_year' ] = $cff_translate_year;
938
+ $options[ 'cff_translate_years' ] = $cff_translate_years;
939
+ $options[ 'cff_translate_ago' ] = $cff_translate_ago;
940
+
941
+ }
942
//Update the array
943
update_option( 'cff_style_settings', $options );
944
// Put an settings updated message on the screen
960
<a href="?page=cff-style&tab=post_layout" class="nav-tab <?php echo $active_tab == 'post_layout' ? 'nav-tab-active' : ''; ?>"><?php _e('Post Layout'); ?></a>
961
<a href="?page=cff-style&tab=typography" class="nav-tab <?php echo $active_tab == 'typography' ? 'nav-tab-active' : ''; ?>"><?php _e('Typography'); ?></a>
962
<a href="?page=cff-style&tab=misc" class="nav-tab <?php echo $active_tab == 'misc' ? 'nav-tab-active' : ''; ?>"><?php _e('Misc'); ?></a>
963
+ <a href="?page=cff-style&tab=custom_text" class="nav-tab <?php echo $active_tab == 'custom_text' ? 'nav-tab-active' : ''; ?>"><?php _e('Custom Text / Translate'); ?></a>
964
</h2>
965
<?php if( $active_tab == 'general' ) { //Start General tab ?>
966
<input type="hidden" name="<?php echo $style_general_hidden_field_name; ?>" value="Y">
1165
<input name="cff_body_length" type="text" value="<?php esc_attr_e( $cff_body_length_val ); ?>" size="4" /> <span><?php _e('Characters.'); ?></span> <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Leave empty to set no maximum length'); ?></i>
1166
</td>
1167
</tr>
1168
</tbody>
1169
</table>
1170
</div>
1350
<tr>
1351
<th><label for="cff_date_formatting" class="bump-left"><?php _e('Date formatting'); ?></label></th>
1352
<td>
1353
+ <select name="cff_date_formatting" id="cff-date-formatting">
1354
<?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
1355
<option value="1" <?php if($cff_date_formatting == "1") echo 'selected="selected"' ?> ><?php _e('2 days ago'); ?></option>
1356
<option value="2" <?php if($cff_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:i a', $original); ?></option>
1367
<option value="13" <?php if($cff_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y', $original); ?></option>
1368
</select>
1369
1370
+ <a class="cff-tooltip-link" href="JavaScript:void(0);" id="cff-translate-date"><?php _e('Translate this'); ?></a>
1371
<div class="cff-tooltip">
1372
<div class="cff-tooltip-table">
1373
<p style="margin-bottom: 15px;"><?php _e('Translate the text below into the language you would like to use:'); ?></p>
1422
1423
</td>
1424
</tr>
1425
+
1426
+ <tr>
1427
+ <th><label for="cff_timezone" class="bump-left"><?php _e('Timezone'); ?></label></th>
1428
+ <td>
1429
+ <select name="cff_timezone" style="width: 300px;">
1430
+ <option value="Pacific/Midway" <?php if($cff_timezone == "Pacific/Midway") echo 'selected="selected"' ?> ><?php _e('(GMT-11:00) Midway Island, Samoa'); ?></option>
1431
+ <option value="America/Adak" <?php if($cff_timezone == "America/Adak") echo 'selected="selected"' ?> ><?php _e('(GMT-10:00) Hawaii-Aleutian'); ?></option>
1432
+ <option value="Etc/GMT+10" <?php if($cff_timezone == "Etc/GMT+10") echo 'selected="selected"' ?> ><?php _e('(GMT-10:00) Hawaii'); ?></option>
1433
+ <option value="Pacific/Marquesas" <?php if($cff_timezone == "Pacific/Marquesas") echo 'selected="selected"' ?> ><?php _e('(GMT-09:30) Marquesas Islands'); ?></option>
1434
+ <option value="Pacific/Gambier" <?php if($cff_timezone == "Pacific/Gambier") echo 'selected="selected"' ?> ><?php _e('(GMT-09:00) Gambier Islands'); ?></option>
1435
+ <option value="America/Anchorage" <?php if($cff_timezone == "America/Anchorage") echo 'selected="selected"' ?> ><?php _e('(GMT-09:00) Alaska'); ?></option>
1436
+ <option value="America/Ensenada" <?php if($cff_timezone == "America/Ensenada") echo 'selected="selected"' ?> ><?php _e('(GMT-08:00) Tijuana, Baja California'); ?></option>
1437
+ <option value="Etc/GMT+8" <?php if($cff_timezone == "Etc/GMT+8") echo 'selected="selected"' ?> ><?php _e('(GMT-08:00) Pitcairn Islands'); ?></option>
1438
+ <option value="America/Los_Angeles" <?php if($cff_timezone == "America/Los_Angeles") echo 'selected="selected"' ?> ><?php _e('(GMT-08:00) Pacific Time (US & Canada)'); ?></option>
1439
+ <option value="America/Denver" <?php if($cff_timezone == "America/Denver") echo 'selected="selected"' ?> ><?php _e('(GMT-07:00) Mountain Time (US & Canada)'); ?></option>
1440
+ <option value="America/Chihuahua" <?php if($cff_timezone == "America/Chihuahua") echo 'selected="selected"' ?> ><?php _e('(GMT-07:00) Chihuahua, La Paz, Mazatlan'); ?></option>
1441
+ <option value="America/Dawson_Creek" <?php if($cff_timezone == "America/Dawson_Creek") echo 'selected="selected"' ?> ><?php _e('(GMT-07:00) Arizona'); ?></option>
1442
+ <option value="America/Belize" <?php if($cff_timezone == "America/Belize") echo 'selected="selected"' ?> ><?php _e('(GMT-06:00) Saskatchewan, Central America'); ?></option>
1443
+ <option value="America/Cancun" <?php if($cff_timezone == "America/Cancun") echo 'selected="selected"' ?> ><?php _e('(GMT-06:00) Guadalajara, Mexico City, Monterrey'); ?></option>
1444
+ <option value="Chile/EasterIsland" <?php if($cff_timezone == "Chile/EasterIsland") echo 'selected="selected"' ?> ><?php _e('(GMT-06:00) Easter Island'); ?></option>
1445
+ <option value="America/Chicago" <?php if($cff_timezone == "America/Chicago") echo 'selected="selected"' ?> ><?php _e('(GMT-06:00) Central Time (US & Canada)'); ?></option>
1446
+ <option value="America/New_York" <?php if($cff_timezone == "America/New_York") echo 'selected="selected"' ?> ><?php _e('(GMT-05:00) Eastern Time (US & Canada)'); ?></option>
1447
+ <option value="America/Havana" <?php if($cff_timezone == "America/Havana") echo 'selected="selected"' ?> ><?php _e('(GMT-05:00) Cuba'); ?></option>
1448
+ <option value="America/Bogota" <?php if($cff_timezone == "America/Bogota") echo 'selected="selected"' ?> ><?php _e('(GMT-05:00) Bogota, Lima, Quito, Rio Branco'); ?></option>
1449
+ <option value="America/Caracas" <?php if($cff_timezone == "America/Caracas") echo 'selected="selected"' ?> ><?php _e('(GMT-04:30) Caracas'); ?></option>
1450
+ <option value="America/Santiago" <?php if($cff_timezone == "America/Santiago") echo 'selected="selected"' ?> ><?php _e('(GMT-04:00) Santiago'); ?></option>
1451
+ <option value="America/La_Paz" <?php if($cff_timezone == "America/La_Paz") echo 'selected="selected"' ?> ><?php _e('(GMT-04:00) La Paz'); ?></option>
1452
+ <option value="Atlantic/Stanley" <?php if($cff_timezone == "Atlantic/Stanley") echo 'selected="selected"' ?> ><?php _e('(GMT-04:00) Faukland Islands'); ?></option>
1453
+ <option value="America/Campo_Grande" <?php if($cff_timezone == "America/Campo_Grande") echo 'selected="selected"' ?> ><?php _e('(GMT-04:00) Brazil'); ?></option>
1454
+ <option value="America/Goose_Bay" <?php if($cff_timezone == "America/Goose_Bay") echo 'selected="selected"' ?> ><?php _e('(GMT-04:00) Atlantic Time (Goose Bay)'); ?></option>
1455
+ <option value="America/Glace_Bay" <?php if($cff_timezone == "America/Glace_Bay") echo 'selected="selected"' ?> ><?php _e('(GMT-04:00) Atlantic Time (Canada)'); ?></option>
1456
+ <option value="America/St_Johns" <?php if($cff_timezone == "America/St_Johns") echo 'selected="selected"' ?> ><?php _e('(GMT-03:30) Newfoundland'); ?></option>
1457
+ <option value="America/Araguaina" <?php if($cff_timezone == "America/Araguaina") echo 'selected="selected"' ?> ><?php _e('(GMT-03:00) UTC-3'); ?></option>
1458
+ <option value="America/Montevideo" <?php if($cff_timezone == "America/Montevideo") echo 'selected="selected"' ?> ><?php _e('(GMT-03:00) Montevideo'); ?></option>
1459
+ <option value="America/Miquelon" <?php if($cff_timezone == "America/Miquelon") echo 'selected="selected"' ?> ><?php _e('(GMT-03:00) Miquelon, St. Pierre'); ?></option>
1460
+ <option value="America/Godthab" <?php if($cff_timezone == "America/Godthab") echo 'selected="selected"' ?> ><?php _e('(GMT-03:00) Greenland'); ?></option>
1461
+ <option value="America/Argentina/Buenos_Aires" <?php if($cff_timezone == "America/Argentina/Buenos_Aires") echo 'selected="selected"' ?> ><?php _e('(GMT-03:00) Buenos Aires'); ?></option>
1462
+ <option value="America/Sao_Paulo" <?php if($cff_timezone == "America/Sao_Paulo") echo 'selected="selected"' ?> ><?php _e('(GMT-03:00) Brasilia'); ?></option>
1463
+ <option value="America/Noronha" <?php if($cff_timezone == "America/Noronha") echo 'selected="selected"' ?> ><?php _e('(GMT-02:00) Mid-Atlantic'); ?></option>
1464
+ <option value="Atlantic/Cape_Verde" <?php if($cff_timezone == "Atlantic/Cape_Verde") echo 'selected="selected"' ?> ><?php _e('(GMT-01:00) Cape Verde Is.'); ?></option>
1465
+ <option value="Atlantic/Azores" <?php if($cff_timezone == "Atlantic/Azores") echo 'selected="selected"' ?> ><?php _e('(GMT-01:00) Azores'); ?></option>
1466
+ <option value="Europe/Belfast" <?php if($cff_timezone == "Europe/Belfast") echo 'selected="selected"' ?> ><?php _e('(GMT) Greenwich Mean Time : Belfast'); ?></option>
1467
+ <option value="Europe/Dublin" <?php if($cff_timezone == "Europe/Dublin") echo 'selected="selected"' ?> ><?php _e('(GMT) Greenwich Mean Time : Dublin'); ?></option>
1468
+ <option value="Europe/Lisbon" <?php if($cff_timezone == "Europe/Lisbon") echo 'selected="selected"' ?> ><?php _e('(GMT) Greenwich Mean Time : Lisbon'); ?></option>
1469
+ <option value="Europe/London" <?php if($cff_timezone == "Europe/London") echo 'selected="selected"' ?> ><?php _e('(GMT) Greenwich Mean Time : London'); ?></option>
1470
+ <option value="Africa/Abidjan" <?php if($cff_timezone == "Africa/Abidjan") echo 'selected="selected"' ?> ><?php _e('(GMT) Monrovia, Reykjavik'); ?></option>
1471
+ <option value="Europe/Amsterdam" <?php if($cff_timezone == "Europe/Amsterdam") echo 'selected="selected"' ?> ><?php _e('(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna'); ?></option>
1472
+ <option value="Europe/Belgrade" <?php if($cff_timezone == "Europe/Belgrade") echo 'selected="selected"' ?> ><?php _e('(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague'); ?></option>
1473
+ <option value="Europe/Brussels" <?php if($cff_timezone == "Europe/Brussels") echo 'selected="selected"' ?> ><?php _e('(GMT+01:00) Brussels, Copenhagen, Madrid, Paris'); ?></option>
1474
+ <option value="Africa/Algiers" <?php if($cff_timezone == "Africa/Algiers") echo 'selected="selected"' ?> ><?php _e('(GMT+01:00) West Central Africa'); ?></option>
1475
+ <option value="Africa/Windhoek" <?php if($cff_timezone == "Africa/Windhoek") echo 'selected="selected"' ?> ><?php _e('(GMT+01:00) Windhoek'); ?></option>
1476
+ <option value="Asia/Beirut" <?php if($cff_timezone == "Asia/Beirut") echo 'selected="selected"' ?> ><?php _e('(GMT+02:00) Beirut'); ?></option>
1477
+ <option value="Africa/Cairo" <?php if($cff_timezone == "Africa/Cairo") echo 'selected="selected"' ?> ><?php _e('(GMT+02:00) Cairo'); ?></option>
1478
+ <option value="Asia/Gaza" <?php if($cff_timezone == "Asia/Gaza") echo 'selected="selected"' ?> ><?php _e('(GMT+02:00) Gaza'); ?></option>
1479
+ <option value="Africa/Blantyre" <?php if($cff_timezone == "Africa/Blantyre") echo 'selected="selected"' ?> ><?php _e('(GMT+02:00) Harare, Pretoria'); ?></option>
1480
+ <option value="Asia/Jerusalem" <?php if($cff_timezone == "Asia/Jerusalem") echo 'selected="selected"' ?> ><?php _e('(GMT+02:00) Jerusalem'); ?></option>
1481
+ <option value="Europe/Minsk" <?php if($cff_timezone == "Europe/Minsk") echo 'selected="selected"' ?> ><?php _e('(GMT+02:00) Minsk'); ?></option>
1482
+ <option value="Asia/Damascus" <?php if($cff_timezone == "Asia/Damascus") echo 'selected="selected"' ?> ><?php _e('(GMT+02:00) Syria'); ?></option>
1483
+ <option value="Europe/Moscow" <?php if($cff_timezone == "Europe/Moscow") echo 'selected="selected"' ?> ><?php _e('(GMT+03:00) Moscow, St. Petersburg, Volgograd'); ?></option>
1484
+ <option value="Africa/Addis_Ababa" <?php if($cff_timezone == "Africa/Addis_Ababa") echo 'selected="selected"' ?> ><?php _e('(GMT+03:00) Nairobi'); ?></option>
1485
+ <option value="Asia/Tehran" <?php if($cff_timezone == "Asia/Tehran") echo 'selected="selected"' ?> ><?php _e('(GMT+03:30) Tehran'); ?></option>
1486
+ <option value="Asia/Dubai" <?php if($cff_timezone == "Asia/Dubai") echo 'selected="selected"' ?> ><?php _e('(GMT+04:00) Abu Dhabi, Muscat'); ?></option>
1487
+ <option value="Asia/Yerevan" <?php if($cff_timezone == "Asia/Yerevan") echo 'selected="selected"' ?> ><?php _e('(GMT+04:00) Yerevan'); ?></option>
1488
+ <option value="Asia/Kabul" <?php if($cff_timezone == "Asia/Kabul") echo 'selected="selected"' ?> ><?php _e('(GMT+04:30) Kabul'); ?></option>
1489
+ <option value="Asia/Yekaterinburg" <?php if($cff_timezone == "Asia/Yekaterinburg") echo 'selected="selected"' ?> ><?php _e('(GMT+05:00) Ekaterinburg'); ?></option>
1490
+ <option value="Asia/Tashkent" <?php if($cff_timezone == "Asia/Tashkent") echo 'selected="selected"' ?> ><?php _e('(GMT+05:00) Tashkent'); ?></option>
1491
+ <option value="Asia/Kolkata" <?php if($cff_timezone == "Asia/Kolkata") echo 'selected="selected"' ?> ><?php _e('(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi'); ?></option>
1492
+ <option value="Asia/Katmandu" <?php if($cff_timezone == "Asia/Katmandu") echo 'selected="selected"' ?> ><?php _e('(GMT+05:45) Kathmandu'); ?></option>
1493
+ <option value="Asia/Dhaka" <?php if($cff_timezone == "Asia/Dhaka") echo 'selected="selected"' ?> ><?php _e('(GMT+06:00) Astana, Dhaka'); ?></option>
1494
+ <option value="Asia/Novosibirsk" <?php if($cff_timezone == "Asia/Novosibirsk") echo 'selected="selected"' ?> ><?php _e('(GMT+06:00) Novosibirsk'); ?></option>
1495
+ <option value="Asia/Rangoon" <?php if($cff_timezone == "Asia/Rangoon") echo 'selected="selected"' ?> ><?php _e('(GMT+06:30) Yangon (Rangoon)'); ?></option>
1496
+ <option value="Asia/Bangkok" <?php if($cff_timezone == "Asia/Bangkok") echo 'selected="selected"' ?> ><?php _e('(GMT+07:00) Bangkok, Hanoi, Jakarta'); ?></option>
1497
+ <option value="Asia/Krasnoyarsk" <?php if($cff_timezone == "Asia/Krasnoyarsk") echo 'selected="selected"' ?> ><?php _e('(GMT+07:00) Krasnoyarsk'); ?></option>
1498
+ <option value="Asia/Hong_Kong" <?php if($cff_timezone == "Asia/Hong_Kong") echo 'selected="selected"' ?> ><?php _e('(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi'); ?></option>
1499
+ <option value="Asia/Irkutsk" <?php if($cff_timezone == "Asia/Irkutsk") echo 'selected="selected"' ?> ><?php _e('(GMT+08:00) Irkutsk, Ulaan Bataar'); ?></option>
1500
+ <option value="Australia/Perth" <?php if($cff_timezone == "Australia/Perth") echo 'selected="selected"' ?> ><?php _e('(GMT+08:00) Perth'); ?></option>
1501
+ <option value="Australia/Eucla" <?php if($cff_timezone == "Australia/Eucla") echo 'selected="selected"' ?> ><?php _e('(GMT+08:45) Eucla'); ?></option>
1502
+ <option value="Asia/Tokyo" <?php if($cff_timezone == "Asia/Tokyo") echo 'selected="selected"' ?> ><?php _e('(GMT+09:00) Osaka, Sapporo, Tokyo'); ?></option>
1503
+ <option value="Asia/Seoul" <?php if($cff_timezone == "Asia/Seoul") echo 'selected="selected"' ?> ><?php _e('(GMT+09:00) Seoul'); ?></option>
1504
+ <option value="Asia/Yakutsk" <?php if($cff_timezone == "Asia/Yakutsk") echo 'selected="selected"' ?> ><?php _e('(GMT+09:00) Yakutsk'); ?></option>
1505
+ <option value="Australia/Adelaide" <?php if($cff_timezone == "Australia/Adelaide") echo 'selected="selected"' ?> ><?php _e('(GMT+09:30) Adelaide'); ?></option>
1506
+ <option value="Australia/Darwin" <?php if($cff_timezone == "Australia/Darwin") echo 'selected="selected"' ?> ><?php _e('(GMT+09:30) Darwin'); ?></option>
1507
+ <option value="Australia/Brisbane" <?php if($cff_timezone == "Australia/Brisbane") echo 'selected="selected"' ?> ><?php _e('(GMT+10:00) Brisbane'); ?></option>
1508
+ <option value="Australia/Hobart" <?php if($cff_timezone == "Australia/Hobart") echo 'selected="selected"' ?> ><?php _e('(GMT+10:00) Hobart'); ?></option>
1509
+ <option value="Asia/Vladivostok" <?php if($cff_timezone == "Asia/Vladivostok") echo 'selected="selected"' ?> ><?php _e('(GMT+10:00) Vladivostok'); ?></option>
1510
+ <option value="Australia/Lord_Howe" <?php if($cff_timezone == "Australia/Lord_Howe") echo 'selected="selected"' ?> ><?php _e('(GMT+10:30) Lord Howe Island'); ?></option>
1511
+ <option value="Etc/GMT-11" <?php if($cff_timezone == "Etc/GMT-11") echo 'selected="selected"' ?> ><?php _e('(GMT+11:00) Solomon Is., New Caledonia'); ?></option>
1512
+ <option value="Asia/Magadan" <?php if($cff_timezone == "Asia/Magadan") echo 'selected="selected"' ?> ><?php _e('(GMT+11:00) Magadan'); ?></option>
1513
+ <option value="Pacific/Norfolk" <?php if($cff_timezone == "Pacific/Norfolk") echo 'selected="selected"' ?> ><?php _e('(GMT+11:30) Norfolk Island'); ?></option>
1514
+ <option value="Asia/Anadyr" <?php if($cff_timezone == "Asia/Anadyr") echo 'selected="selected"' ?> ><?php _e('(GMT+12:00) Anadyr, Kamchatka'); ?></option>
1515
+ <option value="Pacific/Auckland" <?php if($cff_timezone == "Pacific/Auckland") echo 'selected="selected"' ?> ><?php _e('(GMT+12:00) Auckland, Wellington'); ?></option>
1516
+ <option value="Etc/GMT-12" <?php if($cff_timezone == "Etc/GMT-12") echo 'selected="selected"' ?> ><?php _e('(GMT+12:00) Fiji, Kamchatka, Marshall Is.'); ?></option>
1517
+ <option value="Pacific/Chatham" <?php if($cff_timezone == "Pacific/Chatham") echo 'selected="selected"' ?> ><?php _e('(GMT+12:45) Chatham Islands'); ?></option>
1518
+ <option value="Pacific/Tongatapu" <?php if($cff_timezone == "Pacific/Tongatapu") echo 'selected="selected"' ?> ><?php _e('(GMT+13:00) Nuku\'alofa'); ?></option>
1519
+ <option value="Pacific/Kiritimati" <?php if($cff_timezone == "Pacific/Kiritimati") echo 'selected="selected"' ?> ><?php _e('(GMT+14:00) Kiritimati'); ?></option>
1520
+ </select>
1521
+ </td>
1522
+ </tr>
1523
+
1524
<tr>
1525
<th><label for="cff_date_custom" class="bump-left"><?php _e('Custom format'); ?></label></th>
1526
<td>
1838
</tr>
1839
</tbody>
1840
</table>
1841
+ <h3><?php _e('Custom JavaScript'); ?></h3>
1842
+ <table class="form-table">
1843
+ <tbody>
1844
+ <tr valign="top">
1845
+ <td>
1846
+ <?php _e('Enter your own custom JavaScript/jQuery in the box below'); ?>
1847
+ </td>
1848
+ </tr>
1849
+ <tr valign="top">
1850
+ <td>
1851
+ <textarea name="cff_custom_js" id="cff_custom_js" style="width: 70%;" rows="7"><?php esc_attr_e( stripslashes($cff_custom_js) ); ?></textarea>
1852
+ </td>
1853
+ </tr>
1854
+ </tbody>
1855
+ </table>
1856
+ <?php submit_button(); ?>
1857
<hr />
1858
<h3><?php _e('Like Box'); ?></h3>
1859
<table class="form-table">
1922
</tr>
1923
</tbody>
1924
</table>
1925
+
1926
+
1927
+ <hr />
1928
+ <h3 id="cff-header"><?php _e('Feed Header'); ?></h3>
1929
+ <table class="form-table">
1930
+ <tbody>
1931
+ <tr valign="top">
1932
+ <th class="bump-left" scope="row"><label><?php _e('Show Feed Header'); ?></label></th>
1933
+ <td>
1934
+ <input type="checkbox" name="cff_show_header" id="cff_show_header" <?php if($cff_show_header == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
1935
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('This will show a header at the top of your feed'); ?></i>
1936
+ </td>
1937
+ </tr>
1938
+ <tr valign="top">
1939
+ <th class="bump-left" scope="row"><label><?php _e('Display outside the scrollable area'); ?></label></th>
1940
+ <td>
1941
+ <input type="checkbox" name="cff_header_outside" id="cff_header_outside" <?php if($cff_header_outside == true) echo 'checked="checked"' ?> />&nbsp;<?php _e('Yes'); ?>
1942
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Only applicable if you have set a height on the feed'); ?></i>
1943
+ </td>
1944
+ </tr>
1945
+ </tr>
1946
+ <th class="bump-left" scope="row"><label><?php _e('Text'); ?></label></th>
1947
+ <td>
1948
+ <input name="cff_header_text" type="text" value="<?php esc_attr_e( $cff_header_text ); ?>" size="30" />
1949
+ <span>Eg. Facebook Feed, Events, News..</span>
1950
+ </td>
1951
+ </tr>
1952
+ <tr valign="top">
1953
+ <th class="bump-left" scope="row"><label><?php _e('Background Color'); ?></label></th>
1954
+ <td>
1955
+ <label for="cff_header_bg_color">#</label>
1956
+ <input name="cff_header_bg_color" type="text" value="<?php esc_attr_e( $cff_header_bg_color ); ?>" size="10" />
1957
+ <span>Eg. ED9A00</span>&nbsp;&nbsp;<a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
1958
+ </td>
1959
+ </tr>
1960
+ </tr>
1961
+ <th class="bump-left" scope="row"><label><?php _e('Padding'); ?></label></th>
1962
+ <td>
1963
+ <input name="cff_header_padding" type="text" value="<?php esc_attr_e( $cff_header_padding ); ?>" size="6" />
1964
+ <span>Eg. 20px, 5%. <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('This is the amount of padding/spacing that goes around the header.'); ?></i></span>
1965
+ </td>
1966
+ </tr>
1967
+ <tr>
1968
+ <th class="bump-left" scope="row"><label><?php _e('Text Size'); ?></label></th>
1969
+ <td>
1970
+ <select name="cff_header_text_size">
1971
+ <option value="inherit" <?php if($cff_header_text_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1972
+ <option value="10" <?php if($cff_header_text_size == "10") echo 'selected="selected"' ?> >10px</option>
1973
+ <option value="11" <?php if($cff_header_text_size == "11") echo 'selected="selected"' ?> >11px</option>
1974
+ <option value="12" <?php if($cff_header_text_size == "12") echo 'selected="selected"' ?> >12px</option>
1975
+ <option value="14" <?php if($cff_header_text_size == "14") echo 'selected="selected"' ?> >14px</option>
1976
+ <option value="16" <?php if($cff_header_text_size == "16") echo 'selected="selected"' ?> >16px</option>
1977
+ <option value="18" <?php if($cff_header_text_size == "18") echo 'selected="selected"' ?> >18px</option>
1978
+ <option value="20" <?php if($cff_header_text_size == "20") echo 'selected="selected"' ?> >20px</option>
1979
+ <option value="24" <?php if($cff_header_text_size == "24") echo 'selected="selected"' ?> >24px</option>
1980
+ <option value="28" <?php if($cff_header_text_size == "28") echo 'selected="selected"' ?> >28px</option>
1981
+ <option value="32" <?php if($cff_header_text_size == "32") echo 'selected="selected"' ?> >32px</option>
1982
+ <option value="36" <?php if($cff_header_text_size == "36") echo 'selected="selected"' ?> >36px</option>
1983
+ <option value="42" <?php if($cff_header_text_size == "42") echo 'selected="selected"' ?> >42px</option>
1984
+ <option value="48" <?php if($cff_header_text_size == "48") echo 'selected="selected"' ?> >48px</option>
1985
+ <option value="54" <?php if($cff_header_text_size == "54") echo 'selected="selected"' ?> >54px</option>
1986
+ <option value="60" <?php if($cff_header_text_size == "60") echo 'selected="selected"' ?> >60px</option>
1987
+ </select>
1988
+ </td>
1989
+ </tr>
1990
+ <tr>
1991
+ <th class="bump-left" scope="row"><label><?php _e('Text Weight'); ?></label></th>
1992
+ <td>
1993
+ <select name="cff_header_text_weight">
1994
+ <option value="inherit" <?php if($cff_header_text_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1995
+ <option value="normal" <?php if($cff_header_text_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
1996
+ <option value="bold" <?php if($cff_header_text_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
1997
+ </select>
1998
+ </td>
1999
+ </tr>
2000
+ <tr>
2001
+ <th class="bump-left" scope="row"><label><?php _e('Text Color'); ?></label></th>
2002
+ <td>
2003
+ #<input name="cff_header_text_color" type="text" value="<?php esc_attr_e( $cff_header_text_color ); ?>" size="10" placeholder="Eg. ED9A00" />
2004
+ <span><a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a></span>
2005
+ </td>
2006
+ </tr>
2007
+ <tr>
2008
+ <th class="bump-left" scope="row"><label><?php _e('Icon Type'); ?></label></th>
2009
+ <td>
2010
+ <select name="cff_header_icon" id="cff-header-icon">
2011
+ <option value="facebook-square" <?php if($cff_header_icon == "facebook-square") echo 'selected="selected"' ?> >Facebook 1</option>
2012
+ <option value="facebook" <?php if($cff_header_icon == "facebook") echo 'selected="selected"' ?> >Facebook 2</option>
2013
+ <option value="calendar" <?php if($cff_header_icon == "calendar") echo 'selected="selected"' ?> >Events 1</option>
2014
+ <option value="calendar-o" <?php if($cff_header_icon == "calendar-o") echo 'selected="selected"' ?> >Events 2</option>
2015
+ <option value="picture-o" <?php if($cff_header_icon == "picture-o") echo 'selected="selected"' ?> >Photos</option>
2016
+ <option value="users" <?php if($cff_header_icon == "users") echo 'selected="selected"' ?> >People</option>
2017
+ <option value="thumbs-o-up" <?php if($cff_header_icon == "thumbs-o-up") echo 'selected="selected"' ?> >Thumbs Up 1</option>
2018
+ <option value="thumbs-up" <?php if($cff_header_icon == "thumbs-up") echo 'selected="selected"' ?> >Thumbs Up 2</option>
2019
+ <option value="comment-o" <?php if($cff_header_icon == "comment-o") echo 'selected="selected"' ?> >Speech Bubble 1</option>
2020
+ <option value="comment" <?php if($cff_header_icon == "comment") echo 'selected="selected"' ?> >Speech Bubble 2</option>
2021
+ <option value="ticket" <?php if($cff_header_icon == "ticket") echo 'selected="selected"' ?> >Ticket</option>
2022
+ <option value="list-alt" <?php if($cff_header_icon == "list-alt") echo 'selected="selected"' ?> >News List</option>
2023
+ <option value="file" <?php if($cff_header_icon == "file") echo 'selected="selected"' ?> >File 1</option>
2024
+ <option value="file-o" <?php if($cff_header_icon == "file-o") echo 'selected="selected"' ?> >File 2</option>
2025
+ <option value="file-text" <?php if($cff_header_icon == "file-text") echo 'selected="selected"' ?> >File 3</option>
2026
+ <option value="file-text-o" <?php if($cff_header_icon == "file-text-o") echo 'selected="selected"' ?> >File 4</option>
2027
+ <option value="youtube-play" <?php if($cff_header_icon == "youtube-play") echo 'selected="selected"' ?> >Video</option>
2028
+ <option value="youtube" <?php if($cff_header_icon == "youtube") echo 'selected="selected"' ?> >YouTube</option>
2029
+ <option value="vimeo-square" <?php if($cff_header_icon == "vimeo-square") echo 'selected="selected"' ?> >Vimeo</option>
2030
+ </select>
2031
+
2032
+ <i id="cff-header-icon-example" class="fa fa-facebook-square"></i>
2033
+ </td>
2034
+ </tr>
2035
+ <tr>
2036
+ <th class="bump-left" scope="row"><label><?php _e('Icon Color'); ?></label></th>
2037
+ <td>
2038
+ #<input name="cff_header_icon_color" id="cff-header-icon-color" type="text" value="<?php esc_attr_e( $cff_header_icon_color ); ?>" size="10" placeholder="Eg. ED9A00" />
2039
+ <span><a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a></span>
2040
+ </td>
2041
+ </tr>
2042
+ <tr>
2043
+ <th class="bump-left" scope="row"><label><?php _e('Icon Size'); ?></label></th>
2044
+ <td>
2045
+ <select name="cff_header_icon_size" id="cff-header-icon-size">
2046
+ <option value="10" <?php if($cff_header_icon_size == "10") echo 'selected="selected"' ?> >10px</option>
2047
+ <option value="11" <?php if($cff_header_icon_size == "11") echo 'selected="selected"' ?> >11px</option>
2048
+ <option value="12" <?php if($cff_header_icon_size == "12") echo 'selected="selected"' ?> >12px</option>
2049
+ <option value="14" <?php if($cff_header_icon_size == "14") echo 'selected="selected"' ?> >14px</option>
2050
+ <option value="16" <?php if($cff_header_icon_size == "16") echo 'selected="selected"' ?> >16px</option>
2051
+ <option value="18" <?php if($cff_header_icon_size == "18") echo 'selected="selected"' ?> >18px</option>
2052
+ <option value="20" <?php if($cff_header_icon_size == "20") echo 'selected="selected"' ?> >20px</option>
2053
+ <option value="24" <?php if($cff_header_icon_size == "24") echo 'selected="selected"' ?> >24px</option>
2054
+ <option value="28" <?php if($cff_header_icon_size == "28") echo 'selected="selected"' ?> >28px</option>
2055
+ <option value="32" <?php if($cff_header_icon_size == "32") echo 'selected="selected"' ?> >32px</option>
2056
+ <option value="36" <?php if($cff_header_icon_size == "36") echo 'selected="selected"' ?> >36px</option>
2057
+ <option value="42" <?php if($cff_header_icon_size == "42") echo 'selected="selected"' ?> >42px</option>
2058
+ <option value="48" <?php if($cff_header_icon_size == "48") echo 'selected="selected"' ?> >48px</option>
2059
+ <option value="54" <?php if($cff_header_icon_size == "54") echo 'selected="selected"' ?> >54px</option>
2060
+ <option value="60" <?php if($cff_header_icon_size == "60") echo 'selected="selected"' ?> >60px</option>
2061
+ </select>
2062
+ </td>
2063
+ </tr>
2064
+
2065
+ </tbody>
2066
+ </table>
2067
+
2068
+
2069
<hr />
2070
<h3><?php _e('Separating Line'); ?></h3>
2071
<table class="form-table">
2089
<?php submit_button(); ?>
2090
<a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
2091
<?php } //End Misc tab ?>
2092
+
2093
+
2094
+ <?php if( $active_tab == 'custom_text' ) { //Start Post Layout tab ?>
2095
+ <input type="hidden" name="<?php echo $style_custom_text_hidden_field_name; ?>" value="Y">
2096
+ <br />
2097
+ <h3><?php _e('Custom Text / Translate'); ?></h3>
2098
+ <p><?php _e('Enter custom text for the words below, or translate it into the language you would like to use.'); ?></p>
2099
+ <table class="form-table cff-translate-table" style="width: 100%; max-width: 940px;">
2100
+ <tbody>
2101
+
2102
+ <thead>
2103
+ <tr>
2104
+ <th><?php _e('Original Text'); ?></th>
2105
+ <th><?php _e('Custom Text / Translation'); ?></th>
2106
+ <th><?php _e('Context'); ?></th>
2107
+ </tr>
2108
+ </thead>
2109
+
2110
+ <tr class="cff-table-header"><th colspan="3"><?php _e('Post Text'); ?></th></tr>
2111
+ <tr>
2112
+ <td><label for="cff_see_more_text" class="bump-left"><?php _e('See More'); ?></label></td>
2113
+ <td><input name="cff_see_more_text" type="text" value="<?php esc_attr_e( $cff_see_more_text ); ?>" /></td>
2114
+ <td class="cff-context"><?php _e('Used when truncating the post text'); ?></td>
2115
+ </tr>
2116
+
2117
+ <tr>
2118
+ <td><label for="cff_see_less_text" class="bump-left"><?php _e('See Less'); ?></label></td>
2119
+ <td><input name="cff_see_less_text" type="text" value="<?php esc_attr_e( $cff_see_less_text ); ?>" /></td>
2120
+ <td class="cff-context"><?php _e('Used when truncating the post text'); ?></td>
2121
+ </tr>
2122
+
2123
+ <tr>
2124
+ <td><label for="cff_translate_photos_text" class="bump-left"><?php _e('photos'); ?></label></td>
2125
+ <td><input name="cff_translate_photos_text" type="text" value="<?php esc_attr_e( $cff_translate_photos_text ); ?>" /></td>
2126
+ <td class="cff-context"><?php _e('Added to the end of an album name. Eg. (6 photos)'); ?></td>
2127
+ </tr>
2128
+
2129
+ <tr class="cff-table-header"><th colspan="3"><?php _e('Link to Facebook'); ?></th></tr>
2130
+ <tr>
2131
+ <td><label for="cff_facebook_link_text" class="bump-left"><?php _e('View on Facebook'); ?></label></td>
2132
+ <td><input name="cff_facebook_link_text" type="text" value="<?php esc_attr_e( $cff_facebook_link_text ); ?>" /></td>
2133
+ <td class="cff-context"><?php _e('Links to the post on Facebook'); ?></td>
2134
+ </tr>
2135
+
2136
+
2137
+ <tr class="cff-table-header"><th colspan="3"><?php _e('Date'); ?></th></tr>
2138
+ <tr>
2139
+ <td><label for="cff_photos_text" class="bump-left"><?php _e('"Posted _ hours ago" text'); ?></label></td>
2140
+ <td class="cff-translate-date">
2141
+
2142
+ <label for="cff_translate_second"><?php _e("second"); ?></label>
2143
+ <input name="cff_translate_second" type="text" value="<?php esc_attr_e( $cff_translate_second ); ?>" size="20" />
2144
+ <br />
2145
+ <label for="cff_translate_seconds"><?php _e("seconds"); ?></label>
2146
+ <input name="cff_translate_seconds" type="text" value="<?php esc_attr_e( $cff_translate_second ); ?>" size="20" />
2147
+ <br />
2148
+ <label for="cff_translate_minute"><?php _e("minute"); ?></label>
2149
+ <input name="cff_translate_minute" type="text" value="<?php esc_attr_e( $cff_translate_minute ); ?>" size="20" />
2150
+ <br />
2151
+ <label for="cff_translate_minutes"><?php _e("minutes"); ?></label>
2152
+ <input name="cff_translate_minutes" type="text" value="<?php esc_attr_e( $cff_translate_minutes ); ?>" size="20" />
2153
+ <br />
2154
+ <label for="cff_translate_hour"><?php _e("hour"); ?></label>
2155
+ <input name="cff_translate_hour" type="text" value="<?php esc_attr_e( $cff_translate_hour ); ?>" size="20" />
2156
+ <br />
2157
+ <label for="cff_translate_hours"><?php _e("hours"); ?></label>
2158
+ <input name="cff_translate_hours" type="text" value="<?php esc_attr_e( $cff_translate_hours ); ?>" size="20" />
2159
+ <br />
2160
+ <label for="cff_translate_day"><?php _e("day"); ?></label>
2161
+ <input name="cff_translate_day" type="text" value="<?php esc_attr_e( $cff_translate_day ); ?>" size="20" />
2162
+ <br />
2163
+ <label for="cff_translate_days"><?php _e("days"); ?></label>
2164
+ <input name="cff_translate_days" type="text" value="<?php esc_attr_e( $cff_translate_days ); ?>" size="20" />
2165
+ <br />
2166
+ <label for="cff_translate_week"><?php _e("week"); ?></label>
2167
+ <input name="cff_translate_week" type="text" value="<?php esc_attr_e( $cff_translate_week ); ?>" size="20" />
2168
+ <br />
2169
+ <label for="cff_translate_weeks"><?php _e("weeks"); ?></label>
2170
+ <input name="cff_translate_weeks" type="text" value="<?php esc_attr_e( $cff_translate_weeks ); ?>" size="20" />
2171
+ <br />
2172
+ <label for="cff_translate_month"><?php _e("month"); ?></label>
2173
+ <input name="cff_translate_month" type="text" value="<?php esc_attr_e( $cff_translate_month ); ?>" size="20" />
2174
+ <br />
2175
+ <label for="cff_translate_months"><?php _e("months"); ?></label>
2176
+ <input name="cff_translate_months" type="text" value="<?php esc_attr_e( $cff_translate_months ); ?>" size="20" />
2177
+ <br />
2178
+ <label for="cff_translate_year"><?php _e("year"); ?></label>
2179
+ <input name="cff_translate_year" type="text" value="<?php esc_attr_e( $cff_translate_year ); ?>" size="20" />
2180
+ <br />
2181
+ <label for="cff_translate_years"><?php _e("years"); ?></label>
2182
+ <input name="cff_translate_years" type="text" value="<?php esc_attr_e( $cff_translate_years ); ?>" size="20" />
2183
+ <br />
2184
+ <label for="cff_translate_ago"><?php _e("ago"); ?></label>
2185
+ <input name="cff_translate_ago" type="text" value="<?php esc_attr_e( $cff_translate_ago ); ?>" size="20" />
2186
+ </td>
2187
+ <td class="cff-context"><?php _e('Used to translate the "Posted _ days ago" date text'); ?></td>
2188
+ </tr>
2189
+
2190
+ </tbody>
2191
+ </table>
2192
+
2193
+ <?php submit_button(); ?>
2194
+ <?php } //End Post Layout tab ?>
2195
+
2196
</form>
2197
<?php
2198
} //End Style_Page
2200
function cff_admin_style() {
2201
wp_register_style( 'custom_wp_admin_css', plugin_dir_url( __FILE__ ) . 'css/cff-admin-style.css', false, '1.0.0' );
2202
wp_enqueue_style( 'custom_wp_admin_css' );
2203
+ wp_enqueue_style( 'cff-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3' );
2204
}
2205
add_action( 'admin_enqueue_scripts', 'cff_admin_style' );
2206
//Enqueue admin scripts
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: 1.6.8.2
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
@@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
*/
25
//Include admin
26
include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
27
// Add shortcodes
28
add_shortcode('custom-facebook-feed', 'display_cff');
29
function display_cff($atts) {
@@ -49,82 +50,102 @@ function display_cff($atts) {
49
'pagetype' => get_option('cff_page_type'),
50
'num' => get_option('cff_num_show'),
51
'limit' => get_option('cff_post_limit'),
52
- 'others' => get_option('cff_show_others'),
53
'cachetime' => get_option('cff_cache_time'),
54
'cacheunit' => get_option('cff_cache_time_unit'),
55
'locale' => get_option('cff_locale'),
56
- 'width' => $options[ 'cff_feed_width' ],
57
- 'height' => $options[ 'cff_feed_height' ],
58
- 'padding' => $options[ 'cff_feed_padding' ],
59
- 'bgcolor' => $options[ 'cff_bg_color' ],
60
- 'showauthor' => $options[ 'cff_show_author' ],
61
- 'class' => $options[ 'cff_class' ],
62
- 'layout' => $options[ 'cff_preset_layout' ],
63
'include' => $include_string,
64
//Typography
65
- 'seemoretext' => $options[ 'cff_see_more_text' ],
66
- 'seelesstext' => $options[ 'cff_see_less_text' ],
67
- 'textformat' => $options[ 'cff_title_format' ],
68
- 'textsize' => $options[ 'cff_title_size' ],
69
- 'textweight' => $options[ 'cff_title_weight' ],
70
- 'textcolor' => $options[ 'cff_title_color' ],
71
- 'textlink' => $options[ 'cff_title_link' ],
72
- 'descsize' => $options[ 'cff_body_size' ],
73
- 'descweight' => $options[ 'cff_body_weight' ],
74
- 'desccolor' => $options[ 'cff_body_color' ],
75
//Event title
76
- 'eventtitleformat' => $options[ 'cff_event_title_format' ],
77
- 'eventtitlesize' => $options[ 'cff_event_title_size' ],
78
- 'eventtitleweight' => $options[ 'cff_event_title_weight' ],
79
- 'eventtitlecolor' => $options[ 'cff_event_title_color' ],
80
- 'eventtitlelink' => $options[ 'cff_event_title_link' ],
81
//Event date
82
- 'eventdatesize' => $options[ 'cff_event_date_size' ],
83
- 'eventdateweight' => $options[ 'cff_event_date_weight' ],
84
- 'eventdatecolor' => $options[ 'cff_event_date_color' ],
85
- 'eventdatepos' => $options[ 'cff_event_date_position' ],
86
- 'eventdateformat' => $options[ 'cff_event_date_formatting' ],
87
- 'eventdatecustom' => $options[ 'cff_event_date_custom' ],
88
//Event details
89
- 'eventdetailssize' => $options[ 'cff_event_details_size' ],
90
- 'eventdetailsweight' => $options[ 'cff_event_details_weight' ],
91
- 'eventdetailscolor' => $options[ 'cff_event_details_color' ],
92
//Date
93
- 'datepos' => $options[ 'cff_date_position' ],
94
- 'datesize' => $options[ 'cff_date_size' ],
95
- 'dateweight' => $options[ 'cff_date_weight' ],
96
- 'datecolor' => $options[ 'cff_date_color' ],
97
- 'dateformat' => $options[ 'cff_date_formatting' ],
98
- 'datecustom' => $options[ 'cff_date_custom' ],
99
- 'linksize' => $options[ 'cff_link_size' ],
100
- 'linkweight' => $options[ 'cff_link_weight' ],
101
- 'linkcolor' => $options[ 'cff_link_color' ],
102
- 'facebooklinktext' => $options[ 'cff_facebook_link_text' ],
103
- 'viewlinktext' => $options[ 'cff_view_link_text' ],
104
- 'linktotimeline' => $options[ 'cff_link_to_timeline' ],
105
//Social
106
- 'iconstyle' => $options[ 'cff_icon_style' ],
107
- 'socialtextcolor' => $options[ 'cff_meta_text_color' ],
108
- 'socialbgcolor' => $options[ 'cff_meta_bg_color' ],
109
//Misc
110
'textlength' => get_option('cff_title_length'),
111
'desclength' => get_option('cff_body_length'),
112
- 'likeboxpos' => $options[ 'cff_like_box_position' ],
113
- 'likeboxoutside' => $options[ 'cff_like_box_outside' ],
114
- 'likeboxcolor' => $options[ 'cff_likebox_bg_color' ],
115
- 'likeboxtextcolor' => $options[ 'cff_like_box_text_color' ],
116
- 'likeboxwidth' => $options[ 'cff_likebox_width' ],
117
- 'likeboxfaces' => $options[ 'cff_like_box_faces' ],
118
- 'likeboxborder' => $options[ 'cff_like_box_border' ],
119
-
120
- 'videoheight' => $options[ 'cff_video_height' ],
121
- 'videoaction' => $options[ 'cff_video_action' ],
122
- 'sepcolor' => $options[ 'cff_sep_color' ],
123
- 'sepsize' => $options[ 'cff_sep_size' ]
124
), $atts);
125
/********** GENERAL **********/
126
$cff_page_type = $atts[ 'pagetype' ];
127
- if ($cff_page_type == 'group') $cff_is_group = true;
128
129
$cff_post_limit = $atts[ 'limit' ];
130
@@ -163,6 +184,16 @@ function display_cff($atts) {
163
/********** LAYOUT **********/
164
$cff_includes = $atts[ 'include' ];
165
//Look for non-plural version of string in the types string in case user specifies singular in shortcode
166
if ( stripos($cff_includes, 'text') !== false ) $cff_show_text = true;
167
if ( stripos($cff_includes, 'desc') !== false ) $cff_show_desc = true;
168
if ( stripos($cff_includes, 'sharedlink') !== false ) $cff_show_shared_links = true;
@@ -183,8 +214,8 @@ function display_cff($atts) {
183
if ( !empty($cff_meta_text_color) ) $cff_meta_styles .= 'color:#' . $cff_meta_text_color . ';';
184
if ( !empty($cff_meta_bg_color) ) $cff_meta_styles .= 'background-color:#' . $cff_meta_bg_color . ';';
185
$cff_meta_styles .= '"';
186
- $cff_nocomments_text = $options[ 'cff_nocomments_text' ];
187
- $cff_hide_comments = $options[ 'cff_hide_comments' ];
188
if (!isset($cff_nocomments_text) || empty($cff_nocomments_text)) $cff_hide_comments = true;
189
/********** TYPOGRAPHY **********/
190
//See More text
@@ -256,8 +287,11 @@ function display_cff($atts) {
256
if ( !empty($cff_date_weight) && $cff_date_weight != 'inherit' ) $cff_date_styles .= 'font-weight:' . $cff_date_weight . '; ';
257
if ( !empty($cff_date_color) ) $cff_date_styles .= 'color:#' . $cff_date_color . ';';
258
$cff_date_styles .= '"';
259
- $cff_date_before = $options[ 'cff_date_before' ];
260
- $cff_date_after = $options[ 'cff_date_after' ];
261
//Link to Facebook
262
$cff_link_size = $atts[ 'linksize' ];
263
$cff_link_weight = $atts[ 'linkweight' ];
@@ -298,6 +332,22 @@ function display_cff($atts) {
298
if ( empty($cff_likebox_bg_color) && $cff_like_box_faces == 'false' ) $cff_likebox_styles .= ' margin-left: -10px;';
299
$cff_likebox_styles .= '"';
300
301
//Video
302
//Dimensions
303
$cff_video_width = 640;
@@ -336,11 +386,43 @@ function display_cff($atts) {
336
echo "Please enter the Page ID of the Facebook feed you'd like to display. You can do this in either the Custom Facebook Feed plugin settings or in the shortcode itself. For example [custom_facebook_feed id=<b>YOUR_PAGE_ID</b>].<br /><br />";
337
return false;
338
}
339
//Use posts? or feed?
340
$show_others = $atts['others'];
341
$graph_query = 'posts';
342
- if ( $show_others == 'on' || $show_others == 'true' || $show_others == true || $cff_is_group ) $graph_query = 'feed';
343
- if ( $show_others == 'false' ) $graph_query = 'posts';
344
345
346
//Calculate the cache time in seconds
@@ -359,21 +441,52 @@ function display_cff($atts) {
359
$like_box = '<div class="cff-likebox';
360
if ($cff_like_box_outside) $like_box .= ' cff-outside';
361
$like_box .= ($cff_like_box_position == 'top') ? ' top' : ' bottom';
362
- $like_box .= '"' . $cff_likebox_styles . '><script src="http://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" show_faces="'.$cff_like_box_faces.'" stream="false" header="false" colorscheme="'. $cff_like_box_colorscheme .'" show_border="'. $cff_like_box_border .'"></fb:like-box></div>';
363
//Don't show like box if it's a group
364
if($cff_is_group) $like_box = '';
365
366
//***START FEED***
367
- $content = '';
368
//Add like box to the outside of the top of feed
369
- if ($cff_like_box_position == 'top' && $cff_show_like_box && $cff_like_box_outside) $content .= $like_box;
370
//Create CFF container HTML
371
- $content .= '<div id="cff" rel="'.$title_limit.'" class="';
372
- if( !empty($cff_class) ) $content .= $cff_class . ' ';
373
- if ( !empty($cff_feed_height) ) $content .= 'cff-fixed-height ';
374
- $content .= '" ' . $cff_feed_styles . '>';
375
//Add like box to the inside of the top of feed
376
- if ($cff_like_box_position == 'top' && $cff_show_like_box && !$cff_like_box_outside) $content .= $like_box;
377
//Limit var
378
$i = 0;
379
@@ -381,7 +494,7 @@ function display_cff($atts) {
381
//ALL POSTS
382
if (!$cff_events_only){
383
384
- $cff_posts_json_url = 'https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?access_token=' . $access_token . '&limit=' . $cff_post_limit . '&locale=' . $cff_locale;
385
386
//Don't use caching if the cache time is set to zero
387
if ($cff_cache_time != 0){
@@ -398,6 +511,8 @@ function display_cff($atts) {
398
} else {
399
$posts_json = cff_fetchUrl($cff_posts_json_url);
400
}
401
402
//Interpret data with JSON
403
$FBdata = json_decode($posts_json);
@@ -442,6 +557,19 @@ function display_cff($atts) {
442
break;
443
}
444
445
//Is it a duplicate post?
446
if (!isset($prev_post_message)) $prev_post_message = '';
447
if (!isset($prev_post_link)) $prev_post_link = '';
@@ -471,6 +599,24 @@ function display_cff($atts) {
471
$link = str_replace('photo.php?','media/set/?',$link);
472
}
473
474
//If there's no link provided then link to either the Facebook page or the individual status
475
if (empty($news->link)) {
476
if ($cff_link_to_timeline == true){
@@ -489,19 +635,30 @@ function display_cff($atts) {
489
$cff_author .= '</a>';
490
491
//POST TEXT
492
$cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
493
$cff_post_text .= '<span class="cff-text">';
494
- if ($cff_title_link) $cff_post_text .= '<a class="cff-post-text-link" href="'.$link.'" '.$target.'>';
495
if (!empty($news->story)) $post_text = $news->story;
496
if (!empty($news->message)) $post_text = $news->message;
497
- //Use the name if neither the story or message are available, or if the post type is an offer
498
- if ( (!empty($news->name) && empty($news->story) && empty($news->message)) || $cff_post_type == 'offer') $post_text = $news->name;
499
//If the text is wrapped in a link then don't hyperlink any text within
500
if ($cff_title_link) {
501
//Wrap links in a span so we can break the text if it's too long
502
- $cff_post_text .= cff_wrap_span($post_text) . ' ';
503
} else {
504
- $cff_post_text .= cff_make_clickable($post_text) . ' ';
505
}
506
507
if ($cff_title_link) $cff_post_text .= '</a>';
@@ -515,13 +672,13 @@ function display_cff($atts) {
515
//Use the description if it's available and the post type isn't set to offer (offer description isn't useful)
516
if ( ( !empty($news->description) || !empty($news->caption) ) && $cff_post_type != 'offer') {
517
518
- $description_text = $news->description;
519
if (!isset($description_text)) $description_text = $news->caption;
520
521
if (!empty($body_limit)) {
522
if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
523
}
524
- $cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_make_clickable($description_text) . '</span></p>';
525
526
//If the post text and description/caption are the same then don't show the description
527
if($post_text == $description_text) $cff_description = '';
@@ -537,7 +694,7 @@ function display_cff($atts) {
537
//Display link name and description
538
if (!empty($news->description)) {
539
$cff_shared_link .= '<div class="cff-text-link ';
540
- if (!$cff_link_image) $cff_shared_link .= 'cff-no-image';
541
$cff_shared_link .= '"><a class="cff-link-title" href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a>';
542
if(!empty($news->caption)) $cff_shared_link .= '<p class="cff-link-caption">'.$news->caption.'</p>';
543
$cff_shared_link .= $cff_description;
@@ -564,11 +721,11 @@ function display_cff($atts) {
564
$eventID = $url_parts[count($url_parts)-2];
565
566
//Get the contents of the event using the WP HTTP API
567
- $event_json = cff_fetchUrl('https://graph.facebook.com/'.$eventID.'?access_token=' . $access_token);
568
//Interpret data with JSON
569
$event_object = json_decode($event_json);
570
//Event date
571
- $event_time = $event_object->start_time;
572
//If timezone migration is enabled then remove last 5 characters
573
if ( strlen($event_time) == 24 ) $event_time = substr($event_time, 0, -5);
574
if (!empty($event_time)) $cff_event_date = '<p class="cff-date" '.$cff_event_date_styles.'>' . cff_eventdate(strtotime($event_time), $cff_event_date_formatting, $cff_event_date_custom) . '</p>';
@@ -610,10 +767,12 @@ function display_cff($atts) {
610
$cff_is_video_embed = true;
611
//Add the name to the description if it's a video embed
612
if($cff_is_video_embed) {
613
$cff_description = '<div class="cff-desc-wrap ';
614
if (empty($picture)) $cff_description .= 'cff-no-image';
615
- $cff_description .= '"><a class="cff-link-title" href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a>';
616
- $cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_make_clickable($description_text) . '</span></p></div>';
617
}
618
}
619
@@ -636,35 +795,36 @@ function display_cff($atts) {
636
//***CREATE THE POST HTML***//
637
//**************************//
638
//Start the container
639
- $content .= '<div class="cff-item ';
640
- if ($cff_post_type == 'link') $content .= 'cff-link-item';
641
- if ($cff_post_type == 'event') $content .= 'cff-timeline-event';
642
- if ($cff_post_type == 'photo') $content .= 'cff-photo-post';
643
- if ($cff_post_type == 'video') $content .= 'cff-video-post';
644
- if ($cff_post_type == 'swf') $content .= 'cff-swf-post';
645
- if ($cff_post_type == 'status') $content .= 'cff-status-post';
646
- if ($cff_post_type == 'offer') $content .= 'cff-offer-post';
647
- $content .= '" id="'. $news->id .'" ' . $cff_item_styles . '>';
648
649
//POST AUTHOR
650
- if($cff_show_author) $content .= $cff_author;
651
//DATE ABOVE
652
- if ($cff_show_date && $cff_date_position == 'above') $content .= $cff_date;
653
//POST TEXT
654
- if($cff_show_text) $content .= $cff_post_text;
655
//DESCRIPTION
656
- if($cff_show_desc && $cff_post_type != 'offer' && $cff_post_type != 'link') $content .= $cff_description;
657
//LINK
658
- if($cff_show_shared_links) $content .= $cff_shared_link;
659
//DATE BELOW
660
- if ($cff_show_date && $cff_date_position == 'below') $content .= $cff_date;
661
//EVENT
662
- if($cff_show_event_title || $cff_show_event_details) $content .= $cff_event;
663
//VIEW ON FACEBOOK LINK
664
- if($cff_show_link) $content .= $cff_link;
665
666
//End the post item
667
- $content .= '</div><div class="cff-clear"></div>';
668
} // End post type check
669
670
if (isset($news->message)) $prev_post_message = $news->message;
@@ -674,15 +834,15 @@ function display_cff($atts) {
674
} // End the loop
675
} // End ALL POSTS
676
//Load more posts
677
- // $content .= '<button class="loadmore">Load More Posts</button>';
678
//Add the Like Box inside
679
- if ($cff_like_box_position == 'bottom' && $cff_show_like_box && !$cff_like_box_outside) $content .= $like_box;
680
//End the feed
681
- $content .= '</div><div class="cff-clear"></div>';
682
//Add the Like Box outside
683
- if ($cff_like_box_position == 'bottom' && $cff_show_like_box && $cff_like_box_outside) $content .= $like_box;
684
//Return our feed HTML to display
685
- return $content;
686
}
687
//Get JSON object of feed data
688
function cff_fetchUrl($url){
@@ -749,7 +909,8 @@ function cff_auto_link_text_callback($matches) {
749
} else {
750
$url_short = $url_full;
751
}
752
- return "<a class='cff-break-word' rel=\"nofollow\" href=\"$url_full\">$url_full</a>";
753
}
754
//Make links into span instead when the post text is made clickable
755
function cff_wrap_span($text) {
@@ -838,49 +999,49 @@ function cff_getdate($original, $date_format, $custom_date) {
838
839
$options = get_option('cff_style_settings');
840
841
- $cff_second = $options['cff_translate_second'];
842
if ( empty($cff_second) ) $cff_second = 'second';
843
844
- $cff_seconds = $options['cff_translate_seconds'];
845
if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
846
847
- $cff_minute = $options['cff_translate_minute'];
848
if ( empty($cff_minute) ) $cff_minute = 'minute';
849
850
- $cff_minutes = $options['cff_translate_minutes'];
851
if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
852
853
- $cff_hour = $options['cff_translate_hour'];
854
if ( empty($cff_hour) ) $cff_hour = 'hour';
855
856
- $cff_hours = $options['cff_translate_hours'];
857
if ( empty($cff_hours) ) $cff_hours = 'hours';
858
859
- $cff_day = $options['cff_translate_day'];
860
if ( empty($cff_day) ) $cff_day = 'day';
861
862
- $cff_days = $options['cff_translate_days'];
863
if ( empty($cff_days) ) $cff_days = 'days';
864
865
- $cff_week = $options['cff_translate_week'];
866
if ( empty($cff_week) ) $cff_week = 'week';
867
868
- $cff_weeks = $options['cff_translate_weeks'];
869
if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
870
871
- $cff_month = $options['cff_translate_month'];
872
if ( empty($cff_month) ) $cff_month = 'month';
873
874
- $cff_months = $options['cff_translate_months'];
875
if ( empty($cff_months) ) $cff_months = 'months';
876
877
- $cff_year = $options['cff_translate_year'];
878
if ( empty($cff_year) ) $cff_year = 'year';
879
880
- $cff_years = $options['cff_translate_years'];
881
if ( empty($cff_years) ) $cff_years = 'years';
882
883
- $cff_ago = $options['cff_translate_ago'];
884
if ( empty($cff_ago) ) $cff_ago = 'ago';
885
886
@@ -908,12 +1069,14 @@ function cff_getdate($original, $date_format, $custom_date) {
908
$periods[$j] = $periods_plural[$j];
909
}
910
$print = "$difference $periods[$j] {$tense}";
911
break;
912
913
}
914
if ( !empty($custom_date) ){
915
$print = date_i18n($custom_date, $original);
916
}
917
return $print;
918
}
919
function cff_eventdate($original, $date_format, $custom_date) {
@@ -969,49 +1132,49 @@ function cff_timesince($original) {
969
970
$options = get_option('cff_style_settings');
971
972
- $cff_second = $options['cff_translate_second'];
973
if ( empty($cff_second) ) $cff_second = 'second';
974
975
- $cff_seconds = $options['cff_translate_seconds'];
976
if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
977
978
- $cff_minute = $options['cff_translate_minute'];
979
if ( empty($cff_minute) ) $cff_minute = 'minute';
980
981
- $cff_minutes = $options['cff_translate_minutes'];
982
if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
983
984
- $cff_hour = $options['cff_translate_hour'];
985
if ( empty($cff_hour) ) $cff_hour = 'hour';
986
987
- $cff_hours = $options['cff_translate_hours'];
988
if ( empty($cff_hours) ) $cff_hours = 'hours';
989
990
- $cff_day = $options['cff_translate_day'];
991
if ( empty($cff_day) ) $cff_day = 'day';
992
993
- $cff_days = $options['cff_translate_days'];
994
if ( empty($cff_days) ) $cff_days = 'days';
995
996
- $cff_week = $options['cff_translate_week'];
997
if ( empty($cff_week) ) $cff_week = 'week';
998
999
- $cff_weeks = $options['cff_translate_weeks'];
1000
if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
1001
1002
- $cff_month = $options['cff_translate_month'];
1003
if ( empty($cff_month) ) $cff_month = 'month';
1004
1005
- $cff_months = $options['cff_translate_months'];
1006
if ( empty($cff_months) ) $cff_months = 'months';
1007
1008
- $cff_year = $options['cff_translate_year'];
1009
if ( empty($cff_year) ) $cff_year = 'year';
1010
1011
- $cff_years = $options['cff_translate_years'];
1012
if ( empty($cff_years) ) $cff_years = 'years';
1013
1014
- $cff_ago = $options['cff_translate_ago'];
1015
if ( empty($cff_ago) ) $cff_ago = 'ago';
1016
1017
@@ -1024,7 +1187,7 @@ function cff_timesince($original) {
1024
// is it future date or past date
1025
if($now > $original) {
1026
$difference = $now - $original;
1027
- $tense = $cff_ago;;
1028
} else {
1029
$difference = $original - $now;
1030
$tense = $cff_ago;
@@ -1059,14 +1222,15 @@ add_filter('widget_text', 'do_shortcode');
1059
add_action( 'wp_enqueue_scripts', 'cff_add_my_stylesheet' );
1060
function cff_add_my_stylesheet() {
1061
// Respects SSL, Style.css is relative to the current file
1062
- wp_register_style( 'cff', plugins_url('css/cff-style.css?4', __FILE__) );
1063
wp_enqueue_style( 'cff' );
1064
}
1065
//Enqueue scripts
1066
add_action( 'wp_enqueue_scripts', 'cff_scripts_method' );
1067
function cff_scripts_method() {
1068
//Register the script to make it available
1069
- wp_register_script( 'cffscripts', plugins_url( '/js/cff-scripts.js?4' , __FILE__ ), array('jquery'), '1.8', true );
1070
//Enqueue it to load it onto the page
1071
wp_enqueue_script('cffscripts');
1072
}
@@ -1079,6 +1243,7 @@ function cff_activate() {
1079
$options[ 'cff_show_photos_type' ] = true;
1080
$options[ 'cff_show_status_type' ] = true;
1081
// Show all parts of the feed by default on activation
1082
$options[ 'cff_show_text' ] = true;
1083
$options[ 'cff_show_desc' ] = true;
1084
$options[ 'cff_show_shared_links' ] = true;
@@ -1115,7 +1280,8 @@ register_uninstall_hook( __FILE__, 'cff_uninstall' );
1115
add_action( 'wp_head', 'cff_custom_css' );
1116
function cff_custom_css() {
1117
$options = get_option('cff_style_settings');
1118
- $cff_custom_css = $options[ 'cff_custom_css' ];
1119
echo '<!-- Custom Facebook Feed Custom CSS -->';
1120
echo "\r\n";
1121
echo '<style type="text/css">';
@@ -1125,6 +1291,25 @@ function cff_custom_css() {
1125
echo '</style>';
1126
echo "\r\n";
1127
}
1128
1129
//Comment out the line below to view errors
1130
error_reporting(0);
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: 1.7.0
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
24
*/
25
//Include admin
26
include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
27
+
28
// Add shortcodes
29
add_shortcode('custom-facebook-feed', 'display_cff');
30
function display_cff($atts) {
50
'pagetype' => get_option('cff_page_type'),
51
'num' => get_option('cff_num_show'),
52
'limit' => get_option('cff_post_limit'),
53
+ 'others' => '',
54
+ 'showpostsby' => get_option('cff_show_others'),
55
'cachetime' => get_option('cff_cache_time'),
56
'cacheunit' => get_option('cff_cache_time_unit'),
57
'locale' => get_option('cff_locale'),
58
+ 'width' => isset($options[ 'cff_feed_width' ]) ? $options[ 'cff_feed_width' ] : '',
59
+ 'height' => isset($options[ 'cff_feed_height' ]) ? $options[ 'cff_feed_height' ] : '',
60
+ 'padding' => isset($options[ 'cff_feed_padding' ]) ? $options[ 'cff_feed_padding' ] : '',
61
+ 'bgcolor' => isset($options[ 'cff_bg_color' ]) ? $options[ 'cff_bg_color' ] : '',
62
+ 'showauthor' => isset($options[ 'cff_show_author' ]) ? $options[ 'cff_show_author' ] : '',
63
+ 'class' => isset($options[ 'cff_class' ]) ? $options[ 'cff_class' ] : '',
64
+ 'layout' => isset($options[ 'cff_preset_layout' ]) ? $options[ 'cff_preset_layout' ] : '',
65
'include' => $include_string,
66
//Typography
67
+ 'textformat' => isset($options[ 'cff_title_format' ]) ? $options[ 'cff_title_format' ] : '',
68
+ 'textsize' => isset($options[ 'cff_title_size' ]) ? $options[ 'cff_title_size' ] : '',
69
+ 'textweight' => isset($options[ 'cff_title_weight' ]) ? $options[ 'cff_title_weight' ] : '',
70
+ 'textcolor' => isset($options[ 'cff_title_color' ]) ? $options[ 'cff_title_color' ] : '',
71
+ 'textlink' => isset($options[ 'cff_title_link' ]) ? $options[ 'cff_title_link' ] : '',
72
+ 'descsize' => isset($options[ 'cff_body_size' ]) ? $options[ 'cff_body_size' ] : '',
73
+ 'descweight' => isset($options[ 'cff_body_weight' ]) ? $options[ 'cff_body_weight' ] : '',
74
+ 'desccolor' => isset($options[ 'cff_body_color' ]) ? $options[ 'cff_body_color' ] : '',
75
//Event title
76
+ 'eventtitleformat' => isset($options[ 'cff_event_title_format' ]) ? $options[ 'cff_event_title_format' ] : '',
77
+ 'eventtitlesize' => isset($options[ 'cff_event_title_size' ]) ? $options[ 'cff_event_title_size' ] : '',
78
+ 'eventtitleweight' => isset($options[ 'cff_event_title_weight' ]) ? $options[ 'cff_event_title_weight' ] : '',
79
+ 'eventtitlecolor' => isset($options[ 'cff_event_title_color' ]) ? $options[ 'cff_event_title_color' ] : '',
80
+ 'eventtitlelink' => isset($options[ 'cff_event_title_link' ]) ? $options[ 'cff_event_title_link' ] : '',
81
//Event date
82
+ 'eventdatesize' => isset($options[ 'cff_event_date_size' ]) ? $options[ 'cff_event_date_size' ] : '',
83
+ 'eventdateweight' => isset($options[ 'cff_event_date_weight' ]) ? $options[ 'cff_event_date_weight' ] : '',
84
+ 'eventdatecolor' => isset($options[ 'cff_event_date_color' ]) ? $options[ 'cff_event_date_color' ] : '',
85
+ 'eventdatepos' => isset($options[ 'cff_event_date_position' ]) ? $options[ 'cff_event_date_position' ] : '',
86
+ 'eventdateformat' => isset($options[ 'cff_event_date_formatting' ]) ? $options[ 'cff_event_date_formatting' ] : '',
87
+ 'eventdatecustom' => isset($options[ 'cff_event_date_custom' ]) ? $options[ 'cff_event_date_custom' ] : '',
88
//Event details
89
+ 'eventdetailssize' => isset($options[ 'cff_event_details_size' ]) ? $options[ 'cff_event_details_size' ] : '',
90
+ 'eventdetailsweight' => isset($options[ 'cff_event_details_weight' ]) ? $options[ 'cff_event_details_weight' ] : '',
91
+ 'eventdetailscolor' => isset($options[ 'cff_event_details_color' ]) ? $options[ 'cff_event_details_color' ] : '',
92
//Date
93
+ 'datepos' => isset($options[ 'cff_date_position' ]) ? $options[ 'cff_date_position' ] : '',
94
+ 'datesize' => isset($options[ 'cff_date_size' ]) ? $options[ 'cff_date_size' ] : '',
95
+ 'dateweight' => isset($options[ 'cff_date_weight' ]) ? $options[ 'cff_date_weight' ] : '',
96
+ 'datecolor' => isset($options[ 'cff_date_color' ]) ? $options[ 'cff_date_color' ] : '',
97
+ 'dateformat' => isset($options[ 'cff_date_formatting' ]) ? $options[ 'cff_date_formatting' ] : '',
98
+ 'datecustom' => isset($options[ 'cff_date_custom' ]) ? $options[ 'cff_date_custom' ] : '',
99
+ 'timezone' => isset($options[ 'cff_timezone' ]) ? $options[ 'cff_timezone' ] : 'America/Chicago',
100
+
101
+ //Link to Facebook
102
+ 'linksize' => isset($options[ 'cff_link_size' ]) ? $options[ 'cff_link_size' ] : '',
103
+ 'linkweight' => isset($options[ 'cff_link_weight' ]) ? $options[ 'cff_link_weight' ] : '',
104
+ 'linkcolor' => isset($options[ 'cff_link_color' ]) ? $options[ 'cff_link_color' ] : '',
105
+ 'viewlinktext' => isset($options[ 'cff_view_link_text' ]) ? $options[ 'cff_view_link_text' ] : '',
106
+ 'linktotimeline' => isset($options[ 'cff_link_to_timeline' ]) ? $options[ 'cff_link_to_timeline' ] : '',
107
//Social
108
+ 'iconstyle' => isset($options[ 'cff_icon_style' ]) ? $options[ 'cff_icon_style' ] : '',
109
+ 'socialtextcolor' => isset($options[ 'cff_meta_text_color' ]) ? $options[ 'cff_meta_text_color' ] : '',
110
+ 'socialbgcolor' => isset($options[ 'cff_meta_bg_color' ]) ? $options[ 'cff_meta_bg_color' ] : '',
111
//Misc
112
'textlength' => get_option('cff_title_length'),
113
'desclength' => get_option('cff_body_length'),
114
+ 'likeboxpos' => isset($options[ 'cff_like_box_position' ]) ? $options[ 'cff_like_box_position' ] : '',
115
+ 'likeboxoutside' => isset($options[ 'cff_like_box_outside' ]) ? $options[ 'cff_like_box_outside' ] : '',
116
+ 'likeboxcolor' => isset($options[ 'cff_likebox_bg_color' ]) ? $options[ 'cff_likebox_bg_color' ] : '',
117
+ 'likeboxtextcolor' => isset($options[ 'cff_like_box_text_color' ]) ? $options[ 'cff_like_box_text_color' ] : '',
118
+ 'likeboxwidth' => isset($options[ 'cff_likebox_width' ]) ? $options[ 'cff_likebox_width' ] : '',
119
+ 'likeboxfaces' => isset($options[ 'cff_like_box_faces' ]) ? $options[ 'cff_like_box_faces' ] : '',
120
+ 'likeboxborder' => isset($options[ 'cff_like_box_border' ]) ? $options[ 'cff_like_box_border' ] : '',
121
+
122
+ //Page Header
123
+ 'showheader' => isset($options[ 'cff_show_header' ]) ? $options[ 'cff_show_header' ] : '',
124
+ 'headeroutside' => isset($options[ 'cff_header_outside' ]) ? $options[ 'cff_header_outside' ] : '',
125
+ 'headertext' => isset($options[ 'cff_header_text' ]) ? $options[ 'cff_header_text' ] : '',
126
+ 'headerbg' => isset($options[ 'cff_header_bg_color' ]) ? $options[ 'cff_header_bg_color' ] : '',
127
+ 'headerpadding' => isset($options[ 'cff_header_padding' ]) ? $options[ 'cff_header_padding' ] : '',
128
+ 'headertextsize' => isset($options[ 'cff_header_text_size' ]) ? $options[ 'cff_header_text_size' ] : '',
129
+ 'headertextweight' => isset($options[ 'cff_header_text_weight' ]) ? $options[ 'cff_header_text_weight' ] : '',
130
+ 'headertextcolor' => isset($options[ 'cff_header_text_color' ]) ? $options[ 'cff_header_text_color' ] : '',
131
+ 'headericon' => isset($options[ 'cff_header_icon' ]) ? $options[ 'cff_header_icon' ] : '',
132
+ 'headericoncolor' => isset($options[ 'cff_header_icon_color' ]) ? $options[ 'cff_header_icon_color' ] : '',
133
+ 'headericonsize' => isset($options[ 'cff_header_icon_size' ]) ? $options[ 'cff_header_icon_size' ] : '',
134
+
135
+ 'videoheight' => isset($options[ 'cff_video_height' ]) ? $options[ 'cff_video_height' ] : '',
136
+ 'videoaction' => isset($options[ 'cff_video_action' ]) ? $options[ 'cff_video_action' ] : '',
137
+ 'sepcolor' => isset($options[ 'cff_sep_color' ]) ? $options[ 'cff_sep_color' ] : '',
138
+ 'sepsize' => isset($options[ 'cff_sep_size' ]) ? $options[ 'cff_sep_size' ] : '',
139
+
140
+ //Translate
141
+ 'seemoretext' => isset($options[ 'cff_see_more_text' ]) ? $options[ 'cff_see_more_text' ] : '',
142
+ 'seelesstext' => isset($options[ 'cff_see_less_text' ]) ? $options[ 'cff_see_less_text' ] : '',
143
+ 'facebooklinktext' => isset($options[ 'cff_facebook_link_text' ]) ? $options[ 'cff_facebook_link_text' ] : '',
144
+ 'photostext' => isset($options[ 'cff_translate_photos_text' ]) ? $options[ 'cff_translate_photos_text' ] : ''
145
), $atts);
146
/********** GENERAL **********/
147
$cff_page_type = $atts[ 'pagetype' ];
148
+ ($cff_page_type == 'group') ? $cff_is_group = true : $cff_is_group = false;
149
150
$cff_post_limit = $atts[ 'limit' ];
151
184
/********** LAYOUT **********/
185
$cff_includes = $atts[ 'include' ];
186
//Look for non-plural version of string in the types string in case user specifies singular in shortcode
187
+ $cff_show_text = false;
188
+ $cff_show_desc = false;
189
+ $cff_show_shared_links = false;
190
+ $cff_show_date = false;
191
+ $cff_show_media = false;
192
+ $cff_show_event_title = false;
193
+ $cff_show_event_details = false;
194
+ $cff_show_meta = false;
195
+ $cff_show_link = false;
196
+ $cff_show_like_box = false;
197
if ( stripos($cff_includes, 'text') !== false ) $cff_show_text = true;
198
if ( stripos($cff_includes, 'desc') !== false ) $cff_show_desc = true;
199
if ( stripos($cff_includes, 'sharedlink') !== false ) $cff_show_shared_links = true;
214
if ( !empty($cff_meta_text_color) ) $cff_meta_styles .= 'color:#' . $cff_meta_text_color . ';';
215
if ( !empty($cff_meta_bg_color) ) $cff_meta_styles .= 'background-color:#' . $cff_meta_bg_color . ';';
216
$cff_meta_styles .= '"';
217
+ $cff_nocomments_text = isset($options[ 'cff_nocomments_text' ]) ? $options[ 'cff_nocomments_text' ] : '';
218
+ $cff_hide_comments = isset($options[ 'cff_hide_comments' ]) ? $options[ 'cff_hide_comments' ] : '';
219
if (!isset($cff_nocomments_text) || empty($cff_nocomments_text)) $cff_hide_comments = true;
220
/********** TYPOGRAPHY **********/
221
//See More text
287
if ( !empty($cff_date_weight) && $cff_date_weight != 'inherit' ) $cff_date_styles .= 'font-weight:' . $cff_date_weight . '; ';
288
if ( !empty($cff_date_color) ) $cff_date_styles .= 'color:#' . $cff_date_color . ';';
289
$cff_date_styles .= '"';
290
+ $cff_date_before = isset($options[ 'cff_date_before' ]) ? $options[ 'cff_date_before' ] : '';
291
+ $cff_date_after = isset($options[ 'cff_date_after' ]) ? $options[ 'cff_date_after' ] : '';
292
+ //Set user's timezone based on setting
293
+ $cff_timezone = $atts['timezone'];
294
+ date_default_timezone_set($cff_timezone);
295
//Link to Facebook
296
$cff_link_size = $atts[ 'linksize' ];
297
$cff_link_weight = $atts[ 'linkweight' ];
332
if ( empty($cff_likebox_bg_color) && $cff_like_box_faces == 'false' ) $cff_likebox_styles .= ' margin-left: -10px;';
333
$cff_likebox_styles .= '"';
334
335
+ //Get feed header settings
336
+ $cff_header_bg_color = $atts['headerbg'];
337
+ $cff_header_padding = $atts['headerpadding'];
338
+ $cff_header_text_size = $atts['headertextsize'];
339
+ $cff_header_text_weight = $atts['headertextweight'];
340
+ $cff_header_text_color = $atts['headertextcolor'];
341
+
342
+ //Compile feed header styles
343
+ $cff_header_styles = 'style="';
344
+ if ( !empty($cff_header_bg_color) ) $cff_header_styles .= 'background-color: #' . $cff_header_bg_color . ';';
345
+ if ( !empty($cff_header_padding) ) $cff_header_styles .= ' padding: ' . $cff_header_padding . ';';
346
+ if ( !empty($cff_header_text_size) ) $cff_header_styles .= ' font-size: ' . $cff_header_text_size . 'px;';
347
+ if ( !empty($cff_header_text_weight) ) $cff_header_styles .= ' font-weight: ' . $cff_header_text_weight . ';';
348
+ if ( !empty($cff_header_text_color) ) $cff_header_styles .= ' color: #' . $cff_header_text_color . ';';
349
+ $cff_header_styles .= '"';
350
+
351
//Video
352
//Dimensions
353
$cff_video_width = 640;
386
echo "Please enter the Page ID of the Facebook feed you'd like to display. You can do this in either the Custom Facebook Feed plugin settings or in the shortcode itself. For example [custom_facebook_feed id=<b>YOUR_PAGE_ID</b>].<br /><br />";
387
return false;
388
}
389
+
390
+
391
+ //Is it SSL?
392
+ $cff_ssl = '';
393
+ if (is_ssl()) $cff_ssl = '&return_ssl_resources=true';
394
+
395
//Use posts? or feed?
396
+ $old_others_option = get_option('cff_show_others'); //Use this to help depreciate the old option
397
$show_others = $atts['others'];
398
+ $show_posts_by = $atts['showpostsby'];
399
$graph_query = 'posts';
400
+ $cff_show_only_others = false;
401
+
402
+ //If 'others' shortcode option is used then it overrides any other option
403
+ if ($show_others || $old_others_option == 'on') {
404
+ //Show posts by everyone
405
+ if ( $old_others_option == 'on' || $show_others == 'on' || $show_others == 'true' || $show_others == true || $cff_is_group ) $graph_query = 'feed';
406
+
407
+ //Only show posts by me
408
+ if ( $show_others == 'false' ) $graph_query = 'posts';
409
+
410
+ } else {
411
+ //Else use the settings page option or the 'showpostsby' shortcode option
412
+
413
+ //Only show posts by me
414
+ if ( $show_posts_by == 'me' ) $graph_query = 'posts';
415
+
416
+ //Show posts by everyone
417
+ if ( $show_posts_by == 'others' || $cff_is_group ) $graph_query = 'feed';
418
+
419
+ //Show posts ONLY by others
420
+ if ( $show_posts_by == 'onlyothers' && !$cff_is_group ) {
421
+ $graph_query = 'feed';
422
+ $cff_show_only_others = true;
423
+ }
424
+
425
+ }
426
427
428
//Calculate the cache time in seconds
441
$like_box = '<div class="cff-likebox';
442
if ($cff_like_box_outside) $like_box .= ' cff-outside';
443
$like_box .= ($cff_like_box_position == 'top') ? ' top' : ' bottom';
444
+ $like_box .= '" ' . $cff_likebox_styles . '><script src="http://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" show_faces="'.$cff_like_box_faces.'" stream="false" header="false" colorscheme="'. $cff_like_box_colorscheme .'" show_border="'. $cff_like_box_border .'"></fb:like-box></div>';
445
//Don't show like box if it's a group
446
if($cff_is_group) $like_box = '';
447
448
+
449
+ //Feed header
450
+ $cff_show_header = $atts['showheader'];
451
+ $cff_header_outside = $atts['headeroutside'];
452
+ $cff_header_text = $atts['headertext'];
453
+ $cff_header_icon = $atts['headericon'];
454
+ $cff_header_icon_color = $atts['headericoncolor'];
455
+ $cff_header_icon_size = $atts['headericonsize'];
456
+
457
+ $cff_header = '<h3 class="cff-header';
458
+ if ($cff_header_outside) $cff_header .= ' cff-outside';
459
+ $cff_header .= '"' . $cff_header_styles . '>';
460
+ $cff_header .= '<i class="fa fa-' . $cff_header_icon . '"';
461
+ if(!empty($cff_header_icon_color) || !empty($cff_header_icon_size)) $cff_header .= ' style="';
462
+ if(!empty($cff_header_icon_color)) $cff_header .= 'color: #' . $cff_header_icon_color . ';';
463
+ if(!empty($cff_header_icon_size)) $cff_header .= ' font-size: ' . $cff_header_icon_size . 'px;';
464
+ if(!empty($cff_header_icon_color) || !empty($cff_header_icon_size))$cff_header .= '"';
465
+ $cff_header .= '></i>';
466
+ $cff_header .= $cff_header_text;
467
+ $cff_header .= '</h3>';
468
+
469
+
470
//***START FEED***
471
+ $cff_content = '';
472
+
473
+ //Add the page header to the outside of the top of feed
474
+ if ($cff_show_header && $cff_header_outside) $cff_content .= $cff_header;
475
+
476
//Add like box to the outside of the top of feed
477
+ if ($cff_like_box_position == 'top' && $cff_show_like_box && $cff_like_box_outside) $cff_content .= $like_box;
478
+
479
//Create CFF container HTML
480
+ $cff_content .= '<div id="cff" rel="'.$title_limit.'" class="';
481
+ if( !empty($cff_class) ) $cff_content .= $cff_class . ' ';
482
+ if ( !empty($cff_feed_height) ) $cff_content .= 'cff-fixed-height ';
483
+ $cff_content .= '" ' . $cff_feed_styles . '>';
484
+
485
+ //Add the page header to the inside of the top of feed
486
+ if ($cff_show_header && !$cff_header_outside) $cff_content .= $cff_header;
487
+
488
//Add like box to the inside of the top of feed
489
+ if ($cff_like_box_position == 'top' && $cff_show_like_box && !$cff_like_box_outside) $cff_content .= $like_box;
490
//Limit var
491
$i = 0;
492
494
//ALL POSTS
495
if (!$cff_events_only){
496
497
+ $cff_posts_json_url = 'https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?access_token=' . $access_token . '&limit=' . $cff_post_limit . '&locale=' . $cff_locale . $cff_ssl;
498
499
//Don't use caching if the cache time is set to zero
500
if ($cff_cache_time != 0){
511
} else {
512
$posts_json = cff_fetchUrl($cff_posts_json_url);
513
}
514
+
515
+
516
517
//Interpret data with JSON
518
$FBdata = json_decode($posts_json);
557
break;
558
}
559
560
+
561
+ //ONLY show posts by others
562
+ if ( $cff_show_only_others ) {
563
+ //Get the numeric ID of the page
564
+ $page_object = cff_fetchUrl('https://graph.facebook.com/' . $page_id);
565
+ $page_object = json_decode($page_object);
566
+ $numeric_page_id = $page_object->id;
567
+
568
+ //If the post author's ID is the same as the page ID then don't show the post
569
+ if ( $numeric_page_id == $news->from->id ) $cff_show_post = false;
570
+ }
571
+
572
+
573
//Is it a duplicate post?
574
if (!isset($prev_post_message)) $prev_post_message = '';
575
if (!isset($prev_post_link)) $prev_post_link = '';
599
$link = str_replace('photo.php?','media/set/?',$link);
600
}
601
602
+ //Is it an album?
603
+ $cff_album = false;
604
+ $album_string = 'relevant_count=';
605
+ $relevant_count = stripos($link, $album_string);
606
+
607
+ if ( $relevant_count ) {
608
+ //If relevant_count is larger than 1 then there are multiple photos
609
+ $relevant_count = explode('relevant_count=', $link);
610
+ $num_photos = intval($relevant_count[1]);
611
+ if ( $num_photos > 1 ) {
612
+ $cff_album = true;
613
+
614
+ //Link to the album instead of the photo
615
+ $album_link = str_replace('photo.php?','media/set/?',$link);
616
+ $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
617
+ }
618
+ }
619
+
620
//If there's no link provided then link to either the Facebook page or the individual status
621
if (empty($news->link)) {
622
if ($cff_link_to_timeline == true){
635
$cff_author .= '</a>';
636
637
//POST TEXT
638
+ $cff_translate_photos_text = $atts['photostext'];
639
+ if (!isset($cff_translate_photos_text) || empty($cff_translate_photos_text)) $cff_translate_photos_text = 'photos';
640
$cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
641
+ //__ shared __'s photo
642
+ // if ($news->type == 'photo' && !empty($news->story) ) $cff_post_text .= '<span class="cff-byline" '.$cff_body_styles.'>' . $news->story . '</span>';
643
+ // $cff_post_text = '<div class="cff-post-text" ' . $cff_title_styles . '>';
644
$cff_post_text .= '<span class="cff-text">';
645
+ if ($cff_title_link == 'true') $cff_post_text .= '<a class="cff-post-text-link" href="'.$link.'" '.$target.'>';
646
if (!empty($news->story)) $post_text = $news->story;
647
if (!empty($news->message)) $post_text = $news->message;
648
+ if (!empty($news->name) && empty($news->story) && empty($news->message)) $post_text = $news->name;
649
+ if ($cff_album) {
650
+ if (!empty($news->name)) $post_text = $news->name;
651
+ if (!empty($news->message) && empty($news->name)) $post_text = $news->message;
652
+ $post_text .= ' (' . $num_photos . ' '.$cff_translate_photos_text.')';
653
+ }
654
+
655
+
656
//If the text is wrapped in a link then don't hyperlink any text within
657
if ($cff_title_link) {
658