Custom Facebook Feed - Version 2.0

Version Description

  • New: Added an option to display the post date immediately below the author name - as it is on Facebook. This is now the default date position.
  • New: Added options to add a background color and rounded corners to your posts
  • New: If your Facebook event has an end date then it will now be displayed after the start date
  • New: Hashtags in the post descriptions are now also linked
  • New: Tested and approved for the upcoming WordPress 4.0 release
  • Tweak: Moved the 'View on Facebook' link to the left side
  • Tweak: Added error handling to improve user experience
  • Tweak: If the Facebook API can't be reached by the plugin for some reason then it no longer caches the empty response and instead keeps trying to retrieve the posts from Facebook until it is successful
  • Fix: Removed some redundant inline CSS used on the posts
  • Fix: If there is a token in the 'Access Token' field but the 'Enter my own Access Token' box is unchecked then the plugin will no longer use it
  • Fix: Added the trim() function to the 'Test connection to Facebook API' function to improve reliability
  • Fix: Fixed an occasional JavaScript error which occurred when the post text was hidden
Download this release

Release Info

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

Code changes from version 1.9.9.3 to 2.0

README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Custom Facebook Feed ===
2
  Contributors: smashballoon
3
- Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook Like box, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social
4
  Requires at least: 3.0
5
  Tested up to: 3.9.1
6
- Stable tag: 1.9.9.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -34,21 +34,23 @@ Display a **completely customizable**, **responsive** and **search engine crawla
34
  * Display Facebook posts by just the page owner, everyone who posts on your Facebook page, or only other people
35
  * Control the width, height, padding and background color of your Facebook feed
36
  * Customize the size, weight and color of text
 
37
  * Supports Facebook tags - creates links when using the @ symbol to tag people in your Facebook posts
 
 
38
  * Select from a range of date formats or enter your own
39
  * Use your own custom link text in place of the defaults
40
  * Use the shortcode options to style multiple Facebook feeds in completely different ways
41
- * Select the number of Facebook posts to display
42
  * Set a maximum character length for both the text and descriptions of your Facebook posts
43
  * Create a customizable header with a range of icons for your Custom Facebook Feed
44
  * Localization/i18n support to allow every part of the feed to be displayed in your language
45
 
46
- To display photos, videos, the number of likes, shares and comments for each Facebook post, multiple layout options, post filtering by type or #hashtag/string and more then [upgrade to the Pro version](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). Try out the [Pro demo](http://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo").
47
 
48
  = Benefits =
49
 
50
- * **Save time** by using the Custom Facebook Feed instead to generate dynamic, search engine crawlable content on your website
51
  * **Increase social engagement** between you and your users, customers, fans or group members
 
52
  * **Get more likes** by displaying your Facebook content directly on your site
53
  * **Improve your SEO** as all of that quality keyword-rich Facebook content from posts and comments is directly embedded into your website
54
  * Display your Facebook content your way to perfectly match your website's style
@@ -68,7 +70,7 @@ To display photos, videos, the number of likes, shares and comments for each Fac
68
 
69
  == Frequently Asked Questions ==
70
 
