Version Description
- New: Added an 'exclude' shortcode option to allow you to easily exclude specific parts of the post
- New: Timeline events are now cached to help reduce page load time
- New: Added an option for when the WordPress theme is loading the feed via AJAX so that the JavaScript runs after the feed has been loaded into the page
- Tweak: Changed author images back to loading via PHP rather than JavaScript due to issues with certain WordPress themes
- Fix: Reset the timezone after the shortcode has run
- Fix: Fixed an issue with the shared link descriptions not being hidden when specified
- Fix: Fixed a rare issue with the 'textlink' shortcode option
- Fix: Use a fallback JSON string if unable to find the cached version in the database
Download this release
Release Info
Developer | smashballoon |
Plugin | Custom Facebook Feed |
Version | 1.8.1 |
Comparing to | |
See all releases |
Code changes from version 1.8.0 to 1.8.1
- README.txt +12 -2
- css/cff-admin-style.css +23 -0
- custom-facebook-feed-admin.php +30 -17
- custom-facebook-feed.php +61 -6
- js/cff-scripts.js +0 -4
README.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
|
|
3 |
Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, custom, customizable, seo, responsive, mobile, social
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.8.1
|
6 |
-
Stable tag: 1.8.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H5XFD33R3FHMG
|
@@ -131,9 +131,19 @@ You can embed your Facebook feed directly into a template file by using the Word
|
|
131 |
|
132 |
== Changelog ==
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
= 1.8.0 =
|
135 |
* New: Added a built-in color picker
|
136 |
-
* New: Added class to posts based on the author
|
137 |
* Tweak: Now loads the author avatar image in using JavaScript to help speed up load times
|
138 |
* Tweak: Now automatically set the post limit based on the number of posts to be displayed
|
139 |
* Tweak: Core improvements to the way posts are output
|
3 |
Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, custom, customizable, seo, responsive, mobile, social
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.8.1
|
6 |
+
Stable tag: 1.8.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=H5XFD33R3FHMG
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 1.8.1 =
|
135 |
+
* New: Added an 'exclude' shortcode option to allow you to easily exclude specific parts of the post
|
136 |
+
* New: Timeline events are now cached to help reduce page load time
|
137 |
+
* New: Added an option for when the WordPress theme is loading the feed via AJAX so that the JavaScript runs after the feed has been loaded into the page
|
138 |
+
* Tweak: Changed author images back to loading via PHP rather than JavaScript due to issues with certain WordPress themes
|
139 |
+
* Fix: Reset the timezone after the shortcode has run
|
140 |
+
* Fix: Fixed an issue with the shared link descriptions not being hidden when specified
|
141 |
+
* Fix: Fixed a rare issue with the 'textlink' shortcode option
|
142 |
+
* Fix: Use a fallback JSON string if unable to find the cached version in the database
|
143 |
+
|
144 |
= 1.8.0 =
|
145 |
* New: Added a built-in color picker
|
146 |
+
* New: Added class to posts based on the author to allow for independent styling
|
147 |
* Tweak: Now loads the author avatar image in using JavaScript to help speed up load times
|
148 |
* Tweak: Now automatically set the post limit based on the number of posts to be displayed
|
149 |
* Tweak: Core improvements to the way posts are output
|
css/cff-admin-style.css
CHANGED
@@ -13,6 +13,29 @@
|
|
13 |
#cff-admin .cff-tooltip li{
|
14 |
padding: 4px 0;
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
#cff-admin hr{
|
17 |
border: none;
|
18 |
margin: 25px 0;
|
13 |
#cff-admin .cff-tooltip li{
|
14 |
padding: 4px 0;
|
15 |
}
|
16 |
+
#cff-admin .cff-tooltip-link,
|
17 |
+
#cff-admin .cff-external-link{
|
18 |
+
font-size: 13px;
|
19 |
+
margin-left: 10px;
|
20 |
+
}
|
21 |
+
#cff-admin .cff-more-info{
|
22 |
+
padding: 10px 15px;
|
23 |
+
margin: 10px 0;
|
24 |
+
font-size: 13px;
|
25 |
+
background: #f9f9f9;
|
26 |
+
background: rgba(255,255,255,0.8);
|
27 |
+
|
28 |
+
-moz-border-radius: 8px;
|
29 |
+
-webkit-border-radius: 8px;
|
30 |
+
border-radius: 8px;
|
31 |
+
}
|
32 |
+
#cff-admin .postbox .cff-more-info{
|
33 |
+
background: #eee;
|
34 |
+
background: rgba(0,0,0,0.05);
|
35 |
+
}
|
36 |
+
#cff-admin .cff-more-info p{
|
37 |
+
font-size: 13px;
|
38 |
+
}
|
39 |
#cff-admin hr{
|
40 |
border: none;
|
41 |
margin: 25px 0;
|
custom-facebook-feed-admin.php
CHANGED
@@ -44,6 +44,7 @@ function cff_settings_page() {
|
|
44 |
$cff_cache_time = 'cff_cache_time';
|
45 |
$cff_cache_time_unit = 'cff_cache_time_unit';
|
46 |
$cff_locale = 'cff_locale';
|
|
|
47 |
// Read in existing option value from database
|
48 |
$access_token_val = get_option( $access_token );
|
49 |
$page_id_val = get_option( $page_id );
|
@@ -66,6 +67,7 @@ function cff_settings_page() {
|
|
66 |
$cff_cache_time_val = $_POST[ $cff_cache_time ];
|
67 |
$cff_cache_time_unit_val = $_POST[ $cff_cache_time_unit ];
|
68 |
$cff_locale_val = $_POST[ $cff_locale ];
|
|
|
69 |
// Save the posted value in the database
|
70 |
update_option( $access_token, $access_token_val );
|
71 |
update_option( $page_id, $page_id_val );
|
@@ -76,6 +78,7 @@ function cff_settings_page() {
|
|
76 |
update_option( $cff_cache_time, $cff_cache_time_val );
|
77 |
update_option( $cff_cache_time_unit, $cff_cache_time_unit_val );
|
78 |
update_option( $cff_locale, $cff_locale_val );
|
|
|
79 |
|
80 |
//Delete the transient for the main page ID
|
81 |
delete_transient( 'cff_posts_json_' .$page_id_val );
|
@@ -133,22 +136,22 @@ function cff_settings_page() {
|
|
133 |
<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("How do I get an Access Token?"); ?></a>
|
134 |
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123|ABC2fvp5h9tJe4-5-AbC123.</i>
|
135 |
|
136 |
-
<div class="cff-profile-error cff-access-token">
|
137 |
<?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>"); ?>
|
138 |
</div>
|
139 |
|
140 |
-
<div class="cff-tooltip">
|
141 |
<?php _e("<p>In order to use the plugin, Facebook requires you to obtain an access token to verify that you're authorized to access their data. Don't worry though, this is really easy to do. Just follow these <a href='http://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>.</p><p><b>Already have an App ID and App Secret?</b> 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>"); ?>
|
142 |
</div>
|
143 |
</td>
|
144 |
</tr>
|
145 |
<tr valign="top">
|
146 |
-
<th scope="row"><?php _e('Facebook Page ID (or slug)');
|
147 |
<td>
|
148 |
<input name="cff_page_id" id="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
|
149 |
<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What\'s my Page ID?'); ?></a>
|
150 |
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123 or smashballoon</i>
|
151 |
-
<div class="cff-tooltip">
|
152 |
<ul>
|
153 |
<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>'); ?>
|
154 |
<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>
|
@@ -166,7 +169,7 @@ function cff_settings_page() {
|
|
166 |
<option value="group" <?php if($cff_page_type_val == "group") echo 'selected="selected"' ?> ><?php _e('Group'); ?></option>
|
167 |
<option value="profile" <?php if($cff_page_type_val == "profile") echo 'selected="selected"' ?> ><?php _e('Profile'); ?></option>
|
168 |
</select>
|
169 |
-
<div class="cff-profile-error cff-page-type">
|
170 |
<?php _e("<p>Due to Facebook's privacy policy you're not able to display posts from a personal profile, only from a public page or group.</p><p>If you're using a profile to represent a business, organization, product, public figure or the like, then Facebook recommends <a href='http://www.facebook.com/help/175644189234902/' target='_blank'>converting your profile to a page</a>. There are many advantages to using pages over profiles, and once you've converted then the plugin will be able to successfully retrieve and display all of your posts.</p>"); ?>
|
171 |
</div>
|
172 |
</td>
|
@@ -194,11 +197,11 @@ function cff_settings_page() {
|
|
194 |
</td>
|
195 |
</tr>
|
196 |
<tr valign="top">
|
197 |
-
<th scope="row"><?php _e('
|
198 |
<td>
|
199 |
<input name="cff_post_limit" type="text" value="<?php esc_attr_e( $cff_post_limit_val ); ?>" size="4" />
|
200 |
-
<i style="color: #666; font-size: 11px;">Eg. 50</i> <a class="cff-tooltip-link
|
201 |
-
<p class="cff-tooltip"><?php _e(
|
202 |
</td>
|
203 |
</tr>
|
204 |
<tr valign="top">
|
@@ -210,8 +213,8 @@ function cff_settings_page() {
|
|
210 |
<option value="hours" <?php if($cff_cache_time_unit_val == "hours") echo 'selected="selected"' ?> ><?php _e('Hours'); ?></option>
|
211 |
<option value="days" <?php if($cff_cache_time_unit_val == "days") echo 'selected="selected"' ?> ><?php _e('Days'); ?></option>
|
212 |
</select>
|
213 |
-
<a class="cff-tooltip-link
|
214 |
-
<p class="cff-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>
|
215 |
</td>
|
216 |
</tr>
|
217 |
|
@@ -300,6 +303,16 @@ function cff_settings_page() {
|
|
300 |
<i style="color: #666; font-size: 11px;"><?php _e('Select a language'); ?></i>
|
301 |
</td>
|
302 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
|
304 |
</tbody>
|
305 |
</table>
|
@@ -444,7 +457,7 @@ function cff_style_page() {
|
|
444 |
'cff_feed_padding' => '',
|
445 |
'cff_like_box_position' => 'bottom',
|
446 |
'cff_like_box_outside' => false,
|
447 |
-
'cff_likebox_width' => '
|
448 |
'cff_like_box_faces' => false,
|
449 |
'cff_like_box_border' => false,
|
450 |
|
@@ -1379,7 +1392,7 @@ function cff_style_page() {
|
|
1379 |
</select>
|
1380 |
|
1381 |
<i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);" id="cff-translate-date"><?php _e('Translate this'); ?></a></i>
|
1382 |
-
<div class="cff-tooltip">
|
1383 |
<div class="cff-tooltip-table">
|
1384 |
<p style="margin-bottom: 15px;"><?php _e('Translate the text below into the language you would like to use:'); ?></p>
|
1385 |
|
@@ -1536,7 +1549,7 @@ function cff_style_page() {
|
|
1536 |
<th><label for="cff_date_custom" class="bump-left"><?php _e('Custom format'); ?></label></th>
|
1537 |
<td>
|
1538 |
<input name="cff_date_custom" type="text" value="<?php esc_attr_e( $cff_date_custom ); ?>" size="10" placeholder="Eg. F j, Y" />
|
1539 |
-
<i style="margin-left: 5px; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/docs/date/" target="_blank"><?php _e('Examples'); ?></a></i>
|
1540 |
</td>
|
1541 |
</tr>
|
1542 |
<tr>
|
@@ -1701,7 +1714,7 @@ function cff_style_page() {
|
|
1701 |
<th><label for="cff_event_date_custom" class="bump-left"><?php _e('Custom event date format'); ?></label></th>
|
1702 |
<td>
|
1703 |
<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" />
|
1704 |
-
<i style="margin-left: 5px; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/docs/date/" target="_blank"><?php _e('Examples'); ?></a></i>
|
1705 |
</td>
|
1706 |
</tr>
|
1707 |
</tbody>
|
@@ -1872,7 +1885,7 @@ function cff_style_page() {
|
|
1872 |
<td>
|
1873 |
<input type="checkbox" name="cff_show_like_box" id="cff_show_like_box" <?php if($cff_show_like_box == true) echo 'checked="checked"' ?> /> <?php _e('Yes'); ?>
|
1874 |
<i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("Why isn't the Like Box showing up?"); ?></a></i>
|
1875 |
-
<p class="cff-tooltip"><?php _e("The most common reason is that you may have an extension installed in your web browser which is blocking the plugin from loading the Like Box from Facebook."); ?></p>
|
1876 |
</td>
|
1877 |
</tr>
|
1878 |
<tr valign="top">
|
@@ -1905,7 +1918,7 @@ function cff_style_page() {
|
|
1905 |
<option value="white" <?php if($cff_like_box_text_color == "white") echo 'selected="selected"' ?> ><?php _e('White'); ?></option>
|
1906 |
</select>
|
1907 |
<i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('Why only these 2 colors?'); ?></a></i>
|
1908 |
-
<p class="cff-tooltip"><?php _e("The styling of the Facebook Like box widget is restricted by Facebook. This means that the only two text colors available are blue and white, intended for either a light of dark color scheme respectively."); ?></p>
|
1909 |
</td>
|
1910 |
</tr>
|
1911 |
<tr valign="top">
|
@@ -2201,7 +2214,7 @@ function cff_style_page() {
|
|
2201 |
} //End Style_Page
|
2202 |
//Enqueue admin styles
|
2203 |
function cff_admin_style() {
|
2204 |
-
wp_register_style( 'custom_wp_admin_css', plugin_dir_url( __FILE__ ) . 'css/cff-admin-style.css?
|
2205 |
wp_enqueue_style( 'custom_wp_admin_css' );
|
2206 |
wp_enqueue_style( 'cff-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3' );
|
2207 |
wp_enqueue_style( 'wp-color-picker' );
|
44 |
$cff_cache_time = 'cff_cache_time';
|
45 |
$cff_cache_time_unit = 'cff_cache_time_unit';
|
46 |
$cff_locale = 'cff_locale';
|
47 |
+
$cff_ajax = 'cff_ajax';
|
48 |
// Read in existing option value from database
|
49 |
$access_token_val = get_option( $access_token );
|
50 |
$page_id_val = get_option( $page_id );
|
67 |
$cff_cache_time_val = $_POST[ $cff_cache_time ];
|
68 |
$cff_cache_time_unit_val = $_POST[ $cff_cache_time_unit ];
|
69 |
$cff_locale_val = $_POST[ $cff_locale ];
|
70 |
+
$cff_ajax_val = $_POST[ $cff_ajax ];
|
71 |
// Save the posted value in the database
|
72 |
update_option( $access_token, $access_token_val );
|
73 |
update_option( $page_id, $page_id_val );
|
78 |
update_option( $cff_cache_time, $cff_cache_time_val );
|
79 |
update_option( $cff_cache_time_unit, $cff_cache_time_unit_val );
|
80 |
update_option( $cff_locale, $cff_locale_val );
|
81 |
+
update_option( $cff_ajax, $cff_ajax_val );
|
82 |
|
83 |
//Delete the transient for the main page ID
|
84 |
delete_transient( 'cff_posts_json_' .$page_id_val );
|
136 |
<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("How do I get an Access Token?"); ?></a>
|
137 |
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123|ABC2fvp5h9tJe4-5-AbC123.</i>
|
138 |
|
139 |
+
<div class="cff-notice cff-profile-error cff-access-token">
|
140 |
<?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>"); ?>
|
141 |
</div>
|
142 |
|
143 |
+
<div class="cff-tooltip cff-more-info">
|
144 |
<?php _e("<p>In order to use the plugin, Facebook requires you to obtain an access token to verify that you're authorized to access their data. Don't worry though, this is really easy to do. Just follow these <a href='http://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>.</p><p><b>Already have an App ID and App Secret?</b> 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>"); ?>
|
145 |
</div>
|
146 |
</td>
|
147 |
</tr>
|
148 |
<tr valign="top">
|
149 |
+
<th scope="row"><?php _e('Facebook Page ID (or slug)'); ?></th>
|
150 |
<td>
|
151 |
<input name="cff_page_id" id="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
|
152 |
<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What\'s my Page ID?'); ?></a>
|
153 |
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123 or smashballoon</i>
|
154 |
+
<div class="cff-tooltip cff-more-info">
|
155 |
<ul>
|
156 |
<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>'); ?>
|
157 |
<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>
|
169 |
<option value="group" <?php if($cff_page_type_val == "group") echo 'selected="selected"' ?> ><?php _e('Group'); ?></option>
|
170 |
<option value="profile" <?php if($cff_page_type_val == "profile") echo 'selected="selected"' ?> ><?php _e('Profile'); ?></option>
|
171 |
</select>
|
172 |
+
<div class="cff-notice cff-profile-error cff-page-type">
|
173 |
<?php _e("<p>Due to Facebook's privacy policy you're not able to display posts from a personal profile, only from a public page or group.</p><p>If you're using a profile to represent a business, organization, product, public figure or the like, then Facebook recommends <a href='http://www.facebook.com/help/175644189234902/' target='_blank'>converting your profile to a page</a>. There are many advantages to using pages over profiles, and once you've converted then the plugin will be able to successfully retrieve and display all of your posts.</p>"); ?>
|
174 |
</div>
|
175 |
</td>
|
197 |
</td>
|
198 |
</tr>
|
199 |
<tr valign="top">
|
200 |
+
<th scope="row"><?php _e('Change the post limit'); ?></th>
|
201 |
<td>
|
202 |
<input name="cff_post_limit" type="text" value="<?php esc_attr_e( $cff_post_limit_val ); ?>" size="4" />
|
203 |
+
<i style="color: #666; font-size: 11px;">Eg. 50</i> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
|
204 |
+
<p class="cff-tooltip cff-more-info"><?php _e("Most users don't need to change the post lmit. The 'limit' is the number of posts retrieved from the Facebook API. By default the plugin retrieves 7 posts more from the Facebook API than you specify in the 'Number of posts to display' field above, as some posts are filtered out. You can alter how many posts are retrieved by manually setting this value. If you choose to retrieve a high number of posts then it will take longer for Facebook to return the posts when the plugin checks for new ones."); ?></p>
|
205 |
</td>
|
206 |
</tr>
|
207 |
<tr valign="top">
|
213 |
<option value="hours" <?php if($cff_cache_time_unit_val == "hours") echo 'selected="selected"' ?> ><?php _e('Hours'); ?></option>
|
214 |
<option value="days" <?php if($cff_cache_time_unit_val == "days") echo 'selected="selected"' ?> ><?php _e('Days'); ?></option>
|
215 |
</select>
|
216 |
+
<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
|
217 |
+
<p class="cff-tooltip cff-more-info"><?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>
|
218 |
</td>
|
219 |
</tr>
|
220 |
|
303 |
<i style="color: #666; font-size: 11px;"><?php _e('Select a language'); ?></i>
|
304 |
</td>
|
305 |
</tr>
|
306 |
+
|
307 |
+
<tr>
|
308 |
+
<th><label for="cff_ajax" class="bump-left"><?php _e('Loading the feed via Ajax?'); ?></label></th>
|
309 |
+
<td>
|
310 |
+
<input name="cff_ajax" type="checkbox" id="cff_ajax" <?php if($cff_ajax_val == true) echo "checked"; ?> />
|
311 |
+
<label for="cff_ajax"><?php _e('Yes'); ?></label>
|
312 |
+
<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
|
313 |
+
<p class="cff-tooltip cff-more-info"><?php _e('Some modern WordPress themes use Ajax to load content into the page after it has loaded. If your theme uses Ajax to load the Custom Facebook Feed content into the page then check this box. If you are not sure then please check with the theme author.'); ?></p>
|
314 |
+
</td>
|
315 |
+
</tr>
|
316 |
|
317 |
</tbody>
|
318 |
</table>
|
457 |
'cff_feed_padding' => '',
|
458 |
'cff_like_box_position' => 'bottom',
|
459 |
'cff_like_box_outside' => false,
|
460 |
+
'cff_likebox_width' => '',
|
461 |
'cff_like_box_faces' => false,
|
462 |
'cff_like_box_border' => false,
|
463 |
|
1392 |
</select>
|
1393 |
|
1394 |
<i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);" id="cff-translate-date"><?php _e('Translate this'); ?></a></i>
|
1395 |
+
<div class="cff-tooltip cff-more-info">
|
1396 |
<div class="cff-tooltip-table">
|
1397 |
<p style="margin-bottom: 15px;"><?php _e('Translate the text below into the language you would like to use:'); ?></p>
|
1398 |
|
1549 |
<th><label for="cff_date_custom" class="bump-left"><?php _e('Custom format'); ?></label></th>
|
1550 |
<td>
|
1551 |
<input name="cff_date_custom" type="text" value="<?php esc_attr_e( $cff_date_custom ); ?>" size="10" placeholder="Eg. F j, Y" />
|
1552 |
+
<i style="margin-left: 5px; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/docs/date/" class="cff-external-link" target="_blank"><?php _e('Examples'); ?></a></i>
|
1553 |
</td>
|
1554 |
</tr>
|
1555 |
<tr>
|
1714 |
<th><label for="cff_event_date_custom" class="bump-left"><?php _e('Custom event date format'); ?></label></th>
|
1715 |
<td>
|
1716 |
<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" />
|
1717 |
+
<i style="margin-left: 5px; font-size: 11px;"><a href="http://smashballoon.com/custom-facebook-feed/docs/date/" class="cff-external-link" target="_blank"><?php _e('Examples'); ?></a></i>
|
1718 |
</td>
|
1719 |
</tr>
|
1720 |
</tbody>
|
1885 |
<td>
|
1886 |
<input type="checkbox" name="cff_show_like_box" id="cff_show_like_box" <?php if($cff_show_like_box == true) echo 'checked="checked"' ?> /> <?php _e('Yes'); ?>
|
1887 |
<i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("Why isn't the Like Box showing up?"); ?></a></i>
|
1888 |
+
<p class="cff-tooltip cff-more-info"><?php _e("The most common reason is that you may have an extension installed in your web browser which is blocking the plugin from loading the Like Box from Facebook."); ?></p>
|
1889 |
</td>
|
1890 |
</tr>
|
1891 |
<tr valign="top">
|
1918 |
<option value="white" <?php if($cff_like_box_text_color == "white") echo 'selected="selected"' ?> ><?php _e('White'); ?></option>
|
1919 |
</select>
|
1920 |
<i style="margin-left: 5px; font-size: 11px;"><a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('Why only these 2 colors?'); ?></a></i>
|
1921 |
+
<p class="cff-tooltip cff-more-info"><?php _e("The styling of the Facebook Like box widget is restricted by Facebook. This means that the only two text colors available are blue and white, intended for either a light of dark color scheme respectively."); ?></p>
|
1922 |
</td>
|
1923 |
</tr>
|
1924 |
<tr valign="top">
|
2214 |
} //End Style_Page
|
2215 |
//Enqueue admin styles
|
2216 |
function cff_admin_style() {
|
2217 |
+
wp_register_style( 'custom_wp_admin_css', plugin_dir_url( __FILE__ ) . 'css/cff-admin-style.css?3', false, '1.0.0' );
|
2218 |
wp_enqueue_style( 'custom_wp_admin_css' );
|
2219 |
wp_enqueue_style( 'cff-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3' );
|
2220 |
wp_enqueue_style( 'wp-color-picker' );
|
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.8.
|
7 |
Author: Smash Balloon
|
8 |
Author URI: http://smashballoon.com/
|
9 |
License: GPLv2 or later
|
@@ -57,6 +57,7 @@ function display_cff($atts) {
|
|
57 |
'cachetime' => get_option('cff_cache_time'),
|
58 |
'cacheunit' => get_option('cff_cache_time_unit'),
|
59 |
'locale' => get_option('cff_locale'),
|
|
|
60 |
'width' => isset($options[ 'cff_feed_width' ]) ? $options[ 'cff_feed_width' ] : '',
|
61 |
'height' => isset($options[ 'cff_feed_height' ]) ? $options[ 'cff_feed_height' ] : '',
|
62 |
'padding' => isset($options[ 'cff_feed_padding' ]) ? $options[ 'cff_feed_padding' ] : '',
|
@@ -66,6 +67,7 @@ function display_cff($atts) {
|
|
66 |
'class' => isset($options[ 'cff_class' ]) ? $options[ 'cff_class' ] : '',
|
67 |
'layout' => isset($options[ 'cff_preset_layout' ]) ? $options[ 'cff_preset_layout' ] : '',
|
68 |
'include' => $include_string,
|
|
|
69 |
//Typography
|
70 |
'textformat' => isset($options[ 'cff_title_format' ]) ? $options[ 'cff_title_format' ] : '',
|
71 |
'textsize' => isset($options[ 'cff_title_size' ]) ? $options[ 'cff_title_size' ] : '',
|
@@ -207,6 +209,24 @@ function display_cff($atts) {
|
|
207 |
if ( stripos($cff_includes, 'social') !== false ) $cff_show_meta = true;
|
208 |
if ( stripos($cff_includes, ',link') !== false ) $cff_show_link = true; //comma used to separate it from 'sharedlinks' - which also contains 'link' string
|
209 |
if ( stripos($cff_includes, 'like') !== false ) $cff_show_like_box = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
//Set free version to thumb layout by default as layout option not available on settings page
|
211 |
$cff_preset_layout = 'thumb';
|
212 |
|
@@ -301,6 +321,7 @@ function display_cff($atts) {
|
|
301 |
$cff_date_after = isset($options[ 'cff_date_after' ]) ? $options[ 'cff_date_after' ] : '';
|
302 |
//Set user's timezone based on setting
|
303 |
$cff_timezone = $atts['timezone'];
|
|
|
304 |
date_default_timezone_set($cff_timezone);
|
305 |
//Link to Facebook
|
306 |
$cff_link_size = $atts[ 'linksize' ];
|
@@ -543,6 +564,8 @@ function display_cff($atts) {
|
|
543 |
set_transient( $transient_name, $posts_json, $cache_seconds );
|
544 |
} else {
|
545 |
$posts_json = get_transient( $transient_name );
|
|
|
|
|
546 |
}
|
547 |
} else {
|
548 |
$posts_json = cff_fetchUrl($cff_posts_json_url);
|
@@ -671,8 +694,7 @@ function display_cff($atts) {
|
|
671 |
$cff_author_img_var = '$cff_author_img_' . $news->from->id;
|
672 |
if ( !isset($$cff_author_img_var) ) $$cff_author_img_var = 'https://graph.facebook.com/' . $news->from->id . '/picture?type=square';
|
673 |
|
674 |
-
|
675 |
-
$cff_author .= '<img src="" width=50 height=50 rel="'.$$cff_author_img_var.'">';
|
676 |
$cff_author .= '<span class="cff-page-name">'.$news->from->name.'</span>';
|
677 |
$cff_author .= '</a>';
|
678 |
|
@@ -685,7 +707,10 @@ function display_cff($atts) {
|
|
685 |
// $cff_post_text = '<div class="cff-post-text" ' . $cff_title_styles . '>';
|
686 |
$cff_post_text .= '<span class="cff-text">';
|
687 |
|
688 |
-
|
|
|
|
|
|
|
689 |
if (!empty($news->story)) $post_text = $news->story;
|
690 |
if (!empty($news->message)) $post_text = $news->message;
|
691 |
if (!empty($news->name) && empty($news->story) && empty($news->message)) $post_text = $news->name;
|
@@ -744,7 +769,9 @@ function display_cff($atts) {
|
|
744 |
$cff_shared_link .= 'cff-no-image';
|
745 |
$cff_shared_link .= '"><a class="cff-link-title" href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a>';
|
746 |
if(!empty($news->caption)) $cff_shared_link .= '<p class="cff-link-caption">'.$news->caption.'</p>';
|
747 |
-
$
|
|
|
|
|
748 |
$cff_shared_link .= '</div>';
|
749 |
}
|
750 |
|
@@ -770,7 +797,26 @@ function display_cff($atts) {
|
|
770 |
$eventID = $url_parts[count($url_parts)-2];
|
771 |
|
772 |
//Get the contents of the event using the WP HTTP API
|
773 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
774 |
//Interpret data with JSON
|
775 |
$event_object = json_decode($event_json);
|
776 |
//Event date
|
@@ -900,12 +946,21 @@ function display_cff($atts) {
|
|
900 |
$p++;
|
901 |
}
|
902 |
|
|
|
|
|
903 |
//Add the Like Box inside
|
904 |
if ($cff_like_box_position == 'bottom' && $cff_show_like_box && !$cff_like_box_outside) $cff_content .= $like_box;
|
905 |
//End the feed
|
906 |
$cff_content .= '</div><div class="cff-clear"></div>';
|
907 |
//Add the Like Box outside
|
908 |
if ($cff_like_box_position == 'bottom' && $cff_show_like_box && $cff_like_box_outside) $cff_content .= $like_box;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
909 |
//Return our feed HTML to display
|
910 |
return $cff_content;
|
911 |
}
|
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.8.1
|
7 |
Author: Smash Balloon
|
8 |
Author URI: http://smashballoon.com/
|
9 |
License: GPLv2 or later
|
57 |
'cachetime' => get_option('cff_cache_time'),
|
58 |
'cacheunit' => get_option('cff_cache_time_unit'),
|
59 |
'locale' => get_option('cff_locale'),
|
60 |
+
'ajax' => get_option('cff_ajax'),
|
61 |
'width' => isset($options[ 'cff_feed_width' ]) ? $options[ 'cff_feed_width' ] : '',
|
62 |
'height' => isset($options[ 'cff_feed_height' ]) ? $options[ 'cff_feed_height' ] : '',
|
63 |
'padding' => isset($options[ 'cff_feed_padding' ]) ? $options[ 'cff_feed_padding' ] : '',
|
67 |
'class' => isset($options[ 'cff_class' ]) ? $options[ 'cff_class' ] : '',
|
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' ] : '',
|
209 |
if ( stripos($cff_includes, 'social') !== false ) $cff_show_meta = true;
|
210 |
if ( stripos($cff_includes, ',link') !== false ) $cff_show_link = true; //comma used to separate it from 'sharedlinks' - which also contains 'link' string
|
211 |
if ( stripos($cff_includes, 'like') !== false ) $cff_show_like_box = true;
|
212 |
+
|
213 |
+
|
214 |
+
//Exclude string
|
215 |
+
$cff_excludes = $atts[ 'exclude' ];
|
216 |
+
//Look for non-plural version of string in the types string in case user specifies singular in shortcode
|
217 |
+
if ( stripos($cff_excludes, 'author') !== false ) $cff_show_author = false;
|
218 |
+
if ( stripos($cff_excludes, 'text') !== false ) $cff_show_text = false;
|
219 |
+
if ( stripos($cff_excludes, 'desc') !== false ) $cff_show_desc = false;
|
220 |
+
if ( stripos($cff_excludes, 'sharedlink') !== false ) $cff_show_shared_links = false;
|
221 |
+
if ( stripos($cff_excludes, 'date') !== false ) $cff_show_date = false;
|
222 |
+
if ( stripos($cff_excludes, 'media') !== false ) $cff_show_media = false;
|
223 |
+
if ( stripos($cff_excludes, 'eventtitle') !== false ) $cff_show_event_title = false;
|
224 |
+
if ( stripos($cff_excludes, 'eventdetail') !== false ) $cff_show_event_details = false;
|
225 |
+
if ( stripos($cff_excludes, 'social') !== false ) $cff_show_meta = false;
|
226 |
+
if ( stripos($cff_excludes, ',link') !== false ) $cff_show_link = false; //comma used to separate it from 'sharedlinks' - which also contains 'link' string
|
227 |
+
if ( stripos($cff_excludes, 'like') !== false ) $cff_show_like_box = false;
|
228 |
+
|
229 |
+
|
230 |
//Set free version to thumb layout by default as layout option not available on settings page
|
231 |
$cff_preset_layout = 'thumb';
|
232 |
|
321 |
$cff_date_after = isset($options[ 'cff_date_after' ]) ? $options[ 'cff_date_after' ] : '';
|
322 |
//Set user's timezone based on setting
|
323 |
$cff_timezone = $atts['timezone'];
|
324 |
+
$cff_orig_timezone = date_default_timezone_get();
|
325 |
date_default_timezone_set($cff_timezone);
|
326 |
//Link to Facebook
|
327 |
$cff_link_size = $atts[ 'linksize' ];
|
564 |
set_transient( $transient_name, $posts_json, $cache_seconds );
|
565 |
} else {
|
566 |
$posts_json = get_transient( $transient_name );
|
567 |
+
//If we can't find the transient then fall back to just getting the json from the api
|
568 |
+
if ($posts_json == false) $posts_json = cff_fetchUrl($cff_posts_json_url);
|
569 |
}
|
570 |
} else {
|
571 |
$posts_json = cff_fetchUrl($cff_posts_json_url);
|
694 |
$cff_author_img_var = '$cff_author_img_' . $news->from->id;
|
695 |
if ( !isset($$cff_author_img_var) ) $$cff_author_img_var = 'https://graph.facebook.com/' . $news->from->id . '/picture?type=square';
|
696 |
|
697 |
+
$cff_author .= '<img src="'.$$cff_author_img_var.'" width=50 height=50>';
|
|
|
698 |
$cff_author .= '<span class="cff-page-name">'.$news->from->name.'</span>';
|
699 |
$cff_author .= '</a>';
|
700 |
|
707 |
// $cff_post_text = '<div class="cff-post-text" ' . $cff_title_styles . '>';
|
708 |
$cff_post_text .= '<span class="cff-text">';
|
709 |
|
710 |
+
( $cff_title_link == 'on' || $cff_title_link == 'true' || $cff_title_link == true ) ? $cff_title_link = true : $cff_title_link = false;
|
711 |
+
if( $atts[ 'textlink' ] == 'false' ) $cff_title_link = false;
|
712 |
+
|
713 |
+
if ($cff_title_link == true) $cff_post_text .= '<a class="cff-post-text-link" href="'.$link.'" '.$target.'>';
|
714 |
if (!empty($news->story)) $post_text = $news->story;
|
715 |
if (!empty($news->message)) $post_text = $news->message;
|
716 |
if (!empty($news->name) && empty($news->story) && empty($news->message)) $post_text = $news->name;
|
769 |
$cff_shared_link .= 'cff-no-image';
|
770 |
$cff_shared_link .= '"><a class="cff-link-title" href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a>';
|
771 |
if(!empty($news->caption)) $cff_shared_link .= '<p class="cff-link-caption">'.$news->caption.'</p>';
|
772 |
+
if ($cff_show_desc) {
|
773 |
+
$cff_shared_link .= $cff_description;
|
774 |
+
}
|
775 |
$cff_shared_link .= '</div>';
|
776 |
}
|
777 |
|
797 |
$eventID = $url_parts[count($url_parts)-2];
|
798 |
|
799 |
//Get the contents of the event using the WP HTTP API
|
800 |
+
$event_json_url = 'https://graph.facebook.com/'.$eventID.'?access_token=' . $access_token . $cff_ssl;
|
801 |
+
|
802 |
+
//Don't use caching if the cache time is set to zero
|
803 |
+
if ($cff_cache_time != 0){
|
804 |
+
// Get any existing copy of our transient data
|
805 |
+
$transient_name = 'cff_timeline_event_json_' . $eventID;
|
806 |
+
if ( false === ( $event_json = get_transient( $transient_name ) ) || $event_json === null ) {
|
807 |
+
//Get the contents of the Facebook page
|
808 |
+
$event_json = cff_fetchUrl($event_json_url);
|
809 |
+
//Cache the JSON
|
810 |
+
set_transient( $transient_name, $event_json, $cache_seconds );
|
811 |
+
} else {
|
812 |
+
$event_json = get_transient( $transient_name );
|
813 |
+
//If we can't find the transient then fall back to just getting the json from the api
|
814 |
+
if ($event_json == false) $event_json = cff_fetchUrl($event_json_url);
|
815 |
+
}
|
816 |
+
} else {
|
817 |
+
$event_json = cff_fetchUrl($event_json_url);
|
818 |
+
}
|
819 |
+
|
820 |
//Interpret data with JSON
|
821 |
$event_object = json_decode($event_json);
|
822 |
//Event date
|
946 |
$p++;
|
947 |
}
|
948 |
|
949 |
+
//Reset the timezone
|
950 |
+
date_default_timezone_set( $cff_orig_timezone );
|
951 |
//Add the Like Box inside
|
952 |
if ($cff_like_box_position == 'bottom' && $cff_show_like_box && !$cff_like_box_outside) $cff_content .= $like_box;
|
953 |
//End the feed
|
954 |
$cff_content .= '</div><div class="cff-clear"></div>';
|
955 |
//Add the Like Box outside
|
956 |
if ($cff_like_box_position == 'bottom' && $cff_show_like_box && $cff_like_box_outside) $cff_content .= $like_box;
|
957 |
+
|
958 |
+
//If the feed is loaded via Ajax then put the scripts into the shortcode itself
|
959 |
+
$ajax_theme = $atts['ajax'];
|
960 |
+
( $ajax_theme == 'on' || $ajax_theme == 'true' || $ajax_theme == true ) ? $ajax_theme = true : $ajax_theme = false;
|
961 |
+
if( $atts[ 'ajax' ] == 'false' ) $ajax_theme = false;
|
962 |
+
if ($ajax_theme) $cff_content .= '<script type="text/javascript" src="' . plugins_url( '/js/cff-scripts.js?8' , __FILE__ ) . '"></script>';
|
963 |
+
|
964 |
//Return our feed HTML to display
|
965 |
return $cff_content;
|
966 |
}
|
js/cff-scripts.js
CHANGED
@@ -49,10 +49,6 @@ jQuery(document).ready(function() {
|
|
49 |
$less.hide();
|
50 |
}
|
51 |
});
|
52 |
-
|
53 |
-
//Load in author image after the page load to prevent slowing down page load by hitting the API
|
54 |
-
var $authorImg = $self.find('.cff-author img');
|
55 |
-
$authorImg.attr('src', $authorImg.attr('rel') ).removeAttr('rel');
|
56 |
|
57 |
});
|
58 |
});
|
49 |
$less.hide();
|
50 |
}
|
51 |
});
|
|
|
|
|
|
|
|
|
52 |
|
53 |
});
|
54 |
});
|