Custom Facebook Feed - Version 1.6.8

Version Description

  • New: Added option to remove border from the Like box when showing faces
  • New: Set "Like" box text color to either blue or white
  • Tweak: Moved descripion below video or link title and added link source
  • Tweak: Added ability to manually translate the '2 weeks ago' text
  • Tweak: Replaced 'View Link' with 'View on Facebook' so that shared links now link to the Facebook post
  • Tweak: "Like" box is now responsive
  • Tweak: Displays post caption if no description is available
  • Tweak: Vertically center multi-line author names rather than bumping them down below the avatar
  • Tweak: Checks whether the Access Token is inputted in the correct format
  • Fix: Fixed bug in the 'Show posts on my page by others' option
  • Fix: If displaying a group then automatically hides the "Like" box
  • Fix: 'others=false' shortcode option now working correctly
  • Fix: Strip any white space characters from beginning or end of Access Token and Page ID
Download this release

Release Info

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

Code changes from version 1.6.7.1 to 1.6.8

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
3
Tags: facebook, custom, customizable, feed, events, seo, search engine, responsive, mobile, shortcode, social, status, posts
4
Requires at least: 3.0
5
Tested up to: 3.7.1
6
- Stable tag: 1.6.7.1
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -121,6 +121,21 @@ You can embed your Facebook feed directly into a template file by using the Word
121
122
== Changelog ==
123
124
= 1.6.7.1 =
125
* Fix: Fixed a bug in 1.6.7 which was causing an issue displaying the feed in some circumstances
126
3
Tags: facebook, custom, customizable, feed, events, seo, search engine, responsive, mobile, shortcode, social, status, posts
4
Requires at least: 3.0
5
Tested up to: 3.7.1
6
+ Stable tag: 1.6.8
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
121
122
== Changelog ==
123
124
+ = 1.6.8 =
125
+ * New: Added option to remove border from the Like box when showing faces
126
+ * New: Set "Like" box text color to either blue or white
127
+ * Tweak: Moved descripion below video or link title and added link source
128
+ * Tweak: Added ability to manually translate the '2 weeks ago' text
129
+ * Tweak: Replaced 'View Link' with 'View on Facebook' so that shared links now link to the Facebook post
130
+ * Tweak: "Like" box is now responsive
131
+ * Tweak: Displays post caption if no description is available
132
+ * Tweak: Vertically center multi-line author names rather than bumping them down below the avatar
133
+ * Tweak: Checks whether the Access Token is inputted in the correct format
134
+ * Fix: Fixed bug in the 'Show posts on my page by others' option
135
+ * Fix: If displaying a group then automatically hides the "Like" box
136
+ * Fix: 'others=false' shortcode option now working correctly
137
+ * Fix: Strip any white space characters from beginning or end of Access Token and Page ID
138
+
139
= 1.6.7.1 =
140
* Fix: Fixed a bug in 1.6.7 which was causing an issue displaying the feed in some circumstances
141
css/cff-admin-style.css CHANGED
@@ -1,7 +1,7 @@
1
#cff-admin .bump-left{
2
padding-left: 10px;
3
}
4
- #cff-admin .tooltip{
5
display: none;
6
}
7
#cff-admin hr{
@@ -14,4 +14,26 @@
14
}
15
#wpbody-content #cff-admin .metabox-holder {
16
padding-top: 0;
17
}
1
#cff-admin .bump-left{
2
padding-left: 10px;
3
}
4
+ #cff-admin .cff-tooltip{
5
display: none;
6
}
7
#cff-admin hr{
14
}
15
#wpbody-content #cff-admin .metabox-holder {
16
padding-top: 0;
17
+ }
18
+ #cff-admin .cff-profile-error{
19
+ display: none;
20
+
21
+ margin-top: 5px;
22
+ background: #F7E6E6;
23
+ padding: 5px 10px;
24
+ border: 1px solid #BA7B7B;
25
+ color: #592626;
26
+
27
+ -moz-border-radius: 3px;
28
+ -webkit-border-radius: 3px;
29
+ border-radius: 3px;
30
+ }
31
+ #cff-admin .cff-profile-error p{
32
+ margin: 0;
33
+ padding: 5px 0;
34
+ }
35
+ #cff-admin .cff-tooltip-table label{
36
+ display: block;
37
+ float: left;
38
+ width: 60px;
39
}
css/cff-style.css CHANGED
@@ -63,17 +63,18 @@
63
clear: both;
64
display: block;
65
margin-bottom: 15px;
66
}
67
#cff .cff-author img{
68
float: left;
69
margin-right: 15px;
70
}
71
- #cff .cff-author p{
72
- float: left;
73
- clear: none;
74
- width: auto;
75
margin: 0;
76
- padding-top: 15px;
77
font-weight: bold;
78
}
79
#cff .cff-author a{
@@ -94,6 +95,11 @@
94
font-weight: normal;
95
}
96
/*Link image*/
97
#cff .cff-link{
98
float: left;
99
clear: both;
@@ -111,6 +117,10 @@
111
margin-left: 3%;
112
padding: 5px 0 10px 0;
113
}
114
#cff .cff-text-link.cff-no-image{
115
width: 100%;
116
margin-left: 0;
@@ -137,6 +147,12 @@
137
#cff .cff-details .cff-when{
138
/*font-weight: bold;*/
139
}
140
/* View on Facebook / View Link text */
141
#cff .cff-viewpost-link,
142
#cff .cff-viewpost-facebook{
@@ -145,22 +161,38 @@
145
padding-top: 12px;
146
font-size: 11px;
147
}
148
/* Like box */
149
- #cff .cff-likebox iframe{
150
- margin: 0;
151
- }
152
- #cff .cff-likebox{
153
float: left;
154
width: 100%;
155
- margin-left: -10px;
156
}
157
/*Like box is not inside of #cff*/
158
- .cff-likebox.cff-top.cff-outside{
159
margin-bottom: 10px;
160
}
161
- .cff-likebox.cff-bottom.cff-outside{
162
margin-top: 10px;
163
}
164
/* Clear fix */
165
.cff-clear:after {
166
clear: both;
63
clear: both;
64
display: block;
65
margin-bottom: 15px;
66
+ line-height: 1.2;
67
+
68
}
69
#cff .cff-author img{
70
float: left;
71
margin-right: 15px;
72
}
73
+ #cff .cff-author span{
74
+ display: table-cell;
75
+ vertical-align: middle;
76
+ height: 50px;
77
margin: 0;
78
font-weight: bold;
79
}
80
#cff .cff-author a{
95
font-weight: normal;
96
}
97
/*Link image*/
98
+ #cff .cff-shared-link{
99
+ float: left;
100
+ clear: both;
101
+ width: 100%;
102
+ }
103
#cff .cff-link{
104
float: left;
105
clear: both;
117
margin-left: 3%;
118
padding: 5px 0 10px 0;
119
}
120
+ #cff .cff-link-caption{
121
+ font-size: 12px;
122
+ margin: 0;
123
+ }
124
#cff .cff-text-link.cff-no-image{
125
width: 100%;
126
margin-left: 0;
147
#cff .cff-details .cff-when{
148
/*font-weight: bold;*/
149
}
150
+ /* Video */
151
+ #cff .cff-desc-wrap{
152
+ float: left;
153
+ width: 100%;
154
+ }
155
+
156
/* View on Facebook / View Link text */
157
#cff .cff-viewpost-link,
158
#cff .cff-viewpost-facebook{
161
padding-top: 12px;
162
font-size: 11px;
163
}
164
+
165
/* Like box */
166
+ .cff-likebox{
167
float: left;
168
width: 100%;
169
+ /*margin-left: -10px;*/
170
+
171
+ position: relative;
172
+ }
173
+ .cff-likebox .fb_iframe_widget{
174
+ width: 100%;
175
+ }
176
+ .cff-likebox .fb_iframe_widget span{
177
+ width: 100% !important;
178
+ }
179
+ .cff-likebox iframe{
180
+ margin: 0;
181
+
182
+ position: absolute;
183
+ top: 0;
184
+ left: 0;
185
+ width: 100% !important;
186
+ height: 100%;
187
}
188
/*Like box is not inside of #cff*/
189
+ .cff-likebox.top.cff-outside{
190
margin-bottom: 10px;
191
}
192
+ .cff-likebox.bottom.cff-outside{
193
margin-top: 10px;
194
}
195
+
196
/* Clear fix */
197
.cff-clear:after {
198
clear: both;
custom-facebook-feed-admin.php CHANGED
@@ -35,6 +35,7 @@ function cff_settings_page() {
35
$hidden_field_name = 'cff_submit_hidden';
36
$access_token = 'cff_access_token';
37
$page_id = 'cff_page_id';
38
$num_show = 'cff_num_show';
39
$cff_post_limit = 'cff_post_limit';
40
$cff_show_others = 'cff_show_others';
@@ -44,6 +45,7 @@ function cff_settings_page() {
44
// Read in existing option value from database
45
$access_token_val = get_option( $access_token );
46
$page_id_val = get_option( $page_id );
47
$num_show_val = get_option( $num_show, '5' );
48
$cff_post_limit_val = get_option( $cff_post_limit );
49
$cff_show_others_val = get_option( $cff_show_others );
@@ -55,6 +57,7 @@ function cff_settings_page() {
55
// Read their posted value
56
$access_token_val = $_POST[ $access_token ];
57
$page_id_val = $_POST[ $page_id ];
58
$num_show_val = $_POST[ $num_show ];
59
$cff_post_limit_val = $_POST[ $cff_post_limit ];
60
$cff_show_others_val = $_POST[ $cff_show_others ];
@@ -64,6 +67,7 @@ function cff_settings_page() {
64
// Save the posted value in the database
65
update_option( $access_token, $access_token_val );
66
update_option( $page_id, $page_id_val );
67
update_option( $num_show, $num_show_val );
68
update_option( $cff_post_limit, $cff_post_limit_val );
69
update_option( $cff_show_others, $cff_show_others_val );
@@ -111,20 +115,27 @@ function cff_settings_page() {
111
<tr valign="top">
112
<th scope="row"><?php _e('Access Token'); ?></th>
113
<td>
114
- <input name="cff_access_token" type="text" value="<?php esc_attr_e( $access_token_val ); ?>" size="60" />
115
<!--<a href="#" id="verify-token" class="button-secondary"><?php _e('Verify Access Token'); ?></a>-->
116
- &nbsp;<a class="tooltip-link" href="JavaScript:void(0);"><?php _e('How to get an Access Token'); ?></a>
117
- <br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123|ABC2fvp5h9tJe4-5-AbC123</i>
118
- <p class="tooltip"><?php _e("In order to use the plugin, Facebook requires you to obtain an access token to access their data. Don't worry though, this is really easy to do. Just follow these <a href='http://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>"); ?>.</p>
119
</td>
120
</tr>
121
<tr valign="top">
122
- <th scope="row"><?php _e('Facebook Page ID'); ?></th>
123
<td>
124
<input name="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
125
- &nbsp;<a class="tooltip-link" href="JavaScript:void(0);"><?php _e('What\'s my Page ID?'); ?></a>
126
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123 or smashballoon</i>
127
- <div class="tooltip">
128
<ul>
129
<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>'); ?>
130
<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>
@@ -133,6 +144,28 @@ function cff_settings_page() {
133
</div>
134
</td>
135
</tr>
136
<tr valign="top">
137
<th scope="row"><?php _e('Number of posts to display'); ?></th>
138
<td>
@@ -144,15 +177,8 @@ function cff_settings_page() {
144
<th scope="row"><?php _e('Alter the post limit'); ?></th>
145
<td>
146
<input name="cff_post_limit" type="text" value="<?php esc_attr_e( $cff_post_limit_val ); ?>" size="4" />
147
- <i style="color: #666; font-size: 11px;">Eg. 50</i> <a class="tooltip-link bump-left" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
148
- <p class="tooltip"><?php _e('By default the Facebook API only returns your latest 25 posts. If you would like to retrieve more than 25 posts then you can increase the limit by specifying a higher value here. However, the more posts you request the slower the page load time may be when the plugin needs to check Facebook for new posts. Similarly, if you only intend to retrieve a few posts then you may wish to set a lower post limit here so that you aren\'t retrieving more posts than necessary. It\'s best to set this higher than the actual number of posts you want to display as some posts may be filtered out.'); ?></p>
149
- </td>
150
- </tr>
151
- <tr valign="top">
152
- <th scope="row"><?php _e('Show posts by others on my page'); ?><br /><i style="color: #666; font-size: 11px;"><?php _e('(Check this if using a <b>group</b>)'); ?></i></th>
153
- <td>
154
- <input name="cff_show_others" type="checkbox" id="cff_show_others" <?php if($cff_show_others_val == true) echo "checked"; ?> />
155
- <i style="color: #666; font-size: 11px;"><?php _e('By default only posts by the page owner will be shown. Check this box to also show posts by others.'); ?></i>
156
</td>
157
</tr>
158
<tr valign="top">
@@ -164,8 +190,8 @@ function cff_settings_page() {
164
<option value="hours" <?php if($cff_cache_time_unit_val == "hours") echo 'selected="selected"' ?> ><?php _e('Hours'); ?></option>
165
<option value="days" <?php if($cff_cache_time_unit_val == "days") echo 'selected="selected"' ?> ><?php _e('Days'); ?></option>
166
</select>
167
- <a class="tooltip-link bump-left" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
168
- <p class="tooltip"><?php _e('Your Facebook posts and comments data is temporarily cached by the plugin in your WordPress database. You can choose how long this data should be cached for. If you set the time to 60 minutes then the plugin will clear the cached data after that length of time, and the next time the page is viewed it will check for new data.'); ?></p>
169
</td>
170
</tr>
171
@@ -259,26 +285,40 @@ function cff_settings_page() {
259
</table>
260
<?php submit_button(); ?>
261
</form>
262
- <h3><?php _e('Support'); ?></h3>
263
- <p>Having trouble getting the plugin to work? Try visiting the <a href="http://smashballoon.com/custom-facebook-feed/faq/" target="_blank" />Troubleshooting &amp; FAQ</a> page or contact <a href="http://smashballoon.com/custom-facebook-feed/support" target="_blank">support</a>.<br />Smash Balloon is committed to making this plugin better. Please let us know if you have had any issues when using this plugin so that we can continue to improve it!</p>
264
<hr />
265
<h3><?php _e('Displaying your Feed'); ?></h3>
266
<p><?php _e('Copy and paste this shortcode directly into the page, post or widget where you\'d like the feed to show up:'); ?></p>
267
<input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="edd-sysinfo" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).'); ?>" />
268
- <p><?php _e('If you wish, you can override the settings above directly in the shortcode like so:'); ?></p>
269
- <p>[custom-facebook-feed <b><span style='color: purple;'>id=Put_Your_Facebook_Page_ID_Here</span> <span style='color: green;'>num=3</span> <span style='color: blue;'>layout=thumb</span></b>]</p>
270
- <p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php _e('Click here'); ?></a> <?php _e('for a full list of shortcode options'); ?></p>
271
<hr />
272
-
273
<a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
274
<hr />
275
<h4><?php _e('<u>System Info:</u>'); ?></h4>
276
<p>PHP Version: <b><?php echo PHP_VERSION . "\n"; ?></b></p>
277
<p>Web Server Info: <b><?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?></b></p>
278
<p>PHP allow_url_fopen: <b><?php echo ini_get( 'allow_url_fopen' ) ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>"; ?></b></p>
279
<p>PHP cURL: <b><?php echo is_callable('curl_init') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
280
<p>JSON: <b><?php echo function_exists("json_decode") ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
281
- <i style="color: #666; font-size: 11px;"><?php _e('(If any of the items above are listed as'); ?> <span style='color: red;'>No</span> <?php _e('then please include this in your support request)'); ?></i>
282
283
284
<?php
@@ -346,6 +386,23 @@ function cff_style_page() {
346
'cff_date_custom' => '',
347
'cff_date_before' => '',
348
'cff_date_after' => '',
349
//Link to Facebook
350
'cff_link_size' => 'inherit',
351
'cff_link_weight' => 'inherit',
@@ -367,9 +424,11 @@ function cff_style_page() {
367
'cff_like_box_outside' => false,
368
'cff_likebox_width' => '300',
369
'cff_like_box_faces' => false,
370
371
'cff_bg_color' => '',
372
'cff_likebox_bg_color' => '',
373
'cff_video_height' => '',
374
'cff_show_author' => false,
375
'cff_class' => '',
@@ -439,6 +498,23 @@ function cff_style_page() {
439
$cff_date_custom = $options[ 'cff_date_custom' ];
440
$cff_date_before = $options[ 'cff_date_before' ];
441
$cff_date_after = $options[ 'cff_date_after' ];
442
//View on Facebook link
443
$cff_link_size = $options[ 'cff_link_size' ];
444
$cff_link_weight = $options[ 'cff_link_weight' ];
@@ -460,10 +536,12 @@ function cff_style_page() {
460
$cff_like_box_outside = $options[ 'cff_like_box_outside' ];
461
$cff_likebox_width = $options[ 'cff_likebox_width' ];
462
$cff_like_box_faces = $options[ 'cff_like_box_faces' ];
463
464
$cff_show_media = $options[ 'cff_show_media' ];
465
$cff_bg_color = $options[ 'cff_bg_color' ];
466
$cff_likebox_bg_color = $options[ 'cff_likebox_bg_color' ];
467
$cff_video_height = $options[ 'cff_video_height' ];
468
$cff_show_author = $options[ 'cff_show_author' ];
469
$cff_class = $options[ 'cff_class' ];
@@ -540,7 +618,7 @@ function cff_style_page() {
540
$options[ 'cff_show_meta' ] = $cff_show_meta;
541
$options[ 'cff_show_link' ] = $cff_show_link;
542
}
543
- //Update the Post Layout options
544
if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
545
//Character limits
546
$cff_title_length_val = $_POST[ $cff_title_length ];
@@ -582,6 +660,23 @@ function cff_style_page() {
582
$cff_date_custom = $_POST[ 'cff_date_custom' ];
583
$cff_date_before = $_POST[ 'cff_date_before' ];
584
$cff_date_after = $_POST[ 'cff_date_after' ];
585
//View on Facebook link
586
$cff_link_size = $_POST[ 'cff_link_size' ];
587
$cff_link_weight = $_POST[ 'cff_link_weight' ];
@@ -629,6 +724,23 @@ function cff_style_page() {
629
$options[ 'cff_date_custom' ] = $cff_date_custom;
630
$options[ 'cff_date_before' ] = $cff_date_before;
631
$options[ 'cff_date_after' ] = $cff_date_after;
632
//View on Facebook link
633
$options[ 'cff_link_size' ] = $cff_link_size;
634
$options[ 'cff_link_weight' ] = $cff_link_weight;
@@ -637,7 +749,7 @@ function cff_style_page() {
637
$options[ 'cff_view_link_text' ] = $cff_view_link_text;
638
$options[ 'cff_link_to_timeline' ] = $cff_link_to_timeline;
639
}
640
- //Update the Post Layout options
641
if( isset($_POST[ $style_misc_hidden_field_name ]) && $_POST[ $style_misc_hidden_field_name ] == 'Y' ) {
642
//Meta
643
$cff_icon_style = $_POST[ 'cff_icon_style' ];
@@ -652,8 +764,12 @@ function cff_style_page() {
652
$cff_like_box_position = $_POST[ 'cff_like_box_position' ];
653
$cff_like_box_outside = $_POST[ 'cff_like_box_outside' ];
654
$cff_likebox_bg_color = $_POST[ 'cff_likebox_bg_color' ];
655
$cff_likebox_width = $_POST[ 'cff_likebox_width' ];
656
$cff_like_box_faces = $_POST[ 'cff_like_box_faces' ];
657
$cff_video_height = $_POST[ 'cff_video_height' ];
658
$cff_video_action = $_POST[ 'cff_video_action' ];
659
$cff_sep_color = $_POST[ 'cff_sep_color' ];
@@ -672,8 +788,11 @@ function cff_style_page() {
672
$options[ 'cff_like_box_position' ] = $cff_like_box_position;
673
$options[ 'cff_like_box_outside' ] = $cff_like_box_outside;
674
$options[ 'cff_likebox_bg_color' ] = $cff_likebox_bg_color;
675
$options[ 'cff_likebox_width' ] = $cff_likebox_width;
676
$options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
677
678
$options[ 'cff_video_height' ] = $cff_video_height;
679
$options[ 'cff_video_action' ] = $cff_video_action;
@@ -1107,7 +1226,7 @@ function cff_style_page() {
1107
<td>
1108
<select name="cff_date_formatting">
1109
<?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
1110
- <option value="1" <?php if($cff_date_formatting == "1") echo 'selected="selected"' ?> ><?php _e('Posted 2 days ago'); ?></option>
1111
<option value="2" <?php if($cff_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:i a', $original); ?></option>
1112
<option value="3" <?php if($cff_date_formatting == "3") echo 'selected="selected"' ?> ><?php echo date('F jS', $original); ?></option>
1113
<option value="4" <?php if($cff_date_formatting == "4") echo 'selected="selected"' ?> ><?php echo date('D F jS', $original); ?></option>
@@ -1121,6 +1240,60 @@ function cff_style_page() {
1121
<option value="12" <?php if($cff_date_formatting == "12") echo 'selected="selected"' ?> ><?php echo date('d.m.y', $original); ?></option>
1122
<option value="13" <?php if($cff_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y', $original); ?></option>
1123
</select>
1124
</td>
1125
</tr>
1126
<tr>
@@ -1132,11 +1305,11 @@ function cff_style_page() {
1132
</tr>
1133
<tr>
1134
<th><label for="cff_date_before" class="bump-left"><?php _e('Text before date'); ?></label></th>
1135
- <td><input name="cff_date_before" type="text" value="<?php esc_attr_e( $cff_date_before ); ?>" size="10" placeholder="Eg. Posted" /></td>
1136
</tr>
1137
<tr>
1138
<th><label for="cff_date_after" class="bump-left"><?php _e('Text after date'); ?></label></th>
1139
- <td><input name="cff_date_after" type="text" value="<?php esc_attr_e( $cff_date_after ); ?>" size="10" placeholder="Eg. ago" /></td>
1140
</tr>
1141
</tbody>
1142
</table>
@@ -1490,19 +1663,37 @@ function cff_style_page() {
1490
</td>
1491
</tr>
1492
<tr valign="top">
1493
- <th scope="row"><label for="cff_likebox_width" class="bump-left"><?php _e('Like Box Width'); ?></label></th>
1494
<td>
1495
<input name="cff_likebox_width" type="text" value="<?php esc_attr_e( $cff_likebox_width ); ?>" size="6" />
1496
- <span>px <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Default is 300'); ?></i></span>
1497
</td>
1498
</tr>
1499
<tr valign="top">
1500
- <th scope="row"><label class="bump-left"><?php _e('Show faces in Like Box'); ?></label></th>
1501
<td>
1502
<input type="checkbox" name="cff_like_box_faces" id="cff_like_box_faces" <?php if($cff_like_box_faces == true) echo 'checked="checked"' ?> />
1503
<i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Show thumbnail photos of fans who like your page'); ?></i>
1504
</td>
1505
</tr>
1506
1507
<tr><td><b style="font-size: 14px;"><?php _e('Separating Line'); ?></b></td></tr>
1508
<tr valign="top">
35
$hidden_field_name = 'cff_submit_hidden';
36
$access_token = 'cff_access_token';
37
$page_id = 'cff_page_id';
38
+ $cff_page_type = 'cff_page_type';
39
$num_show = 'cff_num_show';
40
$cff_post_limit = 'cff_post_limit';
41
$cff_show_others = 'cff_show_others';
45
// Read in existing option value from database
46
$access_token_val = get_option( $access_token );
47
$page_id_val = get_option( $page_id );
48
+ $cff_page_type_val = get_option( $cff_page_type );
49
$num_show_val = get_option( $num_show, '5' );
50
$cff_post_limit_val = get_option( $cff_post_limit );
51
$cff_show_others_val = get_option( $cff_show_others );
57
// Read their posted value
58
$access_token_val = $_POST[ $access_token ];
59
$page_id_val = $_POST[ $page_id ];
60
+ $cff_page_type_val = $_POST[ $cff_page_type ];
61
$num_show_val = $_POST[ $num_show ];
62
$cff_post_limit_val = $_POST[ $cff_post_limit ];
63
$cff_show_others_val = $_POST[ $cff_show_others ];
67
// Save the posted value in the database
68
update_option( $access_token, $access_token_val );
69
update_option( $page_id, $page_id_val );
70
+ update_option( $cff_page_type, $cff_page_type_val );
71
update_option( $num_show, $num_show_val );
72
update_option( $cff_post_limit, $cff_post_limit_val );
73
update_option( $cff_show_others, $cff_show_others_val );
115
<tr valign="top">
116
<th scope="row"><?php _e('Access Token'); ?></th>
117
<td>
118
+ <input name="cff_access_token" id="cff_access_token" type="text" value="<?php esc_attr_e( $access_token_val ); ?>" size="60" />
119
<!--<a href="#" id="verify-token" class="button-secondary"><?php _e('Verify Access Token'); ?></a>-->
120
+ &nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e("How do I get an Access Token?"); ?></a>
121
+ <br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123|ABC2fvp5h9tJe4-5-AbC123.</i>
122
+
123
+ <div class="cff-profile-error cff-access-token">
124
+ <?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>"); ?>
125
+ </div>
126
+
127
+ <div class="cff-tooltip">
128
+ <?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>"); ?>
129
+ </div>
130
</td>
131
</tr>
132
<tr valign="top">
133
+ <th scope="row"><?php _e('Facebook Page ID (or slug)'); ?><br /><i style="color: #666; font-size: 11px;"><?php _e('(This can usually be found in your <a class="cff-tooltip-link" href="JavaScript:void(0);">Facebook page URL</a>)</i>'); ?></th>
134
<td>
135
<input name="cff_page_id" type="text" value="<?php esc_attr_e( $page_id_val ); ?>" size="60" />
136
+ &nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('What\'s my Page ID?'); ?></a>
137
<br /><i style="color: #666; font-size: 11px;">Eg. 1234567890123 or smashballoon</i>
138
+ <div class="cff-tooltip">
139
<ul>
140
<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>'); ?>
141
<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>
144
</div>
145
</td>
146
</tr>
147
+
148
+ <tr valign="top" class="cff-page-type">
149
+ <th scope="row"><?php _e('Is this a page, group or profile?'); ?></th>
150
+ <td>
151
+ <select name="cff_page_type">
152
+ <option value="page" <?php if($cff_page_type_val == "page") echo 'selected="selected"' ?> ><?php _e('Page'); ?></option>
153
+ <option value="group" <?php if($cff_page_type_val == "group") echo 'selected="selected"' ?> ><?php _e('Group'); ?></option>
154
+ <option value="profile" <?php if($cff_page_type_val == "profile") echo 'selected="selected"' ?> ><?php _e('Profile'); ?></option>
155
+ </select>
156
+ <div class="cff-profile-error cff-page-type">
157
+ <?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>"); ?>
158
+ </div>
159
+ </td>
160
+ </tr>
161
+ <tr valign="top" class="cff-page-options">
162
+ <th scope="row"><?php _e('Show posts on my page by others'); ?></th>
163
+ <td>
164
+ <input name="cff_show_others" type="checkbox" id="cff_show_others" <?php if($cff_show_others_val == true) echo "checked"; ?> />
165
+ <i style="color: #666; font-size: 11px;"><?php _e('Check this box to also show posts by others on your page. By default only posts by the page owner will be shown.'); ?></i>
166
+ </td>
167
+ </tr>
168
+
169
<tr valign="top">
170
<th scope="row"><?php _e('Number of posts to display'); ?></th>
171
<td>
177
<th scope="row"><?php _e('Alter the post limit'); ?></th>
178
<td>
179
<input name="cff_post_limit" type="text" value="<?php esc_attr_e( $cff_post_limit_val ); ?>" size="4" />
180
+ <i style="color: #666; font-size: 11px;">Eg. 50</i> <a class="cff-tooltip-link bump-left" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
181
+ <p class="cff-tooltip"><?php _e('By default the Facebook API only returns your latest 25 posts. If you would like to retrieve more than 25 posts then you can increase the limit by specifying a higher value here. However, the more posts you request the slower the page load time may be when the plugin needs to check Facebook for new posts. Similarly, if you only intend to retrieve a few posts then you may wish to set a lower post limit here so that you aren\'t retrieving more posts than necessary. It\'s best to set this higher than the actual number of posts you want to display as some posts may be filtered out.'); ?></p>
182
</td>
183
</tr>
184
<tr valign="top">
190
<option value="hours" <?php if($cff_cache_time_unit_val == "hours") echo 'selected="selected"' ?> ><?php _e('Hours'); ?></option>
191
<option value="days" <?php if($cff_cache_time_unit_val == "days") echo 'selected="selected"' ?> ><?php _e('Days'); ?></option>
192
</select>
193
+ <a class="cff-tooltip-link bump-left" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
194
+ <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>
195
</td>
196
</tr>
197
285
</table>
286
<?php submit_button(); ?>
287
</form>
288
<hr />
289
<h3><?php _e('Displaying your Feed'); ?></h3>
290
<p><?php _e('Copy and paste this shortcode directly into the page, post or widget where you\'d like the feed to show up:'); ?></p>
291
<input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="edd-sysinfo" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).'); ?>" />
292
<hr />
293
+ <h3><?php _e('Customizing your Feed'); ?></h3>
294
+ <p><?php _e("Use the <a href='admin.php?page=cff-style'>Layout &amp; Style</a> page to customize your feed. If you're displaying multiple feeds then you can override your settings directly in the shortcode like so:"); ?></p>
295
+ <p>[custom-facebook-feed <b><span style='color: green;'>id=some-other-page-id num=3 height=500px</span></b>]</p>
296
+ <p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php _e('See a full list of shortcode options'); ?></a></p>
297
+ <hr />
298
+ <h3><?php _e('Plugin Support'); ?></h3>
299
+ <p>Having trouble getting the plugin to work? Try the links below:</p>
300
+ <ul>
301
+ <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/general/" target="_blank">General Questions</a>'); ?></li>
302
+ <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/setup/" target="_blank">Setting Up &amp; Displaying your Feed</a>'); ?></li>
303
+ <li>- <?php _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/troubleshooting/" target="_blank">Troubleshooting &amp; Common Support Questions</a>'); ?></li>
304
+ </ul>
305
+
306
+ <p><?php _e('Still need help? <a href="http://smashballoon.com/custom-facebook-feed/support/" target="_blank">Request support</a>.'); ?></p>
307
+ <p>Smash Balloon is committed to making this plugin better. Please let us know if you have had any issues when using this plugin so that we can continue to improve it!</p>
308
+
309
+ <hr />
310
<a href="http://smashballoon.com/custom-facebook-feed/demo" target="_blank"><img src="<?php echo plugins_url( 'img/pro.png' , __FILE__ ) ?>" /></a>
311
<hr />
312
+
313
<h4><?php _e('<u>System Info:</u>'); ?></h4>
314
<p>PHP Version: <b><?php echo PHP_VERSION . "\n"; ?></b></p>
315
<p>Web Server Info: <b><?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?></b></p>
316
<p>PHP allow_url_fopen: <b><?php echo ini_get( 'allow_url_fopen' ) ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>"; ?></b></p>
317
<p>PHP cURL: <b><?php echo is_callable('curl_init') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
318
<p>JSON: <b><?php echo function_exists("json_decode") ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>" ?></b></p>
319
+
320
+
321
+
322
323
324
<?php
386
'cff_date_custom' => '',
387
'cff_date_before' => '',
388
'cff_date_after' => '',
389
+ //Date - translation
390
+ 'cff_translate_second' => '',
391
+ 'cff_translate_seconds' => '',
392
+ 'cff_translate_minute' => '',
393
+ 'cff_translate_minutes' => '',
394
+ 'cff_translate_hour' => '',
395
+ 'cff_translate_hours' => '',
396
+ 'cff_translate_day' => '',
397
+ 'cff_translate_days' => '',
398
+ 'cff_translate_week' => '',
399
+ 'cff_translate_weeks' => '',
400
+ 'cff_translate_month' => '',
401
+ 'cff_translate_months' => '',
402
+ 'cff_translate_year' => '',
403
+ 'cff_translate_years' => '',
404
+ 'cff_translate_ago' => '',
405
+
406
//Link to Facebook
407
'cff_link_size' => 'inherit',
408
'cff_link_weight' => 'inherit',
424
'cff_like_box_outside' => false,
425
'cff_likebox_width' => '300',
426
'cff_like_box_faces' => false,
427
+ 'cff_like_box_border' => false,
428
429
'cff_bg_color' => '',
430
'cff_likebox_bg_color' => '',
431
+ 'cff_like_box_text_color' => 'blue',
432
'cff_video_height' => '',
433
'cff_show_author' => false,
434
'cff_class' => '',
498
$cff_date_custom = $options[ 'cff_date_custom' ];
499
$cff_date_before = $options[ 'cff_date_before' ];
500
$cff_date_after = $options[ 'cff_date_after' ];
501
+ //Date translate
502
+ $cff_translate_second = $options[ 'cff_translate_second' ];
503
+ $cff_translate_seconds = $options[ 'cff_translate_seconds' ];
504
+ $cff_translate_minute = $options[ 'cff_translate_minute' ];
505
+ $cff_translate_minutes = $options[ 'cff_translate_minutes' ];
506
+ $cff_translate_hour = $options[ 'cff_translate_hour' ];
507
+ $cff_translate_hours = $options[ 'cff_translate_hours' ];
508
+ $cff_translate_day = $options[ 'cff_translate_day' ];
509
+ $cff_translate_days = $options[ 'cff_translate_days' ];
510
+ $cff_translate_week = $options[ 'cff_translate_week' ];
511
+ $cff_translate_weeks = $options[ 'cff_translate_weeks' ];
512
+ $cff_translate_month = $options[ 'cff_translate_month' ];
513
+ $cff_translate_months = $options[ 'cff_translate_months' ];
514
+ $cff_translate_year = $options[ 'cff_translate_year' ];
515
+ $cff_translate_years = $options[ 'cff_translate_years' ];
516
+ $cff_translate_ago = $options[ 'cff_translate_ago' ];
517
+
518
//View on Facebook link
519
$cff_link_size = $options[ 'cff_link_size' ];
520
$cff_link_weight = $options[ 'cff_link_weight' ];
536
$cff_like_box_outside = $options[ 'cff_like_box_outside' ];
537
$cff_likebox_width = $options[ 'cff_likebox_width' ];
538
$cff_like_box_faces = $options[ 'cff_like_box_faces' ];
539
+ $cff_like_box_border = $options[ 'cff_like_box_border' ];
540
541
$cff_show_media = $options[ 'cff_show_media' ];
542
$cff_bg_color = $options[ 'cff_bg_color' ];
543
$cff_likebox_bg_color = $options[ 'cff_likebox_bg_color' ];
544
+ $cff_like_box_text_color = $options[ 'cff_like_box_text_color' ];
545
$cff_video_height = $options[ 'cff_video_height' ];
546
$cff_show_author = $options[ 'cff_show_author' ];
547
$cff_class = $options[ 'cff_class' ];
618
$options[ 'cff_show_meta' ] = $cff_show_meta;
619
$options[ 'cff_show_link' ] = $cff_show_link;
620
}
621
+ //Update the Typography options
622
if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
623
//Character limits
624
$cff_title_length_val = $_POST[ $cff_title_length ];
660
$cff_date_custom = $_POST[ 'cff_date_custom' ];
661
$cff_date_before = $_POST[ 'cff_date_before' ];
662
$cff_date_after = $_POST[ 'cff_date_after' ];
663
+ //Date translate
664
+ $cff_translate_second = $_POST[ 'cff_translate_second' ];
665
+ $cff_translate_seconds = $_POST[ 'cff_translate_seconds' ];
666
+ $cff_translate_minute = $_POST[ 'cff_translate_minute' ];
667
+ $cff_translate_minutes = $_POST[ 'cff_translate_minutes' ];
668
+ $cff_translate_hour = $_POST[ 'cff_translate_hour' ];
669
+ $cff_translate_hours = $_POST[ 'cff_translate_hours' ];
670
+ $cff_translate_day = $_POST[ 'cff_translate_day' ];
671
+ $cff_translate_days = $_POST[ 'cff_translate_days' ];
672
+ $cff_translate_week = $_POST[ 'cff_translate_week' ];
673
+ $cff_translate_weeks = $_POST[ 'cff_translate_weeks' ];
674
+ $cff_translate_month = $_POST[ 'cff_translate_month' ];
675
+ $cff_translate_months = $_POST[ 'cff_translate_months' ];
676
+ $cff_translate_year = $_POST[ 'cff_translate_year' ];
677
+ $cff_translate_years = $_POST[ 'cff_translate_years' ];
678
+ $cff_translate_ago = $_POST[ 'cff_translate_ago' ];
679
+
680
//View on Facebook link
681
$cff_link_size = $_POST[ 'cff_link_size' ];
682
$cff_link_weight = $_POST[ 'cff_link_weight' ];
724
$options[ 'cff_date_custom' ] = $cff_date_custom;
725
$options[ 'cff_date_before' ] = $cff_date_before;
726
$options[ 'cff_date_after' ] = $cff_date_after;
727
+ //Date translate
728
+ $options[ 'cff_translate_second' ] = $cff_translate_second;
729
+ $options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
730
+ $options[ 'cff_translate_minute' ] = $cff_translate_minute;
731
+ $options[ 'cff_translate_minutes' ] = $cff_translate_minutes;
732
+ $options[ 'cff_translate_hour' ] = $cff_translate_hour;
733
+ $options[ 'cff_translate_hours' ] = $cff_translate_hours;
734
+ $options[ 'cff_translate_day' ] = $cff_translate_day;
735
+ $options[ 'cff_translate_days' ] = $cff_translate_days;
736
+ $options[ 'cff_translate_week' ] = $cff_translate_week;
737
+ $options[ 'cff_translate_weeks' ] = $cff_translate_weeks;
738
+ $options[ 'cff_translate_month' ] = $cff_translate_month;
739
+ $options[ 'cff_translate_months' ] = $cff_translate_months;
740
+ $options[ 'cff_translate_year' ] = $cff_translate_year;
741
+ $options[ 'cff_translate_years' ] = $cff_translate_years;
742
+ $options[ 'cff_translate_ago' ] = $cff_translate_ago;
743
+
744
//View on Facebook link
745
$options[ 'cff_link_size' ] = $cff_link_size;
746
$options[ 'cff_link_weight' ] = $cff_link_weight;
749
$options[ 'cff_view_link_text' ] = $cff_view_link_text;
750
$options[ 'cff_link_to_timeline' ] = $cff_link_to_timeline;
751
}
752
+ //Update the Misc options
753
if( isset($_POST[ $style_misc_hidden_field_name ]) && $_POST[ $style_misc_hidden_field_name ] == 'Y' ) {
754
//Meta
755
$cff_icon_style = $_POST[ 'cff_icon_style' ];
764
$cff_like_box_position = $_POST[ 'cff_like_box_position' ];
765
$cff_like_box_outside = $_POST[ 'cff_like_box_outside' ];
766
$cff_likebox_bg_color = $_POST[ 'cff_likebox_bg_color' ];
767
+ $cff_like_box_text_color = $_POST[ 'cff_like_box_text_color' ];
768
+
769
$cff_likebox_width = $_POST[ 'cff_likebox_width' ];
770
$cff_like_box_faces = $_POST[ 'cff_like_box_faces' ];
771
+ $cff_like_box_border = $_POST[ 'cff_like_box_border' ];
772
+
773
$cff_video_height = $_POST[ 'cff_video_height' ];
774
$cff_video_action = $_POST[ 'cff_video_action' ];
775
$cff_sep_color = $_POST[ 'cff_sep_color' ];
788
$options[ 'cff_like_box_position' ] = $cff_like_box_position;
789
$options[ 'cff_like_box_outside' ] = $cff_like_box_outside;
790
$options[ 'cff_likebox_bg_color' ] = $cff_likebox_bg_color;
791
+ $options[ 'cff_like_box_text_color' ] = $cff_like_box_text_color;
792
+
793
$options[ 'cff_likebox_width' ] = $cff_likebox_width;
794
$options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
795
+ $options[ 'cff_like_box_border' ] = $cff_like_box_border;
796
797
$options[ 'cff_video_height' ] = $cff_video_height;
798
$options[ 'cff_video_action' ] = $cff_video_action;
1226
<td>
1227
<select name="cff_date_formatting">
1228
<?php $original = strtotime('2013-07-25T17:30:00+0000'); ?>
1229
+ <option value="1" <?php if($cff_date_formatting == "1") echo 'selected="selected"' ?> ><?php _e('2 days ago'); ?></option>
1230
<option value="2" <?php if($cff_date_formatting == "2") echo 'selected="selected"' ?> ><?php echo date('F jS, g:i a', $original); ?></option>
1231
<option value="3" <?php if($cff_date_formatting == "3") echo 'selected="selected"' ?> ><?php echo date('F jS', $original); ?></option>
1232
<option value="4" <?php if($cff_date_formatting == "4") echo 'selected="selected"' ?> ><?php echo date('D F jS', $original); ?></option>
1240
<option value="12" <?php if($cff_date_formatting == "12") echo 'selected="selected"' ?> ><?php echo date('d.m.y', $original); ?></option>
1241
<option value="13" <?php if($cff_date_formatting == "13") echo 'selected="selected"' ?> ><?php echo date('d/m/y', $original); ?></option>
1242
</select>
1243
+
1244
+ <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('Translate this'); ?></a>
1245
+ <div class="cff-tooltip">
1246
+ <div class="cff-tooltip-table">
1247
+ <p><?php _e('Translate the text below into the language you would like to use:'); ?></p>
1248
+
1249
+
1250
+ <label for="cff_translate_second"><?php _e("second"); ?></label>
1251
+ <input name="cff_translate_second" type="text" value="<?php esc_attr_e( $cff_translate_second ); ?>" size="30" />
1252
+ <br />
1253
+ <label for="cff_translate_seconds"><?php _e("seconds"); ?></label>
1254
+ <input name="cff_translate_seconds" type="text" value="<?php esc_attr_e( $cff_translate_second ); ?>" size="30" />
1255
+ <br />
1256
+ <label for="cff_translate_minute"><?php _e("minute"); ?></label>
1257
+ <input name="cff_translate_minute" type="text" value="<?php esc_attr_e( $cff_translate_minute ); ?>" size="30" />
1258
+ <br />
1259
+ <label for="cff_translate_minutes"><?php _e("minutes"); ?></label>
1260
+ <input name="cff_translate_minutes" type="text" value="<?php esc_attr_e( $cff_translate_minutes ); ?>" size="30" />
1261
+ <br />
1262
+ <label for="cff_translate_hour"><?php _e("hour"); ?></label>
1263
+ <input name="cff_translate_hour" type="text" value="<?php esc_attr_e( $cff_translate_hour ); ?>" size="30" />
1264
+ <br />
1265
+ <label for="cff_translate_hours"><?php _e("hours"); ?></label>
1266
+ <input name="cff_translate_hours" type="text" value="<?php esc_attr_e( $cff_translate_hours ); ?>" size="30" />
1267
+ <br />
1268
+ <label for="cff_translate_day"><?php _e("day"); ?></label>
1269
+ <input name="cff_translate_day" type="text" value="<?php esc_attr_e( $cff_translate_day ); ?>" size="30" />
1270
+ <br />
1271
+ <label for="cff_translate_days"><?php _e("days"); ?></label>
1272
+ <input name="cff_translate_days" type="text" value="<?php esc_attr_e( $cff_translate_days ); ?>" size="30" />
1273
+ <br />
1274
+ <label for="cff_translate_week"><?php _e("week"); ?></label>
1275
+ <input name="cff_translate_week" type="text" value="<?php esc_attr_e( $cff_translate_week ); ?>" size="30" />
1276
+ <br />
1277
+ <label for="cff_translate_weeks"><?php _e("weeks"); ?></label>
1278
+ <input name="cff_translate_weeks" type="text" value="<?php esc_attr_e( $cff_translate_weeks ); ?>" size="30" />
1279
+ <br />
1280
+ <label for="cff_translate_month"><?php _e("month"); ?></label>
1281
+ <input name="cff_translate_month" type="text" value="<?php esc_attr_e( $cff_translate_month ); ?>" size="30" />
1282
+ <br />
1283
+ <label for="cff_translate_months"><?php _e("months"); ?></label>
1284
+ <input name="cff_translate_months" type="text" value="<?php esc_attr_e( $cff_translate_months ); ?>" size="30" />
1285
+ <br />
1286
+ <label for="cff_translate_year"><?php _e("year"); ?></label>
1287
+ <input name="cff_translate_year" type="text" value="<?php esc_attr_e( $cff_translate_year ); ?>" size="30" />
1288
+ <br />
1289
+ <label for="cff_translate_years"><?php _e("years"); ?></label>
1290
+ <input name="cff_translate_years" type="text" value="<?php esc_attr_e( $cff_translate_years ); ?>" size="30" />
1291
+ <br />
1292
+ <label for="cff_translate_ago"><?php _e("ago"); ?></label>
1293
+ <input name="cff_translate_ago" type="text" value="<?php esc_attr_e( $cff_translate_ago ); ?>" size="30" />
1294
+ </div>
1295
+ </div>
1296
+
1297
</td>
1298
</tr>
1299
<tr>
1305
</tr>
1306
<tr>
1307
<th><label for="cff_date_before" class="bump-left"><?php _e('Text before date'); ?></label></th>
1308
+ <td><input name="cff_date_before" type="text" value="<?php esc_attr_e( $cff_date_before ); ?>" size="20" placeholder="Eg. Posted" /></td>
1309
</tr>
1310
<tr>
1311
<th><label for="cff_date_after" class="bump-left"><?php _e('Text after date'); ?></label></th>
1312
+ <td><input name="cff_date_after" type="text" value="<?php esc_attr_e( $cff_date_after ); ?>" size="20" placeholder="Eg. by ___" /></td>
1313
</tr>
1314
</tbody>
1315
</table>
1663
</td>
1664
</tr>
1665
<tr valign="top">
1666
+ <th scope="row"><label class="bump-left"><?php _e('Color of page name'); ?></label></th>
1667
+ <td>
1668
+ <select name="cff_like_box_text_color">
1669
+ <option value="blue" <?php if($cff_like_box_text_color == "blue") echo 'selected="selected"' ?> ><?php _e('Blue'); ?></option>
1670
+ <option value="white" <?php if($cff_like_box_text_color == "white") echo 'selected="selected"' ?> ><?php _e('White'); ?></option>
1671
+ </select>
1672
+ <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php _e('Why only these 2 colors?'); ?></a>
1673
+ <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>
1674
+ </td>
1675
+ </tr>
1676
+ <tr valign="top">
1677
+ <th scope="row"><label for="cff_likebox_width" class="bump-left"><?php _e('Custom Like Box Width'); ?></label></th>
1678
<td>
1679
<input name="cff_likebox_width" type="text" value="<?php esc_attr_e( $cff_likebox_width ); ?>" size="6" />
1680
+ <span><span>Eg. 50%, 300px</span> <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Default is 100%'); ?></i></span>
1681
</td>
1682
</tr>
1683
<tr valign="top">
1684
+ <th scope="row"><label class="bump-left"><?php _e('Show faces of fans'); ?></label></th>
1685
<td>
1686
<input type="checkbox" name="cff_like_box_faces" id="cff_like_box_faces" <?php if($cff_like_box_faces == true) echo 'checked="checked"' ?> />
1687
<i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Show thumbnail photos of fans who like your page'); ?></i>
1688
</td>
1689
</tr>
1690
+ <tr valign="top">
1691
+ <th scope="row"><label class="bump-left"><?php _e('Show the Like Box border'); ?></label></th>
1692
+ <td>
1693
+ <input type="checkbox" name="cff_like_box_border" id="cff_like_box_outside" <?php if($cff_like_box_border == true) echo 'checked="checked"' ?> />
1694
+ <i style="color: #666; font-size: 11px; margin-left: 5px;"><?php _e('Only applicable if you are showing faces of fans'); ?></i>
1695
+ </td>
1696
+ </tr>
1697
1698
<tr><td><b style="font-size: 14px;"><?php _e('Separating Line'); ?></b></td></tr>
1699
<tr valign="top">
custom-facebook-feed.php CHANGED
@@ -3,13 +3,13 @@
3
Plugin Name: Custom Facebook Feed
4
Plugin URI: http://smashballoon.com/custom-facebook-feed
5
Description: Add a completely customizable Facebook feed to your WordPress site
6
- Version: 1.6.7.1
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
10
*/
11
/*
12
- Copyright 2013 Smash Balloon (email : hey@smashballoon.com)
13
This program is free software; you can redistribute it and/or modify
14
it under the terms of the GNU General Public License as published by
15
the Free Software Foundation; either version 2 of the License, or
@@ -46,6 +46,7 @@ function display_cff($atts) {
46
$atts = shortcode_atts(
47
array(
48
'id' => get_option('cff_page_id'),
49
'num' => get_option('cff_num_show'),
50
'limit' => get_option('cff_post_limit'),
51
'others' => get_option('cff_show_others'),
@@ -111,8 +112,10 @@ function display_cff($atts) {
111
'likeboxpos' => $options[ 'cff_like_box_position' ],
112
'likeboxoutside' => $options[ 'cff_like_box_outside' ],
113
'likeboxcolor' => $options[ 'cff_likebox_bg_color' ],
114
'likeboxwidth' => $options[ 'cff_likebox_width' ],
115
'likeboxfaces' => $options[ 'cff_like_box_faces' ],
116
117
'videoheight' => $options[ 'cff_video_height' ],
118
'videoaction' => $options[ 'cff_video_action' ],
@@ -120,6 +123,9 @@ function display_cff($atts) {
120
'sepsize' => $options[ 'cff_sep_size' ]
121
), $atts);
122
/********** GENERAL **********/
123
$cff_feed_width = $atts['width'];
124
$cff_feed_height = $atts[ 'height' ];
125
$cff_feed_padding = $atts[ 'padding' ];
@@ -265,9 +271,31 @@ function display_cff($atts) {
265
/********** MISC **********/
266
//Like Box styles
267
$cff_likebox_bg_color = $atts[ 'likeboxcolor' ];
268
$cff_likebox_styles = 'style="';
269
if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= 'background-color:#' . $cff_likebox_bg_color . '; margin-left: 0; ';
270
$cff_likebox_styles .= '"';
271
//Video
272
//Dimensions
273
$cff_video_width = 640;
@@ -290,8 +318,8 @@ function display_cff($atts) {
290
if (!isset($title_limit)) $title_limit = 9999;
291
$body_limit = $atts['desclength'];
292
//Assign the Access Token and Page ID variables
293
- $access_token = get_option('cff_access_token');
294
- $page_id = $atts['id'];
295
//Get show posts attribute. If not set then default to 25
296
$show_posts = $atts['num'];
297
if (empty($show_posts)) $show_posts = 25;
@@ -309,8 +337,10 @@ function display_cff($atts) {
309
//Use posts? or feed?
310
$show_others = $atts['others'];
311
$graph_query = 'posts';
312
- if ($show_others == 'on' || $show_others == 'true' || $show_others == true) $graph_query = 'feed';
313
- $cff_post_limit = $atts['limit'];
314
//Calculate the cache time in seconds
315
if($cff_cache_time_unit == 'minutes') $cff_cache_time_unit = 60;
316
if($cff_cache_time_unit == 'hours') $cff_cache_time_unit = 60*60;
@@ -326,8 +356,11 @@ function display_cff($atts) {
326
//Set like box variable
327
$like_box = '<div class="cff-likebox';
328
if ($cff_like_box_outside) $like_box .= ' cff-outside';
329
- $like_box .= ($cff_like_box_position == 'top') ? ' cff-top' : ' cff-bottom';
330
- $like_box .= '"' . $cff_likebox_styles . '><script src="http://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" width="'.$cff_likebox_width.'" show_faces="'.$cff_like_box_faces.'" stream="false" header="false"></fb:like-box></div>';
331
//***START FEED***
332
$content = '';
333
//Add like box to the outside of the top of feed
@@ -449,9 +482,10 @@ function display_cff($atts) {
449
450
//POST AUTHOR
451
$cff_author = '<a class="cff-author" href="http://facebook.com/' . $news->from->id . '" '.$target.' title="'.$news->from->name.' on Facebook">';
452
- $cff_author .= '<img src="http://graph.facebook.com/' . $news->from->id . '/picture">';
453
- $cff_author .= '<p>'.$news->from->name.'</p>';
454
$cff_author .= '</a>';
455
//POST TEXT
456
$cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
457
$cff_post_text .= '<span class="cff-text">';
@@ -473,27 +507,41 @@ function display_cff($atts) {
473
//'See More' link
474
$cff_post_text .= '<span class="cff-expand">... <a href="#"><span class="cff-more">' . $cff_see_more_text . '</span><span class="cff-less">' . $cff_see_less_text . '</span></a></span>';
475
$cff_post_text .= '</' . $cff_title_format . '>';
476
//DESCRIPTION
477
$cff_description = '';
478
//Use the description if it's available and the post type isn't set to offer (offer description isn't useful)
479
- if (!empty($news->description) && $cff_post_type != 'offer') {
480
$description_text = $news->description;
481
if (!empty($body_limit)) {
482
if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
483
}
484
$cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_make_clickable($description_text) . '</span></p>';
485
}
486
//LINK
487
$cff_shared_link = '';
488
//Display shared link
489
if ($news->type == 'link') {
490
//Display link name and description
491
if (!empty($news->description)) {
492
- $cff_shared_link .= '<p class="cff-text-link ';
493
- $cff_shared_link .= 'cff-no-image';
494
- $cff_shared_link .= '"><a href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a></p>';
495
}
496
}
497
//DATE
498
$cff_date_formatting = $atts[ 'dateformat' ];
499
$cff_date_custom = $atts[ 'datecustom' ];
@@ -549,24 +597,36 @@ function display_cff($atts) {
549
550
}
551
}
552
-
553
//Display the link to the Facebook post or external link
554
$cff_link = '';
555
//Default link
556
$cff_viewpost_class = 'cff-viewpost-facebook';
557
if ($cff_facebook_link_text == '') $cff_facebook_link_text = 'View on Facebook';
558
$link_text = $cff_facebook_link_text;
559
- if (!empty($news->link)) {
560
- //Check whether it links to facebook or somewhere else
561
- $facebook_str = 'facebook.com';
562
- if(stripos($link, $facebook_str) == false) {
563
- if ($cff_view_link_text == '') $cff_view_link_text = 'View Link';
564
- $link_text = $cff_view_link_text;
565
- }
566
- $cff_viewpost_class = 'cff-viewpost-link';
567
- }
568
if ($cff_post_type == 'offer') $link_text = 'View Offer';
569
$cff_link = '<a class="' . $cff_viewpost_class . '" href="' . $link . '" title="' . $link_text . '" ' . $target . ' ' . $cff_link_styles . '>' . $link_text . '</a>';
570
//**************************//
571
//***CREATE THE POST HTML***//
572
//**************************//
@@ -588,7 +648,7 @@ function display_cff($atts) {
588
//POST TEXT
589
if($cff_show_text) $content .= $cff_post_text;
590
//DESCRIPTION
591
- if($cff_show_desc) $content .= $cff_description;
592
//LINK
593
if($cff_show_shared_links) $content .= $cff_shared_link;
594
//DATE BELOW
@@ -771,17 +831,67 @@ function cff_getdate($original, $date_format, $custom_date) {
771
break;
772
default:
773
774
- $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
775
$lengths = array("60","60","24","7","4.35","12","10");
776
$now = time();
777
778
// is it future date or past date
779
if($now > $original) {
780
$difference = $now - $original;
781
- $tense = "ago";
782
} else {
783
$difference = $original - $now;
784
- $tense = "from now";
785
}
786
for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
787
$difference /= $lengths[$j];
@@ -790,7 +900,7 @@ function cff_getdate($original, $date_format, $custom_date) {
790
$difference = round($difference);
791
792
if($difference != 1) {
793
- $periods[$j].= "s";
794
}
795
$print = "$difference $periods[$j] {$tense}";
796
break;
@@ -852,17 +962,67 @@ function cff_eventdate($original, $date_format, $custom_date) {
852
//Time stamp function - used for comments
853
function cff_timesince($original) {
854
855
- $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
856
$lengths = array("60","60","24","7","4.35","12","10");
857
$now = time();
858
859
// is it future date or past date
860
if($now > $original) {
861
$difference = $now - $original;
862
- $tense = "ago";
863
} else {
864
$difference = $original - $now;
865
- $tense = "from now";
866
}
867
for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
868
$difference /= $lengths[$j];
@@ -871,7 +1031,7 @@ function cff_timesince($original) {
871
$difference = round($difference);
872
873
if($difference != 1) {
874
- $periods[$j].= "s";
875
}
876
return "$difference $periods[$j] {$tense}";
877
3
Plugin Name: Custom Facebook Feed
4
Plugin URI: http://smashballoon.com/custom-facebook-feed
5
Description: Add a completely customizable Facebook feed to your WordPress site
6
+ Version: 1.6.8
7
Author: Smash Balloon
8
Author URI: http://smashballoon.com/
9
License: GPLv2 or later
10
*/
11
/*
12
+ Copyright 2013 Smash Balloon LLC (email : hey@smashballoon.com)
13
This program is free software; you can redistribute it and/or modify
14
it under the terms of the GNU General Public License as published by
15
the Free Software Foundation; either version 2 of the License, or
46
$atts = shortcode_atts(
47
array(
48
'id' => get_option('cff_page_id'),
49
+ 'pagetype' => get_option('cff_page_type'),
50
'num' => get_option('cff_num_show'),
51
'limit' => get_option('cff_post_limit'),
52
'others' => get_option('cff_show_others'),
112
'likeboxpos' => $options[ 'cff_like_box_position' ],
113
'likeboxoutside' => $options[ 'cff_like_box_outside' ],
114
'likeboxcolor' => $options[ 'cff_likebox_bg_color' ],
115
+ 'likeboxtextcolor' => $options[ 'cff_like_box_text_color' ],
116
'likeboxwidth' => $options[ 'cff_likebox_width' ],
117
'likeboxfaces' => $options[ 'cff_like_box_faces' ],
118
+ 'likeboxborder' => $options[ 'cff_like_box_border' ],
119
120
'videoheight' => $options[ 'cff_video_height' ],
121
'videoaction' => $options[ 'cff_video_action' ],
123
'sepsize' => $options[ 'cff_sep_size' ]
124
), $atts);
125
/********** GENERAL **********/
126
+ $cff_page_type = $atts[ 'pagetype' ];
127
+ if ($cff_page_type == 'group') $cff_is_group = true;
128
+
129
$cff_feed_width = $atts['width'];
130
$cff_feed_height = $atts[ 'height' ];
131
$cff_feed_padding = $atts[ 'padding' ];
271
/********** MISC **********/
272
//Like Box styles
273
$cff_likebox_bg_color = $atts[ 'likeboxcolor' ];
274
+
275
+ $cff_like_box_text_color = $atts[ 'likeboxtextcolor' ];
276
+ $cff_like_box_colorscheme = 'light';
277
+ if ($cff_like_box_text_color == 'white') $cff_like_box_colorscheme = 'dark';
278
+
279
$cff_likebox_styles = 'style="';
280
if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= 'background-color:#' . $cff_likebox_bg_color . '; margin-left: 0; ';
281
+
282
+ $cff_likebox_width = $atts[ 'likeboxwidth' ];
283
+ if ( !isset($cff_likebox_width) || empty($cff_likebox_width) || $cff_likebox_width == '' ) $cff_likebox_width = '100%';
284
+ $cff_like_box_faces = $atts[ 'likeboxfaces' ];
285
+ if ( !isset($cff_like_box_faces) || empty($cff_like_box_faces) ) $cff_like_box_faces = 'false';
286
+ $cff_like_box_border = $atts[ 'likeboxborder' ];
287
+ if ($cff_like_box_border) {
288
+ $cff_like_box_border = 'true';
289
+ } else {
290
+ $cff_like_box_border = 'false';
291
+ }
292
+
293
+ //Compile Like box styles
294
+ $cff_likebox_styles = 'style="width: ' . $cff_likebox_width . ';';
295
+ if ( !empty($cff_likebox_bg_color) ) $cff_likebox_styles .= 'background-color: #' . $cff_likebox_bg_color . ';';
296
+ if ( empty($cff_likebox_bg_color) && $cff_like_box_faces == 'false' ) $cff_likebox_styles .= ' margin-left: -10px;';
297
$cff_likebox_styles .= '"';
298
+
299
//Video
300
//Dimensions
301
$cff_video_width = 640;
318
if (!isset($title_limit)) $title_limit = 9999;
319
$body_limit = $atts['desclength'];
320
//Assign the Access Token and Page ID variables
321
+ $access_token = trim( get_option('cff_access_token') );
322
+ $page_id = trim( $atts['id'] );
323
//Get show posts attribute. If not set then default to 25
324
$show_posts = $atts['num'];
325
if (empty($show_posts)) $show_posts = 25;
337
//Use posts? or feed?
338
$show_others = $atts['others'];
339
$graph_query = 'posts';
340
+ if ( $show_others == 'on' || $show_others == 'true' || $show_others == true || $cff_is_group ) $graph_query = 'feed';
341
+ if ( $show_others == 'false' ) $graph_query = 'posts';
342
+
343
+
344
//Calculate the cache time in seconds
345
if($cff_cache_time_unit == 'minutes') $cff_cache_time_unit = 60;
346
if($cff_cache_time_unit == 'hours') $cff_cache_time_unit = 60*60;
356
//Set like box variable
357
$like_box = '<div class="cff-likebox';
358
if ($cff_like_box_outside) $like_box .= ' cff-outside';
359
+ $like_box .= ($cff_like_box_position == 'top') ? ' top' : ' bottom';
360
+ $like_box .= '"' . $cff_likebox_styles . '><script src="http://connect.facebook.net/' . $cff_locale . '/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/' . $page_id . '" show_faces="'.$cff_like_box_faces.'" stream="false" header="false" colorscheme="'. $cff_like_box_colorscheme .'" show_border="'. $cff_like_box_border .'"></fb:like-box></div>';
361
+ //Don't show like box if it's a group
362
+ if($cff_is_group) $like_box = '';
363
+
364
//***START FEED***
365
$content = '';
366
//Add like box to the outside of the top of feed
482
483
//POST AUTHOR
484
$cff_author = '<a class="cff-author" href="http://facebook.com/' . $news->from->id . '" '.$target.' title="'.$news->from->name.' on Facebook">';
485
+ $cff_author .= '<img src="http://graph.facebook.com/' . $news->from->id . '/picture" width=50 height=50>';
486
+ $cff_author .= '<span class="cff-page-name">'.$news->from->name.'</span>';
487
$cff_author .= '</a>';
488
+
489
//POST TEXT
490
$cff_post_text = '<' . $cff_title_format . ' class="cff-post-text" ' . $cff_title_styles . '>';
491
$cff_post_text .= '<span class="cff-text">';
507
//'See More' link
508
$cff_post_text .= '<span class="cff-expand">... <a href="#"><span class="cff-more">' . $cff_see_more_text . '</span><span class="cff-less">' . $cff_see_less_text . '</span></a></span>';
509
$cff_post_text .= '</' . $cff_title_format . '>';
510
+
511
//DESCRIPTION
512
$cff_description = '';
513
//Use the description if it's available and the post type isn't set to offer (offer description isn't useful)
514
+ if ( ( !empty($news->description) || !empty($news->caption) ) && $cff_post_type != 'offer') {
515
+
516
$description_text = $news->description;
517
+ if (!isset($description_text)) $description_text = $news->caption;
518
+
519
if (!empty($body_limit)) {
520
if (strlen($description_text) > $body_limit) $description_text = substr($description_text, 0, $body_limit) . '...';
521
}
522
$cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_make_clickable($description_text) . '</span></p>';
523
+
524
}
525
+
526
//LINK
527
$cff_shared_link = '';
528
//Display shared link
529
if ($news->type == 'link') {
530
+ $cff_shared_link .= '<div class="cff-shared-link">';
531
+
532
//Display link name and description
533
if (!empty($news->description)) {
534
+ $cff_shared_link .= '<div class="cff-text-link ';
535
+ if (!$cff_link_image) $cff_shared_link .= 'cff-no-image';
536
+ $cff_shared_link .= '"><a class="cff-link-title" href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a>';
537
+ if(!empty($news->caption)) $cff_shared_link .= '<p class="cff-link-caption">'.$news->caption.'</p>';
538
+ $cff_shared_link .= $cff_description;
539
+ $cff_shared_link .= '</div>';
540
}
541
+
542
+ $cff_shared_link .= '</div>';
543
}
544
+
545
//DATE
546
$cff_date_formatting = $atts[ 'dateformat' ];
547
$cff_date_custom = $atts[ 'datecustom' ];
597
598
}
599
}
600
+
601
+ /* VIDEO */
602
+ $cff_is_video_embed = false;
603
+ $cff_media = '';
604
+ if ($news->type == 'video') {
605
+ $cff_is_video_embed = true;
606
+ //Add the name to the description if it's a video embed
607
+ if($cff_is_video_embed) {
608
+ $cff_description = '<div class="cff-desc-wrap ';
609
+ if (empty($picture)) $cff_description .= 'cff-no-image';
610
+ $cff_description .= '"><a class="cff-link-title" href="'.$link.'" '.$target.'>'. '<b>' . $news->name . '</b></a>';
611
+ $cff_description .= '<p class="cff-post-desc" '.$cff_body_styles.'><span>' . cff_make_clickable($description_text) . '</span></p></div>';
612
+ }
613
+ }
614
+
615
+
616
//Display the link to the Facebook post or external link
617
$cff_link = '';
618
//Default link
619
$cff_viewpost_class = 'cff-viewpost-facebook';
620
if ($cff_facebook_link_text == '') $cff_facebook_link_text = 'View on Facebook';
621
$link_text = $cff_facebook_link_text;
622
+
623
+ //Link to the Facebook post if it's a link or a video
624
+ if($cff_post_type == 'link' || $cff_post_type == 'video') $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
625
+
626
if ($cff_post_type == 'offer') $link_text = 'View Offer';
627
$cff_link = '<a class="' . $cff_viewpost_class . '" href="' . $link . '" title="' . $link_text . '" ' . $target . ' ' . $cff_link_styles . '>' . $link_text . '</a>';
628
+
629
+
630
//**************************//
631
//***CREATE THE POST HTML***//
632
//**************************//
648
//POST TEXT
649
if($cff_show_text) $content .= $cff_post_text;
650
//DESCRIPTION
651
+ if($cff_show_desc && $cff_post_type != 'offer' && $cff_post_type != 'link') $content .= $cff_description;
652
//LINK
653
if($cff_show_shared_links) $content .= $cff_shared_link;
654
//DATE BELOW
831
break;
832
default:
833
834
+ $options = get_option('cff_style_settings');
835
+
836
+ $cff_second = $options['cff_translate_second'];
837
+ if ( empty($cff_second) ) $cff_second = 'second';
838
+
839
+ $cff_seconds = $options['cff_translate_seconds'];
840
+ if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
841
+
842
+ $cff_minute = $options['cff_translate_minute'];
843
+ if ( empty($cff_minute) ) $cff_minute = 'minute';
844
+
845
+ $cff_minutes = $options['cff_translate_minutes'];
846
+ if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
847
+
848
+ $cff_hour = $options['cff_translate_hour'];
849
+ if ( empty($cff_hour) ) $cff_hour = 'hour';
850
+
851
+ $cff_hours = $options['cff_translate_hours'];
852
+ if ( empty($cff_hours) ) $cff_hours = 'hours';
853
+
854
+ $cff_day = $options['cff_translate_day'];
855
+ if ( empty($cff_day) ) $cff_day = 'day';
856
+
857
+ $cff_days = $options['cff_translate_days'];
858
+ if ( empty($cff_days) ) $cff_days = 'days';
859
+
860
+ $cff_week = $options['cff_translate_week'];
861
+ if ( empty($cff_week) ) $cff_week = 'week';
862
+
863
+ $cff_weeks = $options['cff_translate_weeks'];
864
+ if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
865
+
866
+ $cff_month = $options['cff_translate_month'];
867
+ if ( empty($cff_month) ) $cff_month = 'month';
868
+
869
+ $cff_months = $options['cff_translate_months'];
870
+ if ( empty($cff_months) ) $cff_months = 'months';
871
+
872
+ $cff_year = $options['cff_translate_year'];
873
+ if ( empty($cff_year) ) $cff_year = 'year';
874
+
875
+ $cff_years = $options['cff_translate_years'];
876
+ if ( empty($cff_years) ) $cff_years = 'years';
877
+
878
+ $cff_ago = $options['cff_translate_ago'];
879
+ if ( empty($cff_ago) ) $cff_ago = 'ago';
880
+
881
+
882
+ $periods = array($cff_second, $cff_minute, $cff_hour, $cff_day, $cff_week, $cff_month, $cff_year, "decade");
883
+ $periods_plural = array($cff_seconds, $cff_minutes, $cff_hours, $cff_days, $cff_weeks, $cff_months, $cff_years, "decade");
884
+
885
$lengths = array("60","60","24","7","4.35","12","10");
886
$now = time();
887
888
// is it future date or past date
889
if($now > $original) {
890
$difference = $now - $original;
891
+ $tense = $cff_ago;
892
} else {
893
$difference = $original - $now;
894
+ $tense = $cff_ago;
895
}
896
for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
897
$difference /= $lengths[$j];
900
$difference = round($difference);
901
902
if($difference != 1) {
903
+ $periods[$j] = $periods_plural[$j];
904
}
905
$print = "$difference $periods[$j] {$tense}";
906
break;
962
//Time stamp function - used for comments
963
function cff_timesince($original) {
964
965
+ $options = get_option('cff_style_settings');
966
+
967
+ $cff_second = $options['cff_translate_second'];
968
+ if ( empty($cff_second) ) $cff_second = 'second';
969
+
970
+ $cff_seconds = $options['cff_translate_seconds'];
971
+ if ( empty($cff_seconds) ) $cff_seconds = 'seconds';
972
+
973
+ $cff_minute = $options['cff_translate_minute'];
974
+ if ( empty($cff_minute) ) $cff_minute = 'minute';
975
+
976
+ $cff_minutes = $options['cff_translate_minutes'];
977
+ if ( empty($cff_minutes) ) $cff_minutes = 'minutes';
978
+
979
+ $cff_hour = $options['cff_translate_hour'];
980
+ if ( empty($cff_hour) ) $cff_hour = 'hour';
981
+
982
+ $cff_hours = $options['cff_translate_hours'];
983
+ if ( empty($cff_hours) ) $cff_hours = 'hours';
984
+
985
+ $cff_day = $options['cff_translate_day'];
986
+ if ( empty($cff_day) ) $cff_day = 'day';
987
+
988
+ $cff_days = $options['cff_translate_days'];
989
+ if ( empty($cff_days) ) $cff_days = 'days';
990
+
991
+ $cff_week = $options['cff_translate_week'];
992
+ if ( empty($cff_week) ) $cff_week = 'week';
993
+
994
+ $cff_weeks = $options['cff_translate_weeks'];
995
+ if ( empty($cff_weeks) ) $cff_weeks = 'weeks';
996
+
997
+ $cff_month = $options['cff_translate_month'];
998
+ if ( empty($cff_month) ) $cff_month = 'month';
999
+
1000
+ $cff_months = $options['cff_translate_months'];
1001
+ if ( empty($cff_months) ) $cff_months = 'months';
1002
+
1003
+ $cff_year = $options['cff_translate_year'];
1004
+ if ( empty($cff_year) ) $cff_year = 'year';
1005
+
1006
+ $cff_years = $options['cff_translate_years'];
1007
+ if ( empty($cff_years) ) $cff_years = 'years';
1008
+
1009
+ $cff_ago = $options['cff_translate_ago'];
1010
+ if ( empty($cff_ago) ) $cff_ago = 'ago';
1011
+
1012
+
1013
+ $periods = array($cff_second, $cff_minute, $cff_hour, $cff_day, $cff_week, $cff_month, $cff_year, "decade");
1014
+ $periods_plural = array($cff_seconds, $cff_minutes, $cff_hours, $cff_days, $cff_weeks, $cff_months, $cff_years, "decade");
1015
+
1016
$lengths = array("60","60","24","7","4.35","12","10");
1017
$now = time();
1018
1019
// is it future date or past date
1020
if($now > $original) {
1021
$difference = $now - $original;
1022
+ $tense = $cff_ago;;
1023
} else {
1024
$difference = $original - $now;
1025
+ $tense = $cff_ago;
1026
}
1027
for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
1028
$difference /= $lengths[$j];
1031
$difference = round($difference);
1032
1033
if($difference != 1) {
1034
+ $periods[$j] = $periods_plural[$j];
1035
}
1036
return "$difference $periods[$j] {$tense}";
1037
js/cff-admin-scripts.js CHANGED
@@ -1,5 +1,50 @@
1
jQuery(document).ready(function() {
2
- jQuery('#cff-admin .tooltip-link').click(function(){
3
- jQuery(this).closest('tr').find('.tooltip').slideToggle();
4
});
5
});
1
jQuery(document).ready(function() {
2
+
3
+ //Tooltips
4
+ jQuery('#cff-admin .cff-tooltip-link').click(function(){
5
+ jQuery(this).closest('tr').find('.cff-tooltip').slideToggle();
6
});
7
+
8
+ //Check Access Token length
9
+ jQuery("#cff_access_token").change(function() {
10
+
11
+ var cff_token_string = jQuery('#cff_access_token').val(),
12
+ cff_token_check = cff_token_string.indexOf('|');
13
+
14
+ if ( (cff_token_check == -1) && (cff_token_string.length < 50) && (cff_token_string.length !== 0) ) {
15
+ jQuery('.cff-profile-error.cff-access-token').fadeIn();
16
+ } else {
17
+ jQuery('.cff-profile-error.cff-access-token').fadeOut();
18
+ }
19
+
20
+ });
21
+
22
+ //Is this a page, group or profile?
23
+ var cff_page_type = jQuery('.cff-page-type select').val(),
24
+ $cff_page_type_options = jQuery('.cff-page-options'),
25
+ $cff_profile_error = jQuery('.cff-profile-error.cff-page-type');
26
+
27
+ //Should we show anything initially?
28
+ if(cff_page_type !== 'page') $cff_page_type_options.hide();
29
+ if(cff_page_type == 'profile') $cff_profile_error.show();
30
+
31
+ //When page type is changed show the relevant item
32
+ jQuery('.cff-page-type').change(function(){
33
+ cff_page_type = jQuery('.cff-page-type select').val();
34
+
35
+ if( cff_page_type !== 'page' ) {
36
+ $cff_page_type_options.fadeOut(function(){
37
+ if( cff_page_type == 'profile' ) {
38
+ $cff_profile_error.fadeIn();
39
+ } else {
40
+ $cff_profile_error.fadeOut();
41
+ }
42
+ });
43
+
44
+ } else {
45
+ $cff_page_type_options.fadeIn();
46
+ $cff_profile_error.fadeOut();
47
+ }
48
+ });
49
+
50
});