Custom Facebook Feed - Version 1.5.9

Version Description

Download this release

Release Info

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

Code changes from version 1.5.2 to 1.5.9

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
3
  Tags: facebook, custom, customizable, feed, events, seo, search engine, responsive, mobile, shortcode, social, status
4
  Requires at least: 3.0
5
  Tested up to: 3.6.1
6
- Stable tag: 1.5.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -21,6 +21,7 @@ Display a **completely customizable**, **responsive** and **search engine crawla
21
  * Display **feeds from multiple different Facebook pages** and use the shortcode to embed them into a page, post or widget anywhere on your site
22
  * Show **events** from your Facebook feed with name, date/time, location and description
23
  * Add your own **custom CSS**
 
24
  * Show and hide certain parts of each post
25
  * Choose to show the Facebook profile picture and name above each post
26
  * Select whether to display posts by just the page owner, or everyone who posts on your Facebook page
@@ -88,12 +89,27 @@ You can embed the feed directly into a template file by using the WordPress do_s
88
  4. Display Facebook events
89
  5. Show and hide certain parts of the posts
90
  6. Configuring the plugin
91
- 7. Use the styling options to customize your Facebook feed
92
- 8. It's super easy to display your Facebook feed in any page or post
93
- 9. Add the shortcode to a widget
 
 
 
94
 
95
  == Changelog ==
96
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  = 1.5.2 =
98
  * Fix: Fixed JavaScript error in previous update
99
 
3
  Tags: facebook, custom, customizable, feed, events, seo, search engine, responsive, mobile, shortcode, social, status
4
  Requires at least: 3.0
5
  Tested up to: 3.6.1
6
+ Stable tag: 1.6.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
21
  * Display **feeds from multiple different Facebook pages** and use the shortcode to embed them into a page, post or widget anywhere on your site
22
  * Show **events** from your Facebook feed with name, date/time, location and description
23
  * Add your own **custom CSS**
24
+ * **Caching** means that posts load lightning fast. Set your own caching time - check for new posts every few seconds, minutes, hours or days. You decide.
25
  * Show and hide certain parts of each post
26
  * Choose to show the Facebook profile picture and name above each post
27
  * Select whether to display posts by just the page owner, or everyone who posts on your Facebook page
89
  4. Display Facebook events
90
  5. Show and hide certain parts of the posts
91
  6. Configuring the plugin
92
+ 7. Layout & Style page - General options
93
+ 8. Layout & Style page - Post Layout options
94
+ 9. Layout & Style page - Typography options
95
+ 10. Layout & Style page - Misc options
96
+ 11. It's super easy to display your Facebook feed in any page or post
97
+ 12. You can add the shortcode to a widget to display it in your sidebar, footer or any other widgetized area
98
 
99
  == Changelog ==
100
 
101
+ = 1.6.0 =
102
+ * New: Post caching now temporarily stores your post data in your WordPress database to allow for super quick load times
103
+ * New: Define your own caching time. Check for new posts every few seconds, minutes, hours or days. You decide.
104
+ * New: Define your own custom text for the 'See More' and 'See Less' buttons
105
+ * New: Add your own CSS class to your feeds
106
+ * New: Define a post limit which is higher or lower than the default 25
107
+ * New: Include the Like box inside or outside of the feed's container
108
+ * New: Customize the event date independently
109
+ * New: Improved layout of admin pages for easier navigation and customization
110
+ * Fix: Provided a fix for the Facebook API duplicate post bug
111
+ * Fix: Fixed bug which ocurred when multiple feeds are displayed on the same page with different text lengths defined
112
+
113
  = 1.5.2 =
114
  * Fix: Fixed JavaScript error in previous update
115
 
css/cff-style.css CHANGED
@@ -24,14 +24,19 @@
24
  /******************/
25
  /*** TYPOGRAPHY ***/
26
  /******************/
 
 
 
 
27
  /* Links */
28
  #cff a {
29
- text-decoration:underline;
30
  }
31
  /* Post titles and body text */
32
  #cff h3, #cff h4, #cff h5, #cff h6, #cff p{
33
  float: left;
34
  width: 100%;
 
35
  padding: 0;
36
  margin: 5px 0;
37
  line-height: 1.4;
@@ -47,11 +52,9 @@
47
  /* Date */
48
  #cff .cff-date{
49
  float: left;
50
- clear: left;
51
- width: auto;
52
  font-size: 11px;
53
  }
54
-
55
  /************/
56
  /***AUTHOR***/
57
  /************/
@@ -76,12 +79,30 @@
76
  #cff .cff-author a{
77
  text-decoration: none;
78
  }
79
-
 
 
 
 
 
80
  /* Link */
81
  #cff .cff-expand{
 
 
 
82
  font-size: 11px;
83
  font-weight: normal;
84
  }
 
 
 
 
 
 
 
 
 
 
85
  /*Link text*/
86
  #cff .text-link{
87
  float: left;
@@ -94,15 +115,12 @@
94
  width: 100%;
95
  margin-left: 0;
96
  }
97
- #cff .break-word{
98
- word-break: break-all;
99
- }
100
- /* Event */
101
  #cff .details{
102
  float: left;
103
- clear: both;
104
  width: 100%;
105
- padding: 15px 0 10px 0;
106
  }
107
  #cff .details h5{
108
  margin: 0 0 5px 0;
@@ -117,24 +135,14 @@
117
  }
118
  #cff .details .where,
119
  #cff .details .when{
120
- font-weight: bold;
121
- }
122
- #cff .details .where{
123
- margin-bottom: -4px;
124
- }
125
- /*****************/
126
- /*** POST META ***/
127
- /*****************/
128
- /* Meta container */
129
- #cff .meta-wrap{
130
- float: left;
131
- width: 100%;
132
  }
 
133
  /* View on Facebook / View Link text */
134
  #cff .cff-viewpost{
135
  float: right;
136
  clear: none;
137
- padding-top: 5px;
138
  font-size: 11px;
139
  }
140
  /* Like box */
@@ -146,6 +154,13 @@
146
  width: 100%;
147
  margin-left: -10px;
148
  }
 
 
 
 
 
 
 
149
  /* Clear fix */
150
  .clear:after {
151
  clear: both;
@@ -158,7 +173,6 @@
158
  display: inline-block;
159
  display: block;
160
  }
161
-
162
  /*********************/
163
  /*** STYLE OPTIONS ***/
164
  /*********************/
24
  /******************/
25
  /*** TYPOGRAPHY ***/
26
  /******************/
27
+ /*See more/less links*/
28
+ #cff .less{
29
+ display: none;
30
+ }
31
  /* Links */
32
  #cff a {
33
+ text-decoration: underline;
34
  }
35
  /* Post titles and body text */
36
  #cff h3, #cff h4, #cff h5, #cff h6, #cff p{
37
  float: left;
38
  width: 100%;
39
+ clear: both;
40
  padding: 0;
41
  margin: 5px 0;
42
  line-height: 1.4;
52
  /* Date */
53
  #cff .cff-date{
54
  float: left;
55
+ width: 100%;
 
56
  font-size: 11px;
57
  }
 
58
  /************/
59
  /***AUTHOR***/
60
  /************/
79
  #cff .cff-author a{
80
  text-decoration: none;
81
  }
82
+ /*************/
83
+ /*** MEDIA ***/
84
+ /*************/
85
+ #cff .break-word{
86
+ word-break: break-all;
87
+ }
88
  /* Link */
89
  #cff .cff-expand{
90
+ display: none;
91
+ }
92
+ #cff .cff-expand a{
93
  font-size: 11px;
94
  font-weight: normal;
95
  }
96
+ /*Link image*/
97
+ #cff .link{
98
+ float: left;
99
+ clear: both;
100
+ max-width: 20%;
101
+ margin-top: 10px;
102
+ }
103
+ #cff .link img{
104
+ max-width: 100%;
105
+ }
106
  /*Link text*/
107
  #cff .text-link{
108
  float: left;
115
  width: 100%;
116
  margin-left: 0;
117
  }
118
+ /* Feed events */
 
 
 
119
  #cff .details{
120
  float: left;
121
+ clear: none;
122
  width: 100%;
123
+ padding: 0 0 10px 0;
124
  }
125
  #cff .details h5{
126
  margin: 0 0 5px 0;
135
  }
136
  #cff .details .where,
137
  #cff .details .when{
138
+ /*font-weight: bold;*/
 
 
 
 
 
 
 
 
 
 
 
139
  }
140
+
141
  /* View on Facebook / View Link text */
142
  #cff .cff-viewpost{
143
  float: right;
144
  clear: none;
145
+ padding-top: 12px;
146
  font-size: 11px;
147
  }
148
  /* Like box */
154
  width: 100%;
155
  margin-left: -10px;
156
  }
157
+ /*Like box is not inside of #cff*/
158
+ .cff-likebox.top.outside{
159
+ margin-bottom: 10px;
160
+ }
161
+ .cff-likebox.bottom.outside{
162
+ margin-top: 10px;
163
+ }
164
  /* Clear fix */
165
  .clear:after {
166
  clear: both;
173
  display: inline-block;
174
  display: block;
175
  }
 
176
  /*********************/
177
  /*** STYLE OPTIONS ***/
178
  /*********************/
custom-facebook-feed-admin.php CHANGED
@@ -33,41 +33,69 @@ add_action('admin_menu', 'cff_styling_menu');
33
  //Create Settings page
34
  function cff_settings_page() {
35
  //Declare variables for fields
36
- $hidden_field_name = 'cff_submit_hidden';
37
- $access_token = 'cff_access_token';
38
- $page_id = 'cff_page_id';
39
- $num_show = 'cff_num_show';
40
- $cff_show_others = 'cff_show_others';
41
-
 
 
42
  // Read in existing option value from database
43
  $access_token_val = get_option( $access_token );
44
  $page_id_val = get_option( $page_id );
45
- $num_show_val = get_option( $num_show );
 
46
  $cff_show_others_val = get_option( $cff_show_others );
47
-
 
48
  // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
49
  if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {
50
  // Read their posted value
51
  $access_token_val = $_POST[ $access_token ];
52
  $page_id_val = $_POST[ $page_id ];
53
  $num_show_val = $_POST[ $num_show ];
 
54
  $cff_show_others_val = $_POST[ $cff_show_others ];
55
-
 
56
  // Save the posted value in the database
57
  update_option( $access_token, $access_token_val );
58
  update_option( $page_id, $page_id_val );
59
  update_option( $num_show, $num_show_val );
 
60
  update_option( $cff_show_others, $cff_show_others_val );
61
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  // Put an settings updated message on the screen
63
  ?>
64
  <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
65
  <?php } ?>
66
 
67
- <div class="wrap">
68
- <h2><?php _e('Custom Facebook Feed Settings'); ?></h2>
 
 
69
  <form name="form1" method="post" action="">
70
  <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
 
71
  <h3><?php _e('Configuration'); ?></h3>
72
  <table class="form-table">
73
  <tbody>
@@ -75,74 +103,120 @@ function cff_settings_page() {
75
  <th scope="row"><?php _e('Access Token'); ?></th>
76
  <td>
77
  <input name="cff_access_token" type="text" value="<?php esc_attr_e( $access_token_val ); ?>" size="60" />
78
- <a href="http://smashballoon.com/custom-facebook-feed/access-token/" target="_blank">How to get an Access Token</a>
 
 
 
79
  </td>
80
  </tr>
81
  <tr valign="top">
82
- <th scope="row"><?php _e('Page ID'); ?></th>
83
  <td>
84
  <input name="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
85
- <a href="http://smashballoon.com/custom-facebook-feed/faq/" target="_blank">What's my Page ID?</a>
 
 
86
  </td>
87
  </tr>
88
  <tr valign="top">
89
  <th scope="row"><?php _e('Number of posts to display'); ?></th>
90
  <td>
91
  <input name="cff_num_show" type="text" value="<?php esc_attr_e( $num_show_val ); ?>" size="4" />
 
 
 
 
 
 
 
 
 
92
  </td>
93
  </tr>
94
  <tr valign="top">
95
  <th scope="row"><?php _e('Show posts by others on my page'); ?></th>
96
  <td>
97
  <input name="cff_show_others" type="checkbox" id="cff_show_others" <?php if($cff_show_others_val == true) echo "checked"; ?> />
98
- <i style="color: #666; font-size: 11px;">By default only posts by the page owner will be shown. Check this box to also show posts by others.</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  </td>
100
  </tr>
 
101
  </tbody>
102
  </table>
103
  <?php submit_button(); ?>
104
  </form>
 
 
105
  <hr />
106
- <h4>Displaying your Feed</h4>
107
- <p>Copy and paste this shortcode directly into the page, post or widget where you'd like the feed to show up:</p>
108
- <input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="edd-sysinfo" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)." />
 
 
 
109
 
110
- <p>You can override the settings above directly in the shortcode like so:</p>
111
 
112
- <p>Eg: [custom-facebook-feed <b><span style='color: green;'>id=<i>Put_Your_Page_ID_Here</i></span> <span style='color: purple;'>num=3</span> <span style='color: blue;'>height=500px</span></b>]</p>
113
-
114
- <p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank">Click here</a> for a full list of shortcode options <i style="color: #666; font-size: 11px;">(Please note that some of them will only work with the Pro version of the plugin)</i></p>
115
- <br />
116
  <hr />
117
- <br />
118
- <p><a href="http://smashballoon.com/custom-facebook-feed/support" target="_blank">Plugin Support</a> - Smash Balloon is committed to making this plugin better. Please let us know if you have had any issues when using this plugin so that we can continue to improve it!</p>
119
- <br /><br />
120
  <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
121
 
122
- <div class="wrap">
123
- <h2><?php _e('System Info'); ?></h2>
124
- <p>PHP Version: <b><?php echo PHP_VERSION . "\n"; ?></b></p>
125
- <p>Web Server Info: <b><?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?></b></p>
126
- <p>PHP allow_url_fopen: <b><?php echo ini_get( 'allow_url_fopen' ) ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>"; ?></b></p>
127
- <p>PHP cURL: <b><?php echo is_callable('curl_init') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
128
- <p>JSON: <b><?php echo function_exists("json_decode") ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
129
- </div>
 
 
 
130
  <?php
131
  } //End Settings_Page
132
  //Create Style page