71
- For a full list of FAQs and help with troubleshooting please visit the **[FAQ & Troubleshooting](http://smashballoon.com/custom-facebook-feed/faq/)** section of the Smash Balloon website
72
 
73
  = How do I find the Page ID of my Facebook page or group? =
74
 
@@ -76,7 +78,7 @@ If you have a Facebook **page** with a URL like this: `https://www.facebook.com/
76
 
77
  If you have a Facebook **group** then use [this tool](http://lookup-id.com/ "Look Up my ID") to find your Group ID.
78
 
79
- Copy and paste the ID into the [Pro demo](http://smashballoon.com/custom-facebook-feed/demo/) to test it.
80
 
81
  = Are there any limitations on which Facebook page or group feeds I can display? =
82
 
@@ -84,7 +86,7 @@ The Facebook feed you're trying to display has to be from a publicly accessible
84
 
85
  If your Facebook page has any restrictions on it (age, for example) then it means that people have to be signed into Facebook in order to view your page. This isn't desirable for most Facebook pages as it means that it isn't accessible by people who don't have a Facebook account and that your Facebook page can't be crawled and indexed by search engines.
86
 
87
- An easy way to determine whether your Facebook page is set to public is to sign out of your Facebook account and try to visit your page. If Facebook forces you to sign in to view your page then it isn't public. You can change your Facebook page to public in your Facebook page settings simply by removing any age or location restrictions you have on it ([screenshot](http://smashballoon.com/wp-content/uploads/2013/06/facebook-page-restrictions.png)), which will then allow the Custom Facebook Feed plugin to access and display your feed.
88
 
89
  = Can I display feeds from multiple Facebook pages or groups? =
90
 
@@ -100,11 +102,11 @@ Once you've done so, the plugin will be able to retrieve and display all of your
100
 
101
  = Can I show photos and videos in my Custom Facebook feed? =
102
 
103
- This free plugin only allows you to display text from your Facebook posts. To display photos and videos in your feed you would need to upgrade to the Pro version of the plugin. Try out a demo of the Pro version on the [Custom Facebook Feed website](http://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo"), and find out more about the Pro version [here](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro").
104
 
105
  = Can I show the comments, shares and likes associated with each Facebook post? =
106
 
107
- This is a feature of the [Pro version of the plugin](http://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). To display comments, shares and likes you would need to upgrade from the free version to the Pro version.
108
 
109
  = Is the content of my Custom Facebook Feed crawlable by search engines? =
110
 
@@ -145,7 +147,7 @@ We understand that sometimes you need help, have issues or just have questions.
145
 
146
  = How to get a Facebook Access Token =
147
 
148
- **For step-by-step instructions and screenshots on how to get a Facebook Access Token just follow the [Facebook Access Token instructions](http://smashballoon.com/custom-facebook-feed/access-token/ "Facebook Access Token instructions") on the Smash Balloon website.**
149
 
150
  You no longer need your own Access Token to use the Custom Facebook Feed Plugin, but if you'd like to use your own then you will need to obtain one from Facebook. Don't worry though, this is really easy to do. Just follow the steps below:
151
 
@@ -175,11 +177,11 @@ You no longer need your own Access Token to use the Custom Facebook Feed Plugin,
175
 
176
  **11)** Fill in Facebook's Security Check and click Continue.
177
 
178
- **12)** Your Facebook App should now be set up. Copy and paste your Facebook App ID and Facebook App Secret into the fields in the last step of the [Access Token instructions](http://smashballoon.com/custom-facebook-feed/access-token/ "How to get a Facebook Access Token") to retrieve your Facebook Access Token.
179
 
180
  = What some of our users think =
181
 
182
- **See all of the reviews [here](http://smashballoon.com/custom-facebook-feed/#support "Custom Facebook Feed customer reviews")**
183
 
184
  "Loving the Facebook feed plugin from @smashballoon. It's gonna transform my work's website! Great customer service too :)" - Grace Snow
185
 
@@ -254,7 +256,7 @@ Make sure that you do not leave your Facebook page or Facebook group after a few
254
 
255
  Facebook has really changed the way people go about promoting their business. With so many people with varied interests available on a single platform, there is something for everyone. All you need to do is find the right target audience and then market your business to them. Facebook provides you all the tools required to reach these people.
256
 
257
- Credit [iMarketing Factory](http://www.imarketingfactory.com/facebook/ "The Importance of Facebook for Small Businesses")
258
 
259
  == Screenshots ==
260
 
@@ -269,6 +271,20 @@ Credit [iMarketing Factory](http://www.imarketingfactory.com/facebook/ "The Impo
269
  9. It's super easy to display your Facebook feed in any page or post
270
 
271
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  = 1.9.9.3 =
273
  * New: Hashtags in link, photo and video descriptions are now also linked
274
  * Fix: Fixed an issue with hashtags being linked when the post text is also linked, which interfered with the text formatting
1
  === Custom Facebook Feed ===
2
  Contributors: smashballoon
3
+ Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook Like box, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social media
4
  Requires at least: 3.0
5
  Tested up to: 3.9.1
6
+ Stable tag: 2.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
34
  * Display Facebook posts by just the page owner, everyone who posts on your Facebook page, or only other people
35
  * Control the width, height, padding and background color of your Facebook feed
36
  * Customize the size, weight and color of text
37
+ * Choose to set a background color and rounded corners on your Facebook posts
38
  * Supports Facebook tags - creates links when using the @ symbol to tag people in your Facebook posts
39
+ * Automatically links hashtags used in posts to the hashtag page on Facebook
40
+ * Select the number of Facebook posts to display
41
  * Select from a range of date formats or enter your own
42
  * Use your own custom link text in place of the defaults
43
  * Use the shortcode options to style multiple Facebook feeds in completely different ways
 
44
  * Set a maximum character length for both the text and descriptions of your Facebook posts
45
  * Create a customizable header with a range of icons for your Custom Facebook Feed
46
  * Localization/i18n support to allow every part of the feed to be displayed in your language
47
 
48
+ To display photos, videos, the number of likes, shares and comments for each Facebook post, multiple layout options, post filtering by type or #hashtag/string and more then [upgrade to the Pro version](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). Try out the [Pro demo](https://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo").
49
 
50
  = Benefits =
51
 
 
52
  * **Increase social engagement** between you and your users, customers, fans or group members
53
+ * **Save time** by using the Custom Facebook Feed to generate dynamic, search engine crawlable content on your website
54
  * **Get more likes** by displaying your Facebook content directly on your site
55
  * **Improve your SEO** as all of that quality keyword-rich Facebook content from posts and comments is directly embedded into your website
56
  * Display your Facebook content your way to perfectly match your website's style
70
 
71
  == Frequently Asked Questions ==
72
 
73
+ For a full list of FAQs and help with troubleshooting please visit the **[FAQ & Troubleshooting](https://smashballoon.com/custom-facebook-feed/faq/)** section of the Smash Balloon website
74
 
75
  = How do I find the Page ID of my Facebook page or group? =
76
 
78
 
79
  If you have a Facebook **group** then use [this tool](http://lookup-id.com/ "Look Up my ID") to find your Group ID.
80
 
81
+ Copy and paste the ID into the [Pro demo](https://smashballoon.com/custom-facebook-feed/demo/) to test it.
82
 
83
  = Are there any limitations on which Facebook page or group feeds I can display? =
84
 
86
 
87
  If your Facebook page has any restrictions on it (age, for example) then it means that people have to be signed into Facebook in order to view your page. This isn't desirable for most Facebook pages as it means that it isn't accessible by people who don't have a Facebook account and that your Facebook page can't be crawled and indexed by search engines.
88
 
89
+ An easy way to determine whether your Facebook page is set to public is to sign out of your Facebook account and try to visit your page. If Facebook forces you to sign in to view your page then it isn't public. You can change your Facebook page to public in your Facebook page settings simply by removing any age or location restrictions you have on it ([screenshot](https://smashballoon.com/wp-content/uploads/2013/06/facebook-page-restrictions.png)), which will then allow the Custom Facebook Feed plugin to access and display your feed.
90
 
91
  = Can I display feeds from multiple Facebook pages or groups? =
92
 
102
 
103
  = Can I show photos and videos in my Custom Facebook feed? =
104
 
105
+ This free plugin only allows you to display text from your Facebook posts. To display photos and videos in your feed you would need to upgrade to the Pro version of the plugin. Try out a demo of the Pro version on the [Custom Facebook Feed website](https://smashballoon.com/custom-facebook-feed/demo "Custom Facebook Feed Demo"), and find out more about the Pro version [here](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro").
106
 
107
  = Can I show the comments, shares and likes associated with each Facebook post? =
108
 
109
+ This is a feature of the [Pro version of the plugin](https://smashballoon.com/custom-facebook-feed/ "Custom Facebook Feed Pro"). To display comments, shares and likes you would need to upgrade from the free version to the Pro version.
110
 
111
  = Is the content of my Custom Facebook Feed crawlable by search engines? =
112
 
147
 
148
  = How to get a Facebook Access Token =
149
 
150
+ **For step-by-step instructions and screenshots on how to get a Facebook Access Token just follow the [Facebook Access Token instructions](https://smashballoon.com/custom-facebook-feed/access-token/ "Facebook Access Token instructions") on the Smash Balloon website.**
151
 
152
  You no longer need your own Access Token to use the Custom Facebook Feed Plugin, but if you'd like to use your own then you will need to obtain one from Facebook. Don't worry though, this is really easy to do. Just follow the steps below:
153
 
177
 
178
  **11)** Fill in Facebook's Security Check and click Continue.
179
 
180
+ **12)** Your Facebook App should now be set up. Copy and paste your Facebook App ID and Facebook App Secret into the fields in the last step of the [Access Token instructions](https://smashballoon.com/custom-facebook-feed/access-token/ "How to get a Facebook Access Token") to retrieve your Facebook Access Token.
181
 
182
  = What some of our users think =
183
 
184
+ **See all of the reviews [here](https://smashballoon.com/custom-facebook-feed/#support "Custom Facebook Feed customer reviews")**
185
 
186
  "Loving the Facebook feed plugin from @smashballoon. It's gonna transform my work's website! Great customer service too :)" - Grace Snow
187
 
256
 
257
  Facebook has really changed the way people go about promoting their business. With so many people with varied interests available on a single platform, there is something for everyone. All you need to do is find the right target audience and then market your business to them. Facebook provides you all the tools required to reach these people.
258
 
259
+ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
260
 
261
  == Screenshots ==
262
 
271
  9. It's super easy to display your Facebook feed in any page or post
272
 
273
  == Changelog ==
274
+ = 2.0 =
275
+ * New: Added an option to display the post date immediately below the author name - as it is on Facebook. This is now the default date position.
276
+ * New: Added options to add a background color and rounded corners to your posts
277
+ * New: If your Facebook event has an end date then it will now be displayed after the start date
278
+ * New: Hashtags in the post descriptions are now also linked
279
+ * New: Tested and approved for the upcoming WordPress 4.0 release
280
+ * Tweak: Moved the 'View on Facebook' link to the left side
281
+ * Tweak: Added error handling to improve user experience
282
+ * Tweak: If the Facebook API can't be reached by the plugin for some reason then it no longer caches the empty response and instead keeps trying to retrieve the posts from Facebook until it is successful
283
+ * Fix: Removed some redundant inline CSS used on the posts
284
+ * Fix: If there is a token in the 'Access Token' field but the 'Enter my own Access Token' box is unchecked then the plugin will no longer use it
285
+ * Fix: Added the trim() function to the 'Test connection to Facebook API' function to improve reliability
286
+ * Fix: Fixed an occasional JavaScript error which occurred when the post text was hidden
287
+
288
  = 1.9.9.3 =
289
  * New: Hashtags in link, photo and video descriptions are now also linked
290
  * Fix: Fixed an issue with hashtags being linked when the post text is also linked, which interfered with the text formatting
css/cff-style.css CHANGED
@@ -29,6 +29,15 @@
29
  #cff .cff-item:first-child{
30
  padding-top: 0;
31
  }
 
 
 
 
 
 
 
 
 
32
  /* Feed Header */
33
  .cff-header{
34
  width: 100%;
@@ -115,6 +124,26 @@
115
  #cff .cff-author a{
116
  text-decoration: none;
117
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  /*************/
119
  /*** MEDIA ***/
120
  /*************/
@@ -173,7 +202,7 @@
173
  clear: none;
174
  width: 72%;
175
  margin-left: 3%;
176
- padding: 5px 0 10px 0;
177
  }
178
  #cff .cff-link-caption{
179
  font-size: 12px;
@@ -210,9 +239,9 @@
210
  /* View on Facebook / View Link text */
211
  #cff .cff-viewpost-link,
212
  #cff .cff-viewpost-facebook{
213
- float: right;
214
  clear: none;
215
- padding: 4px 0 0 4px;
216
  margin: 0;
217
  font-size: 11px;
218
  }
29
  #cff .cff-item:first-child{
30
  padding-top: 0;
31
  }
32
+ #cff .cff-item.cff-box,
33
+ #cff .cff-item.cff-box:first-child{
34
+ padding: 15px;
35
+ margin: 5px 0;
36
+ border: none;
37
+ -webkit-box-sizing: border-box;
38
+ -moz-box-sizing: border-box;
39
+ box-sizing: border-box;
40
+ }
41
  /* Feed Header */
42
  .cff-header{
43
  width: 100%;
124
  #cff .cff-author a{
125
  text-decoration: none;
126
  }
127
+
128
+ /* Author Date */
129
+ #cff .cff-author .cff-page-name.cff-author-date,
130
+ #cff .cff-author .cff-date{
131
+ float: none;
132
+ width: auto;
133
+ clear: none;
134
+ margin: 0;
135
+ font-weight: bold;
136
+ }
137
+ #cff .cff-author .cff-date{
138
+ float: none;
139
+ color: #9197a3;
140
+ font-weight: normal;
141
+ margin-top: 3px;
142
+ }
143
+ #cff .cff-author .cff-page-name.cff-author-date{
144
+ padding-top: 5px;
145
+ }
146
+
147
  /*************/
148
  /*** MEDIA ***/
149
  /*************/
202
  clear: none;
203
  width: 72%;
204
  margin-left: 3%;
205
+ padding: 5px 0;
206
  }
207
  #cff .cff-link-caption{
208
  font-size: 12px;
239
  /* View on Facebook / View Link text */
240
  #cff .cff-viewpost-link,
241
  #cff .cff-viewpost-facebook{
242
+ float: left;
243
  clear: none;
244
+ padding: 4px 0 0 0;
245
  margin: 0;
246
  font-size: 11px;
247
  }
custom-facebook-feed-admin.php CHANGED
@@ -140,7 +140,7 @@ function cff_settings_page() {
140
  <ul>
141
  <li><?php _e('If you have a Facebook <b>page</b> with a URL like this: <code>https://www.facebook.com/your_page_name</code> then the Page ID is just <b>your_page_name</b>. If your page URL is structured like this: <code>https://www.facebook.com/pages/your_page_name/123654123654123</code> then the Page ID is actually the number at the end, so in this case <b>123654123654123</b>.</li>'); ?>
142
  <li><?php _e('If you have a Facebook <b>group</b> then use <a href="http://lookup-id.com/" target="_blank" title="Find my ID">this tool</a> to find your ID.'); ?></li>
143
- <li><?php _e('You can copy and paste your ID into the <a href="http://smashballoon.com/custom-facebook-feed/demo/" target="_blank">demo</a> to test it.'); ?></li>
144
  </ul>
145
  </div>
146
  </td>
@@ -150,7 +150,7 @@ function cff_settings_page() {
150
  <th scope="row" style="padding-bottom: 10px;"><?php _e('Enter my own Access Token <i style="font-weight: normal; font-size: 12px;">This is Optional</i>'); ?></th>
151
  <td>
152
  <input name="cff_show_access_token" type="checkbox" id="cff_show_access_token" <?php if($show_access_token_val == true) echo "checked"; ?> />&nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("What is this?"); ?></a>
153
- <p class="cff-tooltip cff-more-info"><?php _e("A Facebook Access Token is not required to use this plugin, but if you have your own that you'd like to use then you can check this box and enter it here. To get your own Access Token you can follow these <a href='http://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>"); ?>.</p>
154
  </td>
155
  </tr>
156
 
@@ -160,7 +160,7 @@ function cff_settings_page() {
160
  <input name="cff_access_token" id="cff_access_token" type="text" value="<?php esc_attr_e( $access_token_val ); ?>" size="45" />
161
 
162
  <div class="cff-notice cff-profile-error cff-access-token">
163
- <?php _e("<p>This doesn't appear to be an Access Token. Please be sure that you didn't enter your App Secret instead of your Access Token.<br />Your App ID and App Secret are used to obtain your Access Token; simply paste them into the fields in the last step of the <a href='http://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>Access Token instructions</a> and click '<b>Get my Access Token</b>'.</p>"); ?>
164
  </div>
165
  </td>
166
  </tr>
@@ -326,10 +326,10 @@ function cff_settings_page() {
326
  <h3><?php _e('Customizing your Feed'); ?></h3>
327
  <p><?php _e("Use the <a href='admin.php?page=cff-style'>Customize</a> page to customize your feed. If you're displaying multiple feeds then you can override your settings and customizations by using options directly in the shortcode, like so:"); ?></p>
328
  <p>[custom-facebook-feed id=some-other-page-id num=3 height=500px]</p>
329
- <p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php _e('See a full list of shortcode options'); ?></a></p>
330
 
331
  <br />
332
- <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
333
 
334
  <?php } //End config tab ?>
335
 
@@ -340,21 +340,21 @@ function cff_settings_page() {
340
  <h3><?php _e('FAQs and Troubleshooting'); ?></h3>
341
  <p>Having trouble getting the plugin to work? Try the links below:</p>
342
  <ul>
343
- <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/general/" target="_blank">General Questions</a>'); ?></li>
344
- <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/setup/" target="_blank">Setting Up &amp; Displaying your Feed</a>'); ?></li>
345
- <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/troubleshooting/" target="_blank">Troubleshooting &amp; Common Support Questions</a>'); ?></li>
346
  </ul>
347
  <br />
348
  <h3>Documentation</h3>
349
  <p>Need help setting up, configuring or customizing the plugin? Check out the links below:</p>
350
  <ul>
351
- <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/wordpress/" target="_blank">Installation and Configuration</a>'); ?></li>
352
- <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank">Shortcode Reference</a>'); ?></li>
353
- <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank">Custom CSS and JavaScript Snippets</a>'); ?></li>
354
  </ul>
355
 
356
  <br />
357
- <p><?php _e('Still need help? <a href="http://smashballoon.com/custom-facebook-feed/support/" target="_blank">Request support</a>.'); ?></p>
358
 
359
  <br />
360
  <h3><?php _e('System Info'); ?></h3>
@@ -371,7 +371,7 @@ function cff_settings_page() {
371
  $access_token = get_option( $access_token );
372
  if ( $access_token == '' || empty($access_token) ) $access_token = '1436737606570258|MGh1BX4_b_D9HzJtKe702cwMRPI';
373
  ?>
374
- <?php $posts_json = cff_fetchUrl("https://graph.facebook.com/".get_option( $page_id )."/feed?access_token=".$access_token."&limit=1"); ?>
375
  <textarea readonly="readonly" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo $posts_json; ?></textarea>
376
  </div>
377
 
@@ -411,6 +411,10 @@ function cff_style_page() {
411
  'cff_show_meta' => true,
412
  'cff_show_link' => true,
413
  'cff_show_like_box' => true,
 
 
 
 
414
  //Typography
415
  'cff_title_format' => 'p',
416
  'cff_title_size' => 'inherit',
@@ -445,7 +449,7 @@ function cff_style_page() {
445
  'cff_event_details_color' => '',
446
  'cff_event_link_color' => '',
447
  //Date
448
- 'cff_date_position' => 'below',
449
  'cff_date_size' => 'inherit',
450
  'cff_date_weight' => 'inherit',
451
  'cff_date_color' => '',
@@ -562,6 +566,10 @@ function cff_style_page() {
562
  $cff_show_meta = $options[ 'cff_show_meta' ];
563
  $cff_show_link = $options[ 'cff_show_link' ];
564
  $cff_show_like_box = $options[ 'cff_show_like_box' ];
 
 
 
 
565
  //Typography
566
  $cff_see_more_text = $options[ 'cff_see_more_text' ];
567
  $cff_see_less_text = $options[ 'cff_see_less_text' ];
@@ -744,6 +752,12 @@ function cff_style_page() {
744
  (isset($_POST[ 'cff_show_event_details' ]) ) ? $cff_show_event_details = $_POST[ 'cff_show_event_details' ] : $cff_show_event_details = '';
745
  (isset($_POST[ 'cff_show_meta' ]) ) ? $cff_show_meta = $_POST[ 'cff_show_meta' ] : $cff_show_meta = '';
746
  (isset($_POST[ 'cff_show_link' ]) ) ? $cff_show_link = $_POST[ 'cff_show_link' ] : $cff_show_link = '';
 
 
 
 
 
 
747
  //Layout
748
  $options[ 'cff_preset_layout' ] = $cff_preset_layout;
749
  //Include
@@ -757,6 +771,12 @@ function cff_style_page() {
757
  $options[ 'cff_show_event_details' ] = $cff_show_event_details;
758
  $options[ 'cff_show_meta' ] = $cff_show_meta;
759
  $options[ 'cff_show_link' ] = $cff_show_link;
 
 
 
 
 
 
760
  }
761
  //Update the Typography options
762
  if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
@@ -974,8 +994,6 @@ function cff_style_page() {
974
 
975
  if (isset($_POST[ 'cff_video_height' ])) $cff_video_height = $_POST[ 'cff_video_height' ];
976
  if (isset($_POST[ 'cff_video_action' ])) $cff_video_action = $_POST[ 'cff_video_action' ];
977
- if (isset($_POST[ 'cff_sep_color' ])) $cff_sep_color = $_POST[ 'cff_sep_color' ];
978
- if (isset($_POST[ 'cff_sep_size' ])) $cff_sep_size = $_POST[ 'cff_sep_size' ];
979
  if (isset($_POST[ 'cff_open_links' ])) $cff_open_links = $_POST[ 'cff_open_links' ];
980
 
981
  $cff_ajax_val = $_POST[ $cff_ajax ];
@@ -1003,8 +1021,6 @@ function cff_style_page() {
1003
 
1004
  $options[ 'cff_video_height' ] = $cff_video_height;
1005
  $options[ 'cff_video_action' ] = $cff_video_action;
1006
- $options[ 'cff_sep_color' ] = $cff_sep_color;
1007
- $options[ 'cff_sep_size' ] = $cff_sep_size;
1008
  $options[ 'cff_open_links' ] = $cff_open_links;
1009
 
1010
  update_option( $cff_ajax, $cff_ajax_val );
@@ -1133,7 +1149,7 @@ function cff_style_page() {
1133
  <h3><?php _e('Post Types'); ?></h3>
1134
  <tr valign="top">
1135
  <th scope="row"><?php _e('Only show these types of posts:'); ?><br />
1136
- <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>
1137
  <td>
1138
  <div>
1139
  <input name="cff_show_status_type" type="checkbox" id="cff_show_status_type" disabled checked />
@@ -1165,7 +1181,7 @@ function cff_style_page() {
1165
  </table>
1166
  <?php submit_button(); ?>
1167
 
1168
- <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
1169
  <?php } //End General tab ?>
1170
  <?php if( $active_tab == 'post_layout' ) { //Start Post Layout tab ?>
1171
  <input type="hidden" name="<?php echo $style_post_layout_hidden_field_name; ?>" value="Y">
@@ -1177,7 +1193,7 @@ function cff_style_page() {
1177
  <tr>
1178
  <td>
1179
  <p><?php _e("Choose a layout from the 3 below."); ?>
1180
- <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>
1181
  </p>
1182
  </td>
1183
  </tr>
@@ -1205,19 +1221,19 @@ function cff_style_page() {
1205
  <table class="form-table cff-disabled">
1206
  <tbody>
1207
  <tr class="cff-media-position">
1208
- <th><label for="cff_media_position" class="bump-left"><?php _e('Photo/Video Position'); ?></label></th>
1209
  <td>
1210
  <select name="cff_media_position" disabled>
1211
- <option value="below" <?php if($cff_media_position == "below") echo 'selected="selected"' ?> >Below Text</option>
1212
- <option value="above" <?php if($cff_media_position == "above") echo 'selected="selected"' ?> >Above Text</option>
1213
  </select>
1214
  <i style="color: #666; font-size: 11px; margin-left: 5px;">Only applies to Full-width layout</i>
1215
  </td>
1216
  </tr>
1217
  <tr>
1218
- <th><label for="cff_enable_narrow" class="bump-left"><?php _e('Always use the Full-width layout when feed is narrow?'); ?></label></th>
1219
  <td>
1220
- <input name="cff_enable_narrow" type="checkbox" id="cff_enable_narrow" <?php if($cff_enable_narrow == true) echo "checked"; ?> disabled />
1221
  <label for="cff_enable_narrow"><?php _e('Yes'); ?></label>
1222
  <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
1223
  <p class="cff-tooltip cff-more-info"><?php _e("When displaying posts in either a narrow column or on a mobile device the plugin will automatically default to using the 'Full-width' layout as it's better suited to narrow sizes."); ?></p>
@@ -1232,7 +1248,7 @@ function cff_style_page() {
1232
  <tbody>
1233
  <tr valign="top">
1234
  <th scope="row"><?php _e('Include the following in posts: <i style="font-size: 11px;">(when applicable)</i>'); ?>
1235
- <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>
1236
  <td>
1237
  <div>
1238
  <input name="cff_show_author" type="checkbox" id="cff_show_author" <?php if($cff_show_author == true) echo "checked"; ?> />
@@ -1278,9 +1294,40 @@ function cff_style_page() {
1278
  </tr>
1279
  </tbody>
1280
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1281
 
1282
  <?php submit_button(); ?>
1283
- <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
1284
  <?php } //End Post Layout tab ?>
1285
  <?php if( $active_tab == 'typography' ) { //Start Typography tab ?>
1286
  <input type="hidden" name="<?php echo $style_typography_hidden_field_name; ?>" value="Y">
@@ -1646,9 +1693,10 @@ function cff_style_page() {
1646
  <tr>
1647
  <th><label for="cff_date_position" class="bump-left"><?php _e('Position'); ?></label></th>
1648
  <td>
1649
- <select name="cff_date_position">
1650
- <option value="below" <?php if($cff_date_position == "below") echo 'selected="selected"' ?> >Below Text</option>
1651
- <option value="above" <?php if($cff_date_position == "above") echo 'selected="selected"' ?> >Above Text</option>
 
1652
  </select>
1653
  </td>
1654
  </tr>
@@ -1816,7 +1864,7 @@ function cff_style_page() {
1816
  <th><label for="cff_date_custom" class="bump-left"><?php _e('Custom format'); ?></label></th>
1817
  <td>
1818
  <input name="cff_date_custom" type="text" value="<?php esc_attr_e( $cff_date_custom ); ?>" size="10" placeholder="Eg. F j, Y" />
1819
- <a href="http://smashballoon.com/custom-facebook-feed/docs/date/" class="cff-external-link" target="_blank"><?php _e('Examples'); ?></a>
1820
  </td>
1821
  </tr>
1822
  <tr>
@@ -2067,7 +2115,7 @@ function cff_style_page() {
2067
  <th><label for="cff_event_date_custom" class="bump-left"><?php _e('Custom event date format'); ?></label></th>
2068
  <td>
2069
  <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" />
2070
- <a href="http://smashballoon.com/custom-facebook-feed/docs/date/" class="cff-external-link" target="_blank"><?php _e('Examples'); ?></a>
2071
  </td>
2072
  </tr>
2073
  </tbody>
@@ -2196,13 +2244,13 @@ function cff_style_page() {
2196
  <?php submit_button(); ?>
2197
  </div>
2198
 
2199
- <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
2200
 
2201
  <?php } //End Typography tab ?>
2202
  <?php if( $active_tab == 'misc' ) { //Start Misc tab ?>
2203
  <input type="hidden" name="<?php echo $style_misc_hidden_field_name; ?>" value="Y">
2204
  <br />
2205
- <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>
2206
 
2207
  <hr />
2208
  <h3><?php _e('Like Box'); ?></h3>
@@ -2289,7 +2337,7 @@ function cff_style_page() {
2289
  <tr valign="top">
2290
  <td>
2291
  <?php _e('Enter your own custom CSS in the box below'); ?>
2292
- <i style="margin-left: 5px; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank"><?php _e('See some examples'); ?></a></i>
2293
  </td>
2294
  </tr>
2295
  <tr valign="top">
@@ -2305,7 +2353,7 @@ function cff_style_page() {
2305
  <tr valign="top">
2306
  <td>
2307
  <?php _e('Enter your own custom JavaScript/jQuery in the box below'); ?>
2308
- <i style="margin-left: 5px; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank"><?php _e('See some examples'); ?></a></i>
2309
  </td>
2310
  </tr>
2311
  <tr valign="top">
@@ -2317,25 +2365,6 @@ function cff_style_page() {
2317
  </table>
2318
 
2319
 
2320
- <hr />
2321
- <h3><?php _e('Separating Line'); ?></h3>
2322
- <table class="form-table">
2323
- <tbody>
2324
- <tr valign="top">
2325
- <th class="bump-left" scope="row"><label><?php _e('Separating Line Color'); ?></label></th>
2326
- <td>
2327
- <input name="cff_sep_color" value="#<?php esc_attr_e( str_replace('#', '', $cff_sep_color) ); ?>" class="cff-colorpicker" />
2328
- </td>
2329
- </tr>
2330
- <tr valign="top">
2331
- <th class="bump-left" scope="row"><label><?php _e('Separating Line Thickness'); ?></label></th>
2332
- <td>
2333
- <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>
2334
- </td>
2335
- </tr>
2336
- </tbody>
2337
- </table>
2338
-
2339
  <hr />
2340
  <h3><?php _e('Misc Settings'); ?></h3>
2341
  <table class="form-table">
@@ -2353,7 +2382,7 @@ function cff_style_page() {
2353
  </table>
2354
 
2355
  <?php submit_button(); ?>
2356
- <a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
2357
  <?php } //End Misc tab ?>
2358
 
2359
 
140
  <ul>
141
  <li><?php _e('If you have a Facebook <b>page</b> with a URL like this: <code>https://www.facebook.com/your_page_name</code> then the Page ID is just <b>your_page_name</b>. If your page URL is structured like this: <code>https://www.facebook.com/pages/your_page_name/123654123654123</code> then the Page ID is actually the number at the end, so in this case <b>123654123654123</b>.</li>'); ?>
142
  <li><?php _e('If you have a Facebook <b>group</b> then use <a href="http://lookup-id.com/" target="_blank" title="Find my ID">this tool</a> to find your ID.'); ?></li>
143
+ <li><?php _e('You can copy and paste your ID into the <a href="https://smashballoon.com/custom-facebook-feed/demo/" target="_blank">demo</a> to test it.'); ?></li>
144
  </ul>
145
  </div>
146
  </td>
150
  <th scope="row" style="padding-bottom: 10px;"><?php _e('Enter my own Access Token <i style="font-weight: normal; font-size: 12px;">This is Optional</i>'); ?></th>
151
  <td>
152
  <input name="cff_show_access_token" type="checkbox" id="cff_show_access_token" <?php if($show_access_token_val == true) echo "checked"; ?> />&nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("What is this?"); ?></a>
153
+ <p class="cff-tooltip cff-more-info"><?php _e("A Facebook Access Token is not required to use this plugin, but if you have your own that you'd like to use then you can check this box and enter it here. To get your own Access Token you can follow these <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>"); ?>.</p>
154
  </td>
155
  </tr>
156
 
160
  <input name="cff_access_token" id="cff_access_token" type="text" value="<?php esc_attr_e( $access_token_val ); ?>" size="45" />
161
 
162
  <div class="cff-notice cff-profile-error cff-access-token">
163
+ <?php _e("<p>This doesn't appear to be an Access Token. Please be sure that you didn't enter your App Secret instead of your Access Token.<br />Your App ID and App Secret are used to obtain your Access Token; simply paste them into the fields in the last step of the <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>Access Token instructions</a> and click '<b>Get my Access Token</b>'.</p>"); ?>
164
  </div>
165
  </td>
166
  </tr>
326
  <h3><?php _e('Customizing your Feed'); ?></h3>
327
  <p><?php _e("Use the <a href='admin.php?page=cff-style'>Customize</a> page to customize your feed. If you're displaying multiple feeds then you can override your settings and customizations by using options directly in the shortcode, like so:"); ?></p>
328
  <p>[custom-facebook-feed id=some-other-page-id num=3 height=500px]</p>
329
+ <p><a href="https://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php _e('See a full list of shortcode options'); ?></a></p>
330
 
331
  <br />
332
+ <a href="https://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
333
 
334
  <?php } //End config tab ?>
335
 
340
  <h3><?php _e('FAQs and Troubleshooting'); ?></h3>
341
  <p>Having trouble getting the plugin to work? Try the links below:</p>
342
  <ul>
343
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/faq/general/" target="_blank">General Questions</a>'); ?></li>
344
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/faq/setup/" target="_blank">Setting Up &amp; Displaying your Feed</a>'); ?></li>
345
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/faq/troubleshooting/" target="_blank">Troubleshooting &amp; Common Support Questions</a>'); ?></li>
346
  </ul>
347
  <br />
348
  <h3>Documentation</h3>
349
  <p>Need help setting up, configuring or customizing the plugin? Check out the links below:</p>
350
  <ul>
351
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/wordpress/" target="_blank">Installation and Configuration</a>'); ?></li>
352
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank">Shortcode Reference</a>'); ?></li>
353
+ <li>- <?php _e('<a href="https://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank">Custom CSS and JavaScript Snippets</a>'); ?></li>
354
  </ul>
355
 
356
  <br />
357
+ <p><?php _e('Still need help? <a href="https://smashballoon.com/custom-facebook-feed/support/" target="_blank">Request support</a>.'); ?></p>
358
 
359
  <br />
360
  <h3><?php _e('System Info'); ?></h3>
371
  $access_token = get_option( $access_token );
372
  if ( $access_token == '' || empty($access_token) ) $access_token = '1436737606570258|MGh1BX4_b_D9HzJtKe702cwMRPI';
373
  ?>
374
+ <?php $posts_json = cff_fetchUrl("https://graph.facebook.com/".get_option( trim($page_id) )."/feed?access_token=". trim($access_token) ."&limit=1"); ?>
375
  <textarea readonly="readonly" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo $posts_json; ?></textarea>
376
  </div>
377
 
411
  'cff_show_meta' => true,
412
  'cff_show_link' => true,
413
  'cff_show_like_box' => true,
414
+ //Post Styple
415
+ 'cff_post_bg_color' => '',
416
+ 'cff_post_rounded' => '0',
417
+
418
  //Typography
419
  'cff_title_format' => 'p',
420
  'cff_title_size' => 'inherit',
449
  'cff_event_details_color' => '',
450
  'cff_event_link_color' => '',
451
  //Date
452
+ 'cff_date_position' => 'author',
453
  'cff_date_size' => 'inherit',
454
  'cff_date_weight' => 'inherit',
455
  'cff_date_color' => '',
566
  $cff_show_meta = $options[ 'cff_show_meta' ];
567
  $cff_show_link = $options[ 'cff_show_link' ];
568
  $cff_show_like_box = $options[ 'cff_show_like_box' ];
569
+ //Post Style
570
+ $cff_post_bg_color = $options[ 'cff_post_bg_color' ];
571
+ $cff_post_rounded = $options[ 'cff_post_rounded' ];
572
+
573
  //Typography
574
  $cff_see_more_text = $options[ 'cff_see_more_text' ];
575
  $cff_see_less_text = $options[ 'cff_see_less_text' ];
752
  (isset($_POST[ 'cff_show_event_details' ]) ) ? $cff_show_event_details = $_POST[ 'cff_show_event_details' ] : $cff_show_event_details = '';
753
  (isset($_POST[ 'cff_show_meta' ]) ) ? $cff_show_meta = $_POST[ 'cff_show_meta' ] : $cff_show_meta = '';
754
  (isset($_POST[ 'cff_show_link' ]) ) ? $cff_show_link = $_POST[ 'cff_show_link' ] : $cff_show_link = '';
755
+ //Post Style
756
+ (isset($_POST[ 'cff_post_bg_color' ]) ) ? $cff_post_bg_color = $_POST[ 'cff_post_bg_color' ] : $cff_post_bg_color = '';
757
+ (isset($_POST[ 'cff_post_rounded' ]) ) ? $cff_post_rounded = $_POST[ 'cff_post_rounded' ] : $cff_post_rounded = '';
758
+ if (isset($_POST[ 'cff_sep_color' ])) $cff_sep_color = $_POST[ 'cff_sep_color' ];
759
+ if (isset($_POST[ 'cff_sep_size' ])) $cff_sep_size = $_POST[ 'cff_sep_size' ];
760
+
761
  //Layout
762
  $options[ 'cff_preset_layout' ] = $cff_preset_layout;
763
  //Include
771
  $options[ 'cff_show_event_details' ] = $cff_show_event_details;
772
  $options[ 'cff_show_meta' ] = $cff_show_meta;
773
  $options[ 'cff_show_link' ] = $cff_show_link;
774
+ //Post Style
775
+ $options[ 'cff_post_bg_color' ] = $cff_post_bg_color;
776
+ $options[ 'cff_post_rounded' ] = $cff_post_rounded;
777
+ $options[ 'cff_sep_color' ] = $cff_sep_color;
778
+ $options[ 'cff_sep_size' ] = $cff_sep_size;
779
+
780
  }
781
  //Update the Typography options
782
  if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
994
 
995
  if (isset($_POST[ 'cff_video_height' ])) $cff_video_height = $_POST[ 'cff_video_height' ];
996
  if (isset($_POST[ 'cff_video_action' ])) $cff_video_action = $_POST[ 'cff_video_action' ];
 
 
997
  if (isset($_POST[ 'cff_open_links' ])) $cff_open_links = $_POST[ 'cff_open_links' ];
998
 
999
  $cff_ajax_val = $_POST[ $cff_ajax ];
1021
 
1022
  $options[ 'cff_video_height' ] = $cff_video_height;
1023
  $options[ 'cff_video_action' ] = $cff_video_action;
 
 
1024
  $options[ 'cff_open_links' ] = $cff_open_links;
1025
 
1026
  update_option( $cff_ajax, $cff_ajax_val );
1149
  <h3><?php _e('Post Types'); ?></h3>
1150
  <tr valign="top">
1151
  <th scope="row"><?php _e('Only show these types of posts:'); ?><br />
1152
+ <i style="color: #666; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable post types, photos, videos and more'); ?></a></i></th>
1153
  <td>
1154
  <div>
1155
  <input name="cff_show_status_type" type="checkbox" id="cff_show_status_type" disabled checked />
1181
  </table>
1182
  <?php submit_button(); ?>
1183
 
1184
+ <a href="https://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
1185
  <?php } //End General tab ?>
1186
  <?php if( $active_tab == 'post_layout' ) { //Start Post Layout tab ?>
1187
  <input type="hidden" name="<?php echo $style_post_layout_hidden_field_name; ?>" value="Y">
1193
  <tr>
1194
  <td>
1195
  <p><?php _e("Choose a layout from the 3 below."); ?>
1196
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable post layouts'); ?></a></i>
1197
  </p>
1198
  </td>
1199
  </tr>
1221
  <table class="form-table cff-disabled">
1222
  <tbody>
1223
  <tr class="cff-media-position">
1224
+ <th><label class="bump-left"><?php _e('Photo/Video Position'); ?></label></th>
1225
  <td>
1226
  <select name="cff_media_position" disabled>
1227
+ <option>Below Text</option>
1228
+ <option>Above Text</option>
1229
  </select>
1230
  <i style="color: #666; font-size: 11px; margin-left: 5px;">Only applies to Full-width layout</i>
1231
  </td>
1232
  </tr>
1233
  <tr>
1234
+ <th><label class="bump-left"><?php _e('Always use the Full-width layout when feed is narrow?'); ?></label></th>
1235
  <td>
1236
+ <input type="checkbox" id="cff_enable_narrow" disabled />
1237
  <label for="cff_enable_narrow"><?php _e('Yes'); ?></label>
1238
  <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
1239
  <p class="cff-tooltip cff-more-info"><?php _e("When displaying posts in either a narrow column or on a mobile device the plugin will automatically default to using the 'Full-width' layout as it's better suited to narrow sizes."); ?></p>
1248
  <tbody>
1249
  <tr valign="top">
1250
  <th scope="row"><?php _e('Include the following in posts: <i style="font-size: 11px;">(when applicable)</i>'); ?>
1251
+ <br /><i style="color: #666; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable all of these options'); ?></a></i></th>
1252
  <td>
1253
  <div>
1254
  <input name="cff_show_author" type="checkbox" id="cff_show_author" <?php if($cff_show_author == true) echo "checked"; ?> />
1294
  </tr>
1295
  </tbody>
1296
  </table>
1297
+
1298
+ <hr />
1299
+ <h3><?php _e('Post Style'); ?></h3>
1300
+ <table class="form-table">
1301
+ <tbody>
1302
+ <tr valign="top">
1303
+ <th class="bump-left" scope="row"><?php _e('Background Color'); ?></th>
1304
+ <td>
1305
+ <input name="cff_post_bg_color" value="#<?php esc_attr_e( str_replace('#', '', $cff_post_bg_color) ); ?>" class="cff-colorpicker" />
1306
+ </td>
1307
+ </tr>
1308
+ <tr valign="top">
1309
+ <th class="bump-left" scope="row"><?php _e('Rounded Corner Size'); ?></th>
1310
+ <td>
1311
+ <input name="cff_post_rounded" type="text" value="<?php esc_attr_e( $cff_post_rounded ); ?>" size="3" />px <span><i style="color: #666; font-size: 11px; margin-left: 5px;">Eg. 5</i></span>
1312
+ </td>
1313
+ </tr>
1314
+ <tr valign="top">
1315
+ <th class="bump-left" scope="row"><label><?php _e('Separating Line Color'); ?></label></th>
1316
+ <td>
1317
+ <input name="cff_sep_color" value="#<?php esc_attr_e( str_replace('#', '', $cff_sep_color) ); ?>" class="cff-colorpicker" /><i style="color: #666; font-size: 11px; margin-left: 5px; position: relative; top: -10px;"><?php _e("Doesn't apply if you have a background color applied to your posts"); ?></i>
1318
+ </td>
1319
+ </tr>
1320
+ <tr valign="top">
1321
+ <th class="bump-left" scope="row"><label><?php _e('Separating Line Thickness'); ?></label></th>
1322
+ <td>
1323
+ <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>
1324
+ </td>
1325
+ </tr>
1326
+ </tbody>
1327
+ </table>
1328
 
1329
  <?php submit_button(); ?>
1330
+ <a href="https://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
1331
  <?php } //End Post Layout tab ?>
1332
  <?php if( $active_tab == 'typography' ) { //Start Typography tab ?>
1333
  <input type="hidden" name="<?php echo $style_typography_hidden_field_name; ?>" value="Y">
1693
  <tr>
1694
  <th><label for="cff_date_position" class="bump-left"><?php _e('Position'); ?></label></th>
1695
  <td>
1696
+ <select name="cff_date_position" style="width: 280px;">
1697
+ <option value="author" <?php if($cff_date_position == "author") echo 'selected="selected"' ?> >Immediately under the post author</option>
1698
+ <option value="above" <?php if($cff_date_position == "above") echo 'selected="selected"' ?> >At the top of the post</option>
1699
+ <option value="below" <?php if($cff_date_position == "below") echo 'selected="selected"' ?> >At the bottom of the post</option>
1700
  </select>
1701
  </td>
1702
  </tr>
1864
  <th><label for="cff_date_custom" class="bump-left"><?php _e('Custom format'); ?></label></th>
1865
  <td>
1866
  <input name="cff_date_custom" type="text" value="<?php esc_attr_e( $cff_date_custom ); ?>" size="10" placeholder="Eg. F j, Y" />
1867
+ <a href="https://smashballoon.com/custom-facebook-feed/docs/date/" class="cff-external-link" target="_blank"><?php _e('Examples'); ?></a>
1868
  </td>
1869
  </tr>
1870
  <tr>
2115
  <th><label for="cff_event_date_custom" class="bump-left"><?php _e('Custom event date format'); ?></label></th>
2116
  <td>
2117
  <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" />
2118
+ <a href="https://smashballoon.com/custom-facebook-feed/docs/date/" class="cff-external-link" target="_blank"><?php _e('Examples'); ?></a>
2119
  </td>
2120
  </tr>
2121
  </tbody>
2244
  <?php submit_button(); ?>
2245
  </div>
2246
 
2247
+ <a href="https://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
2248
 
2249
  <?php } //End Typography tab ?>
2250
  <?php if( $active_tab == 'misc' ) { //Start Misc tab ?>
2251
  <input type="hidden" name="<?php echo $style_misc_hidden_field_name; ?>" value="Y">
2252
  <br />
2253
+ <h3><?php _e('Likes, Shares and Comments'); ?></h3><i style="color: #666; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/" target="_blank"><?php _e('Upgrade to Pro to enable likes, shares and comments'); ?></a></i>
2254
 
2255
  <hr />
2256
  <h3><?php _e('Like Box'); ?></h3>
2337
  <tr valign="top">
2338
  <td>
2339
  <?php _e('Enter your own custom CSS in the box below'); ?>
2340
+ <i style="margin-left: 5px; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank"><?php _e('See some examples'); ?></a></i>
2341
  </td>
2342
  </tr>
2343
  <tr valign="top">
2353
  <tr valign="top">
2354
  <td>
2355
  <?php _e('Enter your own custom JavaScript/jQuery in the box below'); ?>
2356
+ <i style="margin-left: 5px; font-size: 11px;"><a href="https://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank"><?php _e('See some examples'); ?></a></i>
2357
  </td>
2358
  </tr>
2359
  <tr valign="top">
2365
  </table>
2366
 
2367
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2368
  <hr />
2369
  <h3><?php _e('Misc Settings'); ?></h3>
2370
  <table class="form-table">
2382
  </table>
2383
 
2384
  <?php submit_button(); ?>
2385
+ <a href="https://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
2386
  <?php } //End Misc tab ?>
2387
 
2388
 
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.9.9.3
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -68,6 +68,10 @@ function display_cff($atts) {
68
  'layout' => isset($options[ 'cff_preset_layout' ]) ? $options[ 'cff_preset_layout' ] : '',
69
  'include' => $include_string,
70
  'exclude' => '',
 
 
 
 
71
  //Typography
72
  'textformat' => isset($options[ 'cff_title_format' ]) ? $options[ 'cff_title_format' ] : '',
73
  'textsize' => isset($options[ 'cff_title_size' ]) ? $options[ 'cff_title_size' ] : '',
@@ -167,6 +171,7 @@ function display_cff($atts) {
167
  'facebooklinktext' => isset($options[ 'cff_facebook_link_text' ]) ? $options[ 'cff_facebook_link_text' ] : '',
168
  'photostext' => isset($options[ 'cff_translate_photos_text' ]) ? $options[ 'cff_translate_photos_text' ] : ''
169
  ), $atts);
 
170
  /********** GENERAL **********/
171
  $cff_page_type = $atts[ 'pagetype' ];
172
  ($cff_page_type == 'group') ? $cff_is_group = true : $cff_is_group = false;
@@ -454,10 +459,20 @@ function display_cff($atts) {
454
  //Need to set a color otherwise the CSS is invalid
455
  $cff_sep_color = 'fff';
456
  }
 
 
 
 
 
 
457
  //CFF item styles
458
- $cff_item_styles = 'style="';
459
- $cff_item_styles .= 'border-bottom: ' . $cff_sep_size . 'px solid #' . str_replace('#', '', $cff_sep_color) . '; ';
460
- $cff_item_styles .= '"';
 
 
 
 
461
 
462
  //Text limits
463
  $title_limit = $atts['textlength'];
@@ -485,8 +500,12 @@ function display_cff($atts) {
485
  $show_posts = $atts['num'];
486
  if (empty($show_posts)) $show_posts = 25;
487
  if ( $show_posts == 0 || $show_posts == 'undefined' ) $show_posts = 25;
 
 
 
 
488
  //If there's no Access Token then use the default
489
- if ($access_token == '') $access_token = '1436737606570258|MGh1BX4_b_D9HzJtKe702cwMRPI';
490
  //Check whether a Page ID has been defined
491
  if ($page_id == '') {
492
  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=YOUR_PAGE_ID_HERE].<br /><br />";
@@ -624,8 +643,13 @@ function display_cff($atts) {
624
  if ( false === ( $posts_json = get_transient( $transient_name ) ) || $posts_json === null ) {
625
  //Get the contents of the Facebook page
626
  $posts_json = cff_fetchUrl($cff_posts_json_url);
627
- //Cache the JSON
628
- set_transient( $transient_name, $posts_json, $cache_seconds );
 
 
 
 
 
629
  } else {
630
  $posts_json = get_transient( $transient_name );
631
  //If we can't find the transient then fall back to just getting the json from the api
@@ -635,10 +659,16 @@ function display_cff($atts) {
635
  $posts_json = cff_fetchUrl($cff_posts_json_url);
636
  }
637
 
638
-
639
 
640
  //Interpret data with JSON
641
  $FBdata = json_decode($posts_json);
 
 
 
 
 
 
 
642
  //***STARTS POSTS LOOP***
643
  foreach ($FBdata->data as $news )
644
  {
@@ -751,16 +781,32 @@ function display_cff($atts) {
751
  }
752
  }
753
 
 
 
 
 
 
 
 
 
 
754
  //POST AUTHOR
755
  $cff_author = '<div class="cff-author"><a href="https://facebook.com/' . $news->from->id . '" '.$target.' title="'.$news->from->name.' on Facebook" '.$cff_author_styles.'>';
756
-
757
  //Set the author image as a variable. If it already exists then don't query the api for it again.
758
  $cff_author_img_var = '$cff_author_img_' . $news->from->id;
759
  if ( !isset($$cff_author_img_var) ) $$cff_author_img_var = 'https://graph.facebook.com/' . $news->from->id . '/picture?type=square';
760
  $cff_author .= '<img src="'.$$cff_author_img_var.'" title="'.$news->from->name.'" alt="'.$news->from->name.'" width=50 height=50>';
761
- $cff_author .= '<span class="cff-page-name">'.$news->from->name.'</span>';
 
 
 
 
 
 
 
762
  $cff_author .= '</a></div>';
763
 
 
764
  //POST TEXT
765
  $cff_translate_photos_text = $atts['photostext'];
766
  if (!isset($cff_translate_photos_text) || empty($cff_translate_photos_text)) $cff_translate_photos_text = 'photos';
@@ -891,7 +937,7 @@ function display_cff($atts) {
891
  if (!empty($body_limit)) {
892
  if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
893
  }
894
- $cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_autolink( htmlspecialchars($description_text) ) . '</span></p>';
895
 
896
  //If the post text and description/caption are the same then don't show the description
897
  if($post_text == $description_text) $cff_description = '';
@@ -924,12 +970,6 @@ function display_cff($atts) {
924
  $cff_shared_link .= '</div>';
925
  }
926
 
927
- //DATE
928
- $cff_date_formatting = $atts[ 'dateformat' ];
929
- $cff_date_custom = $atts[ 'datecustom' ];
930
-
931
- $post_time = $news->created_time;
932
- $cff_date = '<p class="cff-date" '.$cff_date_styles.'>'. $cff_date_before . ' ' . cff_getdate(strtotime($post_time), $cff_date_formatting, $cff_date_custom) . ' ' . $cff_date_after . '</p>';
933
  //EVENT
934
  $cff_event = '';
935
  if ($cff_show_event_title || $cff_show_event_details) {
@@ -965,12 +1005,15 @@ function display_cff($atts) {
965
 
966
  //Interpret data with JSON
967
  $event_object = json_decode($event_json);
 
968
  //Event date
969
- isset( $event_object->start_time ) ? $event_time = $event_object->start_time : $event_time = '';
 
970
  //If timezone migration is enabled then remove last 5 characters
971
  if ( strlen($event_time) == 24 ) $event_time = substr($event_time, 0, -5);
972
- $cff_event_date = '';
973
- 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>';
 
974
  //EVENT
975
  //Display the event details
976
  $cff_event .= '<div class="cff-details">';
@@ -1078,6 +1121,7 @@ function display_cff($atts) {
1078
  if ($cff_post_type == 'status') $cff_post_item .= 'cff-status-post';
1079
  if ($cff_post_type == 'offer') $cff_post_item .= 'cff-offer-post';
1080
  if ($cff_album) $cff_post_item .= ' cff-album';
 
1081
  $cff_post_item .= ' author-'. cff_to_slug($news->from->name) .'" id="'. $news->id .'" ' . $cff_item_styles . '>';
1082
 
1083
  //POST AUTHOR
@@ -1143,7 +1187,7 @@ function display_cff($atts) {
1143
  ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
1144
  if ($cff_title_link) $cff_link_hashtags = 'false';
1145
  $cff_content .= '<script type="text/javascript">var cfflinkhashtags = "' . $cff_link_hashtags . '";</script>';
1146
- $cff_content .= '<script type="text/javascript" src="' . plugins_url( '/js/cff-scripts.js?8' , __FILE__ ) . '"></script>';
1147
  }
1148
 
1149
  $cff_content .= '</div>';
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add a completely customizable Facebook feed to your WordPress site
6
+ Version: 2.0
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
68
  'layout' => isset($options[ 'cff_preset_layout' ]) ? $options[ 'cff_preset_layout' ] : '',
69
  'include' => $include_string,
70
  'exclude' => '',
71
+ //Post Style
72
+ 'postbgcolor' => isset($options[ 'cff_post_bg_color' ]) ? $options[ 'cff_post_bg_color' ] : '',
73
+ 'postcorners' => isset($options[ 'cff_post_rounded' ]) ? $options[ 'cff_post_rounded' ] : '',
74
+
75
  //Typography
76
  'textformat' => isset($options[ 'cff_title_format' ]) ? $options[ 'cff_title_format' ] : '',
77
  'textsize' => isset($options[ 'cff_title_size' ]) ? $options[ 'cff_title_size' ] : '',
171
  'facebooklinktext' => isset($options[ 'cff_facebook_link_text' ]) ? $options[ 'cff_facebook_link_text' ] : '',
172
  'photostext' => isset($options[ 'cff_translate_photos_text' ]) ? $options[ 'cff_translate_photos_text' ] : ''
173
  ), $atts);
174
+
175
  /********** GENERAL **********/
176
  $cff_page_type = $atts[ 'pagetype' ];
177
  ($cff_page_type == 'group') ? $cff_is_group = true : $cff_is_group = false;
459
  //Need to set a color otherwise the CSS is invalid
460
  $cff_sep_color = 'fff';
461
  }
462
+
463
+ $cff_post_bg_color = $atts['postbgcolor'];
464
+ $cff_post_rounded = $atts['postcorners'];
465
+ ($cff_post_bg_color !== '#' && $cff_post_bg_color !== '') ? $cff_post_bg_color_check = true : $cff_post_bg_color_check = false;
466
+ ($cff_sep_color !== '#' && $cff_sep_color !== '') ? $cff_sep_color_check = true : $cff_sep_color_check = false;
467
+
468
  //CFF item styles
469
+ if( $cff_sep_color_check || $cff_post_bg_color_check ){
470
+ $cff_item_styles = 'style="';
471
+ if($cff_sep_color_check && !$cff_post_bg_color_check) $cff_item_styles .= 'border-bottom: ' . $cff_sep_size . 'px solid #' . str_replace('#', '', $cff_sep_color) . '; ';
472
+ if($cff_post_bg_color_check) $cff_item_styles .= 'background-color: ' . $cff_post_bg_color . '; ';
473
+ if(isset($cff_post_rounded)) $cff_item_styles .= '-webkit-border-radius: ' . $cff_post_rounded . 'px; -moz-border-radius: ' . $cff_post_rounded . 'px; border-radius: ' . $cff_post_rounded . 'px; ';
474
+ $cff_item_styles .= '"';
475
+ }
476
 
477
  //Text limits
478
  $title_limit = $atts['textlength'];
500
  $show_posts = $atts['num'];
501
  if (empty($show_posts)) $show_posts = 25;
502
  if ( $show_posts == 0 || $show_posts == 'undefined' ) $show_posts = 25;
503
+
504
+ //If the 'Enter my own Access Token' box is unchecked then don't use the user's access token, even if there's one in the field
505
+ get_option('cff_show_access_token') ? $cff_show_access_token = true : $cff_show_access_token = false;
506
+
507
  //If there's no Access Token then use the default
508
+ if ($access_token == '' || !$cff_show_access_token) $access_token = '1436737606570258|MGh1BX4_b_D9HzJtKe702cwMRPI';
509
  //Check whether a Page ID has been defined
510
  if ($page_id == '') {
511
  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=YOUR_PAGE_ID_HERE].<br /><br />";
643
  if ( false === ( $posts_json = get_transient( $transient_name ) ) || $posts_json === null ) {
644
  //Get the contents of the Facebook page
645
  $posts_json = cff_fetchUrl($cff_posts_json_url);
646
+
647
+ //Check whether any data is returned from the API. If it isn't then don't cache the error response and instead keep checking the API on every page load until data is returned.
648
+ $FBdata = json_decode($posts_json);
649
+ if( !empty($FBdata->data) ) {
650
+ //Cache the JSON
651
+ set_transient( $transient_name, $posts_json, $cache_seconds );
652
+ }
653
  } else {
654
  $posts_json = get_transient( $transient_name );
655
  //If we can't find the transient then fall back to just getting the json from the api
659
  $posts_json = cff_fetchUrl($cff_posts_json_url);
660
  }
661
 
 
662
 
663
  //Interpret data with JSON
664
  $FBdata = json_decode($posts_json);
665
+
666
+ //If there's no data then show a pretty error message
667
+ if( empty($FBdata->data) ) {
668
+ $cff_content .= 'Unable to display Facebook posts. For solutions, please refer to the 1st question on our <a href="https://smashballoon.com/custom-facebook-feed/faq/troubleshooting/">Troubleshooting page</a>.';
669
+ return $cff_content;
670
+ }
671
+
672
  //***STARTS POSTS LOOP***
673
  foreach ($FBdata->data as $news )
674
  {
781
  }
782
  }
783
 
784
+ //DATE
785
+ $cff_date_formatting = $atts[ 'dateformat' ];
786
+ $cff_date_custom = $atts[ 'datecustom' ];
787
+
788
+ $post_time = $news->created_time;
789
+ $cff_date = '<p class="cff-date" '.$cff_date_styles.'>'. $cff_date_before . ' ' . cff_getdate(strtotime($post_time), $cff_date_formatting, $cff_date_custom) . ' ' . $cff_date_after;
790
+ if($cff_date_position == 'below') $cff_date .= '<span class="cff-date-dot">&nbsp;&middot;&nbsp;&nbsp;</span>';
791
+ $cff_date .= '</p>';
792
+
793
  //POST AUTHOR
794
  $cff_author = '<div class="cff-author"><a href="https://facebook.com/' . $news->from->id . '" '.$target.' title="'.$news->from->name.' on Facebook" '.$cff_author_styles.'>';
 
795
  //Set the author image as a variable. If it already exists then don't query the api for it again.
796
  $cff_author_img_var = '$cff_author_img_' . $news->from->id;
797
  if ( !isset($$cff_author_img_var) ) $$cff_author_img_var = 'https://graph.facebook.com/' . $news->from->id . '/picture?type=square';
798
  $cff_author .= '<img src="'.$$cff_author_img_var.'" title="'.$news->from->name.'" alt="'.$news->from->name.'" width=50 height=50>';
799
+
800
+ if($cff_date_position !== 'above' && $cff_date_position !== 'below'){
801
+ $cff_author .= '<p class="cff-page-name cff-author-date">'.$news->from->name.'</p>';
802
+ $cff_author .= $cff_date;
803
+ } else {
804
+ $cff_author .= '<span class="cff-page-name">'.$news->from->name.'</span>';
805
+ }
806
+
807
  $cff_author .= '</a></div>';
808
 
809
+
810
  //POST TEXT
811
  $cff_translate_photos_text = $atts['photostext'];
812
  if (!isset($cff_translate_photos_text) || empty($cff_translate_photos_text)) $cff_translate_photos_text = 'photos';
937
  if (!empty($body_limit)) {
938
  if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
939
  }
940
+ $cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_autolink( htmlspecialchars($description_text) ) . ' </span></p>';
941
 
942
  //If the post text and description/caption are the same then don't show the description
943
  if($post_text == $description_text) $cff_description = '';
970
  $cff_shared_link .= '</div>';
971
  }
972
 
 
 
 
 
 
 
973
  //EVENT
974
  $cff_event = '';
975
  if ($cff_show_event_title || $cff_show_event_details) {
1005
 
1006
  //Interpret data with JSON
1007
  $event_object = json_decode($event_json);
1008
+
1009
  //Event date
1010
+ $event_time = $event_object->start_time;
1011
+ isset($event_object->end_time) ? $event_end_time = ' - ' . cff_eventdate(strtotime($event_object->end_time), $cff_event_date_formatting, $cff_event_date_custom) : $event_end_time = '';
1012
  //If timezone migration is enabled then remove last 5 characters
1013
  if ( strlen($event_time) == 24 ) $event_time = substr($event_time, 0, -5);
1014
+ 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) . $event_end_time.'</p>';
1015
+
1016
+
1017
  //EVENT
1018
  //Display the event details
1019
  $cff_event .= '<div class="cff-details">';
1121
  if ($cff_post_type == 'status') $cff_post_item .= 'cff-status-post';
1122
  if ($cff_post_type == 'offer') $cff_post_item .= 'cff-offer-post';
1123
  if ($cff_album) $cff_post_item .= ' cff-album';
1124
+ if ($cff_post_bg_color_check) $cff_post_item .= ' cff-box';
1125
  $cff_post_item .= ' author-'. cff_to_slug($news->from->name) .'" id="'. $news->id .'" ' . $cff_item_styles . '>';
1126
 
1127
  //POST AUTHOR
1187
  ($cff_link_hashtags == 'true' || $cff_link_hashtags == 'on') ? $cff_link_hashtags = 'true' : $cff_link_hashtags = 'false';
1188
  if ($cff_title_link) $cff_link_hashtags = 'false';
1189
  $cff_content .= '<script type="text/javascript">var cfflinkhashtags = "' . $cff_link_hashtags . '";</script>';
1190
+ $cff_content .= '<script type="text/javascript" src="' . plugins_url( '/js/cff-scripts.js?10' , __FILE__ ) . '"></script>';
1191
  }
1192
 
1193
  $cff_content .= '</div>';
js/cff-scripts.js CHANGED
@@ -57,21 +57,24 @@ jQuery(document).ready(function() {
57
  }
58
 
59
  //Link hashtags
60
- if(cfflinkhashtags == 'true'){
61
- var str = $self.find('.cff-text').html(),
62
- descstr = $self.find('.cff-post-desc').html(),
63
- regex = /(?:\s|^)(?:#(?!\d+(?:\s|$)))(\w+)(?=\s|$)/gi,
64
- linkcolor = $self.find('.cff-text').attr('rel');
65
 
66
- function replacer(hash){
67
- var replacementString = jQuery.trim(hash);
68
- return ' <a href="https://www.facebook.com/hashtag/'+ replacementString.substring(1) +'" target="_blank" style="color: #' + linkcolor + '">' + replacementString + '</a>';
69
- }
 
 
70
  //Replace hashtags in text
71
- $self.find('.cff-text').html( str.replace( regex , replacer ) );
72
- //Replace hashtags in desc
73
- if( $self.find('.cff-post-desc').length ) $self.find('.cff-post-desc').html( descstr.replace( regex , replacer ) );
74
  }
 
 
 
75
 
76
  });
77
  });
57
  }
58
 
59
  //Link hashtags
60
+ var cffTextStr = $self.find('.cff-text').html(),
61
+ cffDescStr = $self.find('.cff-post-desc').html(),
62
+ regex = /(?:\s|^)(?:#(?!\d+(?:\s|$)))(\w+)(?=\s|$)/gi,
63
+ linkcolor = $self.find('.cff-text').attr('rel');
 
64
 
65
+ function replacer(hash){
66
+ var replacementString = jQuery.trim(hash);
67
+ return ' <a href="https://www.facebook.com/hashtag/'+ replacementString.substring(1) +'" target="_blank" style="color: #' + linkcolor + '">' + replacementString + '</a>';
68
+ }
69
+
70
+ if(cfflinkhashtags == 'true'){
71
  //Replace hashtags in text
72
+ var $cffText = $self.find('.cff-text');
73
+ if($cffText.length > 0) $cffText.html( cffTextStr.replace( regex , replacer ) );
 
74
  }
75
+
76
+ //Replace hashtags in desc
77
+ if( $self.find('.cff-post-desc').length > 0 ) $self.find('.cff-post-desc').html( cffDescStr.replace( regex , replacer ) );
78
 
79
  });
80
  });