133
  function cff_style_page() {
134
  //Declare variables for fields
135
- $style_hidden_field_name = 'cff_style_submit_hidden';
 
 
 
 
136
  $defaults = array(
 
 
 
 
 
 
 
 
137
  //Include
138
  'cff_show_text' => true,
139
  'cff_show_desc' => true,
 
140
  'cff_show_date' => true,
 
141
  'cff_show_event_title' => true,
142
  'cff_show_event_details' => true,
 
143
  'cff_show_link' => true,
144
  'cff_show_like_box' => true,
145
  //Typography
 
 
146
  'cff_title_format' => 'p',
147
  'cff_title_size' => 'inherit',
148
  'cff_title_weight' => 'inherit',
@@ -150,15 +224,22 @@ function cff_style_page() {
150
  'cff_body_size' => 'inherit',
151
  'cff_body_weight' => 'inherit',
152
  'cff_body_color' => '',
 
153
  'cff_event_title_format' => 'p',
154
  'cff_event_title_size' => 'inherit',
155
  'cff_event_title_weight' => 'inherit',
156
  'cff_event_title_color' => '',
 
 
 
 
 
 
 
 
157
  'cff_event_details_size' => 'inherit',
158
  'cff_event_details_weight' => 'inherit',
159
  'cff_event_details_color' => '',
160
- 'cff_event_date_formatting' => '1',
161
- 'cff_event_date_custom' => '',
162
  //Date
163
  'cff_date_position' => 'below',
164
  'cff_date_size' => 'inherit',
@@ -174,34 +255,57 @@ function cff_style_page() {
174
  'cff_link_color' => '',
175
  'cff_facebook_link_text' => 'View on Facebook',
176
  'cff_view_link_text' => 'View Link',
 
 
 
 
 
 
177
  //Misc
178
  'cff_feed_width' => '',
179
  'cff_feed_height' => '',
180
- 'cff_feed_padding' => '',
181
  'cff_like_box_position' => 'bottom',
 
182
  'cff_bg_color' => '',
183
  'cff_likebox_bg_color' => '',
 
184
  'cff_show_author' => false,
 
185
  //New
186
  'cff_custom_css' => '',
187
  'cff_title_link' => false,
188
  'cff_event_title_link' => false,
 
189
  'cff_sep_color' => '',
190
  'cff_sep_size' => '1'
191
  );
192
- //Save layout options in an array
193
  add_option( 'cff_style_settings', $options );
194
  $options = wp_parse_args(get_option('cff_style_settings'), $defaults);
195
  //Set the page variables
 
 
 
 
 
 
 
 
196
  //Include
197
  $cff_show_text = $options[ 'cff_show_text' ];
198
  $cff_show_desc = $options[ 'cff_show_desc' ];
 
199
  $cff_show_date = $options[ 'cff_show_date' ];
 
200
  $cff_show_event_title = $options[ 'cff_show_event_title' ];
201
  $cff_show_event_details = $options[ 'cff_show_event_details' ];
 
202
  $cff_show_link = $options[ 'cff_show_link' ];
203
  $cff_show_like_box = $options[ 'cff_show_like_box' ];
204
  //Typography
 
 
205
  $cff_title_format = $options[ 'cff_title_format' ];
206
  $cff_title_size = $options[ 'cff_title_size' ];
207
  $cff_title_weight = $options[ 'cff_title_weight' ];
@@ -209,16 +313,22 @@ function cff_style_page() {
209
  $cff_body_size = $options[ 'cff_body_size' ];
210
  $cff_body_weight = $options[ 'cff_body_weight' ];
211
  $cff_body_color = $options[ 'cff_body_color' ];
 
212
  $cff_event_title_format = $options[ 'cff_event_title_format' ];
213
  $cff_event_title_size = $options[ 'cff_event_title_size' ];
214
  $cff_event_title_weight = $options[ 'cff_event_title_weight' ];
215
  $cff_event_title_color = $options[ 'cff_event_title_color' ];
 
 
 
 
 
 
 
 
216
  $cff_event_details_size = $options[ 'cff_event_details_size' ];
217
  $cff_event_details_weight = $options[ 'cff_event_details_weight' ];
218
  $cff_event_details_color = $options[ 'cff_event_details_color' ];
219
- $cff_event_date_formatting = $options[ 'cff_event_date_formatting' ];
220
- $cff_event_date_custom = $options[ 'cff_event_date_custom' ];
221
-
222
  //Date
223
  $cff_date_position = $options[ 'cff_date_position' ];
224
  $cff_date_size = $options[ 'cff_date_size' ];
@@ -234,155 +344,231 @@ function cff_style_page() {
234
  $cff_link_color = $options[ 'cff_link_color' ];
235
  $cff_facebook_link_text = $options[ 'cff_facebook_link_text' ];
236
  $cff_view_link_text = $options[ 'cff_view_link_text' ];
 
 
 
 
 
 
237
  //Misc
238
  $cff_feed_width = $options[ 'cff_feed_width' ];
239
  $cff_feed_height = $options[ 'cff_feed_height' ];
240
  $cff_feed_padding = $options[ 'cff_feed_padding' ];
241
  $cff_like_box_position = $options[ 'cff_like_box_position' ];
 
 
242
  $cff_open_links = $options[ 'cff_open_links' ];
243
  $cff_bg_color = $options[ 'cff_bg_color' ];
244
  $cff_likebox_bg_color = $options[ 'cff_likebox_bg_color' ];
 
245
  $cff_show_author = $options[ 'cff_show_author' ];
246
-
247
  //New
248
  $cff_custom_css = $options[ 'cff_custom_css' ];
249
  $cff_title_link = $options[ 'cff_title_link' ];
250
  $cff_event_title_link = $options[ 'cff_event_title_link' ];
 
251
  $cff_sep_color = $options[ 'cff_sep_color' ];
252
  $cff_sep_size = $options[ 'cff_sep_size' ];
253
-
254
- // Texts lengths
255
- $cff_title_length = 'cff_title_length';
256
  $cff_body_length = 'cff_body_length';
257
  // Read in existing option value from database
258
  $cff_title_length_val = get_option( $cff_title_length );
259
  $cff_body_length_val = get_option( $cff_body_length );
260
  // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
261
  if( isset($_POST[ $style_hidden_field_name ]) && $_POST[ $style_hidden_field_name ] == 'Y' ) {
262
-
263
- // Read their posted value
264
- $cff_title_length_val = $_POST[ $cff_title_length ];
265
- $cff_body_length_val = $_POST[ $cff_body_length ];
266
- // Save the posted value in the database
267
- update_option( $cff_title_length, $cff_title_length_val );
268
- update_option( $cff_body_length, $cff_body_length_val );
269
-
270
- //Update the page variable
271
- //Include
272
- $cff_show_text = $_POST[ 'cff_show_text' ];
273
- $cff_show_desc = $_POST[ 'cff_show_desc' ];
274
- $cff_show_date = $_POST[ 'cff_show_date' ];
275
- $cff_show_event_title = $_POST[ 'cff_show_event_title' ];
276
- $cff_show_event_details = $_POST[ 'cff_show_event_details' ];
277
- $cff_show_link = $_POST[ 'cff_show_link' ];
278
- $cff_show_like_box = $_POST[ 'cff_show_like_box' ];
279
- //Typography
280
- $cff_title_format = $_POST[ 'cff_title_format' ];
281
- $cff_title_size = $_POST[ 'cff_title_size' ];
282
- $cff_title_weight = $_POST[ 'cff_title_weight' ];
283
- $cff_title_color = $_POST[ 'cff_title_color' ];
284
- $cff_body_size = $_POST[ 'cff_body_size' ];
285
- $cff_body_weight = $_POST[ 'cff_body_weight' ];
286
- $cff_body_color = $_POST[ 'cff_body_color' ];
287
- $cff_event_title_format = $_POST[ 'cff_event_title_format' ];
288
- $cff_event_title_size = $_POST[ 'cff_event_title_size' ];
289
- $cff_event_title_weight = $_POST[ 'cff_event_title_weight' ];
290
- $cff_event_title_color = $_POST[ 'cff_event_title_color' ];
291
- $cff_event_details_size = $_POST[ 'cff_event_details_size' ];
292
- $cff_event_details_weight = $_POST[ 'cff_event_details_weight' ];
293
- $cff_event_details_color = $_POST[ 'cff_event_details_color' ];
294
- $cff_event_date_formatting = $_POST[ 'cff_event_date_formatting' ];
295
- $cff_event_date_custom = $_POST[ 'cff_event_date_custom' ];
296
-
297
- //Date
298
- $cff_date_position = $_POST[ 'cff_date_position' ];
299
- $cff_date_size = $_POST[ 'cff_date_size' ];
300
- $cff_date_weight = $_POST[ 'cff_date_weight' ];
301
- $cff_date_color = $_POST[ 'cff_date_color' ];
302
- $cff_date_formatting = $_POST[ 'cff_date_formatting' ];
303
- $cff_date_custom = $_POST[ 'cff_date_custom' ];
304
- $cff_date_before = $_POST[ 'cff_date_before' ];
305
- $cff_date_after = $_POST[ 'cff_date_after' ];
306
- //View on Facebook link
307
- $cff_link_size = $_POST[ 'cff_link_size' ];
308
- $cff_link_weight = $_POST[ 'cff_link_weight' ];
309
- $cff_link_color = $_POST[ 'cff_link_color' ];
310
- $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
311
- $cff_view_link_text = $_POST[ 'cff_view_link_text' ];
312
- //Misc
313
- $cff_feed_width = $_POST[ 'cff_feed_width' ];
314
- $cff_feed_height = $_POST[ 'cff_feed_height' ];
315
- $cff_feed_padding = $_POST[ 'cff_feed_padding' ];
316
- $cff_like_box_position = $_POST[ 'cff_like_box_position' ];
317
- $cff_open_links = $_POST[ 'cff_open_links' ];
318
- $cff_bg_color = $_POST[ 'cff_bg_color' ];
319
- $cff_likebox_bg_color = $_POST[ 'cff_likebox_bg_color' ];
320
- $cff_show_author = $_POST[ 'cff_show_author' ];
321
-
322
- //New
323
- $cff_custom_css = $_POST[ 'cff_custom_css' ];
324
- $cff_title_link = $_POST[ 'cff_title_link' ];
325
- $cff_event_title_link = $_POST[ 'cff_event_title_link' ];
326
- $cff_sep_color = $_POST[ 'cff_sep_color' ];
327
- $cff_sep_size = $_POST[ 'cff_sep_size' ];
328
- //Update the options in the array in the database
329
- //Include
330
- $options[ 'cff_show_text' ] = $cff_show_text;
331
- $options[ 'cff_show_desc' ] = $cff_show_desc;
332
- $options[ 'cff_show_date' ] = $cff_show_date;
333
- $options[ 'cff_show_event_title' ] = $cff_show_event_title;
334
- $options[ 'cff_show_event_details' ] = $cff_show_event_details;
335
- $options[ 'cff_show_link' ] = $cff_show_link;
336
- $options[ 'cff_show_like_box' ] = $cff_show_like_box;
337
- //Typography
338
- $options[ 'cff_title_format' ] = $cff_title_format;
339
- $options[ 'cff_title_size' ] = $cff_title_size;
340
- $options[ 'cff_title_weight' ] = $cff_title_weight;
341
- $options[ 'cff_title_color' ] = $cff_title_color;
342
- $options[ 'cff_body_size' ] = $cff_body_size;
343
- $options[ 'cff_body_weight' ] = $cff_body_weight;
344
- $options[ 'cff_body_color' ] = $cff_body_color;
345
- $options[ 'cff_event_title_format' ] = $cff_event_title_format;
346
- $options[ 'cff_event_title_size' ] = $cff_event_title_size;
347
- $options[ 'cff_event_title_weight' ] = $cff_event_title_weight;
348
- $options[ 'cff_event_title_color' ] = $cff_event_title_color;
349
- $options[ 'cff_event_details_size' ] = $cff_event_details_size;
350
- $options[ 'cff_event_details_weight' ] = $cff_event_details_weight;
351
- $options[ 'cff_event_details_color' ] = $cff_event_details_color;
352
- $options[ 'cff_event_date_formatting' ] = $cff_event_date_formatting;
353
- $options[ 'cff_event_date_custom' ] = $cff_event_date_custom;
354
-
355
- //Date
356
- $options[ 'cff_date_position' ] = $cff_date_position;
357
- $options[ 'cff_date_size' ] = $cff_date_size;
358
- $options[ 'cff_date_weight' ] = $cff_date_weight;
359
- $options[ 'cff_date_color' ] = $cff_date_color;
360
- $options[ 'cff_date_formatting' ] = $cff_date_formatting;
361
- $options[ 'cff_date_custom' ] = $cff_date_custom;
362
- $options[ 'cff_date_before' ] = $cff_date_before;
363
- $options[ 'cff_date_after' ] = $cff_date_after;
364
- //Link
365
- $options[ 'cff_link_size' ] = $cff_link_size;
366
- $options[ 'cff_link_weight' ] = $cff_link_weight;
367
- $options[ 'cff_link_color' ] = $cff_link_color;
368
- $options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
369
- $options[ 'cff_view_link_text' ] = $cff_view_link_text;
370
- //Misc
371
- $options[ 'cff_feed_width' ] = $cff_feed_width;
372
- $options[ 'cff_feed_height' ] = $cff_feed_height;
373
- $options[ 'cff_feed_padding' ] = $cff_feed_padding;
374
- $options[ 'cff_like_box_position' ] = $cff_like_box_position;
375
- $options[ 'cff_open_links' ] = $cff_open_links;
376
- $options[ 'cff_bg_color' ] = $cff_bg_color;
377
- $options[ 'cff_likebox_bg_color' ] = $cff_likebox_bg_color;
378
- $options[ 'cff_show_author' ] = $cff_show_author;
379
-
380
- //New
381
- $options[ 'cff_custom_css' ] = $cff_custom_css;
382
- $options[ 'cff_title_link' ] = $cff_title_link;
383
- $options[ 'cff_event_title_link' ] = $cff_event_title_link;
384
- $options[ 'cff_sep_color' ] = $cff_sep_color;
385
- $options[ 'cff_sep_size' ] = $cff_sep_size;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  //Update the array
387
  update_option( 'cff_style_settings', $options );
388
  // Put an settings updated message on the screen
@@ -390,12 +576,24 @@ function cff_style_page() {
390
  <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
391
  <?php } ?>
392
 
393
- <div class="wrap">
394
- <h2><?php _e('Custom Facebook Feed - Layout and Style'); ?></h2>
 
 
395
  <form name="form1" method="post" action="">
396
  <input type="hidden" name="<?php echo $style_hidden_field_name; ?>" value="Y">
 
 
 
 
 
 
 
 
 
 
 
397
  <br />
398
- <hr />
399
  <table class="form-table">
400
  <tbody>
401
  <h3><?php _e('General'); ?></h3>
@@ -403,28 +601,28 @@ function cff_style_page() {
403
  <th scope="row"><?php _e('Feed Width'); ?></th>
404
  <td>
405
  <input name="cff_feed_width" type="text" value="<?php esc_attr_e( $cff_feed_width ); ?>" size="6" />
406
- <span>Eg. 500px, 50%, 10em. <i style="color: #666; font-size: 11px; margin-left: 5px;">Default is 100%</i></span>
407
  </td>
408
  </tr>
409
  <tr valign="top">
410
  <th scope="row"><?php _e('Feed Height'); ?></th>
411
  <td>
412
  <input name="cff_feed_height" type="text" value="<?php esc_attr_e( $cff_feed_height ); ?>" size="6" />
413
- <span>Eg. 500px, 50em. <i style="color: #666; font-size: 11px; margin-left: 5px;">Leave empty to set no maximum height. If the feed exceeds this height then a scroll bar will be used.</i></span>
414
  </td>
415
  </tr>
416
  <th scope="row"><?php _e('Feed Padding'); ?></th>
417
  <td>
418
  <input name="cff_feed_padding" type="text" value="<?php esc_attr_e( $cff_feed_padding ); ?>" size="6" />
419
- <span>Eg. 20px, 5%. <i style="color: #666; font-size: 11px; margin-left: 5px;">This is the amount of padding/spacing that goes around the feed. This is particularly useful if you intend to set a background color on the feed.</i></span>
420
  </td>
421
  </tr>
422
  <tr valign="top">
423
  <th scope="row"><?php _e('Feed Background Color'); ?></th>
424
  <td>
425
  <label for="cff_bg_color">#</label>
426
- <input name="cff_bg_color" type="text" value="<?php esc_attr_e( $cff_bg_color ); ?>" size="10" />
427
- <span>Eg. ED9A00 <a href="http://www.colorpicker.com/" target="_blank">Color Picker</a></span>
428
  </td>
429
  </tr>
430
  <tr valign="top">
@@ -432,493 +630,706 @@ function cff_style_page() {
432
  <td>
433
  <input name="cff_show_author" type="checkbox" id="cff_show_author" <?php if($cff_show_author == true) echo "checked"; ?> />
434
  <label for="cff_show_status_type">Yes</label>
435
- <i style="color: #666; font-size: 11px; margin-left: 5px;">This will show the thumbnail picture and name of the post author at the top of each post</i>
436
 
437
  </td>
438
  </tr>
 
 
 
 
 
 
 
439
  </tbody>
440
  </table>
441
- <br />
442
  <hr />
443
  <table class="form-table">
444
  <tbody>
445
  <h3><?php _e('Post Types'); ?></h3>
446
  <tr valign="top">
447
- <th scope="row"><?php _e('Only show these types of posts:'); ?></th>
 
448
  <td>
449
- <input name="cff_show_status_type" type="checkbox" id="cff_show_status_type" disabled checked />
450
- <label for="cff_show_status_type">Statuses</label>
451
- &nbsp;&nbsp;
452
-
453
- <input type="checkbox" name="cff_show_event_type" id="cff_show_event_type" disabled checked />
454
- <label for="cff_show_event_type">Events</label>
455
- &nbsp;&nbsp;
456
- <input type="checkbox" name="cff_show_photos_type" id="cff_show_photos_type" disabled checked />
457
- <label for="cff_show_photos_type">Photos</label>
458
- &nbsp;&nbsp;
459
- <input type="checkbox" name="cff_show_video_type" id="cff_show_video_type" disabled checked />
460
- <label for="cff_show_video_type">Videos</label>
461
- &nbsp;&nbsp;
462
- <input type="checkbox" name="cff_show_links_type" id="cff_show_links_type" disabled checked />
463
- <label for="cff_show_links_type">Links</label>
464
- &nbsp;
465
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Upgrade to Pro</a></i>
 
 
 
466
  </td>
467
  </tr>
468
  </tbody>
469
  </table>
 
 
 
 
 
 
 
470
  <br />
471
- <hr />
472
  <h3><?php _e('Post Layout'); ?></h3>
473
  <table class="form-table">
474
  <tbody>
475
  <tr>
476
- <td><p>Choose a post layout:</p></td>
477
  <td>
478
  <select name="cff_preset_layout" disabled>
479
- <option>Thumbnail</option>
480
- <option>Half-width</option>
481
- <option>Full-width</option>
482
  </select>
483
- <i style="color: #666; font-size: 11px; margin-left: 5px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Upgrade to Pro</a></i>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  </td>
485
  </tr>
 
 
 
 
 
 
486
  <tr valign="top">
487
- <th scope="row"><?php _e('Include the following in posts (when applicable):'); ?></th>
 
488
  <td>
489
  <div>
490
  <input name="cff_show_text" type="checkbox" id="cff_show_text" <?php if($cff_show_text == true) echo "checked"; ?> />
491
- <label for="cff_show_text">Post text</label>
492
  </div>
493
  <div>
494
- <input type="checkbox" name="cff_show_desc" id="cff_show_desc" <?php if($cff_show_desc == true) echo 'checked="checked"' ?> />
495
- <label for="cff_show_desc">Link description</label>
496
  </div>
497
  <div>
498
- <input type="checkbox" name="cff_show_date" id="cff_show_date" <?php if($cff_show_date == true) echo 'checked="checked"' ?> />
499
- <label for="cff_show_date">Date</label>
500
  </div>
501
  <div>
502
- <input type="checkbox" disabled />
503
- <label style="color: #999;">Photos/videos</label><i style="color: #666; font-size: 11px; margin-left: 5px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Upgrade to Pro</a></i>
 
 
 
 
504
  </div>
505
-
506
  <div>
507
  <input type="checkbox" name="cff_show_event_title" id="cff_show_event_title" <?php if($cff_show_event_title == true) echo 'checked="checked"' ?> />
508
- <label for="cff_show_event_title">Event title</label>
509
  </div>
510
  <div>
511
  <input type="checkbox" name="cff_show_event_details" id="cff_show_event_details" <?php if($cff_show_event_details == true) echo 'checked="checked"' ?> />
512
- <label for="cff_show_event_details">Event details</label>
513
  </div>
514
  <div>
515
- <input type="checkbox" disabled />
516
- <label style="color: #999;">Like/shares/comments</label><i style="color: #666; font-size: 11px; margin-left: 5px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Upgrade to Pro</a></i>
517
  </div>
518
  <div>
519
  <input type="checkbox" name="cff_show_link" id="cff_show_link" <?php if($cff_show_link == true) echo 'checked="checked"' ?> />
520
- <label for="cff_show_link">View on Facebook/View Link</label>
521
  </div>
522
  </td>
523
  </tr>
524
  </tbody>
525
  </table>
 
526
  <?php submit_button(); ?>
527
- <hr />
 
 
 
 
 
 
528
  <h3><?php _e('Typography'); ?></h3>
529
- <table class="form-table">
530
- <tbody>
531
- <tr><td><b style="font-size: 14px;"><?php _e('Post Text'); ?></b></td></tr>
532
- <tr>
533
- <th><label for="cff_title_format" class="bump-left">Format</label></th>
534
- <td>
535
- <select name="cff_title_format">
536
- <option value="p" <?php if($cff_title_format == "p") echo 'selected="selected"' ?> >Paragraph</option>
537
- <option value="h3" <?php if($cff_title_format == "h3") echo 'selected="selected"' ?> >Heading 3</option>
538
- <option value="h4" <?php if($cff_title_format == "h4") echo 'selected="selected"' ?> >Heading 4</option>
539
- <option value="h5" <?php if($cff_title_format == "h5") echo 'selected="selected"' ?> >Heading 5</option>
540
- <option value="h6" <?php if($cff_title_format == "h6") echo 'selected="selected"' ?> >Heading 6</option>
541
- </select>
542
- </td>
543
- </tr>
544
- <tr>
545
- <th><label for="cff_title_size" class="bump-left">Text Size</label></th>
546
- <td>
547
- <select name="cff_title_size">
548
- <option value="inherit" <?php if($cff_title_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
549
- <option value="10" <?php if($cff_title_size == "10") echo 'selected="selected"' ?> >10px</option>
550
- <option value="11" <?php if($cff_title_size == "11") echo 'selected="selected"' ?> >11px</option>
551
- <option value="12" <?php if($cff_title_size == "12") echo 'selected="selected"' ?> >12px</option>
552
- <option value="14" <?php if($cff_title_size == "14") echo 'selected="selected"' ?> >14px</option>
553
- <option value="16" <?php if($cff_title_size == "16") echo 'selected="selected"' ?> >16px</option>
554
- <option value="18" <?php if($cff_title_size == "18") echo 'selected="selected"' ?> >18px</option>
555
- <option value="20" <?php if($cff_title_size == "20") echo 'selected="selected"' ?> >20px</option>
556
- <option value="24" <?php if($cff_title_size == "24") echo 'selected="selected"' ?> >24px</option>
557
- <option value="28" <?php if($cff_title_size == "28") echo 'selected="selected"' ?> >28px</option>
558
- <option value="32" <?php if($cff_title_size == "32") echo 'selected="selected"' ?> >32px</option>
559
- <option value="36" <?php if($cff_title_size == "36") echo 'selected="selected"' ?> >36px</option>
560
- <option value="42" <?php if($cff_title_size == "42") echo 'selected="selected"' ?> >42px</option>
561
- <option value="48" <?php if($cff_title_size == "48") echo 'selected="selected"' ?> >48px</option>
562
- <option value="60" <?php if($cff_title_size == "54") echo 'selected="selected"' ?> >54px</option>
563
- <option value="60" <?php if($cff_title_size == "60") echo 'selected="selected"' ?> >60px</option>
564
- </select>
565
- </td>
566
- </tr>
567
- <tr>
568
- <th><label for="cff_title_weight" class="bump-left">Text Weight</label></th>
569
- <td>
570
- <select name="cff_title_weight">
571
- <option value="inherit" <?php if($cff_title_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
572
- <option value="normal" <?php if($cff_title_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
573
- <option value="bold" <?php if($cff_title_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
574
- </select>
575
- </td>
576
- </tr>
577
- <tr>
578
- <th><label for="cff_title_color" class="bump-left">Text Color</label></th>
579
- <td>
580
- #<input name="cff_title_color" type="text" value="<?php esc_attr_e( $cff_title_color ); ?>" size="10" placeholder="Eg. ED9A00" />
581
- <span><a href="http://www.colorpicker.com/" target="_blank">Color Picker</a></span>
582
- </td>
583
- </tr>
584
- <tr>
585
- <th><label for="cff_title_link" class="bump-left">Link text to Facebook post?</label></th>
586
- <td><input type="checkbox" name="cff_title_link" id="cff_title_link" <?php if($cff_title_link == true) echo 'checked="checked"' ?> />&nbsp;Yes</td>
587
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
588
 
589
- <tr><td><b style="font-size: 14px;"><?php _e('Photo/Video Description'); ?></b></td></tr>
590
-
591
- <tr>
592
- <th><label for="cff_body_size" class="bump-left">Text Size</label></th>
593
- <td>
594
- <select name="cff_body_size">
595
- <option value="inherit" <?php if($cff_body_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
596
- <option value="10" <?php if($cff_body_size == "10") echo 'selected="selected"' ?> >10px</option>
597
- <option value="11" <?php if($cff_body_size == "11") echo 'selected="selected"' ?> >11px</option>
598
- <option value="12" <?php if($cff_body_size == "12") echo 'selected="selected"' ?> >12px</option>
599
- <option value="14" <?php if($cff_body_size == "14") echo 'selected="selected"' ?> >14px</option>
600
- <option value="16" <?php if($cff_body_size == "16") echo 'selected="selected"' ?> >16px</option>
601
- <option value="18" <?php if($cff_body_size == "18") echo 'selected="selected"' ?> >18px</option>
602
- <option value="20" <?php if($cff_body_size == "20") echo 'selected="selected"' ?> >20px</option>
603
- <option value="24" <?php if($cff_body_size == "24") echo 'selected="selected"' ?> >24px</option>
604
- <option value="28" <?php if($cff_body_size == "28") echo 'selected="selected"' ?> >28px</option>
605
- <option value="32" <?php if($cff_body_size == "32") echo 'selected="selected"' ?> >32px</option>
606
- <option value="36" <?php if($cff_body_size == "36") echo 'selected="selected"' ?> >36px</option>
607
- <option value="42" <?php if($cff_body_size == "42") echo 'selected="selected"' ?> >42px</option>
608
- <option value="48" <?php if($cff_body_size == "48") echo 'selected="selected"' ?> >48px</option>
609
- <option value="60" <?php if($cff_body_size == "54") echo 'selected="selected"' ?> >54px</option>
610
- <option value="60" <?php if($cff_body_size == "60") echo 'selected="selected"' ?> >60px</option>
611
- </select>
612
- </td>
613
- </tr>
614
- <tr>
615
- <th><label for="cff_body_weight" class="bump-left">Text Weight</label></th>
616
- <td>
617
- <select name="cff_body_weight">
618
- <option value="inherit" <?php if($cff_body_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
619
- <option value="normal" <?php if($cff_body_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
620
- <option value="bold" <?php if($cff_body_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
621
- </select>
622
- </td>
623
- </tr>
624
- <tr>
625
- <th><label for="cff_body_color" class="bump-left">Text Color</label></th>
626
-
627
- <td>
628
- #<input name="cff_body_color" type="text" value="<?php esc_attr_e( $cff_body_color ); ?>" size="10" placeholder="Eg. ED9A00" />
629
- <a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
630
- </td>
631
- </tr>
632
- <tr><td><b style="font-size: 14px;"><?php _e('Event Title'); ?></b></td></tr>
633
-
634
- <tr>
635
- <th><label for="cff_event_title_format" class="bump-left">Format</label></th>
636
- <td>
637
- <select name="cff_event_title_format">
638
- <option value="p" <?php if($cff_event_title_format == "p") echo 'selected="selected"' ?> >Paragraph</option>
639
- <option value="h3" <?php if($cff_event_title_format == "h3") echo 'selected="selected"' ?> >Heading 3</option>
640
- <option value="h4" <?php if($cff_event_title_format == "h4") echo 'selected="selected"' ?> >Heading 4</option>
641
- <option value="h5" <?php if($cff_event_title_format == "h5") echo 'selected="selected"' ?> >Heading 5</option>
642
- <option value="h6" <?php if($cff_event_title_format == "h6") echo 'selected="selected"' ?> >Heading 6</option>
643
- </select>
644
- </td>
645
- </tr>
646
-
647
- <tr>
648
- <th><label for="cff_event_title_size" class="bump-left">Text Size</label></th>
649
- <td>
650
- <select name="cff_event_title_size">
651
- <option value="inherit" <?php if($cff_event_title_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
652
- <option value="10" <?php if($cff_event_title_size == "10") echo 'selected="selected"' ?> >10px</option>
653
- <option value="11" <?php if($cff_event_title_size == "11") echo 'selected="selected"' ?> >11px</option>
654
- <option value="12" <?php if($cff_event_title_size == "12") echo 'selected="selected"' ?> >12px</option>
655
- <option value="14" <?php if($cff_event_title_size == "14") echo 'selected="selected"' ?> >14px</option>
656
- <option value="16" <?php if($cff_event_title_size == "16") echo 'selected="selected"' ?> >16px</option>
657
- <option value="18" <?php if($cff_event_title_size == "18") echo 'selected="selected"' ?> >18px</option>
658
- <option value="20" <?php if($cff_event_title_size == "20") echo 'selected="selected"' ?> >20px</option>
659
- <option value="24" <?php if($cff_event_title_size == "24") echo 'selected="selected"' ?> >24px</option>
660
- <option value="28" <?php if($cff_event_title_size == "28") echo 'selected="selected"' ?> >28px</option>
661
- <option value="32" <?php if($cff_event_title_size == "32") echo 'selected="selected"' ?> >32px</option>
662
- <option value="36" <?php if($cff_event_title_size == "36") echo 'selected="selected"' ?> >36px</option>
663
- <option value="42" <?php if($cff_event_title_size == "42") echo 'selected="selected"' ?> >42px</option>
664
- <option value="48" <?php if($cff_event_title_size == "48") echo 'selected="selected"' ?> >48px</option>
665
- <option value="60" <?php if($cff_event_title_size == "54") echo 'selected="selected"' ?> >54px</option>
666
- <option value="60" <?php if($cff_event_title_size == "60") echo 'selected="selected"' ?> >60px</option>
667
- </select>
668
- </td>
669
- </tr>
670
- <tr>
671
- <th><label for="cff_event_title_weight" class="bump-left">Text Weight</label></th>
672
- <td>
673
- <select name="cff_event_title_weight">
674
- <option value="inherit" <?php if($cff_event_title_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
675
- <option value="normal" <?php if($cff_event_title_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
676
- <option value="bold" <?php if($cff_event_title_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
677
- </select>
678
- </td>
679
- </tr>
680
- <tr>
681
- <th><label for="cff_event_title_color" class="bump-left">Text Color</label></th>
682
- <td>
683
- <input name="cff_event_title_color" type="text" value="<?php esc_attr_e( $cff_event_title_color ); ?>" size="10" placeholder="Eg. ED9A00" />
684
- <a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
685
- </td>
686
- </tr>
687
- <tr>
688
- <th><label for="cff_title_link" class="bump-left">Link title to Facebook event page?</label></th>
689
- <td><input type="checkbox" name="cff_event_title_link" id="cff_event_title_link" <?php if($cff_event_title_link == true) echo 'checked="checked"' ?> />&nbsp;Yes</td>
690
- </tr>
691
- <tr><td><b style="font-size: 14px;"><?php _e('Event Details'); ?></b></td></tr>
692
-
693
- <tr>
694
- <th><label for="cff_event_details_size" class="bump-left">Text Size</label></th>
695
- <td>
696
- <select name="cff_event_details_size">
697
- <option value="inherit" <?php if($cff_event_details_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
698
- <option value="10" <?php if($cff_event_details_size == "10") echo 'selected="selected"' ?> >10px</option>
699
- <option value="11" <?php if($cff_event_details_size == "11") echo 'selected="selected"' ?> >11px</option>
700
- <option value="12" <?php if($cff_event_details_size == "12") echo 'selected="selected"' ?> >12px</option>
701
- <option value="14" <?php if($cff_event_details_size == "14") echo 'selected="selected"' ?> >14px</option>
702
- <option value="16" <?php if($cff_event_details_size == "16") echo 'selected="selected"' ?> >16px</option>
703
- <option value="18" <?php if($cff_event_details_size == "18") echo 'selected="selected"' ?> >18px</option>
704
- <option value="20" <?php if($cff_event_details_size == "20") echo 'selected="selected"' ?> >20px</option>
705
- <option value="24" <?php if($cff_event_details_size == "24") echo 'selected="selected"' ?> >24px</option>
706
- <option value="28" <?php if($cff_event_details_size == "28") echo 'selected="selected"' ?> >28px</option>
707
- <option value="32" <?php if($cff_event_details_size == "32") echo 'selected="selected"' ?> >32px</option>
708
- <option value="36" <?php if($cff_event_details_size == "36") echo 'selected="selected"' ?> >36px</option>
709
- <option value="42" <?php if($cff_event_details_size == "42") echo 'selected="selected"' ?> >42px</option>
710
- <option value="48" <?php if($cff_event_details_size == "48") echo 'selected="selected"' ?> >48px</option>
711
- <option value="60" <?php if($cff_event_details_size == "54") echo 'selected="selected"' ?> >54px</option>
712
- <option value="60" <?php if($cff_event_details_size == "60") echo 'selected="selected"' ?> >60px</option>
713
- </select>
714
- </td>
715
- </tr>
716
- <tr>
717
- <th><label for="cff_event_details_weight" class="bump-left">Text Weight</label></th>
718
- <td>
719
- <select name="cff_event_details_weight">
720
- <option value="inherit" <?php if($cff_event_details_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
721
- <option value="normal" <?php if($cff_event_details_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
722
- <option value="bold" <?php if($cff_event_details_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
723
- </select>
724
- </td>
725
- </tr>
726
- <tr>
727
- <th><label for="cff_event_details_color" class="bump-left">Text Color</label></th>
728
- <td>
729
- #<input name="cff_event_details_color" type="text" value="<?php esc_attr_e( $cff_event_details_color ); ?>" size="10" placeholder="Eg. ED9A00" />
730
- <a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
731
- </td>
732
- </tr>
733
- <tr>
734
- <th><label for="cff_event_date_formatting" class="bump-left">Event date formatting</label></th>
735
- <td>
736
- <select name="cff_event_date_formatting">
737
- <?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
738
- <option value="1" <?php if($cff_event_date_formatting == "1") echo 'selected="selected"' ?> ><?php echo date('F j, Y, g:ia', $original); ?></option>
739
- <option value="2" <?php if($cff_event_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:ia', $original); ?></option>
740
- <option value="3" <?php if($cff_event_date_formatting == "3") echo 'selected="selected"' ?> ><?php echo date('g:ia - F jS', $original); ?></option>
741
- <option value="4" <?php if($cff_event_date_formatting == "4") echo 'selected="selected"' ?> ><?php echo date('g:ia, F jS', $original); ?></option>
742
- <option value="5" <?php if($cff_event_date_formatting == "5") echo 'selected="selected"' ?> ><?php echo date('l F jS - g:ia', $original); ?></option>
743
- <option value="6" <?php if($cff_event_date_formatting == "6") echo 'selected="selected"' ?> ><?php echo date('D M jS, Y, g:iA', $original); ?></option>
744
- <option value="7" <?php if($cff_event_date_formatting == "7") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y, g:iA', $original); ?></option>
745
- <option value="8" <?php if($cff_event_date_formatting == "8") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y - g:ia', $original); ?></option>
746
- <option value="9" <?php if($cff_event_date_formatting == "9") echo 'selected="selected"' ?> ><?php echo date("l M jS, 'y", $original); ?></option>
747
- <option value="10" <?php if($cff_event_date_formatting == "10") echo 'selected="selected"' ?> ><?php echo date('m.d.y - g:iA', $original); ?></option>
748
- <option value="11" <?php if($cff_event_date_formatting == "11") echo 'selected="selected"' ?> ><?php echo date('m/d/y, g:ia', $original); ?></option>
749
- <option value="12" <?php if($cff_event_date_formatting == "12") echo 'selected="selected"' ?> ><?php echo date('d.m.y - g:iA', $original); ?></option>
750
- <option value="13" <?php if($cff_event_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y, g:ia', $original); ?></option>
751
- </select>
752
- </td>
753
- </tr>
754
- <tr>
755
- <th><label for="cff_event_date_custom" class="bump-left">Custom event date format</label></th>
756
- <td>
757
- <input name="cff_event_date_custom" type="text" value="<?php esc_attr_e( $cff_event_date_custom ); ?>" size="10" placeholder="Eg. F j, Y - g:ia" />
758
- <i style="color: #666; font-size: 11px;">(<a href="http://smashballoon.com/custom-facebook-feed/docs/date/" target="_blank">Examples</a>)</i>
759
- </td>
760
- </tr>
761
-
762
- <tr><td><b style="font-size: 14px;"><?php _e('Date'); ?></b></td></tr>
763
- <tr>
764
- <th><label for="cff_date_position" class="bump-left">Position</label></th>
765
- <td>
766
- <select name="cff_date_position">
767
- <option value="below" <?php if($cff_date_position == "below") echo 'selected="selected"' ?> >Below Text</option>
768
- <option value="above" <?php if($cff_date_position == "above") echo 'selected="selected"' ?> >Above Text</option>
769
- </select>
770
- </td>
771
- </tr>
772
- <tr>
773
- <th><label for="cff_date_size" class="bump-left">Text Size</label></th>
774
- <td>
775
- <select name="cff_date_size">
776
- <option value="inherit" <?php if($cff_date_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
777
- <option value="10" <?php if($cff_date_size == "10") echo 'selected="selected"' ?> >10px</option>
778
- <option value="11" <?php if($cff_date_size == "11") echo 'selected="selected"' ?> >11px</option>
779
- <option value="12" <?php if($cff_date_size == "12") echo 'selected="selected"' ?> >12px</option>
780
- <option value="14" <?php if($cff_date_size == "14") echo 'selected="selected"' ?> >14px</option>
781
- <option value="16" <?php if($cff_date_size == "16") echo 'selected="selected"' ?> >16px</option>
782
- <option value="18" <?php if($cff_date_size == "18") echo 'selected="selected"' ?> >18px</option>
783
- <option value="20" <?php if($cff_date_size == "20") echo 'selected="selected"' ?> >20px</option>
784
- <option value="24" <?php if($cff_date_size == "24") echo 'selected="selected"' ?> >24px</option>
785
- <option value="28" <?php if($cff_date_size == "28") echo 'selected="selected"' ?> >28px</option>
786
- <option value="32" <?php if($cff_date_size == "32") echo 'selected="selected"' ?> >32px</option>
787
- <option value="36" <?php if($cff_date_size == "36") echo 'selected="selected"' ?> >36px</option>
788
- <option value="42" <?php if($cff_date_size == "42") echo 'selected="selected"' ?> >42px</option>
789
- <option value="48" <?php if($cff_date_size == "48") echo 'selected="selected"' ?> >48px</option>
790
- <option value="60" <?php if($cff_date_size == "54") echo 'selected="selected"' ?> >54px</option>
791
- <option value="60" <?php if($cff_date_size == "60") echo 'selected="selected"' ?> >60px</option>
792
- </select>
793
- </td>
794
- </tr>
795
- <tr>
796
- <th><label for="cff_date_weight" class="bump-left">Text Weight</label></th>
797
- <td>
798
- <select name="cff_date_weight">
799
- <option value="inherit" <?php if($cff_date_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
800
- <option value="normal" <?php if($cff_date_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
801
- <option value="bold" <?php if($cff_date_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
802
- </select>
803
- </td>
804
- </tr>
805
- <tr>
806
- <th><label for="cff_date_color" class="bump-left">Text Color</label></th>
807
- <td>
808
- #<input name="cff_date_color" type="text" value="<?php esc_attr_e( $cff_date_color ); ?>" size="10" placeholder="Eg. ED9A00" />
809
- <a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
810
- </td>
811
- </tr>
812
 
813
- <tr>
814
- <th><label for="cff_date_formatting" class="bump-left">Date formatting</label></th>
815
- <td>
816
- <select name="cff_date_formatting">
817
- <?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
818
- <option value="1" <?php if($cff_date_formatting == "1") echo 'selected="selected"' ?> >Posted 2 days ago</option>
819
- <option value="2" <?php if($cff_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:i a', $original); ?></option>
820
- <option value="3" <?php if($cff_date_formatting == "3") echo 'selected="selected"' ?> ><?php echo date('F jS', $original); ?></option>
821
- <option value="4" <?php if($cff_date_formatting == "4") echo 'selected="selected"' ?> ><?php echo date('D F jS', $original); ?></option>
822
- <option value="5" <?php if($cff_date_formatting == "5") echo 'selected="selected"' ?> ><?php echo date('l F jS', $original); ?></option>
823
- <option value="6" <?php if($cff_date_formatting == "6") echo 'selected="selected"' ?> ><?php echo date('D M jS, Y', $original); ?></option>
824
- <option value="7" <?php if($cff_date_formatting == "7") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y', $original); ?></option>
825
- <option value="8" <?php if($cff_date_formatting == "8") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y - g:i a', $original); ?></option>
826
- <option value="9" <?php if($cff_date_formatting == "9") echo 'selected="selected"' ?> ><?php echo date("l M jS, 'y", $original); ?></option>
827
- <option value="10" <?php if($cff_date_formatting == "10") echo 'selected="selected"' ?> ><?php echo date('m.d.y', $original); ?></option>
828
- <option value="11" <?php if($cff_date_formatting == "11") echo 'selected="selected"' ?> ><?php echo date('m/d/y', $original); ?></option>
829
- <option value="12" <?php if($cff_date_formatting == "12") echo 'selected="selected"' ?> ><?php echo date('d.m.y', $original); ?></option>
830
- <option value="13" <?php if($cff_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y', $original); ?></option>
831
- </select>
832
- </td>
833
- </tr>
834
- <tr>
835
- <th><label for="cff_date_custom" class="bump-left">Custom format</label></th>
836
- <td>
837
- <input name="cff_date_custom" type="text" value="<?php esc_attr_e( $cff_date_custom ); ?>" size="10" placeholder="Eg. F j, Y" />
838
- <i style="color: #666; font-size: 11px;">(<a href="http://smashballoon.com/custom-facebook-feed/docs/date/" target="_blank">Examples</a>)</i>
839
- </td>
840
- </tr>
841
- <tr>
842
- <th><label for="cff_date_before" class="bump-left">Text before date</label></th>
843
- <td><input name="cff_date_before" type="text" value="<?php esc_attr_e( $cff_date_before ); ?>" size="10" placeholder="Eg. Posted" /></td>
844
- </tr>
845
- <tr>
846
- <th><label for="cff_date_after" class="bump-left">Text after date</label></th>
847
- <td><input name="cff_date_after" type="text" value="<?php esc_attr_e( $cff_date_after ); ?>" size="10" placeholder="Eg. ago" /></td>
848
- </tr>
849
- <tr><td><b style="font-size: 14px;"><?php _e('Link to Facebook'); ?></b></td></tr>
850
-
851
- <tr>
852
- <th><label for="cff_link_size" class="bump-left">Text Size</label></th>
853
- <td>
854
- <select name="cff_link_size">
855
- <option value="inherit" <?php if($cff_link_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
856
- <option value="10" <?php if($cff_link_size == "10") echo 'selected="selected"' ?> >10px</option>
857
- <option value="11" <?php if($cff_link_size == "11") echo 'selected="selected"' ?> >11px</option>
858
- <option value="12" <?php if($cff_link_size == "12") echo 'selected="selected"' ?> >12px</option>
859
- <option value="14" <?php if($cff_link_size == "14") echo 'selected="selected"' ?> >14px</option>
860
- <option value="16" <?php if($cff_link_size == "16") echo 'selected="selected"' ?> >16px</option>
861
- <option value="18" <?php if($cff_link_size == "18") echo 'selected="selected"' ?> >18px</option>
862
- <option value="20" <?php if($cff_link_size == "20") echo 'selected="selected"' ?> >20px</option>
863
- <option value="24" <?php if($cff_link_size == "24") echo 'selected="selected"' ?> >24px</option>
864
- <option value="28" <?php if($cff_link_size == "28") echo 'selected="selected"' ?> >28px</option>
865
- <option value="32" <?php if($cff_link_size == "32") echo 'selected="selected"' ?> >32px</option>
866
- <option value="36" <?php if($cff_link_size == "36") echo 'selected="selected"' ?> >36px</option>
867
- <option value="42" <?php if($cff_link_size == "42") echo 'selected="selected"' ?> >42px</option>
868
- <option value="48" <?php if($cff_link_size == "48") echo 'selected="selected"' ?> >48px</option>
869
- <option value="60" <?php if($cff_link_size == "54") echo 'selected="selected"' ?> >54px</option>
870
- <option value="60" <?php if($cff_link_size == "60") echo 'selected="selected"' ?> >60px</option>
871
- </select>
872
- </td>
873
- </tr>
874
- <tr>
875
- <th><label for="cff_link_weight" class="bump-left">Text Weight</label></th>
876
- <td>
877
- <select name="cff_link_weight">
878
- <option value="inherit" <?php if($cff_link_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
879
- <option value="normal" <?php if($cff_link_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
880
- <option value="bold" <?php if($cff_link_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
881
- </select>
882
- </td>
883
- </tr>
884
- <tr>
885
- <th><label for="cff_link_color" class="bump-left">Text Color</label></th>
886
- <td>
887
- <input name="cff_link_color" type="text" value="<?php esc_attr_e( $cff_link_color ); ?>" size="10" placeholder="Eg. ED9A00" />
888
- <a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
889
- </td>
890
- </tr>
891
- <tr>
892
- <th><label for="cff_facebook_link_text" class="bump-left">Custom 'View on Facebook' text</label></th>
893
- <td>
894
- <input name="cff_facebook_link_text" type="text" value="<?php esc_attr_e( $cff_facebook_link_text ); ?>" size="20" />
895
- <i style="color: #666; font-size: 11px; margin-left: 5px;">Use different text in place of the default 'View on Facebook' link</i>
896
- </td>
897
- </tr>
898
- <tr>
899
- <th><label for="cff_view_link_text" class="bump-left">Custom 'View Link' text</label></th>
900
- <td>
901
- <input name="cff_view_link_text" type="text" value="<?php esc_attr_e( $cff_view_link_text ); ?>" size="20" />
902
- <i style="color: #666; font-size: 11px; margin-left: 5px;">Use different text in place of the default 'View on Facebook' link</i>
903
- </td>
904
- </tr>
905
-
906
- </tbody>
907
- </table>
908
- <br />
909
- <?php submit_button(); ?>
910
- <hr />
911
- <h3><?php _e('Likes, Shares and Comments'); ?></h3>
912
- <p style="color: #666; font-size: 11px; font-style: italic; margin-left: 5px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Upgrade to Pro</a></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
913
 
 
 
 
914
  <br />
 
 
915
  <hr />
916
  <h3><?php _e('Custom CSS'); ?></h3>
917
  <table class="form-table">
918
  <tbody>
919
  <tr valign="top">
920
  <td>
921
- Enter your own custom CSS in the box below
922
  </td>
923
  </tr>
924
  <tr valign="top">
@@ -928,72 +1339,80 @@ function cff_style_page() {
928
  </tr>
929
  </tbody>
930
  </table>
931
- <br />
932
  <hr />
933
  <h3><?php _e('Misc'); ?></h3>
934
  <table class="form-table">
935
  <tbody>
936
- <tr><td><b style="font-size: 14px;"><?php _e('Text Character Limits'); ?></b></td></tr>
937
- <tr valign="top">
938
- <th scope="row"><?php _e('Maximum Post Text Length'); ?></th>
939
- <td>
940
- <input name="cff_title_length" type="text" value="<?php esc_attr_e( $cff_title_length_val ); ?>" size="4" /> <span>Characters.</span> <span>Eg. 200</span> <i style="color: #666; font-size: 11px; margin-left: 5px;">(Leave empty to set no maximum length)</i>
941
- </td>
942
- </tr>
943
- <tr valign="top">
944
- <th scope="row"><?php _e('Maximum Video/Link/Event Description Length'); ?></th>
945
- <td>
946
- <input name="cff_body_length" type="text" value="<?php esc_attr_e( $cff_body_length_val ); ?>" size="4" /> <span>Characters.</span> <i style="color: #666; font-size: 11px; margin-left: 5px;">(Leave empty to set no maximum length)</i>
947
- </td>
948
- </tr>
949
  <tr><td><b style="font-size: 14px;"><?php _e('Like Box'); ?></b></td></tr>
950
  <tr valign="top">
951
- <th scope="row"><?php _e('Show the Like Box'); ?></th>
952
  <td>
953
  <input type="checkbox" name="cff_show_like_box" id="cff_show_like_box" <?php if($cff_show_like_box == true) echo 'checked="checked"' ?> />
954
  </td>
955
  </tr>
956
  <tr valign="top">
957
- <th scope="row"><?php _e('Like Box Position'); ?></th>
958
  <td>
959
  <select name="cff_like_box_position">
960
- <option value="bottom" <?php if($cff_like_box_position == "bottom") echo 'selected="selected"' ?> >Bottom</option>
961
- <option value="top" <?php if($cff_like_box_position == "top") echo 'selected="selected"' ?> >Top</option>
962
  </select>
963
  </td>
964
  </tr>
965
  <tr valign="top">
966
- <th scope="row"><?php _e('Like Box Background Color'); ?></th>
 
 
 
 
 
 
 
967
  <td>
968
  <label for="cff_likebox_bg_color">#</label>
969
  <input name="cff_likebox_bg_color" type="text" value="<?php esc_attr_e( $cff_likebox_bg_color ); ?>" size="10" />
970
- <span>Eg. ED9A00</span>&nbsp;&nbsp;<a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
971
  </td>
972
  </tr>
 
973
  <tr><td><b style="font-size: 14px;"><?php _e('Separating Line'); ?></b></td></tr>
974
  <tr valign="top">
975
- <th scope="row"><?php _e('Separating Line Color'); ?></th>
976
  <td>
977
  <label for="cff_sep_color">#</label>
978
  <input name="cff_sep_color" type="text" value="<?php esc_attr_e( $cff_sep_color ); ?>" size="10" />
979
- <span>Eg. ED9A00</span>&nbsp;&nbsp;<a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
980
  </td>
981
  </tr>
982
  <tr valign="top">
983
- <th scope="row"><?php _e('Separating Line Thickness'); ?></th>
984
  <td>
985
- <input name="cff_sep_size" type="text" value="<?php esc_attr_e( $cff_sep_size ); ?>" size="1" /><span>px</span> <i style="color: #666; font-size: 11px; margin-left: 5px;">(Leave empty to hide)</i>
986
  </td>
987
  </tr>
988
  </tbody>
989
  </table>
990
  <?php submit_button(); ?>
 
 
 
 
991
  </form>
992
- <hr />
993
- <br />
994
- <p>Please note that the free version of the plugin only displays text updates. For <b>photos, videos, comments and more</b> please upgrade to the <a href="http://smashballoon.com/custom-facebook-feed/" target="_blank">Pro version</a> of the plugin.</p>
995
- <br /><br />
996
- <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
997
  <?php
998
- } //End Style_Page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
999
  ?>
33
  //Create Settings page
34
  function cff_settings_page() {
35
  //Declare variables for fields
36
+ $hidden_field_name = 'cff_submit_hidden';
37
+ $access_token = 'cff_access_token';
38
+ $page_id = 'cff_page_id';
39
+ $num_show = 'cff_num_show';
40
+ $cff_post_limit = 'cff_post_limit';
41
+ $cff_show_others = 'cff_show_others';
42
+ $cff_cache_time = 'cff_cache_time';
43
+ $cff_cache_time_unit = 'cff_cache_time_unit';
44
  // Read in existing option value from database
45
  $access_token_val = get_option( $access_token );
46
  $page_id_val = get_option( $page_id );
47
+ $num_show_val = get_option( $num_show, '5' );
48
+ $cff_post_limit_val = get_option( $cff_post_limit );
49
  $cff_show_others_val = get_option( $cff_show_others );
50
+ $cff_cache_time_val = get_option( $cff_cache_time, '1' );
51
+ $cff_cache_time_unit_val = get_option( $cff_cache_time_unit, 'hours' );
52
  // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
53
  if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {
54
  // Read their posted value
55
  $access_token_val = $_POST[ $access_token ];
56
  $page_id_val = $_POST[ $page_id ];
57
  $num_show_val = $_POST[ $num_show ];
58
+ $cff_post_limit_val = $_POST[ $cff_post_limit ];
59
  $cff_show_others_val = $_POST[ $cff_show_others ];
60
+ $cff_cache_time_val = $_POST[ $cff_cache_time ];
61
+ $cff_cache_time_unit_val = $_POST[ $cff_cache_time_unit ];
62
  // Save the posted value in the database
63
  update_option( $access_token, $access_token_val );
64
  update_option( $page_id, $page_id_val );
65
  update_option( $num_show, $num_show_val );
66
+ update_option( $cff_post_limit, $cff_post_limit_val );
67
  update_option( $cff_show_others, $cff_show_others_val );
68
+ update_option( $cff_cache_time, $cff_cache_time_val );
69
+ update_option( $cff_cache_time_unit, $cff_cache_time_unit_val );
70
+
71
+ //Delete the transient for the main page ID
72
+ delete_transient( 'posts_json_' .$page_id_val );
73
+ delete_transient( 'events_json_' . $page_id_val );
74
+ //Delete ALL transients
75
+ global $wpdb;
76
+ $table_name = $wpdb->prefix . "options";
77
+ $wpdb->query( "
78
+ DELETE
79
+ FROM $table_name
80
+ WHERE `option_name` LIKE ('%cff\_posts\_json\_%')
81
+ " );
82
+ $wpdb->query( "
83
+ DELETE
84
+ FROM $table_name
85
+ WHERE `option_name` LIKE ('%cff\_events\_json\_%')
86
+ " );
87
  // Put an settings updated message on the screen
88
  ?>
89
  <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
90
  <?php } ?>
91
 
92
+ <div id="cff-admin" class="wrap">
93
+ <div id="header">
94
+ <h1><?php _e('Custom Facebook Feed Settings'); ?></h1>
95
+ </div>
96
  <form name="form1" method="post" action="">
97
  <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
98
+ <br />
99
  <h3><?php _e('Configuration'); ?></h3>
100
  <table class="form-table">
101
  <tbody>
103
  <th scope="row"><?php _e('Access Token'); ?></th>
104
  <td>
105
  <input name="cff_access_token" type="text" value="<?php esc_attr_e( $access_token_val ); ?>" size="60" />
106
+ <!--<a href="#" id="verify-token" class="button-secondary"><?php _e('Verify Access Token'); ?></a>-->
107
+ &nbsp;<a class="tooltip-link" href="JavaScript:void(0);"><?php _e('How to get an Access Token'); ?></a>
108
+ <br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123|ABC2fvp5h9tJe4-5-AbC123</i>
109
+ <p class="tooltip"><?php _e("In order to use the plugin, Facebook requires you to obtain an access token to access their data. Don't worry though, this is really easy to do. Just follow the step-by-step instructions at the following link: <a href='http://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>How to get a Facebook Access Token</a>"); ?>.</p>
110
  </td>
111
  </tr>
112
  <tr valign="top">
113
+ <th scope="row"><?php _e('Facebook Page ID'); ?></th>
114
  <td>
115
  <input name="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
116
+ &nbsp;<a class="tooltip-link" href="JavaScript:void(0);"><?php _e('What\'s my Page ID?'); ?></a>
117
+ <br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123 or smashballoon</i>
118
+ <p class="tooltip"><?php _e('If you have a Facebook page with a URL like this:'); ?> <code>https://www.facebook.com/your_page_name</code> <?php _e('then the Page ID is just'); ?> <b>your_page_name</b>. <?php _e('If your page URL is structured like this:'); ?> <code>https://www.facebook.com/pages/your_page_name/123654123654123</code> <?php _e('then the Page ID is actually the number at the end, so in this case'); ?> <b>123654123654123</b>.</p>
119
  </td>
120
  </tr>
121
  <tr valign="top">
122
  <th scope="row"><?php _e('Number of posts to display'); ?></th>
123
  <td>
124
  <input name="cff_num_show" type="text" value="<?php esc_attr_e( $num_show_val ); ?>" size="4" />
125
+ <i style="color: #666; font-size: 11px;">Eg. 5</i>
126
+ </td>
127
+ </tr>
128
+ <tr valign="top">
129
+ <th scope="row"><?php _e('Alter the post limit'); ?></th>
130
+ <td>
131
+ <input name="cff_post_limit" type="text" value="<?php esc_attr_e( $cff_post_limit_val ); ?>" size="4" />
132
+ <i style="color: #666; font-size: 11px;">Eg. 50</i> <a class="tooltip-link bump-left" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
133
+ <p class="tooltip"><?php _e('By default the Facebook API only returns your latest 25 posts. If you would like to retrieve more than 25 posts then you can increase the limit by specifying a higher value here. However, the more posts you request the slower the page load time may be when the plugin needs to check Facebook for new posts. Similarly, if you only intend to retrieve a few posts then you may wish to set a lower post limit here so that you aren\'t retrieving more posts than necessary.'); ?></p>
134
  </td>
135
  </tr>
136
  <tr valign="top">
137
  <th scope="row"><?php _e('Show posts by others on my page'); ?></th>
138
  <td>
139
  <input name="cff_show_others" type="checkbox" id="cff_show_others" <?php if($cff_show_others_val == true) echo "checked"; ?> />
140
+ <i style="color: #666; font-size: 11px;"><?php _e('By default only posts by the page owner will be shown. Check this box to also show posts by others.'); ?></i>
141
+ </td>
142
+ </tr>
143
+ <tr valign="top">
144
+ <th scope="row"><?php _e('Check for new Facebook posts every'); ?></th>
145
+ <td>
146
+ <input name="cff_cache_time" type="text" value="<?php esc_attr_e( $cff_cache_time_val ); ?>" size="4" />
147
+ <select name="cff_cache_time_unit">
148
+ <option value="minutes" <?php if($cff_cache_time_unit_val == "minutes") echo 'selected="selected"' ?> ><?php _e('Minutes'); ?></option>
149
+ <option value="hours" <?php if($cff_cache_time_unit_val == "hours") echo 'selected="selected"' ?> ><?php _e('Hours'); ?></option>
150
+ <option value="days" <?php if($cff_cache_time_unit_val == "days") echo 'selected="selected"' ?> ><?php _e('Days'); ?></option>
151
+ </select>
152
+ <a class="tooltip-link bump-left" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
153
+ <p class="tooltip"><?php _e('Your Facebook posts and comments data is temporarily cached by the plugin in your WordPress database. You can choose how long this data should be cached for. If you set the time to 60 minutes then the plugin will clear the cached data after that length of time, and the next time the page is viewed it will check for new data.'); ?></p>
154
  </td>
155
  </tr>
156
+
157
  </tbody>
158
  </table>
159
  <?php submit_button(); ?>
160
  </form>
161
+ <h3><?php _e('Support'); ?></h3>
162
+ <p>Having trouble getting the plugin to work? Try visiting the <a href="http://smashballoon.com/custom-facebook-feed/troubleshooting/" target="_blank" />Troubleshooting</a> page, <a href="http://smashballoon.com/custom-facebook-feed/faq/" target="_blank" />FAQ</a> page, or contact <a href="http://smashballoon.com/custom-facebook-feed/support" target="_blank">support</a>.<br />Smash Balloon is committed to making this plugin better. Please let us know if you have had any issues when using this plugin so that we can continue to improve it!</p>
163
  <hr />
164
+ <h3><?php _e('Displaying your Feed'); ?></h3>
165
+ <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>
166
+ <input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="edd-sysinfo" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).'); ?>" />
167
+ <p><?php _e('If you wish, you can override the settings above directly in the shortcode like so:'); ?></p>
168
+ <p>[custom-facebook-feed <b><span style='color: purple;'>id=Put_Your_Facebook_Page_ID_Here</span> <span style='color: green;'>num=3</span> <span style='color: blue;'>layout=thumb</span></b>]</p>
169
+ <p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php _e('Click here'); ?></a> <?php _e('for a full list of shortcode options'); ?></p>
170
 
 
171
 
 
 
 
 
172
  <hr />
173
+
 
 
174
  <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
175
 
176
+ <hr />
177
+
178
+ <h4><?php _e('<u>System Info:</u>'); ?></h4>
179
+ <p>PHP Version: <b><?php echo PHP_VERSION . "\n"; ?></b></p>
180
+ <p>Web Server Info: <b><?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?></b></p>
181
+ <p>PHP allow_url_fopen: <b><?php echo ini_get( 'allow_url_fopen' ) ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>"; ?></b></p>
182
+ <p>PHP cURL: <b><?php echo is_callable('curl_init') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
183
+ <p>JSON: <b><?php echo function_exists("json_decode") ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
184
+ <i style="color: #666; font-size: 11px;"><?php _e('(If any of the items above are listed as'); ?> <span style='color: red;'>No</span> <?php _e('then please include this in your support request)'); ?></i>
185
+
186
+
187
  <?php
188
  } //End Settings_Page
189
  //Create Style page
190
  function cff_style_page() {
191
  //Declare variables for fields
192
+ $style_hidden_field_name = 'cff_style_submit_hidden';
193
+ $style_general_hidden_field_name = 'cff_style_general_submit_hidden';
194
+ $style_post_layout_hidden_field_name = 'cff_style_post_layout_submit_hidden';
195
+ $style_typography_hidden_field_name = 'cff_style_typography_submit_hidden';
196
+ $style_misc_hidden_field_name = 'cff_style_misc_submit_hidden';
197
  $defaults = array(
198
+ //Post types
199
+ 'cff_show_links_type' => true,
200
+ 'cff_show_event_type' => true,
201
+ 'cff_show_video_type' => true,
202
+ 'cff_show_photos_type' => true,
203
+ 'cff_show_status_type' => true,
204
+ //Layout
205
+ 'cff_preset_layout' => 'thumb',
206
  //Include
207
  'cff_show_text' => true,
208
  'cff_show_desc' => true,
209
+ 'cff_show_shared_links' => true,
210
  'cff_show_date' => true,
211
+ 'cff_show_media' => true,
212
  'cff_show_event_title' => true,
213
  'cff_show_event_details' => true,
214
+ 'cff_show_meta' => true,
215
  'cff_show_link' => true,
216
  'cff_show_like_box' => true,
217
  //Typography
218
+ 'cff_see_more_text' => 'See More',
219
+ 'cff_see_less_text' => 'See Less',
220
  'cff_title_format' => 'p',
221
  'cff_title_size' => 'inherit',
222
  'cff_title_weight' => 'inherit',
224
  'cff_body_size' => 'inherit',
225
  'cff_body_weight' => 'inherit',
226
  'cff_body_color' => '',
227
+ //Event title
228
  'cff_event_title_format' => 'p',
229
  'cff_event_title_size' => 'inherit',
230
  'cff_event_title_weight' => 'inherit',
231
  'cff_event_title_color' => '',
232
+ //Event date
233
+ 'cff_event_date_size' => 'inherit',
234
+ 'cff_event_date_weight' => 'inherit',
235
+ 'cff_event_date_color' => '',
236
+ 'cff_event_date_position' => 'below',
237
+ 'cff_event_date_formatting' => '1',
238
+ 'cff_event_date_custom' => '',
239
+ //Event details
240
  'cff_event_details_size' => 'inherit',
241
  'cff_event_details_weight' => 'inherit',
242
  'cff_event_details_color' => '',
 
 
243
  //Date
244
  'cff_date_position' => 'below',
245
  'cff_date_size' => 'inherit',
255
  'cff_link_color' => '',
256
  'cff_facebook_link_text' => 'View on Facebook',
257
  'cff_view_link_text' => 'View Link',
258
+ //Meta
259
+ 'cff_icon_style' => 'light',
260
+ 'cff_meta_text_color' => '',
261
+ 'cff_meta_bg_color' => '',
262
+ 'cff_nocomments_text' => 'No comments yet',
263
+ 'cff_hide_comments' => '',
264
  //Misc
265
  'cff_feed_width' => '',
266
  'cff_feed_height' => '',
267
+ 'cff_feed_padding' => '',
268
  'cff_like_box_position' => 'bottom',
269
+ 'cff_like_box_outside' => false,
270
  'cff_bg_color' => '',
271
  'cff_likebox_bg_color' => '',
272
+ 'cff_video_height' => '',
273
  'cff_show_author' => false,
274
+ 'cff_class' => '',
275
  //New
276
  'cff_custom_css' => '',
277
  'cff_title_link' => false,
278
  'cff_event_title_link' => false,
279
+ 'cff_video_action' => 'file',
280
  'cff_sep_color' => '',
281
  'cff_sep_size' => '1'
282
  );
283
+ //Save layout option in an array
284
  add_option( 'cff_style_settings', $options );
285
  $options = wp_parse_args(get_option('cff_style_settings'), $defaults);
286
  //Set the page variables
287
+ //Post types
288
+ $cff_show_links_type = $options[ 'cff_show_links_type' ];
289
+ $cff_show_event_type = $options[ 'cff_show_event_type' ];
290
+ $cff_show_video_type = $options[ 'cff_show_video_type' ];
291
+ $cff_show_photos_type = $options[ 'cff_show_photos_type' ];
292
+ $cff_show_status_type = $options[ 'cff_show_status_type' ];
293
+ //Layout
294
+ $cff_preset_layout = $options[ 'cff_preset_layout' ];
295
  //Include
296
  $cff_show_text = $options[ 'cff_show_text' ];
297
  $cff_show_desc = $options[ 'cff_show_desc' ];
298
+ $cff_show_shared_links = $options[ 'cff_show_shared_links' ];
299
  $cff_show_date = $options[ 'cff_show_date' ];
300
+ $cff_show_media = $options[ 'cff_show_media' ];
301
  $cff_show_event_title = $options[ 'cff_show_event_title' ];
302
  $cff_show_event_details = $options[ 'cff_show_event_details' ];
303
+ $cff_show_meta = $options[ 'cff_show_meta' ];
304
  $cff_show_link = $options[ 'cff_show_link' ];
305
  $cff_show_like_box = $options[ 'cff_show_like_box' ];
306
  //Typography
307
+ $cff_see_more_text = $options[ 'cff_see_more_text' ];
308
+ $cff_see_less_text = $options[ 'cff_see_less_text' ];
309
  $cff_title_format = $options[ 'cff_title_format' ];
310
  $cff_title_size = $options[ 'cff_title_size' ];
311
  $cff_title_weight = $options[ 'cff_title_weight' ];
313
  $cff_body_size = $options[ 'cff_body_size' ];
314
  $cff_body_weight = $options[ 'cff_body_weight' ];
315
  $cff_body_color = $options[ 'cff_body_color' ];
316
+ //Event title
317
  $cff_event_title_format = $options[ 'cff_event_title_format' ];
318
  $cff_event_title_size = $options[ 'cff_event_title_size' ];
319
  $cff_event_title_weight = $options[ 'cff_event_title_weight' ];
320
  $cff_event_title_color = $options[ 'cff_event_title_color' ];
321
+ //Event date
322
+ $cff_event_date_size = $options[ 'cff_event_date_size' ];
323
+ $cff_event_date_weight = $options[ 'cff_event_date_weight' ];
324
+ $cff_event_date_color = $options[ 'cff_event_date_color' ];
325
+ $cff_event_date_position = $options[ 'cff_event_date_position' ];
326
+ $cff_event_date_formatting = $options[ 'cff_event_date_formatting' ];
327
+ $cff_event_date_custom = $options[ 'cff_event_date_custom' ];
328
+ //Event details
329
  $cff_event_details_size = $options[ 'cff_event_details_size' ];
330
  $cff_event_details_weight = $options[ 'cff_event_details_weight' ];
331
  $cff_event_details_color = $options[ 'cff_event_details_color' ];
 
 
 
332
  //Date
333
  $cff_date_position = $options[ 'cff_date_position' ];
334
  $cff_date_size = $options[ 'cff_date_size' ];
344
  $cff_link_color = $options[ 'cff_link_color' ];
345
  $cff_facebook_link_text = $options[ 'cff_facebook_link_text' ];
346
  $cff_view_link_text = $options[ 'cff_view_link_text' ];
347
+ //Meta
348
+ $cff_icon_style = $options[ 'cff_icon_style' ];
349
+ $cff_meta_text_color = $options[ 'cff_meta_text_color' ];
350
+ $cff_meta_bg_color = $options[ 'cff_meta_bg_color' ];
351
+ $cff_nocomments_text = $options[ 'cff_nocomments_text' ];
352
+ $cff_hide_comments = $options[ 'cff_hide_comments' ];
353
  //Misc
354
  $cff_feed_width = $options[ 'cff_feed_width' ];
355
  $cff_feed_height = $options[ 'cff_feed_height' ];
356
  $cff_feed_padding = $options[ 'cff_feed_padding' ];
357
  $cff_like_box_position = $options[ 'cff_like_box_position' ];
358
+ $cff_like_box_outside = $options[ 'cff_like_box_outside' ];
359
+ $cff_show_media = $options[ 'cff_show_media' ];
360
  $cff_open_links = $options[ 'cff_open_links' ];
361
  $cff_bg_color = $options[ 'cff_bg_color' ];
362
  $cff_likebox_bg_color = $options[ 'cff_likebox_bg_color' ];
363
+ $cff_video_height = $options[ 'cff_video_height' ];
364
  $cff_show_author = $options[ 'cff_show_author' ];
365
+ $cff_class = $options[ 'cff_class' ];
366
  //New
367
  $cff_custom_css = $options[ 'cff_custom_css' ];
368
  $cff_title_link = $options[ 'cff_title_link' ];
369
  $cff_event_title_link = $options[ 'cff_event_title_link' ];
370
+ $cff_video_action = $options[ 'cff_video_action' ];
371
  $cff_sep_color = $options[ 'cff_sep_color' ];
372
  $cff_sep_size = $options[ 'cff_sep_size' ];
373
+
374
+ // Texts lengths
375
+ $cff_title_length = 'cff_title_length';
376
  $cff_body_length = 'cff_body_length';
377
  // Read in existing option value from database
378
  $cff_title_length_val = get_option( $cff_title_length );
379
  $cff_body_length_val = get_option( $cff_body_length );
380
  // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
381
  if( isset($_POST[ $style_hidden_field_name ]) && $_POST[ $style_hidden_field_name ] == 'Y' ) {
382
+ //Update the General options
383
+ if( isset($_POST[ $style_general_hidden_field_name ]) && $_POST[ $style_general_hidden_field_name ] == 'Y' ) {
384
+ //General
385
+ $cff_feed_width = $_POST[ 'cff_feed_width' ];
386
+ $cff_feed_height = $_POST[ 'cff_feed_height' ];
387
+ $cff_feed_padding = $_POST[ 'cff_feed_padding' ];
388
+ $cff_bg_color = $_POST[ 'cff_bg_color' ];
389
+ $cff_show_author = $_POST[ 'cff_show_author' ];
390
+ $cff_class = $_POST[ 'cff_class' ];
391
+ //Post types
392
+ $cff_show_links_type = $_POST[ 'cff_show_links_type' ];
393
+ $cff_show_event_type = $_POST[ 'cff_show_event_type' ];
394
+ $cff_show_video_type = $_POST[ 'cff_show_video_type' ];
395
+ $cff_show_photos_type = $_POST[ 'cff_show_photos_type' ];
396
+ $cff_show_status_type = $_POST[ 'cff_show_status_type' ];
397
+ //General
398
+ $options[ 'cff_feed_width' ] = $cff_feed_width;
399
+ $options[ 'cff_feed_height' ] = $cff_feed_height;
400
+ $options[ 'cff_feed_padding' ] = $cff_feed_padding;
401
+ $options[ 'cff_bg_color' ] = $cff_bg_color;
402
+ $options[ 'cff_show_author' ] = $cff_show_author;
403
+ $options[ 'cff_class' ] = $cff_class;
404
+ //Post types
405
+ $options[ 'cff_show_links_type' ] = $cff_show_links_type;
406
+ $options[ 'cff_show_event_type' ] = $cff_show_event_type;
407
+ $options[ 'cff_show_video_type' ] = $cff_show_video_type;
408
+ $options[ 'cff_show_photos_type' ] = $cff_show_photos_type;
409
+ $options[ 'cff_show_status_type' ] = $cff_show_status_type;
410
+ }
411
+ //Update the Post Layout options
412
+ if( isset($_POST[ $style_post_layout_hidden_field_name ]) && $_POST[ $style_post_layout_hidden_field_name ] == 'Y' ) {
413
+ //Layout
414
+ $cff_preset_layout = $_POST[ 'cff_preset_layout' ];
415
+ //Include
416
+ $cff_show_text = $_POST[ 'cff_show_text' ];
417
+ $cff_show_desc = $_POST[ 'cff_show_desc' ];
418
+ $cff_show_shared_links = $_POST[ 'cff_show_shared_links' ];
419
+ $cff_show_date = $_POST[ 'cff_show_date' ];
420
+ $cff_show_media = $_POST[ 'cff_show_media' ];
421
+ $cff_show_event_title = $_POST[ 'cff_show_event_title' ];
422
+ $cff_show_event_details = $_POST[ 'cff_show_event_details' ];
423
+ $cff_show_meta = $_POST[ 'cff_show_meta' ];
424
+ $cff_show_link = $_POST[ 'cff_show_link' ];
425
+ //Layout
426
+ $options[ 'cff_preset_layout' ] = $cff_preset_layout;
427
+ //Include
428
+ $options[ 'cff_show_text' ] = $cff_show_text;
429
+ $options[ 'cff_show_desc' ] = $cff_show_desc;
430
+ $options[ 'cff_show_shared_links' ] = $cff_show_shared_links;
431
+ $options[ 'cff_show_date' ] = $cff_show_date;
432
+ $options[ 'cff_show_media' ] = $cff_show_media;
433
+ $options[ 'cff_show_event_title' ] = $cff_show_event_title;
434
+ $options[ 'cff_show_event_details' ] = $cff_show_event_details;
435
+ $options[ 'cff_show_meta' ] = $cff_show_meta;
436
+ $options[ 'cff_show_link' ] = $cff_show_link;
437
+ }
438
+ //Update the Post Layout options
439
+ if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
440
+ //Character limits
441
+ $cff_title_length_val = $_POST[ $cff_title_length ];
442
+ $cff_body_length_val = $_POST[ $cff_body_length ];
443
+ $cff_see_more_text = $_POST[ 'cff_see_more_text' ];
444
+ $cff_see_less_text = $_POST[ 'cff_see_less_text' ];
445
+ //Typography
446
+ $cff_title_format = $_POST[ 'cff_title_format' ];
447
+ $cff_title_size = $_POST[ 'cff_title_size' ];
448
+ $cff_title_weight = $_POST[ 'cff_title_weight' ];
449
+ $cff_title_color = $_POST[ 'cff_title_color' ];
450
+ $cff_title_link = $_POST[ 'cff_title_link' ];
451
+ $cff_body_size = $_POST[ 'cff_body_size' ];
452
+ $cff_body_weight = $_POST[ 'cff_body_weight' ];
453
+ $cff_body_color = $_POST[ 'cff_body_color' ];
454
+ //Event title
455
+ $cff_event_title_format = $_POST[ 'cff_event_title_format' ];
456
+ $cff_event_title_size = $_POST[ 'cff_event_title_size' ];
457
+ $cff_event_title_weight = $_POST[ 'cff_event_title_weight' ];
458
+ $cff_event_title_color = $_POST[ 'cff_event_title_color' ];
459
+ $cff_event_title_link = $_POST[ 'cff_event_title_link' ];
460
+ //Event date
461
+ $cff_event_date_size = $_POST[ 'cff_event_date_size' ];
462
+ $cff_event_date_weight = $_POST[ 'cff_event_date_weight' ];
463
+ $cff_event_date_color = $_POST[ 'cff_event_date_color' ];
464
+ $cff_event_date_position = $_POST[ 'cff_event_date_position' ];
465
+ $cff_event_date_formatting = $_POST[ 'cff_event_date_formatting' ];
466
+ $cff_event_date_custom = $_POST[ 'cff_event_date_custom' ];
467
+ //Event details
468
+ $cff_event_details_size = $_POST[ 'cff_event_details_size' ];
469
+ $cff_event_details_weight = $_POST[ 'cff_event_details_weight' ];
470
+ $cff_event_details_color = $_POST[ 'cff_event_details_color' ];
471
+ //Date
472
+ $cff_date_position = $_POST[ 'cff_date_position' ];
473
+ $cff_date_size = $_POST[ 'cff_date_size' ];
474
+ $cff_date_weight = $_POST[ 'cff_date_weight' ];
475
+ $cff_date_color = $_POST[ 'cff_date_color' ];
476
+ $cff_date_formatting = $_POST[ 'cff_date_formatting' ];
477
+ $cff_date_custom = $_POST[ 'cff_date_custom' ];
478
+ $cff_date_before = $_POST[ 'cff_date_before' ];
479
+ $cff_date_after = $_POST[ 'cff_date_after' ];
480
+ //View on Facebook link
481
+ $cff_link_size = $_POST[ 'cff_link_size' ];
482
+ $cff_link_weight = $_POST[ 'cff_link_weight' ];
483
+ $cff_link_color = $_POST[ 'cff_link_color' ];
484
+ $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
485
+ $cff_view_link_text = $_POST[ 'cff_view_link_text' ];
486
+ //Character limits
487
+ update_option( $cff_title_length, $cff_title_length_val );
488
+ update_option( $cff_body_length, $cff_body_length_val );
489
+ $options[ 'cff_see_more_text' ] = $cff_see_more_text;
490
+ $options[ 'cff_see_less_text' ] = $cff_see_less_text;
491
+ //Typography
492
+ $options[ 'cff_title_format' ] = $cff_title_format;
493
+ $options[ 'cff_title_size' ] = $cff_title_size;
494
+ $options[ 'cff_title_weight' ] = $cff_title_weight;
495
+ $options[ 'cff_title_color' ] = $cff_title_color;
496
+ $options[ 'cff_title_link' ] = $cff_title_link;
497
+ $options[ 'cff_body_size' ] = $cff_body_size;
498
+ $options[ 'cff_body_weight' ] = $cff_body_weight;
499
+ $options[ 'cff_body_color' ] = $cff_body_color;
500
+ //Event title
501
+ $options[ 'cff_event_title_format' ] = $cff_event_title_format;
502
+ $options[ 'cff_event_title_size' ] = $cff_event_title_size;
503
+ $options[ 'cff_event_title_weight' ] = $cff_event_title_weight;
504
+ $options[ 'cff_event_title_color' ] = $cff_event_title_color;
505
+ $options[ 'cff_event_title_link' ] = $cff_event_title_link;
506
+ //Event date
507
+ $options[ 'cff_event_date_size' ] = $cff_event_date_size;
508
+ $options[ 'cff_event_date_weight' ] = $cff_event_date_weight;
509
+ $options[ 'cff_event_date_color' ] = $cff_event_date_color;
510
+ $options[ 'cff_event_date_position' ] = $cff_event_date_position;
511
+ $options[ 'cff_event_date_formatting' ] = $cff_event_date_formatting;
512
+ $options[ 'cff_event_date_custom' ] = $cff_event_date_custom;
513
+ //Event details
514
+ $options[ 'cff_event_details_size' ] = $cff_event_details_size;
515
+ $options[ 'cff_event_details_weight' ] = $cff_event_details_weight;
516
+ $options[ 'cff_event_details_color' ] = $cff_event_details_color;
517
+ //Date
518
+ $options[ 'cff_date_position' ] = $cff_date_position;
519
+ $options[ 'cff_date_size' ] = $cff_date_size;
520
+ $options[ 'cff_date_weight' ] = $cff_date_weight;
521
+ $options[ 'cff_date_color' ] = $cff_date_color;
522
+ $options[ 'cff_date_formatting' ] = $cff_date_formatting;
523
+ $options[ 'cff_date_custom' ] = $cff_date_custom;
524
+ $options[ 'cff_date_before' ] = $cff_date_before;
525
+ $options[ 'cff_date_after' ] = $cff_date_after;
526
+ //View on Facebook link
527
+ $options[ 'cff_link_size' ] = $cff_link_size;
528
+ $options[ 'cff_link_weight' ] = $cff_link_weight;
529
+ $options[ 'cff_link_color' ] = $cff_link_color;
530
+ $options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
531
+ $options[ 'cff_view_link_text' ] = $cff_view_link_text;
532
+ }
533
+ //Update the Post Layout options
534
+ if( isset($_POST[ $style_misc_hidden_field_name ]) && $_POST[ $style_misc_hidden_field_name ] == 'Y' ) {
535
+ //Meta
536
+ $cff_icon_style = $_POST[ 'cff_icon_style' ];
537
+ $cff_meta_text_color = $_POST[ 'cff_meta_text_color' ];
538
+ $cff_meta_bg_color = $_POST[ 'cff_meta_bg_color' ];
539
+ $cff_nocomments_text = $_POST[ 'cff_nocomments_text' ];
540
+ $cff_hide_comments = $_POST[ 'cff_hide_comments' ];
541
+ //Custom CSS
542
+ $cff_custom_css = $_POST[ 'cff_custom_css' ];
543
+ //Misc
544
+ $cff_show_like_box = $_POST[ 'cff_show_like_box' ];
545
+ $cff_like_box_position = $_POST[ 'cff_like_box_position' ];
546
+ $cff_like_box_outside = $_POST[ 'cff_like_box_outside' ];
547
+ $cff_likebox_bg_color = $_POST[ 'cff_likebox_bg_color' ];
548
+ $cff_video_height = $_POST[ 'cff_video_height' ];
549
+ $cff_video_action = $_POST[ 'cff_video_action' ];
550
+ $cff_sep_color = $_POST[ 'cff_sep_color' ];
551
+ $cff_sep_size = $_POST[ 'cff_sep_size' ];
552
+ $cff_open_links = $_POST[ 'cff_open_links' ];
553
+ //Meta
554
+ $options[ 'cff_icon_style' ] = $cff_icon_style;
555
+ $options[ 'cff_meta_text_color' ] = $cff_meta_text_color;
556
+ $options[ 'cff_meta_bg_color' ] = $cff_meta_bg_color;
557
+ $options[ 'cff_nocomments_text' ] = $cff_nocomments_text;
558
+ $options[ 'cff_hide_comments' ] = $cff_hide_comments;
559
+ //Custom CSS
560
+ $options[ 'cff_custom_css' ] = $cff_custom_css;
561
+ //Misc
562
+ $options[ 'cff_show_like_box' ] = $cff_show_like_box;
563
+ $options[ 'cff_like_box_position' ] = $cff_like_box_position;
564
+ $options[ 'cff_like_box_outside' ] = $cff_like_box_outside;
565
+ $options[ 'cff_likebox_bg_color' ] = $cff_likebox_bg_color;
566
+ $options[ 'cff_video_height' ] = $cff_video_height;
567
+ $options[ 'cff_video_action' ] = $cff_video_action;
568
+ $options[ 'cff_sep_color' ] = $cff_sep_color;
569
+ $options[ 'cff_sep_size' ] = $cff_sep_size;
570
+ $options[ 'cff_open_links' ] = $cff_open_links;
571
+ }
572
  //Update the array
573
  update_option( 'cff_style_settings', $options );
574
  // Put an settings updated message on the screen
576
  <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
577
  <?php } ?>
578
 
579
+ <div id="cff-admin" class="wrap">
580
+ <div id="header">
581
+ <h1><?php _e('Layout & Style'); ?></h1>
582
+ </div>
583
  <form name="form1" method="post" action="">
584
  <input type="hidden" name="<?php echo $style_hidden_field_name; ?>" value="Y">
585
+ <?php
586
+ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
587
+ ?>
588
+ <h2 class="nav-tab-wrapper">
589
+ <a href="?page=cff-style&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?>"><?php _e('General'); ?></a>
590
+ <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>
591
+ <a href="?page=cff-style&tab=typography" class="nav-tab <?php echo $active_tab == 'typography' ? 'nav-tab-active' : ''; ?>"><?php _e('Typography'); ?></a>
592
+ <a href="?page=cff-style&tab=misc" class="nav-tab <?php echo $active_tab == 'misc' ? 'nav-tab-active' : ''; ?>"><?php _e('Misc'); ?></a>
593
+ </h2>
594
+ <?php if( $active_tab == 'general' ) { //Start General tab ?>
595
+ <input type="hidden" name="<?php echo $style_general_hidden_field_name; ?>" value="Y">
596
  <br />
 
597
  <table class="form-table">
598
  <tbody>
599
  <h3><?php _e('General'); ?></h3>
601
  <th scope="row"><?php _e('Feed Width'); ?></th>
602
  <td>
603
  <input name="cff_feed_width" type="text" value="<?php esc_attr_e( $cff_feed_width ); ?>" size="6" />
604
+ <span>Eg. 500px, 50%, 10em. <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Default is 100%'); ?></i></span>
605
  </td>
606
  </tr>
607
  <tr valign="top">
608
  <th scope="row"><?php _e('Feed Height'); ?></th>
609
  <td>
610
  <input name="cff_feed_height" type="text" value="<?php esc_attr_e( $cff_feed_height ); ?>" size="6" />
611
+ <span>Eg. 500px, 50em. <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Leave empty to set no maximum height. If the feed exceeds this height then a scroll bar will be used.'); ?></i></span>
612
  </td>
613
  </tr>
614
  <th scope="row"><?php _e('Feed Padding'); ?></th>
615
  <td>
616
  <input name="cff_feed_padding" type="text" value="<?php esc_attr_e( $cff_feed_padding ); ?>" size="6" />
617
+ <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 feed. This is particularly useful if you intend to set a background color on the feed.'); ?></i></span>
618
  </td>
619
  </tr>
620
  <tr valign="top">
621
  <th scope="row"><?php _e('Feed Background Color'); ?></th>
622
  <td>
623
  <label for="cff_bg_color">#</label>
624
+ <input name="cff_bg_color" type="text" value="<?php esc_attr_e( $cff_bg_color ); ?>" size="10" placeholder="Eg. ED9A00" />
625
+ <span><a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a></span>
626
  </td>
627
  </tr>
628
  <tr valign="top">
630
  <td>
631
  <input name="cff_show_author" type="checkbox" id="cff_show_author" <?php if($cff_show_author == true) echo "checked"; ?> />
632
  <label for="cff_show_status_type">Yes</label>
633
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('This will show the thumbnail picture and name of the post author at the top of each post'); ?></i>
634
 
635
  </td>
636
  </tr>
637
+ <tr valign="top">
638
+ <th scope="row"><?php _e('Add CSS class to feed'); ?></th>
639
+ <td>
640
+ <input name="cff_class" type="text" value="<?php esc_attr_e( $cff_class ); ?>" size="25" />
641
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('To add multiple classes separate each with a space, Eg. classone classtwo classthree'); ?></i>
642
+ </td>
643
+ </tr>
644
  </tbody>
645
  </table>
646
+
647
  <hr />
648
  <table class="form-table">
649
  <tbody>
650
  <h3><?php _e('Post Types'); ?></h3>
651
  <tr valign="top">
652
+ <th scope="row"><?php _e('Only show these types of posts:'); ?><br />
653
+ <i style="color: #666; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable post types, photos, videos and more'); ?></a></i></th>
654
  <td>
655
+ <div>
656
+ <input name="cff_show_status_type" type="checkbox" id="cff_show_status_type" disabled <?php if($cff_show_status_type == true) echo "checked"; ?> />
657
+ <label for="cff_show_status_type"><?php _e('Statuses'); ?></label>
658
+ </div>
659
+ <div>
660
+ <input type="checkbox" name="cff_show_event_type" id="cff_show_event_type" disabled <?php if($cff_show_event_type == true) echo 'checked="checked"' ?> />
661
+ <label for="cff_show_event_type"><?php _e('Events'); ?></label>
662
+ </div>
663
+ <div>
664
+ <input type="checkbox" name="cff_show_photos_type" id="cff_show_photos_type" disabled <?php if($cff_show_photos_type == true) echo 'checked="checked"' ?> />
665
+ <label for="cff_show_photos_type"><?php _e('Photos'); ?></label>
666
+ </div>
667
+ <div>
668
+ <input type="checkbox" name="cff_show_video_type" id="cff_show_video_type" disabled <?php if($cff_show_video_type == true) echo 'checked="checked"' ?> />
669
+ <label for="cff_show_video_type"><?php _e('Videos'); ?></label>
670
+ </div>
671
+ <div>
672
+ <input type="checkbox" name="cff_show_links_type" id="cff_show_links_type" disabled <?php if($cff_show_links_type == true) echo 'checked="checked"' ?> />
673
+ <label for="cff_show_links_type"><?php _e('Links'); ?></label>
674
+ </div>
675
  </td>
676
  </tr>
677
  </tbody>
678
  </table>
679
+ <?php submit_button(); ?>
680
+
681
+ <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
682
+
683
+ <?php } //End General tab ?>
684
+ <?php if( $active_tab == 'post_layout' ) { //Start Post Layout tab ?>
685
+ <input type="hidden" name="<?php echo $style_post_layout_hidden_field_name; ?>" value="Y">
686
  <br />
 
687
  <h3><?php _e('Post Layout'); ?></h3>
688
  <table class="form-table">
689
  <tbody>
690
  <tr>
691
+ <td><p><?php _e('Choose a layout from the 3 below:'); ?></p></td>
692
  <td>
693
  <select name="cff_preset_layout" disabled>
694
+ <option value="thumb"><?php _e('Thumbnail'); ?></option>
695
+ <option value="half"><?php _e('Half-width'); ?></option>
696
+ <option value="full"><?php _e('Full-width'); ?></option>
697
  </select>
698
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable post layouts'); ?></a></i>
699
+ </td>
700
+ </tr>
701
+ <tr valign="top">
702
+ <th scope="row"><?php _e('Thumbnail:'); ?></th>
703
+ <td>
704
+ <img src="<?php echo plugins_url( 'img/layout-thumb.png' , __FILE__ ) ?>" alt="Thumbnail Layout" width="400px" style="border: 1px solid #ccc;" />
705
+ </td>
706
+ </tr>
707
+ <tr valign="top">
708
+ <th scope="row"><?php _e('Half-width:'); ?></th>
709
+ <td>
710
+ <img src="<?php echo plugins_url( 'img/layout-half.png' , __FILE__ ) ?>" alt="Half Width Layout" width="400px" style="border: 1px solid #ccc;" />
711
+ </td>
712
+ </tr>
713
+ <tr valign="top">
714
+ <th scope="row"><?php _e('Full-width:'); ?></th>
715
+ <td>
716
+ <img src="<?php echo plugins_url( 'img/layout-full.png' , __FILE__ ) ?>" alt="Full Width Layout" width="400px" style="border: 1px solid #ccc;" />
717
  </td>
718
  </tr>
719
+ </tbody>
720
+ </table>
721
+ <hr />
722
+ <h3><?php _e('Show/Hide'); ?></h3>
723
+ <table class="form-table">
724
+ <tbody>
725
  <tr valign="top">
726
+ <th scope="row"><?php _e('Include the following in posts:'); ?><br /><?php _e('(when applicable)'); ?>
727
+ <br /><i style="color: #666; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable all of these options'); ?></a></i></th>
728
  <td>
729
  <div>
730
  <input name="cff_show_text" type="checkbox" id="cff_show_text" <?php if($cff_show_text == true) echo "checked"; ?> />
731
+ <label for="cff_show_text"><?php _e('Post text'); ?></label>
732
  </div>
733
  <div>
734
+ <input type="checkbox" name="cff_show_date" id="cff_show_date" <?php if($cff_show_date == true) echo 'checked="checked"' ?> />
735
+ <label for="cff_show_date"><?php _e('Date'); ?></label>
736
  </div>
737
  <div>
738
+ <input type="checkbox" id="cff_show_media" disabled />
739
+ <label for="cff_show_media"><?php _e('Photos/videos'); ?></label>
740
  </div>
741
  <div>
742
+ <input type="checkbox" name="cff_show_shared_links" id="cff_show_shared_links" <?php if($cff_show_shared_links == true) echo 'checked="checked"' ?> />
743
+ <label for="cff_show_shared_links"><?php _e('Shared links'); ?></label>
744
+ </div>
745
+ <div>
746
+ <input type="checkbox" name="cff_show_desc" id="cff_show_desc" <?php if($cff_show_desc == true) echo 'checked="checked"' ?> />
747
+ <label for="cff_show_desc"><?php _e('Link, photo and video descriptions'); ?></label>
748
  </div>
 
749
  <div>
750
  <input type="checkbox" name="cff_show_event_title" id="cff_show_event_title" <?php if($cff_show_event_title == true) echo 'checked="checked"' ?> />
751
+ <label for="cff_show_event_title"><?php _e('Event title'); ?></label>
752
  </div>
753
  <div>
754
  <input type="checkbox" name="cff_show_event_details" id="cff_show_event_details" <?php if($cff_show_event_details == true) echo 'checked="checked"' ?> />
755
+ <label for="cff_show_event_details"><?php _e('Event details'); ?></label>
756
  </div>
757
  <div>
758
+ <input type="checkbox" id="cff_show_meta" disabled />
759
+ <label for="cff_show_meta"><?php _e('Like/shares/comments'); ?></label>
760
  </div>
761
  <div>
762
  <input type="checkbox" name="cff_show_link" id="cff_show_link" <?php if($cff_show_link == true) echo 'checked="checked"' ?> />
763
+ <label for="cff_show_link"><?php _e('View on Facebook/View Link'); ?></label>
764
  </div>
765
  </td>
766
  </tr>
767
  </tbody>
768
  </table>
769
+
770
  <?php submit_button(); ?>
771
+
772
+ <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
773
+
774
+ <?php } //End Post Layout tab ?>
775
+ <?php if( $active_tab == 'typography' ) { //Start Typography tab ?>
776
+ <input type="hidden" name="<?php echo $style_typography_hidden_field_name; ?>" value="Y">
777
+ <br />
778
  <h3><?php _e('Typography'); ?></h3>
779
+ <p><i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('"Inherit" means that the text will inherit the styles from your theme.'); ?></i></p>
780
+ <div id="poststuff" class="metabox-holder">
781
+ <div class="meta-box-sortables ui-sortable">
782
+ <div id="adminform" class="postbox" style="display: block;">
783
+ <div class="handlediv" title="Click to toggle"><br></div>
784
+ <h3 class="hndle"><span><?php _e('Text Character Limits'); ?></span></h3>
785
+ <div class="inside">
786
+ <table class="form-table">
787
+ <tbody>
788
+ <tr valign="top">
789
+ <th scope="row"><label class="bump-left"><?php _e('Maximum Post Text Length'); ?></label></th>
790
+ <td>
791
+ <input name="cff_title_length" type="text" value="<?php esc_attr_e( $cff_title_length_val ); ?>" size="4" /> <span><?php _e('Characters.'); ?></span> <span>Eg. 200</span> <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('If the post text exceeds this length then a "See More" button will be added. Leave empty to set no maximum length.'); ?></i>
792
+ </td>
793
+ </tr>
794
+ <tr valign="top">
795
+ <th scope="row"><label class="bump-left"><?php _e('Maximum Description Length'); ?></label></th>
796
+ <td>
797
+ <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>
798
+ </td>
799
+ </tr>
800
+ <tr>
801
+ <th><label for="cff_see_more_text" class="bump-left"><?php _e('Custom "See More" text'); ?></label></th>
802
+ <td>
803
+ <input name="cff_see_more_text" type="text" value="<?php esc_attr_e( $cff_see_more_text ); ?>" size="20" />
804
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Use different text in place of the default "See More" text'); ?></i>
805
+ </td>
806
+ </tr>
807
+ <tr>
808
+ <th><label for="cff_see_less_text" class="bump-left"><?php _e('Custom "See Less" text'); ?></label></th>
809
+ <td>
810
+ <input name="cff_see_less_text" type="text" value="<?php esc_attr_e( $cff_see_less_text ); ?>" size="20" />
811
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Use different text in place of the default "See Less" text'); ?></i>
812
+ </td>
813
+ </tr>
814
+ </tbody>
815
+ </table>
816
+ </div>
817
+ </div>
818
+ <div id="adminform" class="postbox" style="display: block;">
819
+ <div class="handlediv" title="Click to toggle"><br></div>
820
+ <h3 class="hndle"><span><?php _e('Post Text'); ?></span></h3>
821
+ <div class="inside">
822
+ <table class="form-table">
823
+ <tbody>
824
+ <tr>
825
+ <th><label for="cff_title_format" class="bump-left"><?php _e('Format'); ?></label></th>
826
+ <td>
827
+ <select name="cff_title_format">
828
+ <option value="p" <?php if($cff_title_format == "p") echo 'selected="selected"' ?> >Paragraph</option>
829
+ <option value="h3" <?php if($cff_title_format == "h3") echo 'selected="selected"' ?> >Heading 3</option>
830
+ <option value="h4" <?php if($cff_title_format == "h4") echo 'selected="selected"' ?> >Heading 4</option>
831
+ <option value="h5" <?php if($cff_title_format == "h5") echo 'selected="selected"' ?> >Heading 5</option>
832
+ <option value="h6" <?php if($cff_title_format == "h6") echo 'selected="selected"' ?> >Heading 6</option>
833
+ </select>
834
+ </td>
835
+ </tr>
836
+ <tr>
837
+ <th><label for="cff_title_size" class="bump-left"><?php _e('Text Size'); ?></label></th>
838
+ <td>
839
+ <select name="cff_title_size">
840
+ <option value="inherit" <?php if($cff_title_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
841
+ <option value="10" <?php if($cff_title_size == "10") echo 'selected="selected"' ?> >10px</option>
842
+ <option value="11" <?php if($cff_title_size == "11") echo 'selected="selected"' ?> >11px</option>
843
+ <option value="12" <?php if($cff_title_size == "12") echo 'selected="selected"' ?> >12px</option>
844
+ <option value="14" <?php if($cff_title_size == "14") echo 'selected="selected"' ?> >14px</option>
845
+ <option value="16" <?php if($cff_title_size == "16") echo 'selected="selected"' ?> >16px</option>
846
+ <option value="18" <?php if($cff_title_size == "18") echo 'selected="selected"' ?> >18px</option>
847
+ <option value="20" <?php if($cff_title_size == "20") echo 'selected="selected"' ?> >20px</option>
848
+ <option value="24" <?php if($cff_title_size == "24") echo 'selected="selected"' ?> >24px</option>
849
+ <option value="28" <?php if($cff_title_size == "28") echo 'selected="selected"' ?> >28px</option>
850
+ <option value="32" <?php if($cff_title_size == "32") echo 'selected="selected"' ?> >32px</option>
851
+ <option value="36" <?php if($cff_title_size == "36") echo 'selected="selected"' ?> >36px</option>
852
+ <option value="42" <?php if($cff_title_size == "42") echo 'selected="selected"' ?> >42px</option>
853
+ <option value="48" <?php if($cff_title_size == "48") echo 'selected="selected"' ?> >48px</option>
854
+ <option value="60" <?php if($cff_title_size == "54") echo 'selected="selected"' ?> >54px</option>
855
+ <option value="60" <?php if($cff_title_size == "60") echo 'selected="selected"' ?> >60px</option>
856
+ </select>
857
+ </td>
858
+ </tr>
859
+ <tr>
860
+ <th><label for="cff_title_weight" class="bump-left"><?php _e('Text Weight'); ?></label></th>
861
+ <td>
862
+ <select name="cff_title_weight">
863
+ <option value="inherit" <?php if($cff_title_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
864
+ <option value="normal" <?php if($cff_title_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
865
+ <option value="bold" <?php if($cff_title_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
866
+ </select>
867
+ </td>
868
+ </tr>
869
+ <tr>
870
+ <th><label for="cff_title_color" class="bump-left"><?php _e('Text Color'); ?></label></th>
871
+ <td>
872
+ #<input name="cff_title_color" type="text" value="<?php esc_attr_e( $cff_title_color ); ?>" size="10" placeholder="Eg. ED9A00" />
873
+ <span><a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a></span>
874
+ </td>
875
+ </tr>
876
+ <tr>
877
+ <th><label for="cff_title_link" class="bump-left"><?php _e('Link text to Facebook post?'); ?></label></th>
878
+ <td><input type="checkbox" name="cff_title_link" id="cff_title_link" <?php if($cff_title_link == true) echo 'checked="checked"' ?> />&nbsp;Yes</td>
879
+ </tr>
880
+
881
+ </tbody>
882
+ </table>
883
+ </div>
884
+ </div>
885
+ <div id="adminform" class="postbox" style="display: block;">
886
+ <div class="handlediv" title="Click to toggle"><br></div>
887
+ <h3 class="hndle"><span><?php _e('Link, Photo and Video Description'); ?></span></h3>
888
+ <div class="inside">
889
+ <table class="form-table">
890
+ <tbody>
891
 
892
+ <tr>
893
+ <th><label for="cff_body_size" class="bump-left"><?php _e('Text Size'); ?></label></th>
894
+ <td>
895
+ <select name="cff_body_size">
896
+ <option value="inherit" <?php if($cff_body_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
897
+ <option value="10" <?php if($cff_body_size == "10") echo 'selected="selected"' ?> >10px</option>
898
+ <option value="11" <?php if($cff_body_size == "11") echo 'selected="selected"' ?> >11px</option>
899
+ <option value="12" <?php if($cff_body_size == "12") echo 'selected="selected"' ?> >12px</option>
900
+ <option value="14" <?php if($cff_body_size == "14") echo 'selected="selected"' ?> >14px</option>
901
+ <option value="16" <?php if($cff_body_size == "16") echo 'selected="selected"' ?> >16px</option>
902
+ <option value="18" <?php if($cff_body_size == "18") echo 'selected="selected"' ?> >18px</option>
903
+ <option value="20" <?php if($cff_body_size == "20") echo 'selected="selected"' ?> >20px</option>
904
+ <option value="24" <?php if($cff_body_size == "24") echo 'selected="selected"' ?> >24px</option>
905
+ <option value="28" <?php if($cff_body_size == "28") echo 'selected="selected"' ?> >28px</option>
906
+ <option value="32" <?php if($cff_body_size == "32") echo 'selected="selected"' ?> >32px</option>
907
+ <option value="36" <?php if($cff_body_size == "36") echo 'selected="selected"' ?> >36px</option>
908
+ <option value="42" <?php if($cff_body_size == "42") echo 'selected="selected"' ?> >42px</option>
909
+ <option value="48" <?php if($cff_body_size == "48") echo 'selected="selected"' ?> >48px</option>
910
+ <option value="60" <?php if($cff_body_size == "54") echo 'selected="selected"' ?> >54px</option>
911
+ <option value="60" <?php if($cff_body_size == "60") echo 'selected="selected"' ?> >60px</option>
912
+ </select>
913
+ </td>
914
+ </tr>
915
+ <tr>
916
+ <th><label for="cff_body_weight" class="bump-left"><?php _e('Text Weight'); ?></label></th>
917
+ <td>
918
+ <select name="cff_body_weight">
919
+ <option value="inherit" <?php if($cff_body_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
920
+ <option value="normal" <?php if($cff_body_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
921
+ <option value="bold" <?php if($cff_body_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
922
+ </select>
923
+ </td>
924
+ </tr>
925
+ <tr>
926
+ <th><label for="cff_body_color" class="bump-left"><?php _e('Text Color'); ?></label></th>
927
+
928
+ <td>
929
+ #<input name="cff_body_color" type="text" value="<?php esc_attr_e( $cff_body_color ); ?>" size="10" placeholder="Eg. ED9A00" />
930
+ <a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
931
+ </td>
932
+ </tr>
933
+ </tbody>
934
+ </table>
935
+ </div>
936
+ </div>
937
+ <div style="margin-top: -15px;">
938
+ <?php submit_button(); ?>
939
+ </div>
940
+ <div id="adminform" class="postbox" style="display: block;">
941
+ <div class="handlediv" title="Click to toggle"><br></div>
942
+ <h3 class="hndle"><span><?php _e('Date'); ?></span></h3>
943
+ <div class="inside">
944
+ <table class="form-table">
945
+ <tbody>
946
+ <tr>
947
+ <th><label for="cff_date_position" class="bump-left"><?php _e('Position'); ?></label></th>
948
+ <td>
949
+ <select name="cff_date_position">
950
+ <option value="below" <?php if($cff_date_position == "below") echo 'selected="selected"' ?> >Below Text</option>
951
+ <option value="above" <?php if($cff_date_position == "above") echo 'selected="selected"' ?> >Above Text</option>
952
+ </select>
953
+ </td>
954
+ </tr>
955
+ <tr>
956
+ <th><label for="cff_date_size" class="bump-left"><?php _e('Text Size'); ?></label></th>
957
+ <td>
958
+ <select name="cff_date_size">
959
+ <option value="inherit" <?php if($cff_date_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
960
+ <option value="10" <?php if($cff_date_size == "10") echo 'selected="selected"' ?> >10px</option>
961
+ <option value="11" <?php if($cff_date_size == "11") echo 'selected="selected"' ?> >11px</option>
962
+ <option value="12" <?php if($cff_date_size == "12") echo 'selected="selected"' ?> >12px</option>
963
+ <option value="14" <?php if($cff_date_size == "14") echo 'selected="selected"' ?> >14px</option>
964
+ <option value="16" <?php if($cff_date_size == "16") echo 'selected="selected"' ?> >16px</option>
965
+ <option value="18" <?php if($cff_date_size == "18") echo 'selected="selected"' ?> >18px</option>
966
+ <option value="20" <?php if($cff_date_size == "20") echo 'selected="selected"' ?> >20px</option>
967
+ <option value="24" <?php if($cff_date_size == "24") echo 'selected="selected"' ?> >24px</option>
968
+ <option value="28" <?php if($cff_date_size == "28") echo 'selected="selected"' ?> >28px</option>
969
+ <option value="32" <?php if($cff_date_size == "32") echo 'selected="selected"' ?> >32px</option>
970
+ <option value="36" <?php if($cff_date_size == "36") echo 'selected="selected"' ?> >36px</option>
971
+ <option value="42" <?php if($cff_date_size == "42") echo 'selected="selected"' ?> >42px</option>
972
+ <option value="48" <?php if($cff_date_size == "48") echo 'selected="selected"' ?> >48px</option>
973
+ <option value="60" <?php if($cff_date_size == "54") echo 'selected="selected"' ?> >54px</option>
974
+ <option value="60" <?php if($cff_date_size == "60") echo 'selected="selected"' ?> >60px</option>
975
+ </select>
976
+ </td>
977
+ </tr>
978
+ <tr>
979
+ <th><label for="cff_date_weight" class="bump-left"><?php _e('Text Weight'); ?></label></th>
980
+ <td>
981
+ <select name="cff_date_weight">
982
+ <option value="inherit" <?php if($cff_date_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
983
+ <option value="normal" <?php if($cff_date_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
984
+ <option value="bold" <?php if($cff_date_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
985
+ </select>
986
+ </td>
987
+ </tr>
988
+ <tr>
989
+ <th><label for="cff_date_color" class="bump-left"><?php _e('Text Color'); ?></label></th>
990
+ <td>
991
+ #<input name="cff_date_color" type="text" value="<?php esc_attr_e( $cff_date_color ); ?>" size="10" placeholder="Eg. ED9A00" />
992
+ <a href="http://www.colorpicker.com/" target="_blank">Color Picker</a>
993
+ </td>
994
+ </tr>
995
+
996
+ <tr>
997
+ <th><label for="cff_date_formatting" class="bump-left"><?php _e('Date formatting'); ?></label></th>
998
+ <td>
999
+ <select name="cff_date_formatting">
1000
+ <?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
1001
+ <option value="1" <?php if($cff_date_formatting == "1") echo 'selected="selected"' ?> ><?php _e('Posted 2 days ago'); ?></option>
1002
+ <option value="2" <?php if($cff_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:i a', $original); ?></option>
1003
+ <option value="3" <?php if($cff_date_formatting == "3") echo 'selected="selected"' ?> ><?php echo date('F jS', $original); ?></option>
1004
+ <option value="4" <?php if($cff_date_formatting == "4") echo 'selected="selected"' ?> ><?php echo date('D F jS', $original); ?></option>
1005
+ <option value="5" <?php if($cff_date_formatting == "5") echo 'selected="selected"' ?> ><?php echo date('l F jS', $original); ?></option>
1006
+ <option value="6" <?php if($cff_date_formatting == "6") echo 'selected="selected"' ?> ><?php echo date('D M jS, Y', $original); ?></option>
1007
+ <option value="7" <?php if($cff_date_formatting == "7") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y', $original); ?></option>
1008
+ <option value="8" <?php if($cff_date_formatting == "8") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y - g:i a', $original); ?></option>
1009
+ <option value="9" <?php if($cff_date_formatting == "9") echo 'selected="selected"' ?> ><?php echo date("l M jS, 'y", $original); ?></option>
1010
+ <option value="10" <?php if($cff_date_formatting == "10") echo 'selected="selected"' ?> ><?php echo date('m.d.y', $original); ?></option>
1011
+ <option value="11" <?php if($cff_date_formatting == "11") echo 'selected="selected"' ?> ><?php echo date('m/d/y', $original); ?></option>
1012
+ <option value="12" <?php if($cff_date_formatting == "12") echo 'selected="selected"' ?> ><?php echo date('d.m.y', $original); ?></option>
1013
+ <option value="13" <?php if($cff_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y', $original); ?></option>
1014
+ </select>
1015
+ </td>
1016
+ </tr>
1017
+ <tr>
1018
+ <th><label for="cff_date_custom" class="bump-left"><?php _e('Custom format'); ?></label></th>
1019
+ <td>
1020
+ <input name="cff_date_custom" type="text" value="<?php esc_attr_e( $cff_date_custom ); ?>" size="10" placeholder="Eg. F j, Y" />
1021
+ <i style="color: #666; font-size: 11px;">(<a href="http://smashballoon.com/custom-facebook-feed/docs/date/" target="_blank"><?php _e('Examples'); ?></a>)</i>
1022
+ </td>
1023
+ </tr>
1024
+ <tr>
1025
+ <th><label for="cff_date_before" class="bump-left"><?php _e('Text before date'); ?></label></th>
1026
+ <td><input name="cff_date_before" type="text" value="<?php esc_attr_e( $cff_date_before ); ?>" size="10" placeholder="Eg. Posted" /></td>
1027
+ </tr>
1028
+ <tr>
1029
+ <th><label for="cff_date_after" class="bump-left"><?php _e('Text after date'); ?></label></th>
1030
+ <td><input name="cff_date_after" type="text" value="<?php esc_attr_e( $cff_date_after ); ?>" size="10" placeholder="Eg. ago" /></td>
1031
+ </tr>
1032
+ </tbody>
1033
+ </table>
1034
+ </div>
1035
+ </div>
1036
+ <div id="adminform" class="postbox" style="display: block;">
1037
+ <div class="handlediv" title="Click to toggle"><br></div>
1038
+ <h3 class="hndle"><span><?php _e('Event Title'); ?></span></h3>
1039
+ <div class="inside">
1040
+ <table class="form-table">
1041
+ <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1042
 
1043
+ <tr>
1044
+ <th><label for="cff_event_title_format" class="bump-left"><?php _e('Format'); ?></label></th>
1045
+ <td>
1046
+ <select name="cff_event_title_format">
1047
+ <option value="p" <?php if($cff_event_title_format == "p") echo 'selected="selected"' ?> >Paragraph</option>
1048
+ <option value="h3" <?php if($cff_event_title_format == "h3") echo 'selected="selected"' ?> >Heading 3</option>
1049
+ <option value="h4" <?php if($cff_event_title_format == "h4") echo 'selected="selected"' ?> >Heading 4</option>
1050
+ <option value="h5" <?php if($cff_event_title_format == "h5") echo 'selected="selected"' ?> >Heading 5</option>
1051
+ <option value="h6" <?php if($cff_event_title_format == "h6") echo 'selected="selected"' ?> >Heading 6</option>
1052
+ </select>
1053
+ </td>
1054
+ </tr>
1055
+
1056
+ <tr>
1057
+ <th><label for="cff_event_title_size" class="bump-left"><?php _e('Text Size'); ?></label></th>
1058
+ <td>
1059
+ <select name="cff_event_title_size">
1060
+ <option value="inherit" <?php if($cff_event_title_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1061
+ <option value="10" <?php if($cff_event_title_size == "10") echo 'selected="selected"' ?> >10px</option>
1062
+ <option value="11" <?php if($cff_event_title_size == "11") echo 'selected="selected"' ?> >11px</option>
1063
+ <option value="12" <?php if($cff_event_title_size == "12") echo 'selected="selected"' ?> >12px</option>
1064
+ <option value="14" <?php if($cff_event_title_size == "14") echo 'selected="selected"' ?> >14px</option>
1065
+ <option value="16" <?php if($cff_event_title_size == "16") echo 'selected="selected"' ?> >16px</option>
1066
+ <option value="18" <?php if($cff_event_title_size == "18") echo 'selected="selected"' ?> >18px</option>
1067
+ <option value="20" <?php if($cff_event_title_size == "20") echo 'selected="selected"' ?> >20px</option>
1068
+ <option value="24" <?php if($cff_event_title_size == "24") echo 'selected="selected"' ?> >24px</option>
1069
+ <option value="28" <?php if($cff_event_title_size == "28") echo 'selected="selected"' ?> >28px</option>
1070
+ <option value="32" <?php if($cff_event_title_size == "32") echo 'selected="selected"' ?> >32px</option>
1071
+ <option value="36" <?php if($cff_event_title_size == "36") echo 'selected="selected"' ?> >36px</option>
1072
+ <option value="42" <?php if($cff_event_title_size == "42") echo 'selected="selected"' ?> >42px</option>
1073
+ <option value="48" <?php if($cff_event_title_size == "48") echo 'selected="selected"' ?> >48px</option>
1074
+ <option value="60" <?php if($cff_event_title_size == "54") echo 'selected="selected"' ?> >54px</option>
1075
+ <option value="60" <?php if($cff_event_title_size == "60") echo 'selected="selected"' ?> >60px</option>
1076
+ </select>
1077
+ </td>
1078
+ </tr>
1079
+ <tr>
1080
+ <th><label for="cff_event_title_weight" class="bump-left"><?php _e('Text Weight'); ?></label></th>
1081
+ <td>
1082
+ <select name="cff_event_title_weight">
1083
+ <option value="inherit" <?php if($cff_event_title_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1084
+ <option value="normal" <?php if($cff_event_title_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
1085
+ <option value="bold" <?php if($cff_event_title_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
1086
+ </select>
1087
+ </td>
1088
+ </tr>
1089
+ <tr>
1090
+ <th><label for="cff_event_title_color" class="bump-left"><?php _e('Text Color'); ?></label></th>
1091
+ <td>
1092
+ <input name="cff_event_title_color" type="text" value="<?php esc_attr_e( $cff_event_title_color ); ?>" size="10" placeholder="Eg. ED9A00" />
1093
+ <a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
1094
+ </td>
1095
+ </tr>
1096
+ <tr>
1097
+ <th><label for="cff_title_link" class="bump-left"><?php _e('Link title to Facebook event page?'); ?></label></th>
1098
+ <td><input type="checkbox" name="cff_event_title_link" id="cff_event_title_link" <?php if($cff_event_title_link == true) echo 'checked="checked"' ?> />&nbsp;Yes</td>
1099
+ </tr>
1100
+ </tbody>
1101
+ </table>
1102
+ </div>
1103
+ </div>
1104
+ <div style="margin-top: -15px;">
1105
+ <?php submit_button(); ?>
1106
+ </div>
1107
+ <div id="adminform" class="postbox" style="display: block;">
1108
+ <div class="handlediv" title="Click to toggle"><br></div>
1109
+ <h3 class="hndle"><span><?php _e('Event Date'); ?></span></h3>
1110
+ <div class="inside">
1111
+ <table class="form-table">
1112
+ <tbody>
1113
+
1114
+ <tr>
1115
+ <th><label for="cff_event_date_size" class="bump-left"><?php _e('Text Size'); ?></label></th>
1116
+ <td>
1117
+ <select name="cff_event_date_size">
1118
+ <option value="inherit" <?php if($cff_event_date_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1119
+ <option value="10" <?php if($cff_event_date_size == "10") echo 'selected="selected"' ?> >10px</option>
1120
+ <option value="11" <?php if($cff_event_date_size == "11") echo 'selected="selected"' ?> >11px</option>
1121
+ <option value="12" <?php if($cff_event_date_size == "12") echo 'selected="selected"' ?> >12px</option>
1122
+ <option value="14" <?php if($cff_event_date_size == "14") echo 'selected="selected"' ?> >14px</option>
1123
+ <option value="16" <?php if($cff_event_date_size == "16") echo 'selected="selected"' ?> >16px</option>
1124
+ <option value="18" <?php if($cff_event_date_size == "18") echo 'selected="selected"' ?> >18px</option>
1125
+ <option value="20" <?php if($cff_event_date_size == "20") echo 'selected="selected"' ?> >20px</option>
1126
+ <option value="24" <?php if($cff_event_date_size == "24") echo 'selected="selected"' ?> >24px</option>
1127
+ <option value="28" <?php if($cff_event_date_size == "28") echo 'selected="selected"' ?> >28px</option>
1128
+ <option value="32" <?php if($cff_event_date_size == "32") echo 'selected="selected"' ?> >32px</option>
1129
+ <option value="36" <?php if($cff_event_date_size == "36") echo 'selected="selected"' ?> >36px</option>
1130
+ <option value="42" <?php if($cff_event_date_size == "42") echo 'selected="selected"' ?> >42px</option>
1131
+ <option value="48" <?php if($cff_event_date_size == "48") echo 'selected="selected"' ?> >48px</option>
1132
+ <option value="60" <?php if($cff_event_date_size == "54") echo 'selected="selected"' ?> >54px</option>
1133
+ <option value="60" <?php if($cff_event_date_size == "60") echo 'selected="selected"' ?> >60px</option>
1134
+ </select>
1135
+ </td>
1136
+ </tr>
1137
+ <tr>
1138
+ <th><label for="cff_event_date_weight" class="bump-left"><?php _e('Text Weight'); ?></label></th>
1139
+ <td>
1140
+ <select name="cff_event_date_weight">
1141
+ <option value="inherit" <?php if($cff_event_date_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1142
+ <option value="normal" <?php if($cff_event_date_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
1143
+ <option value="bold" <?php if($cff_event_date_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
1144
+ </select>
1145
+ </td>
1146
+ </tr>
1147
+ <tr>
1148
+ <th><label for="cff_event_date_color" class="bump-left"><?php _e('Text Color'); ?></label></th>
1149
+ <td>
1150
+ #<input name="cff_event_date_color" type="text" value="<?php esc_attr_e( $cff_event_date_color ); ?>" size="10" placeholder="Eg. ED9A00" />
1151
+ <a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
1152
+ </td>
1153
+ </tr>
1154
+ <tr valign="top">
1155
+ <th scope="row"><label class="bump-left"><?php _e('Date Position'); ?></label></th>
1156
+ <td>
1157
+ <select name="cff_event_date_position">
1158
+ <option value="below" <?php if($cff_event_date_position == "below") echo 'selected="selected"' ?> ><?php _e('Below event title'); ?></option>
1159
+ <option value="above" <?php if($cff_event_date_position == "above") echo 'selected="selected"' ?> ><?php _e('Above event title'); ?></option>
1160
+ </select>
1161
+ </td>
1162
+ </tr>
1163
+ <tr>
1164
+ <th><label for="cff_event_date_formatting" class="bump-left"><?php _e('Event date formatting'); ?></label></th>
1165
+ <td>
1166
+ <select name="cff_event_date_formatting">
1167
+ <?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
1168
+ <option value="1" <?php if($cff_event_date_formatting == "1") echo 'selected="selected"' ?> ><?php echo date('F j, Y, g:ia', $original); ?></option>
1169
+ <option value="2" <?php if($cff_event_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:ia', $original); ?></option>
1170
+ <option value="3" <?php if($cff_event_date_formatting == "3") echo 'selected="selected"' ?> ><?php echo date('g:ia - F jS', $original); ?></option>
1171
+ <option value="4" <?php if($cff_event_date_formatting == "4") echo 'selected="selected"' ?> ><?php echo date('g:ia, F jS', $original); ?></option>
1172
+ <option value="5" <?php if($cff_event_date_formatting == "5") echo 'selected="selected"' ?> ><?php echo date('l F jS - g:ia', $original); ?></option>
1173
+ <option value="6" <?php if($cff_event_date_formatting == "6") echo 'selected="selected"' ?> ><?php echo date('D M jS, Y, g:iA', $original); ?></option>
1174
+ <option value="7" <?php if($cff_event_date_formatting == "7") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y, g:iA', $original); ?></option>
1175
+ <option value="8" <?php if($cff_event_date_formatting == "8") echo 'selected="selected"' ?> ><?php echo date('l F jS, Y - g:ia', $original); ?></option>
1176
+ <option value="9" <?php if($cff_event_date_formatting == "9") echo 'selected="selected"' ?> ><?php echo date("l M jS, 'y", $original); ?></option>
1177
+ <option value="10" <?php if($cff_event_date_formatting == "10") echo 'selected="selected"' ?> ><?php echo date('m.d.y - g:iA', $original); ?></option>
1178
+ <option value="11" <?php if($cff_event_date_formatting == "11") echo 'selected="selected"' ?> ><?php echo date('m/d/y, g:ia', $original); ?></option>
1179
+ <option value="12" <?php if($cff_event_date_formatting == "12") echo 'selected="selected"' ?> ><?php echo date('d.m.y - g:iA', $original); ?></option>
1180
+ <option value="13" <?php if($cff_event_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y, g:ia', $original); ?></option>
1181
+ </select>
1182
+ </td>
1183
+ </tr>
1184
+ <tr>
1185
+ <th><label for="cff_event_date_custom" class="bump-left"><?php _e('Custom event date format'); ?></label></th>
1186
+ <td>
1187
+ <input name="cff_event_date_custom" type="text" value="<?php esc_attr_e( $cff_event_date_custom ); ?>" size="10" placeholder="Eg. F j, Y - g:ia" />
1188
+ <i style="color: #666; font-size: 11px;">(<a href="http://smashballoon.com/custom-facebook-feed/docs/date/" target="_blank"><?php _e('Examples'); ?></a>)</i>
1189
+ </td>
1190
+ </tr>
1191
+ </tbody>
1192
+ </table>
1193
+ </div>
1194
+ </div>
1195
+ <div id="adminform" class="postbox" style="display: block;">
1196
+ <div class="handlediv" title="Click to toggle"><br></div>
1197
+ <h3 class="hndle"><span><?php _e('Event Details'); ?></span></h3>
1198
+ <div class="inside">
1199
+ <table class="form-table">
1200
+ <tbody>
1201
+
1202
+ <tr>
1203
+ <th><label for="cff_event_details_size" class="bump-left"><?php _e('Text Size'); ?></label></th>
1204
+ <td>
1205
+ <select name="cff_event_details_size">
1206
+ <option value="inherit" <?php if($cff_event_details_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1207
+ <option value="10" <?php if($cff_event_details_size == "10") echo 'selected="selected"' ?> >10px</option>
1208
+ <option value="11" <?php if($cff_event_details_size == "11") echo 'selected="selected"' ?> >11px</option>
1209
+ <option value="12" <?php if($cff_event_details_size == "12") echo 'selected="selected"' ?> >12px</option>
1210
+ <option value="14" <?php if($cff_event_details_size == "14") echo 'selected="selected"' ?> >14px</option>
1211
+ <option value="16" <?php if($cff_event_details_size == "16") echo 'selected="selected"' ?> >16px</option>
1212
+ <option value="18" <?php if($cff_event_details_size == "18") echo 'selected="selected"' ?> >18px</option>
1213
+ <option value="20" <?php if($cff_event_details_size == "20") echo 'selected="selected"' ?> >20px</option>
1214
+ <option value="24" <?php if($cff_event_details_size == "24") echo 'selected="selected"' ?> >24px</option>
1215
+ <option value="28" <?php if($cff_event_details_size == "28") echo 'selected="selected"' ?> >28px</option>
1216
+ <option value="32" <?php if($cff_event_details_size == "32") echo 'selected="selected"' ?> >32px</option>
1217
+ <option value="36" <?php if($cff_event_details_size == "36") echo 'selected="selected"' ?> >36px</option>
1218
+ <option value="42" <?php if($cff_event_details_size == "42") echo 'selected="selected"' ?> >42px</option>
1219
+ <option value="48" <?php if($cff_event_details_size == "48") echo 'selected="selected"' ?> >48px</option>
1220
+ <option value="60" <?php if($cff_event_details_size == "54") echo 'selected="selected"' ?> >54px</option>
1221
+ <option value="60" <?php if($cff_event_details_size == "60") echo 'selected="selected"' ?> >60px</option>
1222
+ </select>
1223
+ </td>
1224
+ </tr>
1225
+ <tr>
1226
+ <th><label for="cff_event_details_weight" class="bump-left"><?php _e('Text Weight'); ?></label></th>
1227
+ <td>
1228
+ <select name="cff_event_details_weight">
1229
+ <option value="inherit" <?php if($cff_event_details_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1230
+ <option value="normal" <?php if($cff_event_details_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
1231
+ <option value="bold" <?php if($cff_event_details_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
1232
+ </select>
1233
+ </td>
1234
+ </tr>
1235
+ <tr>
1236
+ <th><label for="cff_event_details_color" class="bump-left"><?php _e('Text Color'); ?></label></th>
1237
+ <td>
1238
+ #<input name="cff_event_details_color" type="text" value="<?php esc_attr_e( $cff_event_details_color ); ?>" size="10" placeholder="Eg. ED9A00" />
1239
+ <a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
1240
+ </td>
1241
+ </tr>
1242
+ </tbody>
1243
+ </table>
1244
+ </div>
1245
+ </div>
1246
+ <div id="adminform" class="postbox" style="display: block;">
1247
+ <div class="handlediv" title="Click to toggle"><br></div>
1248
+ <h3 class="hndle"><span><?php _e('Link to Facebook'); ?></span></h3>
1249
+ <div class="inside">
1250
+ <table class="form-table">
1251
+ <tbody>
1252
+
1253
+ <tr>
1254
+ <th><label for="cff_link_size" class="bump-left"><?php _e('Text Size'); ?></label></th>
1255
+ <td>
1256
+ <select name="cff_link_size">
1257
+ <option value="inherit" <?php if($cff_link_size == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1258
+ <option value="10" <?php if($cff_link_size == "10") echo 'selected="selected"' ?> >10px</option>
1259
+ <option value="11" <?php if($cff_link_size == "11") echo 'selected="selected"' ?> >11px</option>
1260
+ <option value="12" <?php if($cff_link_size == "12") echo 'selected="selected"' ?> >12px</option>
1261
+ <option value="14" <?php if($cff_link_size == "14") echo 'selected="selected"' ?> >14px</option>
1262
+ <option value="16" <?php if($cff_link_size == "16") echo 'selected="selected"' ?> >16px</option>
1263
+ <option value="18" <?php if($cff_link_size == "18") echo 'selected="selected"' ?> >18px</option>
1264
+ <option value="20" <?php if($cff_link_size == "20") echo 'selected="selected"' ?> >20px</option>
1265
+ <option value="24" <?php if($cff_link_size == "24") echo 'selected="selected"' ?> >24px</option>
1266
+ <option value="28" <?php if($cff_link_size == "28") echo 'selected="selected"' ?> >28px</option>
1267
+ <option value="32" <?php if($cff_link_size == "32") echo 'selected="selected"' ?> >32px</option>
1268
+ <option value="36" <?php if($cff_link_size == "36") echo 'selected="selected"' ?> >36px</option>
1269
+ <option value="42" <?php if($cff_link_size == "42") echo 'selected="selected"' ?> >42px</option>
1270
+ <option value="48" <?php if($cff_link_size == "48") echo 'selected="selected"' ?> >48px</option>
1271
+ <option value="60" <?php if($cff_link_size == "54") echo 'selected="selected"' ?> >54px</option>
1272
+ <option value="60" <?php if($cff_link_size == "60") echo 'selected="selected"' ?> >60px</option>
1273
+ </select>
1274
+ </td>
1275
+ </tr>
1276
+ <tr>
1277
+ <th><label for="cff_link_weight" class="bump-left"><?php _e('Text Weight'); ?></label></th>
1278
+ <td>
1279
+ <select name="cff_link_weight">
1280
+ <option value="inherit" <?php if($cff_link_weight == "inherit") echo 'selected="selected"' ?> >Inherit</option>
1281
+ <option value="normal" <?php if($cff_link_weight == "normal") echo 'selected="selected"' ?> >Normal</option>
1282
+ <option value="bold" <?php if($cff_link_weight == "bold") echo 'selected="selected"' ?> >Bold</option>
1283
+ </select>
1284
+ </td>
1285
+ </tr>
1286
+ <tr>
1287
+ <th><label for="cff_link_color" class="bump-left"><?php _e('Text Color'); ?></label></th>
1288
+ <td>
1289
+ <input name="cff_link_color" type="text" value="<?php esc_attr_e( $cff_link_color ); ?>" size="10" placeholder="Eg. ED9A00" />
1290
+ <a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
1291
+ </td>
1292
+ </tr>
1293
+ <tr>
1294
+ <th><label for="cff_facebook_link_text" class="bump-left"><?php _e('Custom "View on Facebook" text'); ?></label></th>
1295
+ <td>
1296
+ <input name="cff_facebook_link_text" type="text" value="<?php esc_attr_e( $cff_facebook_link_text ); ?>" size="20" />
1297
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Use different text in place of the default "View on Facebook" link'); ?></i>
1298
+ </td>
1299
+ </tr>
1300
+ <tr>
1301
+ <th><label for="cff_view_link_text" class="bump-left"><?php _e('Custom "View Link" text'); ?></label></th>
1302
+ <td>
1303
+ <input name="cff_view_link_text" type="text" value="<?php esc_attr_e( $cff_view_link_text ); ?>" size="20" />
1304
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Use different text in place of the default "View on Facebook" link'); ?></i>
1305
+ </td>
1306
+ </tr>
1307
+
1308
+ </tbody>
1309
+ </table>
1310
+ </div>
1311
+ </div>
1312
+ </div>
1313
+ </div>
1314
+ <div style="margin-top: -15px;">
1315
+ <?php submit_button(); ?>
1316
+ </div>
1317
+
1318
+ <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
1319
 
1320
+ <?php } //End Typography tab ?>
1321
+ <?php if( $active_tab == 'misc' ) { //Start Misc tab ?>
1322
+ <input type="hidden" name="<?php echo $style_misc_hidden_field_name; ?>" value="Y">
1323
  <br />
1324
+ <h3><?php _e('Likes, Shares and Comments'); ?></h3><i style="color: #666; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable likes, shares and comments'); ?></a></i>
1325
+
1326
  <hr />
1327
  <h3><?php _e('Custom CSS'); ?></h3>
1328
  <table class="form-table">
1329
  <tbody>
1330
  <tr valign="top">
1331
  <td>
1332
+ <?php _e('Enter your own custom CSS in the box below'); ?>
1333
  </td>
1334
  </tr>
1335
  <tr valign="top">
1339
  </tr>
1340
  </tbody>
1341
  </table>
 
1342
  <hr />
1343
  <h3><?php _e('Misc'); ?></h3>
1344
  <table class="form-table">
1345
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
1346
  <tr><td><b style="font-size: 14px;"><?php _e('Like Box'); ?></b></td></tr>
1347
  <tr valign="top">
1348
+ <th scope="row"><label class="bump-left"><?php _e('Show the Like Box'); ?></label></th>
1349
  <td>
1350
  <input type="checkbox" name="cff_show_like_box" id="cff_show_like_box" <?php if($cff_show_like_box == true) echo 'checked="checked"' ?> />
1351
  </td>
1352
  </tr>
1353
  <tr valign="top">
1354
+ <th scope="row"><label class="bump-left"><?php _e('Like Box Position'); ?></label></th>
1355
  <td>
1356
  <select name="cff_like_box_position">
1357
+ <option value="bottom" <?php if($cff_like_box_position == "bottom") echo 'selected="selected"' ?> ><?php _e('Bottom'); ?></option>
1358
+ <option value="top" <?php if($cff_like_box_position == "top") echo 'selected="selected"' ?> ><?php _e('Top'); ?></option>
1359
  </select>
1360
  </td>
1361
  </tr>
1362
  <tr valign="top">
1363
+ <th scope="row"><label class="bump-left"><?php _e('Display outside the scrollable area'); ?></label></th>
1364
+ <td>
1365
+ <input type="checkbox" name="cff_like_box_outside" id="cff_like_box_outside" <?php if($cff_like_box_outside == true) echo 'checked="checked"' ?> />
1366
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('(Only applicable if you have set a height on the feed)'); ?></i>
1367
+ </td>
1368
+ </tr>
1369
+ <tr valign="top">
1370
+ <th scope="row"><label class="bump-left"><?php _e('Like Box Background Color'); ?></label></th>
1371
  <td>
1372
  <label for="cff_likebox_bg_color">#</label>
1373
  <input name="cff_likebox_bg_color" type="text" value="<?php esc_attr_e( $cff_likebox_bg_color ); ?>" size="10" />
1374
+ <span>Eg. ED9A00</span>&nbsp;&nbsp;<a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
1375
  </td>
1376
  </tr>
1377
+
1378
  <tr><td><b style="font-size: 14px;"><?php _e('Separating Line'); ?></b></td></tr>
1379
  <tr valign="top">
1380
+ <th scope="row"><label class="bump-left"><?php _e('Separating Line Color'); ?></label></th>
1381
  <td>
1382
  <label for="cff_sep_color">#</label>
1383
  <input name="cff_sep_color" type="text" value="<?php esc_attr_e( $cff_sep_color ); ?>" size="10" />
1384
+ <span>Eg. ED9A00</span>&nbsp;&nbsp;<a href="http://www.colorpicker.com/" target="_blank"><?php _e('Color Picker'); ?></a>
1385
  </td>
1386
  </tr>
1387
  <tr valign="top">
1388
+ <th scope="row"><label class="bump-left"><?php _e('Separating Line Thickness'); ?></label></th>
1389
  <td>
1390
+ <input name="cff_sep_size" type="text" value="<?php esc_attr_e( $cff_sep_size ); ?>" size="1" /><span>px</span> <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('(Leave empty to hide)'); ?></i>
1391
  </td>
1392
  </tr>
1393
  </tbody>
1394
  </table>
1395
  <?php submit_button(); ?>
1396
+
1397
+ <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
1398
+
1399
+ <?php } //End Misc tab ?>
1400
  </form>
 
 
 
 
 
1401
  <?php
1402
+ } //End Style_Page
1403
+ //Enqueue admin styles
1404
+ function cff_admin_style() {
1405
+ wp_register_style( 'custom_wp_admin_css', plugin_dir_url( __FILE__ ) . 'css/cff-admin-style.css', false, '1.0.0' );
1406
+ wp_enqueue_style( 'custom_wp_admin_css' );
1407
+ }
1408
+ add_action( 'admin_enqueue_scripts', 'cff_admin_style' );
1409
+ //Enqueue admin scripts
1410
+ function cff_admin_scripts() {
1411
+ wp_enqueue_script( 'cff_admin_script', plugin_dir_url( __FILE__ ) . 'js/cff-admin-scripts.js' );
1412
+ if( !wp_script_is('jquery-ui') ) {
1413
+ wp_enqueue_script( 'jquery-ui' , 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js' );
1414
+ }
1415
+ wp_enqueue_script( 'hoverIntent' );
1416
+ }
1417
+ add_action( 'admin_enqueue_scripts', 'cff_admin_scripts' );
1418
  ?>
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.5.2
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -27,33 +27,47 @@ include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
27
  // Add shortcodes
28
  add_shortcode('custom-facebook-feed', 'display_cff');
29
  function display_cff($atts) {
30
-
31
  //Style options
32
  $options = get_option('cff_style_settings');
33
-
34
  //Create the types string to set as shortcode default
35
- $include_string = '';
 
 
 
 
 
36
  if($options[ 'cff_show_text' ]) $include_string .= 'text,';
37
  if($options[ 'cff_show_desc' ]) $include_string .= 'desc,';
 
38
  if($options[ 'cff_show_date' ]) $include_string .= 'date,';
 
39
  if($options[ 'cff_show_event_title' ]) $include_string .= 'eventtitle,';
40
  if($options[ 'cff_show_event_details' ]) $include_string .= 'eventdetails,';
41
- if($options[ 'cff_show_link' ]) $include_string .= 'link';
 
42
  if($options[ 'cff_show_like_box' ]) $include_string .= 'likebox,';
43
-
44
  //Pass in shortcode attrbutes
45
  $atts = shortcode_atts(
46
  array(
47
  'id' => get_option('cff_page_id'),
48
  'num' => get_option('cff_num_show'),
 
49
  'others' => get_option('cff_show_others'),
 
 
50
  'width' => $options[ 'cff_feed_width' ],
51
  'height' => $options[ 'cff_feed_height' ],
52
  'padding' => $options[ 'cff_feed_padding' ],
53
  'bgcolor' => $options[ 'cff_bg_color' ],
54
  'showauthor' => $options[ 'cff_show_author' ],
 
 
 
55
  'include' => $include_string,
56
  //Typography
 
 
57
  'textformat' => $options[ 'cff_title_format' ],
58
  'textsize' => $options[ 'cff_title_size' ],
59
  'textweight' => $options[ 'cff_title_weight' ],
@@ -62,41 +76,59 @@ function display_cff($atts) {
62
  'descsize' => $options[ 'cff_body_size' ],
63
  'descweight' => $options[ 'cff_body_weight' ],
64
  'desccolor' => $options[ 'cff_body_color' ],
 
65
  'eventtitleformat' => $options[ 'cff_event_title_format' ],
66
  'eventtitlesize' => $options[ 'cff_event_title_size' ],
67
  'eventtitleweight' => $options[ 'cff_event_title_weight' ],
68
  'eventtitlecolor' => $options[ 'cff_event_title_color' ],
69
  'eventtitlelink' => $options[ 'cff_event_title_link' ],
 
 
 
 
 
 
 
 
70
  'eventdetailssize' => $options[ 'cff_event_details_size' ],
71
  'eventdetailsweight' => $options[ 'cff_event_details_weight' ],
72
  'eventdetailscolor' => $options[ 'cff_event_details_color' ],
 
73
  'datepos' => $options[ 'cff_date_position' ],
74
  'datesize' => $options[ 'cff_date_size' ],
75
  'dateweight' => $options[ 'cff_date_weight' ],
76
  'datecolor' => $options[ 'cff_date_color' ],
 
 
77
  'linksize' => $options[ 'cff_link_size' ],
78
  'linkweight' => $options[ 'cff_link_weight' ],
79
  'linkcolor' => $options[ 'cff_link_color' ],
80
  'facebooklinktext' => $options[ 'cff_facebook_link_text' ],
81
  'viewlinktext' => $options[ 'cff_view_link_text' ],
 
 
 
82
  //Misc
83
  'textlength' => get_option('cff_title_length'),
84
  'desclength' => get_option('cff_body_length'),
85
  'likeboxpos' => $options[ 'cff_like_box_position' ],
 
86
  'likeboxcolor' => $options[ 'cff_likebox_bg_color' ],
 
 
87
  'sepcolor' => $options[ 'cff_sep_color' ],
88
  'sepsize' => $options[ 'cff_sep_size' ]
89
  ), $atts);
90
-
91
-
92
-
93
-
94
  /********** GENERAL **********/
95
  $cff_feed_width = $atts['width'];
96
  $cff_feed_height = $atts[ 'height' ];
97
  $cff_feed_padding = $atts[ 'padding' ];
98
  $cff_bg_color = $atts[ 'bgcolor' ];
99
  $cff_show_author = $atts[ 'showauthor' ];
 
 
 
 
100
  //Compile feed styles
101
  $cff_feed_styles = 'style="';
102
  if ( !empty($cff_feed_width) ) $cff_feed_styles .= 'width:' . $cff_feed_width . '; ';
@@ -106,21 +138,53 @@ function display_cff($atts) {
106
  $cff_feed_styles .= '"';
107
  //Like box
108
  $cff_like_box_position = $atts[ 'likeboxpos' ];
 
109
  //Open links in new window?
110
  $cff_open_links = $options[ 'cff_open_links' ];
111
  $target = 'target="_blank"';
112
  if ($cff_open_links) $target = 'target="_blank"';
 
 
 
 
 
 
 
 
 
 
 
113
  /********** LAYOUT **********/
114
  $cff_includes = $atts[ 'include' ];
115
  //Look for non-plural version of string in the types string in case user specifies singular in shortcode
116
  if ( stripos($cff_includes, 'text') !== false ) $cff_show_text = true;
117
  if ( stripos($cff_includes, 'desc') !== false ) $cff_show_desc = true;
 
118
  if ( stripos($cff_includes, 'date') !== false ) $cff_show_date = true;
 
119
  if ( stripos($cff_includes, 'eventtitle') !== false ) $cff_show_event_title = true;
120
  if ( stripos($cff_includes, 'eventdetail') !== false ) $cff_show_event_details = true;
121
- if ( stripos($cff_includes, 'link') !== false ) $cff_show_link = true;
 
122
  if ( stripos($cff_includes, 'like') !== false ) $cff_show_like_box = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  /********** TYPOGRAPHY **********/
 
 
 
 
124
  //Title
125
  $cff_title_format = $atts[ 'textformat' ];
126
  if (empty($cff_title_format)) $cff_title_format = 'p';
@@ -154,6 +218,18 @@ function display_cff($atts) {
154
  if ( !empty($cff_event_title_color) ) $cff_event_title_styles .= 'color:#' . $cff_event_title_color . ';';
155
  $cff_event_title_styles .= '"';
156
  $cff_event_title_link = $atts[ 'eventtitlelink' ];
 
 
 
 
 
 
 
 
 
 
 
 
157
  //Event Details
158
  $cff_event_details_size = $atts[ 'eventdetailssize' ];
159
  $cff_event_details_weight = $atts[ 'eventdetailsweight' ];
@@ -193,6 +269,20 @@ function display_cff($atts) {
193
  $cff_likebox_styles = 'style="';
194
  if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= 'background-color:#' . $cff_likebox_bg_color . '; margin-left: 0; ';
195
  $cff_likebox_styles .= '"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  //Separating Line
197
  $cff_sep_color = $atts[ 'sepcolor' ];
198
  if (empty($cff_sep_color)) $cff_sep_color = 'ddd';
@@ -202,20 +292,18 @@ function display_cff($atts) {
202
  $cff_item_styles = 'style="';
203
  $cff_item_styles .= 'border-bottom: ' . $cff_sep_size . 'px solid #' . $cff_sep_color . '; ';
204
  $cff_item_styles .= '"';
205
-
206
-
207
-
208
  //Text limits
209
  $title_limit = $atts['textlength'];
210
- $body_limit = $atts['desclength']; ?>
211
- <?php //Assign the Access Token and Page ID variables
 
212
  $access_token = get_option('cff_access_token');
213
  $page_id = $atts['id'];
214
-
215
- //Get show posts attribute. If not set then default to 25.
216
  $show_posts = $atts['num'];
217
- if (empty($show_posts) || $show_posts == '') $show_posts = 25;
218
-
219
  //Check whether the Access Token is present and valid
220
  if ($access_token == '') {
221
  echo 'Please enter a valid Access Token. You can do this in the Custom Facebook Feed plugin settings.<br /><br />';
@@ -226,226 +314,297 @@ function display_cff($atts) {
226
  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 />";
227
  return false;
228
  }
229
-
230
  //Use posts? or feed?
231
  $show_others = $atts['others'];
232
  $graph_query = 'posts';
233
  if ($show_others) $graph_query = 'feed';
234
-
235
- //Get the contents of the Facebook page
236
- $json_object = fetchUrl('https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?access_token=' . $access_token);
237
- //Interpret data with JSON
238
- $FBdata = json_decode($json_object);
 
239
  //Set like box variable
240
- $like_box = '<div class="cff-likebox" ' . $cff_likebox_styles . '><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" width="300" show_faces="false" stream="false" header="true"></fb:like-box></div>';
241
-
 
 
242
  //***START FEED***
243
- //Create HTML
244
- $content = '<div id="cff" rel="'.$title_limit.'" class="';
 
 
 
 
245
  if ( !empty($cff_feed_height) ) $content .= 'fixed-height ';
246
- $content .= '"' . $cff_feed_styles . '>';
247
- //Add like box to top of feed
248
- if ($cff_like_box_position == 'top' && $cff_show_like_box) $content .= $like_box;
 
 
 
249
  //Limit var
250
  $i = 0;
251
 
252
- foreach ($FBdata->data as $news )
253
- {
254
- //Explode News and Page ID's into 2 values
255
- $PostID = explode("_", $news->id);
256
- //Check the post type
257
- $cff_post_type = $news->type;
258
- if ($cff_post_type == 'link') {
259
- $story = $news->story;
260
- //Check whether it's an event
261
- $created_event = 'created an event.';
262
- $shared_event = 'shared an event.';
263
- $created_event = stripos($story, $created_event);
264
- $shared_event = stripos($story, $shared_event);
265
- if ( $created_event || $shared_event ) $cff_post_type = 'event';
266
  }
267
- //Check whether it's a status (author comment or like)
268
- if ( ( $news->type == 'status' && !empty($news->message) ) || $news->type !== 'status' ) {
269
- //If it isn't then create the post
270
- //Only create posts for the amount of posts specified
271
- if ( $i == $show_posts ) break;
272
- $i++;
273
- //********************************//
274
- //***COMPILE SECTION VARIABLES***//
275
- //********************************//
276
-
277
- //Set the post link
278
- if(!empty($news->link)) {
279
- $link = $news->link;
280
- } else {
281
- //If there's no link provided then link to Facebook page
282
- $link = 'http://facebook.com/' . $page_id;
 
 
283
  }
284
-
285
- //Is it a shared album?
286
- $shared_album_string = 'shared an album:';
287
- if (!empty($news->story)){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  $shared_album = stripos($news->story, $shared_album_string);
289
  if ( $shared_album ) {
290
  $link = str_replace('photo.php?','media/set/?',$link);
291
  }
292
- }
293
-
294
-
295
- //POST AUTHOR
296
- $cff_author = '<a class="cff-author" href="http://facebook.com/' . $news->from->id . '" '.$target.' title="'.$news->from->name.' on Facebook">';
297
- $cff_author .= '<img src="http://graph.facebook.com/' . $news->from->id . '/picture">';
298
- $cff_author .= '<p>'.$news->from->name.'</p>';
299
- $cff_author .= '</a>';
300
-
301
-
302
- //POST TEXT
303
- $cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
304
- $cff_post_text .= '<span>';
305
- if ($cff_title_link) $cff_post_text .= '<a class="cff-post-text-link" href="'.$link.'" '.$target.'>';
306
-
307
- if (!empty($news->story)) $post_text = $news->story;
308
- if (!empty($news->message)) $post_text = $news->message;
309
- if (!empty($news->name) && empty($news->story) && empty($news->message)) $post_text = $news->name;
310
-
311
- //If the text is wrapped in a link then don't hyperlink any text within
312
- if ($cff_title_link) {
313
- //Wrap links in a span so we can break the text if it's too long
314
- $cff_post_text .= cff_wrap_span($post_text) . ' ';
315
- } else {
316
- $cff_post_text .= cff_make_clickable($post_text) . ' ';
317
- }
318
-
319
- if ($cff_title_link) $cff_post_text .= '</a>';
320
- $cff_post_text .= '</span>';
321
- $cff_post_text .= '</' . $cff_title_format . '>';
322
-
323
- //DESCRIPTION
324
- $cff_description = '';
325
- if (!empty($news->description)) {
326
- $description_text = $news->description;
327
- if (!empty($body_limit)) {
328
- if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
329
  }
330
- $cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_make_clickable($description_text) . '</span></p>';
331
- }
332
-
333
- //LINK
334
- $cff_shared_link = '';
335
- //Display shared link
336
- if ($news->type == 'link') {
337
- //Display link name and description
338
  if (!empty($news->description)) {
339
- $cff_shared_link .= '<p class="text-link no-image"><a href="'.$news->link.'" '.$target.'>'. '<b>' . $news->name . '</b></a></p>';
340
- }
341
- }
342
- //DATE
343
- $cff_date_formatting = $options[ 'cff_date_formatting' ];
344
- $cff_date_custom = $options[ 'cff_date_custom' ];
345
- $cff_date = '<p class="cff-date" '.$cff_date_styles.'>'. $cff_date_before . ' ' . cff_getdate(strtotime($news->created_time), $cff_date_formatting, $cff_date_custom) . ' ' . $cff_date_after . '</p>';
346
- //EVENT
347
- $cff_event = '';
348
- if ($cff_show_event_title || $cff_show_event_details) {
349
- //Check for media
350
- if ($cff_post_type == 'event') {
351
-
352
- //Get the event object
353
- $eventID = $PostID[1];
354
- if ( $shared_event ) {
355
- //Get the event id from the event URL. eg: http://www.facebook.com/events/123451234512345/
356
- $event_url = parse_url($link);
357
- $url_parts = explode('/', $event_url['path']);
358
- //Get the id from the parts
359
- $eventID = $url_parts[count($url_parts)-2];
360
  }
361
- //Get the contents of the event using the WP HTTP API
362
- $event_json = fetchUrl('https://graph.facebook.com/'.$eventID.'?access_token=' . $access_token);
363
- //Interpret data with JSON
364
- $event_object = json_decode($event_json);
365
-
366
- //EVENT
367
- //Display the event details
368
- $cff_event .= '<div class="details">';
369
- //Show event title
370
- if ($cff_show_event_title && !empty($event_object->name)) {
371
- if ($cff_event_title_link) $cff_event .= '<a href="'.$link.'">';
372
- $cff_event .= '<' . $cff_event_title_format . ' ' . $cff_event_title_styles . '>' . $event_object->name . '</' . $cff_event_title_format . '>';
373
- if ($cff_event_title_link) $cff_event .= '</a>';
374
  }
375
- //Show event details
376
- if ($cff_show_event_details){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  $event_time = $event_object->start_time;
378
  //If timezone migration is enabled then remove last 5 characters
379
  if ( strlen($event_time) == 24 ) $event_time = substr($event_time, 0, -5);
380
-
381
- //Event date
382
- $cff_event_date_formatting = $options[ 'cff_event_date_formatting' ];
383
- $cff_event_date_custom = $options[ 'cff_event_date_custom' ];
384
-
385
- if (!empty($event_object->location)) $cff_event .= '<p class="where" ' . $cff_event_details_styles . '>' . $event_object->location . '</p>';
386
- if (!empty($event_object->start_time)) $cff_event .= '<p class="when" ' . $cff_event_details_styles . '>' . cff_eventdate(strtotime($event_time), $cff_event_date_formatting, $cff_event_date_custom) . '</p>';
387
- if (!empty($event_object->description)){
388
- $description = $event_object->description;
389
- if (!empty($body_limit)) {
390
- if (strlen($description) > $body_limit) $description = substr($description, 0, $body_limit) . '...';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  }
392
- $cff_event .= '<p class="info" ' . $cff_event_details_styles . '>' . cff_make_clickable($description) . '</p>';
393
  }
 
 
394
  }
395
- $cff_event .= '</div>';
396
-
397
  }
398
- }
399
- //LINK
400
- //Display the link to the Facebook post or external link
401
- $cff_link = '';
402
- //Default link
403
- if ($cff_facebook_link_text == '') $cff_facebook_link_text = 'View on Facebook';
404
- $link_text = $cff_facebook_link_text;
405
-
406
- if (!empty($news->link)) {
407
- //Check whether it links to facebook or somewhere else
408
- $facebook_str = 'facebook.com';
409
- if(stripos($link, $facebook_str) == false) {
410
- if ($cff_view_link_text == '') $cff_view_link_text = 'View Link';
411
- $link_text = $cff_view_link_text;
412
  }
413
- }
414
- $cff_link = '<a class="cff-viewpost" href="' . $link . '" title="' . $link_text . '" ' . $target . ' ' . $cff_link_styles . '>' . $link_text . '</a>';
415
-
416
-
417
- //**************************//
418
- //***CREATE THE POST HTML***//
419
- //**************************//
420
- //Start the container
421
- $content .= '<div class="cff-item ';
422
- if ($news->type == 'link') $content .= 'link-item';
423
- $content .= '" ' . $cff_item_styles . '>';
424
- //POST AUTHOR
425
- if($cff_show_author) $content .= $cff_author;
426
- //DATE ABOVE
427
- if($cff_show_date && $cff_date_position == 'above') $content .= $cff_date;
428
- //POST TEXT
429
- if($cff_show_text) $content .= $cff_post_text;
430
- //DESCRIPTION
431
- if($cff_show_desc) $content .= $cff_description;
432
- //SHARED LINK
433
- if($cff_show_desc) $content .= $cff_shared_link;
434
- //EVENT
435
- if($cff_show_event_title || $cff_show_event_details) $content .= $cff_event;
436
- //DATE BELOW
437
- if($cff_show_date && $cff_date_position == 'below') $content .= $cff_date;
438
- //VIEW ON FACEBOOK LINK
439
- if($cff_show_link) $content .= $cff_link;
440
-
441
- //End the post item
442
- $content .= '</div><div class="clear"></div>';
443
- } // End status check
444
- } // End the loop
445
- //Add the Like Box
446
- if ($cff_like_box_position == 'bottom' && $cff_show_like_box) $content .= $like_box;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  //End the feed
448
  $content .= '</div><div class="clear"></div>';
 
 
449
  //Return our feed HTML to display
450
  return $content;
451
  }
@@ -484,27 +643,21 @@ function auto_link_text_callback($matches) {
484
  $max_depth_if_over_length = 2;
485
  $ellipsis = '&hellip;';
486
  $target = 'target="_blank"';
487
-
488
  $url_full = $matches[0];
489
  $url_short = '';
490
-
491
  if (strlen($url_full) > $max_url_length) {
492
  $parts = parse_url($url_full);
493
  $url_short = $parts['scheme'] . '://' . preg_replace('/^www\./', '', $parts['host']) . '/';
494
-
495
  $path_components = explode('/', trim($parts['path'], '/'));
496
  foreach ($path_components as $dir) {
497
  $url_string_components[] = $dir . '/';
498
  }
499
-
500
  if (!empty($parts['query'])) {
501
  $url_string_components[] = '?' . $parts['query'];
502
  }
503
-
504
  if (!empty($parts['fragment'])) {
505
  $url_string_components[] = '#' . $parts['fragment'];
506
  }
507
-
508
  for ($k = 0; $k < count($url_string_components); $k++) {
509
  $curr_component = $url_string_components[$k];
510
  if ($k >= $max_depth_if_over_length || strlen($url_short) + strlen($curr_component) > $max_url_length) {
@@ -517,15 +670,11 @@ function auto_link_text_callback($matches) {
517
  }
518
  $url_short .= $curr_component;
519
  }
520
-
521
  } else {
522
  $url_short = $url_full;
523
  }
524
-
525
- return "<a class='break-word' rel=\"nofollow\" href=\"$url_full\">$url_short</a>";
526
  }
527
-
528
-
529
  //Make links into span instead when the post text is made clickable
530
  function cff_wrap_span($text) {
531
  $pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#';
@@ -536,27 +685,21 @@ function cff_wrap_span_callback($matches) {
536
  $max_depth_if_over_length = 2;
537
  $ellipsis = '&hellip;';
538
  $target = 'target="_blank"';
539
-
540
  $url_full = $matches[0];
541
  $url_short = '';
542
-
543
  if (strlen($url_full) > $max_url_length) {
544
  $parts = parse_url($url_full);
545
  $url_short = $parts['scheme'] . '://' . preg_replace('/^www\./', '', $parts['host']) . '/';
546
-
547
  $path_components = explode('/', trim($parts['path'], '/'));
548
  foreach ($path_components as $dir) {
549
  $url_string_components[] = $dir . '/';
550
  }
551
-
552
  if (!empty($parts['query'])) {
553
  $url_string_components[] = '?' . $parts['query'];
554
  }
555
-
556
  if (!empty($parts['fragment'])) {
557
  $url_string_components[] = '#' . $parts['fragment'];
558
  }
559
-
560
  for ($k = 0; $k < count($url_string_components); $k++) {
561
  $curr_component = $url_string_components[$k];
562
  if ($k >= $max_depth_if_over_length || strlen($url_short) + strlen($curr_component) > $max_url_length) {
@@ -569,15 +712,11 @@ function cff_wrap_span_callback($matches) {
569
  }
570
  $url_short .= $curr_component;
571
  }
572
-
573
  } else {
574
  $url_short = $url_full;
575
  }
576
-
577
  return "<span class='break-word'>$url_short</span>";
578
  }
579
-
580
-
581
  //2013-04-28T21:06:56+0000
582
  //Time stamp function - used for posts
583
  function cff_getdate($original, $date_format, $custom_date) {
@@ -619,7 +758,6 @@ function cff_getdate($original, $date_format, $custom_date) {
619
  case '13':
620
  $print = date('d/m/y', $original);
621
  break;
622
-
623
  default:
624
 
625
  $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
@@ -643,11 +781,8 @@ function cff_getdate($original, $date_format, $custom_date) {
643
  if($difference != 1) {
644
  $periods[$j].= "s";
645
  }
646
-
647
  $print = "$difference $periods[$j] {$tense}";
648
-
649
  break;
650
-
651
 
652
  }
653
  if ( !empty($custom_date) ){
@@ -655,8 +790,6 @@ function cff_getdate($original, $date_format, $custom_date) {
655
  }
656
  return $print;
657
  }
658
-
659
-
660
  function cff_eventdate($original, $date_format, $custom_date) {
661
  switch ($date_format) {
662
 
@@ -696,7 +829,6 @@ function cff_eventdate($original, $date_format, $custom_date) {
696
  case '13':
697
  $print = date('d/m/y, g:ia', $original);
698
  break;
699
-
700
  default:
701
  $print = date('F j, Y, g:ia', $original);
702
  break;
@@ -706,40 +838,75 @@ function cff_eventdate($original, $date_format, $custom_date) {
706
  }
707
  return $print;
708
  }
709
-
710
-
711
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
  //Enqueue stylesheet
713
  add_action( 'wp_enqueue_scripts', 'cff_add_my_stylesheet' );
714
  function cff_add_my_stylesheet() {
715
  // Respects SSL, Style.css is relative to the current file
716
- wp_register_style( 'cff', plugins_url('css/cff-style.css', __FILE__) );
717
  wp_enqueue_style( 'cff' );
718
  }
719
-
720
  //Enqueue scripts
721
  add_action( 'wp_enqueue_scripts', 'cff_scripts_method' );
722
  function cff_scripts_method() {
723
  wp_enqueue_script(
724
  'cffscripts',
725
- plugins_url( '/js/cff-scripts.js' , __FILE__ ),
726
  array( 'jquery' )
727
  );
728
  }
729
-
730
- //Allows shortcodes in sidebar of theme
731
  add_filter('widget_text', 'do_shortcode');
732
  function cff_activate() {
733
  $options = get_option('cff_style_settings');
734
- //Show all parts of the feed by default on activation
 
 
 
 
 
735
  $options[ 'cff_show_text' ] = true;
736
  $options[ 'cff_show_desc' ] = true;
 
737
  $options[ 'cff_show_date' ] = true;
 
738
  $options[ 'cff_show_event_title' ] = true;
739
  $options[ 'cff_show_event_details' ] = true;
 
740
  $options[ 'cff_show_link' ] = true;
741
  $options[ 'cff_show_like_box' ] = true;
742
- $options[ 'cff_sep_size' ] = '1';
743
  update_option( 'cff_style_settings', $options );
744
  }
745
  register_activation_hook( __FILE__, 'cff_activate' );
@@ -748,10 +915,15 @@ function cff_uninstall()
748
  {
749
  if ( ! current_user_can( 'activate_plugins' ) )
750
  return;
 
751
  delete_option( 'cff_access_token' );
752
  delete_option( 'cff_page_id' );
753
  delete_option( 'cff_num_show' );
 
754
  delete_option( 'cff_show_others' );
 
 
 
755
  delete_option( 'cff_title_length' );
756
  delete_option( 'cff_body_length' );
757
  delete_option('cff_style_settings');
@@ -770,6 +942,22 @@ function cff_custom_css() {
770
  echo '</style>';
771
  echo "\r\n";
772
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
773
  //Comment out the line below to view errors
774
  error_reporting(0);
775
  ?>
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.0
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
27
  // Add shortcodes
28
  add_shortcode('custom-facebook-feed', 'display_cff');
29
  function display_cff($atts) {
30
+
31
  //Style options
32
  $options = get_option('cff_style_settings');
 
33
  //Create the types string to set as shortcode default
34
+ if($options[ 'cff_show_links_type' ]) $type_string .= 'links,';
35
+ if($options[ 'cff_show_event_type' ]) $type_string .= 'events,';
36
+ if($options[ 'cff_show_video_type' ]) $type_string .= 'videos,';
37
+ if($options[ 'cff_show_photos_type' ]) $type_string .= 'photos,';
38
+ if($options[ 'cff_show_status_type' ]) $type_string .= 'statuses,';
39
+ //Create the types string to set as shortcode default
40
  if($options[ 'cff_show_text' ]) $include_string .= 'text,';
41
  if($options[ 'cff_show_desc' ]) $include_string .= 'desc,';
42
+ if($options[ 'cff_show_shared_links' ]) $include_string .= 'sharedlinks,';
43
  if($options[ 'cff_show_date' ]) $include_string .= 'date,';
44
+ if($options[ 'cff_show_media' ]) $include_string .= 'media,';
45
  if($options[ 'cff_show_event_title' ]) $include_string .= 'eventtitle,';
46
  if($options[ 'cff_show_event_details' ]) $include_string .= 'eventdetails,';
47
+ if($options[ 'cff_show_meta' ]) $include_string .= 'social,';
48
+ if($options[ 'cff_show_link' ]) $include_string .= 'link,';
49
  if($options[ 'cff_show_like_box' ]) $include_string .= 'likebox,';
 
50
  //Pass in shortcode attrbutes
51
  $atts = shortcode_atts(
52
  array(
53
  'id' => get_option('cff_page_id'),
54
  'num' => get_option('cff_num_show'),
55
+ 'limit' => get_option('cff_post_limit'),
56
  'others' => get_option('cff_show_others'),
57
+ 'cachetime' => get_option('cff_cache_time'),
58
+ 'cacheunit' => get_option('cff_cache_time_unit'),
59
  'width' => $options[ 'cff_feed_width' ],
60
  'height' => $options[ 'cff_feed_height' ],
61
  'padding' => $options[ 'cff_feed_padding' ],
62
  'bgcolor' => $options[ 'cff_bg_color' ],
63
  'showauthor' => $options[ 'cff_show_author' ],
64
+ 'class' => $options[ 'cff_class' ],
65
+ 'layout' => $options[ 'cff_preset_layout' ],
66
+ 'type' => $type_string,
67
  'include' => $include_string,
68
  //Typography
69
+ 'seemoretext' => $options[ 'cff_see_more_text' ],
70
+ 'seelesstext' => $options[ 'cff_see_less_text' ],
71
  'textformat' => $options[ 'cff_title_format' ],
72
  'textsize' => $options[ 'cff_title_size' ],
73
  'textweight' => $options[ 'cff_title_weight' ],
76
  'descsize' => $options[ 'cff_body_size' ],
77
  'descweight' => $options[ 'cff_body_weight' ],
78
  'desccolor' => $options[ 'cff_body_color' ],
79
+ //Event title
80
  'eventtitleformat' => $options[ 'cff_event_title_format' ],
81
  'eventtitlesize' => $options[ 'cff_event_title_size' ],
82
  'eventtitleweight' => $options[ 'cff_event_title_weight' ],
83
  'eventtitlecolor' => $options[ 'cff_event_title_color' ],
84
  'eventtitlelink' => $options[ 'cff_event_title_link' ],
85
+ //Event date
86
+ 'eventdatesize' => $options[ 'cff_event_date_size' ],
87
+ 'eventdateweight' => $options[ 'cff_event_date_weight' ],
88
+ 'eventdatecolor' => $options[ 'cff_event_date_color' ],
89
+ 'eventdatepos' => $options[ 'cff_event_date_position' ],
90
+ 'eventdateformat' => $options[ 'cff_event_date_formatting' ],
91
+ 'eventdatecustom' => $options[ 'cff_event_date_custom' ],
92
+ //Event details
93
  'eventdetailssize' => $options[ 'cff_event_details_size' ],
94
  'eventdetailsweight' => $options[ 'cff_event_details_weight' ],
95
  'eventdetailscolor' => $options[ 'cff_event_details_color' ],
96
+ //Date
97
  'datepos' => $options[ 'cff_date_position' ],
98
  'datesize' => $options[ 'cff_date_size' ],
99
  'dateweight' => $options[ 'cff_date_weight' ],
100
  'datecolor' => $options[ 'cff_date_color' ],
101
+ 'dateformat' => $options[ 'cff_date_formatting' ],
102
+ 'datecustom' => $options[ 'cff_date_custom' ],
103
  'linksize' => $options[ 'cff_link_size' ],
104
  'linkweight' => $options[ 'cff_link_weight' ],
105
  'linkcolor' => $options[ 'cff_link_color' ],
106
  'facebooklinktext' => $options[ 'cff_facebook_link_text' ],
107
  'viewlinktext' => $options[ 'cff_view_link_text' ],
108
+ 'iconstyle' => $options[ 'cff_icon_style' ],
109
+ 'socialtextcolor' => $options[ 'cff_meta_text_color' ],
110
+ 'socialbgcolor' => $options[ 'cff_meta_bg_color' ],
111
  //Misc
112
  'textlength' => get_option('cff_title_length'),
113
  'desclength' => get_option('cff_body_length'),
114
  'likeboxpos' => $options[ 'cff_like_box_position' ],
115
+ 'likeboxoutside' => $options[ 'cff_like_box_outside' ],
116
  'likeboxcolor' => $options[ 'cff_likebox_bg_color' ],
117
+ 'videoheight' => $options[ 'cff_video_height' ],
118
+ 'videoaction' => $options[ 'cff_video_action' ],
119
  'sepcolor' => $options[ 'cff_sep_color' ],
120
  'sepsize' => $options[ 'cff_sep_size' ]
121
  ), $atts);
 
 
 
 
122
  /********** GENERAL **********/
123
  $cff_feed_width = $atts['width'];
124
  $cff_feed_height = $atts[ 'height' ];
125
  $cff_feed_padding = $atts[ 'padding' ];
126
  $cff_bg_color = $atts[ 'bgcolor' ];
127
  $cff_show_author = $atts[ 'showauthor' ];
128
+ $cff_cache_time = $atts[ 'cachetime' ];
129
+ if (!isset($cff_cache_time)) $cff_cache_time = 0;
130
+ $cff_cache_time_unit = $atts[ 'cacheunit' ];
131
+ $cff_class = $atts['class'];
132
  //Compile feed styles
133
  $cff_feed_styles = 'style="';
134
  if ( !empty($cff_feed_width) ) $cff_feed_styles .= 'width:' . $cff_feed_width . '; ';
138
  $cff_feed_styles .= '"';
139
  //Like box
140
  $cff_like_box_position = $atts[ 'likeboxpos' ];
141
+ $cff_like_box_outside = $atts[ 'likeboxoutside' ];
142
  //Open links in new window?
143
  $cff_open_links = $options[ 'cff_open_links' ];
144
  $target = 'target="_blank"';
145
  if ($cff_open_links) $target = 'target="_blank"';
146
+ /********** POST TYPES **********/
147
+ $cff_types = $atts[ 'type' ];
148
+ //Look for non-plural version of string in the types string in case user specifies singular in shortcode
149
+ $cff_show_links_type = true;
150
+ $cff_show_event_type = true;
151
+ $cff_show_video_type = true;
152
+ $cff_show_photos_type = true;
153
+ $cff_show_status_type = true;
154
+ $cff_events_only = false;
155
+ //Are we showing ONLY events?
156
+ if ($cff_show_event_type && !$cff_show_links_type && !$cff_show_video_type && !$cff_show_photos_type && !$cff_show_status_type) $cff_events_only = true;
157
  /********** LAYOUT **********/
158
  $cff_includes = $atts[ 'include' ];
159
  //Look for non-plural version of string in the types string in case user specifies singular in shortcode
160
  if ( stripos($cff_includes, 'text') !== false ) $cff_show_text = true;
161
  if ( stripos($cff_includes, 'desc') !== false ) $cff_show_desc = true;
162
+ if ( stripos($cff_includes, 'sharedlink') !== false ) $cff_show_shared_links = true;
163
  if ( stripos($cff_includes, 'date') !== false ) $cff_show_date = true;
164
+ if ( stripos($cff_includes, 'media') !== false ) $cff_show_media = true;
165
  if ( stripos($cff_includes, 'eventtitle') !== false ) $cff_show_event_title = true;
166
  if ( stripos($cff_includes, 'eventdetail') !== false ) $cff_show_event_details = true;
167
+ if ( stripos($cff_includes, 'social') !== false ) $cff_show_meta = true;
168
+ if ( stripos($cff_includes, ',link') !== false ) $cff_show_link = true; //comma used to separate it from 'sharedlinks' - which also contains 'link' string
169
  if ( stripos($cff_includes, 'like') !== false ) $cff_show_like_box = true;
170
+ $cff_preset_layout = 'thumb';
171
+
172
+ /********** META **********/
173
+ $cff_icon_style = $atts[ 'iconstyle' ];
174
+ $cff_meta_text_color = $atts[ 'socialtextcolor' ];
175
+ $cff_meta_bg_color = $atts[ 'socialbgcolor' ];
176
+ $cff_meta_styles = 'style="';
177
+ if ( !empty($cff_meta_text_color) ) $cff_meta_styles .= 'color:#' . $cff_meta_text_color . ';';
178
+ if ( !empty($cff_meta_bg_color) ) $cff_meta_styles .= 'background-color:#' . $cff_meta_bg_color . ';';
179
+ $cff_meta_styles .= '"';
180
+ $cff_nocomments_text = $options[ 'cff_nocomments_text' ];
181
+ $cff_hide_comments = $options[ 'cff_hide_comments' ];
182
+ if (!isset($cff_nocomments_text) || empty($cff_nocomments_text)) $cff_hide_comments = true;
183
  /********** TYPOGRAPHY **********/
184
+ //See More text
185
+ $cff_see_more_text = $atts[ 'seemoretext' ];
186
+ $cff_see_less_text = $atts[ 'seelesstext' ];
187
+ //See Less text
188
  //Title
189
  $cff_title_format = $atts[ 'textformat' ];
190
  if (empty($cff_title_format)) $cff_title_format = 'p';
218
  if ( !empty($cff_event_title_color) ) $cff_event_title_styles .= 'color:#' . $cff_event_title_color . ';';
219
  $cff_event_title_styles .= '"';
220
  $cff_event_title_link = $atts[ 'eventtitlelink' ];
221
+ //Event Date
222
+ $cff_event_date_size = $atts[ 'eventdatesize' ];
223
+ $cff_event_date_weight = $atts[ 'eventdateweight' ];
224
+ $cff_event_date_color = $atts[ 'eventdatecolor' ];
225
+ $cff_event_date_position = $atts[ 'eventdatepos' ];
226
+ $cff_event_date_formatting = $atts[ 'eventdateformat' ];
227
+ $cff_event_date_custom = $atts[ 'eventdatecustom' ];
228
+ $cff_event_date_styles = 'style="';
229
+ if ( !empty($cff_event_date_size) && $cff_event_date_size != 'inherit' ) $cff_event_date_styles .= 'font-size:' . $cff_event_date_size . 'px; ';
230
+ if ( !empty($cff_event_date_weight) && $cff_event_date_weight != 'inherit' ) $cff_event_date_styles .= 'font-weight:' . $cff_event_date_weight . '; ';
231
+ if ( !empty($cff_event_date_color) ) $cff_event_date_styles .= 'color:#' . $cff_event_date_color . ';';
232
+ $cff_event_date_styles .= '"';
233
  //Event Details
234
  $cff_event_details_size = $atts[ 'eventdetailssize' ];
235
  $cff_event_details_weight = $atts[ 'eventdetailsweight' ];
269
  $cff_likebox_styles = 'style="';
270
  if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= 'background-color:#' . $cff_likebox_bg_color . '; margin-left: 0; ';
271
  $cff_likebox_styles .= '"';
272
+ //Video
273
+ //Dimensions
274
+ $cff_video_width = 640;
275
+ $cff_video_height = $atts[ 'videoheight' ];
276
+
277
+ if ($cff_thumb_layout) {
278
+ if(empty($cff_video_height)) $cff_video_height = 100;
279
+ } else if ($cff_half_layout) {
280
+ if(empty($cff_video_height)) $cff_video_height = 180;
281
+ } else {
282
+ if(empty($cff_video_height)) $cff_video_height = 360;
283
+ }
284
+ //Action
285
+ $cff_video_action = $atts[ 'videoaction' ];
286
  //Separating Line
287
  $cff_sep_color = $atts[ 'sepcolor' ];
288
  if (empty($cff_sep_color)) $cff_sep_color = 'ddd';
292
  $cff_item_styles = 'style="';
293
  $cff_item_styles .= 'border-bottom: ' . $cff_sep_size . 'px solid #' . $cff_sep_color . '; ';
294
  $cff_item_styles .= '"';
295
+
 
 
296
  //Text limits
297
  $title_limit = $atts['textlength'];
298
+ if (!isset($title_limit)) $title_limit = 9999;
299
+ $body_limit = $atts['desclength'];
300
+ //Assign the Access Token and Page ID variables
301
  $access_token = get_option('cff_access_token');
302
  $page_id = $atts['id'];
303
+ //Get show posts attribute. If not set then default to 25
 
304
  $show_posts = $atts['num'];
305
+ if (empty($show_posts)) $show_posts = 25;
306
+ if ( $show_posts == 0 || $show_posts == undefined ) $show_posts = 25;
307
  //Check whether the Access Token is present and valid
308
  if ($access_token == '') {
309
  echo 'Please enter a valid Access Token. You can do this in the Custom Facebook Feed plugin settings.<br /><br />';
314
  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 />";
315
  return false;
316
  }
 
317
  //Use posts? or feed?
318
  $show_others = $atts['others'];
319
  $graph_query = 'posts';
320
  if ($show_others) $graph_query = 'feed';
321
+ $cff_post_limit = $atts['limit'];
322
+ //Calculate the cache time in seconds
323
+ if($cff_cache_time_unit == 'minutes') $cff_cache_time_unit = 60;
324
+ if($cff_cache_time_unit == 'hours') $cff_cache_time_unit = 60*60;
325
+ if($cff_cache_time_unit == 'days') $cff_cache_time_unit = 60*60*24;
326
+ $cache_seconds = $cff_cache_time * $cff_cache_time_unit;
327
  //Set like box variable
328
+ $like_box = '<div class="cff-likebox';
329
+ if ($cff_like_box_outside) $like_box .= ' outside';
330
+ $like_box .= ($cff_like_box_position == 'top') ? ' top' : ' bottom';
331
+ $like_box .= '"' . $cff_likebox_styles . '><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" width="300" show_faces="false" stream="false" header="true"></fb:like-box></div>';
332
  //***START FEED***
333
+ $content = '';
334
+ //Add like box to the outside of the top of feed
335
+ if ($cff_like_box_position == 'top' && $cff_show_like_box && $cff_like_box_outside) $content .= $like_box;
336
+ //Create CFF container HTML
337
+ $content .= '<div id="cff" rel="'.$title_limit.'" class="';
338
+ if( !empty($cff_class) ) $content .= $cff_class . ' ';
339
  if ( !empty($cff_feed_height) ) $content .= 'fixed-height ';
340
+ if ( $cff_thumb_layout ) $content .= 'thumb-layout ';
341
+ // if ( $cff_media_medium ) $content .= 'medium-image ';
342
+ if ( $cff_half_layout ) $content .= 'half-layout ';
343
+ $content .= '" ' . $cff_feed_styles . '>';
344
+ //Add like box to the inside of the top of feed
345
+ if ($cff_like_box_position == 'top' && $cff_show_like_box && !$cff_like_box_outside) $content .= $like_box;
346
  //Limit var
347
  $i = 0;
348
 
349
+
350
+ //ALL POSTS
351
+ if (!$cff_events_only){
352
+
353
+ // Get any existing copy of our transient data
354
+ $transient_name = 'cff_posts_json_' . $page_id;
355
+ if ( false === ( $posts_json = get_transient( $transient_name ) ) || $posts_json === null ) {
356
+ //Get the contents of the Facebook page
357
+ $posts_json = fetchUrl('https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?access_token=' . $access_token . '&limit=' . $cff_post_limit);
358
+ //Cache the JSON
359
+ set_transient( $transient_name, $posts_json, $cache_seconds );
360
+ } else {
361
+ $posts_json = get_transient( $transient_name );
 
362
  }
363
+
364
+ //Interpret data with JSON
365
+ $FBdata = json_decode($posts_json);
366
+ //***STARTS POSTS LOOP***
367
+ foreach ($FBdata->data as $news )
368
+ {
369
+ //Explode News and Page ID's into 2 values
370
+ $PostID = explode("_", $news->id);
371
+ //Check the post type
372
+ $cff_post_type = $news->type;
373
+ if ($cff_post_type == 'link') {
374
+ $story = $news->story;
375
+ //Check whether it's an event
376
+ $created_event = 'created an event.';
377
+ $shared_event = 'shared an event.';
378
+ $created_event = stripos($story, $created_event);
379
+ $shared_event = stripos($story, $shared_event);
380
+ if ( $created_event || $shared_event ) $cff_post_type = 'event';
381
  }
382
+ //Should we show this post or not?
383
+ $cff_show_post = false;
384
+ switch ($cff_post_type) {
385
+ case 'link':
386
+ if ( $cff_show_links_type ) $cff_show_post = true;
387
+ break;
388
+ case 'event':
389
+ if ( $cff_show_event_type ) $cff_show_post = true;
390
+ break;
391
+ case 'video':
392
+ if ( $cff_show_video_type ) $cff_show_post = true;
393
+ break;
394
+ case 'swf':
395
+ if ( $cff_show_video_type ) $cff_show_post = true;
396
+ break;
397
+ case 'photo':
398
+ if ( $cff_show_photos_type ) $cff_show_post = true;
399
+ break;
400
+ case 'status':
401
+ //Check whether it's a status (author comment or like)
402
+ if ( $cff_show_status_type && !empty($news->message) ) $cff_show_post = true;
403
+ break;
404
+ }
405
+ //Is it a duplicate post?
406
+ if ( ($prev_post_message == $news->message) && ($prev_post_link == $news->link) && ($prev_post_description == $news->description) ) $cff_show_post = false;
407
+ //Check post type and display post if selected
408
+ if ( $cff_show_post ) {
409
+ //If it isn't then create the post
410
+ //Only create posts for the amount of posts specified
411
+ if ( $i == $show_posts ) break;
412
+ $i++;
413
+ //********************************//
414
+ //***COMPILE SECTION VARIABLES***//
415
+ //********************************//
416
+
417
+ //Set the post link
418
+ $link = $news->link;
419
+ //Is it a shared album?
420
+ $shared_album_string = 'shared an album:';
421
  $shared_album = stripos($news->story, $shared_album_string);
422
  if ( $shared_album ) {
423
  $link = str_replace('photo.php?','media/set/?',$link);
424
  }
425
+ //If there's no link provided then link to Facebook page
426
+ if (empty($news->link)) $link = 'http://facebook.com/' . $page_id;
427
+ //POST AUTHOR
428
+ $cff_author = '<a class="cff-author" href="http://facebook.com/' . $news->from->id . '" '.$target.' title="'.$news->from->name.' on Facebook">';
429
+ $cff_author .= '<img src="http://graph.facebook.com/' . $news->from->id . '/picture">';
430
+ $cff_author .= '<p>'.$news->from->name.'</p>';
431
+ $cff_author .= '</a>';
432
+ //POST TEXT
433
+ $cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
434
+ $cff_post_text .= '<span class="text">';
435
+ if ($cff_title_link) $cff_post_text .= '<a class="cff-post-text-link" href="'.$link.'" '.$target.'>';
436
+ if (!empty($news->story)) $post_text = $news->story;
437
+ if (!empty($news->message)) $post_text = $news->message;
438
+ if (!empty($news->name) && empty($news->story) && empty($news->message)) $post_text = $news->name;
439
+ //If the text is wrapped in a link then don't hyperlink any text within
440
+ if ($cff_title_link) {
441
+ //Wrap links in a span so we can break the text if it's too long
442
+ $cff_post_text .= cff_wrap_span($post_text) . ' ';
443
+ } else {
444
+ $cff_post_text .= cff_make_clickable($post_text) . ' ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  }
446
+
447
+ if ($cff_title_link) $cff_post_text .= '</a>';
448
+ $cff_post_text .= '</span>';
449
+ //'See More' link
450
+ $cff_post_text .= '<span class="cff-expand">... <a href="#"><span class="more">' . $cff_see_more_text . '</span><span class="less">' . $cff_see_less_text . '</span></a></span>';
451
+ $cff_post_text .= '</' . $cff_title_format . '>';
452
+ //DESCRIPTION
453
+ $cff_description = '';
454
  if (!empty($news->description)) {
455
+ $description_text = $news->description;
456
+ if (!empty($body_limit)) {
457
+ if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  }
459
+ $cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_make_clickable($description_text) . '</span></p>';
460
+ }
461
+ //LINK
462
+ $cff_shared_link = '';
463
+ //Display shared link
464
+ if ($news->type == 'link') {
465
+ //Display link name and description
466
+ if (!empty($news->description)) {
467
+ $cff_shared_link .= '<p class="text-link ';
468
+ $cff_shared_link .= 'no-image';
469
+ $cff_shared_link .= '"><a href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a></p>';
 
 
470
  }
471
+ }
472
+ //DATE
473
+ $cff_date_formatting = $atts[ 'dateformat' ];
474
+ $cff_date_custom = $atts[ 'datecustom' ];
475
+ $cff_date = '<p class="cff-date" '.$cff_date_styles.'>'. $cff_date_before . ' ' . cff_getdate(strtotime($news->created_time), $cff_date_formatting, $cff_date_custom) . ' ' . $cff_date_after . '</p>';
476
+ //EVENT
477
+ $cff_event = '';
478
+ if ($cff_show_event_title || $cff_show_event_details) {
479
+ //Check for media
480
+ if ($cff_post_type == 'event') {
481
+
482
+ //Get the event object
483
+ $eventID = $PostID[1];
484
+ if ( $shared_event ) {
485
+ //Get the event id from the event URL. eg: http://www.facebook.com/events/123451234512345/
486
+ $event_url = parse_url($link);
487
+ $url_parts = explode('/', $event_url['path']);
488
+ //Get the id from the parts
489
+ $eventID = $url_parts[count($url_parts)-2];
490
+ }
491
+ //Get the contents of the event using the WP HTTP API
492
+ $event_json = fetchUrl('https://graph.facebook.com/'.$eventID.'?access_token=' . $access_token);
493
+ //Interpret data with JSON
494
+ $event_object = json_decode($event_json);
495
+ //Event date
496
  $event_time = $event_object->start_time;
497
  //If timezone migration is enabled then remove last 5 characters
498
  if ( strlen($event_time) == 24 ) $event_time = substr($event_time, 0, -5);
499
+ 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>';
500
+ //EVENT
501
+ //Display the event details
502
+ $cff_event .= '<div class="details">';
503
+ //show event date above title
504
+ if ($cff_event_date_position == 'above') $cff_event .= $cff_event_date;
505
+ //Show event title
506
+ if ($cff_show_event_title && !empty($event_object->name)) {
507
+ if ($cff_event_title_link) $cff_event .= '<a href="'.$link.'">';
508
+ $cff_event .= '<' . $cff_event_title_format . ' ' . $cff_event_title_styles . '>' . $event_object->name . '</' . $cff_event_title_format . '>';
509
+ if ($cff_event_title_link) $cff_event .= '</a>';
510
+ }
511
+ //show event date below title
512
+ if ($cff_event_date_position !== 'above') $cff_event .= $cff_event_date;
513
+ //Show event details
514
+ if ($cff_show_event_details){
515
+ //Location
516
+ if (!empty($event_object->location)) $cff_event .= '<p class="where" ' . $cff_event_details_styles . '>' . $event_object->location . '</p>';
517
+ //Description
518
+ if (!empty($event_object->description)){
519
+ $description = $event_object->description;
520
+ if (!empty($body_limit)) {
521
+ if (strlen($description) > $body_limit) $description = substr($description, 0, $body_limit) . '...';
522
+ }
523
+ $cff_event .= '<p class="info" ' . $cff_event_details_styles . '>' . cff_make_clickable($description) . '</p>';
524
  }
 
525
  }
526
+ $cff_event .= '</div>';
527
+
528
  }
 
 
529
  }
530
+
531
+ //Display the link to the Facebook post or external link
532
+ $cff_link = '';
533
+ //Default link
534
+ if ($cff_facebook_link_text == '') $cff_facebook_link_text = 'View on Facebook';
535
+ $link_text = $cff_facebook_link_text;
536
+ if (!empty($news->link)) {
537
+ //Check whether it links to facebook or somewhere else
538
+ $facebook_str = 'facebook.com';
539
+ if(stripos($link, $facebook_str) == false) {
540
+ if ($cff_view_link_text == '') $cff_view_link_text = 'View Link';
541
+ $link_text = $cff_view_link_text;
542
+ }
 
543
  }
544
+ $cff_link = '<a class="cff-viewpost" href="' . $link . '" title="' . $link_text . '" ' . $target . ' ' . $cff_link_styles . '>' . $link_text . '</a>';
545
+ //Compile the meta and link if included
546
+ if ($cff_show_meta) $cff_meta_total .= $cff_meta;
547
+ if ($cff_show_link) $cff_meta_total .= $cff_link;
548
+ $cff_meta_total .= '</div>';
549
+ $cff_comments = '';
550
+ if ( !($comment_count == 0 && $cff_hide_comments) ) {
551
+ //Create the comments box
552
+ $cff_comments .= '<div class="comments-box" ' . $cff_meta_styles . '>';
553
+ //Get the comments
554
+ if (!empty($news->comments->data)){
555
+ foreach ($news->comments->data as $comment_item ) {
556
+ $comment = $comment_item->message;
557
+ $cff_comments .= '<p><a href="http://facebook.com/'. $comment_item->from->id .'" class="name" '.$target.' ' . $cff_meta_styles . '>' . $comment_item->from->name . '</a>' . cff_make_clickable($comment) . '<span class="time">'. cff_timeSince(strtotime($comment_item->created_time)) . '</span></p>';
558
+ }
559
+ } else {
560
+ $cff_comments .= '<p>' . $cff_nocomments_text . '</p>';
561
+ }
562
+ $cff_comments .= '</div>';
563
+ }
564
+ //Compile comments if meta is included
565
+ if ($cff_show_meta) $cff_meta_total .= $cff_comments;
566
+ //**************************//
567
+ //***CREATE THE POST HTML***//
568
+ //**************************//
569
+ //Start the container
570
+ $content .= '<div class="cff-item ';
571
+ if ($news->type == 'link') $content .= 'link-item';
572
+ $content .= '" id="'. $news->id .'" ' . $cff_item_styles . '>';
573
+
574
+ //POST AUTHOR
575
+ if($cff_show_author) $content .= $cff_author;
576
+ //DATE ABOVE
577
+ if ($cff_show_date && $cff_date_position == 'above') $content .= $cff_date;
578
+ //POST TEXT
579
+ if($cff_show_text) $content .= $cff_post_text;
580
+ //DESCRIPTION
581
+ if($cff_show_desc) $content .= $cff_description;
582
+ //LINK
583
+ if($cff_show_shared_links) $content .= $cff_shared_link;
584
+ //DATE BELOW
585
+ if ($cff_show_date && $cff_date_position == 'below') $content .= $cff_date;
586
+ //VIEW ON FACEBOOK LINK
587
+ if($cff_show_link) $content .= $cff_link;
588
+
589
+ //EVENT
590
+ if($cff_show_event_title || $cff_show_event_details) $content .= $cff_event;
591
+
592
+ //End the post item
593
+ $content .= '</div><div class="clear"></div>';
594
+ } // End post type check
595
+ $prev_post_message = $news->message;
596
+ $prev_post_link = $news->link;
597
+ $prev_post_description = $news->description;
598
+ } // End the loop
599
+ } // End ALL POSTS
600
+ //Load more posts
601
+ // $content .= '<button class="loadmore">Load More Posts</button>';
602
+ //Add the Like Box inside
603
+ if ($cff_like_box_position == 'bottom' && $cff_show_like_box && !$cff_like_box_outside) $content .= $like_box;
604
  //End the feed
605
  $content .= '</div><div class="clear"></div>';
606
+ //Add the Like Box outside
607
+ if ($cff_like_box_position == 'bottom' && $cff_show_like_box && $cff_like_box_outside) $content .= $like_box;
608
  //Return our feed HTML to display
609
  return $content;
610
  }
643
  $max_depth_if_over_length = 2;
644
  $ellipsis = '&hellip;';
645
  $target = 'target="_blank"';
 
646
  $url_full = $matches[0];
647
  $url_short = '';
 
648
  if (strlen($url_full) > $max_url_length) {
649
  $parts = parse_url($url_full);
650
  $url_short = $parts['scheme'] . '://' . preg_replace('/^www\./', '', $parts['host']) . '/';
 
651
  $path_components = explode('/', trim($parts['path'], '/'));
652
  foreach ($path_components as $dir) {
653
  $url_string_components[] = $dir . '/';
654
  }
 
655
  if (!empty($parts['query'])) {
656
  $url_string_components[] = '?' . $parts['query'];
657
  }
 
658
  if (!empty($parts['fragment'])) {
659
  $url_string_components[] = '#' . $parts['fragment'];
660
  }
 
661
  for ($k = 0; $k < count($url_string_components); $k++) {
662
  $curr_component = $url_string_components[$k];
663
  if ($k >= $max_depth_if_over_length || strlen($url_short) + strlen($curr_component) > $max_url_length) {
670
  }
671
  $url_short .= $curr_component;
672
  }
 
673
  } else {
674
  $url_short = $url_full;
675
  }
676
+ return "<a class='break-word' rel=\"nofollow\" href=\"$url_full\">$url_full</a>";
 
677
  }
 
 
678
  //Make links into span instead when the post text is made clickable
679
  function cff_wrap_span($text) {
680
  $pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#';
685
  $max_depth_if_over_length = 2;
686
  $ellipsis = '&hellip;';
687
  $target = 'target="_blank"';
 
688
  $url_full = $matches[0];
689
  $url_short = '';
 
690
  if (strlen($url_full) > $max_url_length) {
691
  $parts = parse_url($url_full);
692
  $url_short = $parts['scheme'] . '://' . preg_replace('/^www\./', '', $parts['host']) . '/';
 
693
  $path_components = explode('/', trim($parts['path'], '/'));
694
  foreach ($path_components as $dir) {
695
  $url_string_components[] = $dir . '/';
696
  }
 
697
  if (!empty($parts['query'])) {
698
  $url_string_components[] = '?' . $parts['query'];
699
  }
 
700
  if (!empty($parts['fragment'])) {
701
  $url_string_components[] = '#' . $parts['fragment'];
702
  }
 
703
  for ($k = 0; $k < count($url_string_components); $k++) {
704
  $curr_component = $url_string_components[$k];
705
  if ($k >= $max_depth_if_over_length || strlen($url_short) + strlen($curr_component) > $max_url_length) {
712
  }
713
  $url_short .= $curr_component;
714
  }
 
715
  } else {
716
  $url_short = $url_full;
717
  }
 
718
  return "<span class='break-word'>$url_short</span>";
719
  }
 
 
720
  //2013-04-28T21:06:56+0000
721
  //Time stamp function - used for posts
722
  function cff_getdate($original, $date_format, $custom_date) {
758
  case '13':
759
  $print = date('d/m/y', $original);
760
  break;
 
761
  default:
762
 
763
  $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
781
  if($difference != 1) {
782
  $periods[$j].= "s";
783
  }
 
784
  $print = "$difference $periods[$j] {$tense}";
 
785
  break;
 
786
 
787
  }
788
  if ( !empty($custom_date) ){
790
  }
791
  return $print;
792
  }
 
 
793
  function cff_eventdate($original, $date_format, $custom_date) {
794
  switch ($date_format) {
795
 
829
  case '13':
830
  $print = date('d/m/y, g:ia', $original);
831
  break;
 
832
  default:
833
  $print = date('F j, Y, g:ia', $original);
834
  break;
838
  }
839
  return $print;
840
  }
841
+ //Time stamp function - used for comments
842
+ function cff_timesince($original) {
843
+
844
+ $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
845
+ $lengths = array("60","60","24","7","4.35","12","10");
846
+ $now = time();
847
+
848
+ // is it future date or past date
849
+ if($now > $original) {
850
+ $difference = $now - $original;
851
+ $tense = "ago";
852
+ } else {
853
+ $difference = $original - $now;
854
+ $tense = "from now";
855
+ }
856
+ for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
857
+ $difference /= $lengths[$j];
858
+ }
859
+
860
+ $difference = round($difference);
861
+
862
+ if($difference != 1) {
863
+ $periods[$j].= "s";
864
+ }
865
+ return "$difference $periods[$j] {$tense}";
866
+
867
+ }
868
+ //Use custom stripos function if it's not available (only available in PHP 5+)
869
+ if(!is_callable('stripos')){
870
+ function stripos($haystack, $needle){
871
+ return strpos($haystack, stristr( $haystack, $needle ));
872
+ }
873
+ }
874
  //Enqueue stylesheet
875
  add_action( 'wp_enqueue_scripts', 'cff_add_my_stylesheet' );
876
  function cff_add_my_stylesheet() {
877
  // Respects SSL, Style.css is relative to the current file
878
+ wp_register_style( 'cff', plugins_url('css/cff-style.css?3', __FILE__) );
879
  wp_enqueue_style( 'cff' );
880
  }
 
881
  //Enqueue scripts
882
  add_action( 'wp_enqueue_scripts', 'cff_scripts_method' );
883
  function cff_scripts_method() {
884
  wp_enqueue_script(
885
  'cffscripts',
886
+ plugins_url( '/js/cff-scripts.js?3' , __FILE__ ),
887
  array( 'jquery' )
888
  );
889
  }
890
+ //Allows shortcodes in theme
 
891
  add_filter('widget_text', 'do_shortcode');
892
  function cff_activate() {
893
  $options = get_option('cff_style_settings');
894
+ $options[ 'cff_show_links_type' ] = true;
895
+ $options[ 'cff_show_event_type' ] = true;
896
+ $options[ 'cff_show_video_type' ] = true;
897
+ $options[ 'cff_show_photos_type' ] = true;
898
+ $options[ 'cff_show_status_type' ] = true;
899
+ // Show all parts of the feed by default on activation
900
  $options[ 'cff_show_text' ] = true;
901
  $options[ 'cff_show_desc' ] = true;
902
+ $options[ 'cff_show_shared_links' ] = true;
903
  $options[ 'cff_show_date' ] = true;
904
+ $options[ 'cff_show_media' ] = true;
905
  $options[ 'cff_show_event_title' ] = true;
906
  $options[ 'cff_show_event_details' ] = true;
907
+ $options[ 'cff_show_meta' ] = true;
908
  $options[ 'cff_show_link' ] = true;
909
  $options[ 'cff_show_like_box' ] = true;
 
910
  update_option( 'cff_style_settings', $options );
911
  }
912
  register_activation_hook( __FILE__, 'cff_activate' );
915
  {
916
  if ( ! current_user_can( 'activate_plugins' ) )
917
  return;
918
+ //Settings
919
  delete_option( 'cff_access_token' );
920
  delete_option( 'cff_page_id' );
921
  delete_option( 'cff_num_show' );
922
+ delete_option( 'cff_post_limit' );
923
  delete_option( 'cff_show_others' );
924
+ delete_option('cff_cache_time');
925
+ delete_option('cff_cache_time_unit');
926
+ //Style & Layout
927
  delete_option( 'cff_title_length' );
928
  delete_option( 'cff_body_length' );
929
  delete_option('cff_style_settings');
942
  echo '</style>';
943
  echo "\r\n";
944
  }
945
+ add_action( 'wp_footer', 'cff_js' );
946
+ function cff_js() {
947
+ // $path = site_url();
948
+ $url = site_url();
949
+ $path = urlencode(ABSPATH);
950
+ echo '<!-- Custom Facebook Feed JS -->';
951
+ echo "\r\n";
952
+ echo '<script type="text/javascript">';
953
+ echo "\r\n";
954
+ echo 'var siteURL = "' . $url . '";';
955
+ echo "\r\n";
956
+ echo 'var rootPath = "' . $path . '";';
957
+ echo "\r\n";
958
+ echo '</script>';
959
+ echo "\r\n";
960
+ }
961
  //Comment out the line below to view errors
962
  error_reporting(0);
963
  ?>
img/icons.png DELETED
Binary file
img/play.png DELETED
Binary file
img/pro.jpg DELETED
Binary file
js/cff-scripts.js CHANGED
@@ -7,39 +7,41 @@ jQuery(document).ready(function() {
7
  if( jQuery('#cff .link').parent('p').length ){
8
  jQuery('#cff .link').unwrap('p');
9
  }
10
-
11
- //Expand post
12
- jQuery('.cff-item').each(function(){
13
  var $self = jQuery(this),
14
  expanded = false,
15
- $post_text = $self.find('.cff-post-text span'),
16
- text_limit = jQuery('#cff').attr('rel');
17
- if(text_limit == '' || text_limit == undefined) text_limit = 99999;
18
-
19
  //If the text is linked then use the text within the link
20
- if ( $post_text.find('a.cff-post-text-link').length ) $post_text = $self.find('.cff-post-text span a');
21
  var full_text = $post_text.html();
22
  if(full_text == undefined) full_text = '';
23
  var short_text = full_text.substring(0,text_limit);
24
 
25
  //Cut the text based on limits set
26
  $post_text.html( short_text );
27
- //Append link to end of text
28
- if (full_text.length > text_limit) $post_text.after('... <a class="cff-expand" href="#">See More</a>');
29
-
30
  //Click function
31
- $self.find('.cff-expand').click(function(e){
32
  e.preventDefault();
33
- var $expand = jQuery(this);
34
-
 
35
  if (expanded == false){
36
  $post_text.html( full_text );
37
  expanded = true;
38
- $expand.text('See Less');
 
39
  } else {
40
  $post_text.html( short_text );
41
  expanded = false;
42
- $expand.text('See More');
 
43
  }
44
  });
45
  });
7
  if( jQuery('#cff .link').parent('p').length ){
8
  jQuery('#cff .link').unwrap('p');
9
  }
10
+
11
+ jQuery('#cff .cff-item').each(function(){
12
+ //Expand post
13
  var $self = jQuery(this),
14
  expanded = false,
15
+ $post_text = $self.find('.cff-post-text .text'),
16
+ text_limit = $self.closest('#cff').attr('rel');
17
+ if (typeof text_limit === 'undefined' || text_limit == '') text_limit = 99999;
18
+
19
  //If the text is linked then use the text within the link
20
+ if ( $post_text.find('a.cff-post-text-link').length ) $post_text = $self.find('.cff-post-text .text a');
21
  var full_text = $post_text.html();
22
  if(full_text == undefined) full_text = '';
23
  var short_text = full_text.substring(0,text_limit);
24
 
25
  //Cut the text based on limits set
26
  $post_text.html( short_text );
27
+ //Show the 'See More' link if needed
28
+ if (full_text.length > text_limit) $self.find('.cff-expand').show();
 
29
  //Click function
30
+ $self.find('.cff-expand a').click(function(e){
31
  e.preventDefault();
32
+ var $expand = jQuery(this),
33
+ $more = $expand.find('.more'),
34
+ $less = $expand.find('.less');
35
  if (expanded == false){
36
  $post_text.html( full_text );
37
  expanded = true;
38
+ $more.hide();
39
+ $less.show();
40
  } else {
41
  $post_text.html( short_text );
42
  expanded = false;
43
+ $more.show();
44
+ $less.hide();
45
  }
46
  });
47
  });