Version Description
- December 2, 2013 =
- Fixed: Empty events won't show
- Improved: a cache renewal is no longer required after changing the image size
- Improved: after changing important settings, cache will automatically be cleared
- Improved: added a test configuration button which performs a simple ping to Facebook.
- Improved: added an info message for new users
- Improved: filters are now added the "WordPress way", which means they can be disabled
- Improved: namespaced the trigger for renewing the cache
- Improved: added empty
index.php
files to prevent directory listings - Improved: code clean-up
Download this release
Release Info
Developer | DvanKooten |
Plugin | Recent Facebook Posts |
Version | 1.8.4 |
Comparing to | |
See all releases |
Code changes from version 1.7.3 to 1.8.4
- assets/css/admin.css +61 -24
- assets/css/default.css +16 -2
- assets/css/index.php +3 -0
- assets/img/index.php +3 -0
- assets/index.php +3 -0
- assets/js/index.php +3 -0
- includes/RFBP.php +0 -303
- includes/RFBP_Widget.php +0 -104
- includes/{RFBP_Admin.php → class-admin.php} +57 -25
- includes/{RFBP_API.php → class-api.php} +16 -2
- includes/class-public.php +277 -0
- includes/class-widget.php +118 -0
- includes/helper-functions.php +39 -2
- includes/index.php +3 -0
- includes/plugin.php +72 -0
- includes/template-functions.php +2 -1
- includes/views/index.php +3 -0
- includes/views/settings_page.html.php +160 -141
- index.php +3 -0
- languages/index.php +3 -0
- languages/recent-facebook-posts-nl_NL.mo +0 -0
- languages/recent-facebook-posts-nl_NL.po +282 -0
- languages/recent-facebook-posts.mo +0 -0
- languages/recent-facebook-posts.po +268 -0
- license.txt +621 -0
- readme.txt +58 -7
- recent-facebook-posts.php +31 -21
assets/css/admin.css
CHANGED
@@ -1,24 +1,61 @@
|
|
1 |
-
.rfbp-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
.rfbp-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.rfbp-container{
|
2 |
+
max-width:1200px;
|
3 |
+
}
|
4 |
+
|
5 |
+
.rfbp-primary{
|
6 |
+
width:60%;
|
7 |
+
}
|
8 |
+
|
9 |
+
.rfbp-column{
|
10 |
+
float:left;
|
11 |
+
}
|
12 |
+
|
13 |
+
.rfbp-secondary {
|
14 |
+
width:35%;
|
15 |
+
margin-left: 2%;
|
16 |
+
padding-left:2%;
|
17 |
+
border-left: 1px solid #efefef;
|
18 |
+
}
|
19 |
+
|
20 |
+
.rfbp-error{
|
21 |
+
color:red;
|
22 |
+
}
|
23 |
+
|
24 |
+
.rfbp-box{
|
25 |
+
margin:0 0 25px;
|
26 |
+
clear:both;
|
27 |
+
}
|
28 |
+
|
29 |
+
.rfbp-info {
|
30 |
+
padding:5px 15px;
|
31 |
+
color: #3a87ad;
|
32 |
+
background-color: #d9edf7;
|
33 |
+
border-color: #bce8f1;
|
34 |
+
}
|
35 |
+
|
36 |
+
.rfbp-alert {
|
37 |
+
padding:5px 15px;
|
38 |
+
color: #c09853;
|
39 |
+
background-color: #fcf8e3;
|
40 |
+
border-color: #faebcc;
|
41 |
+
}
|
42 |
+
|
43 |
+
.rfbp-title{ margin-top: 2em; }
|
44 |
+
|
45 |
+
@media(max-width: 919px) {
|
46 |
+
.rfbp-column{
|
47 |
+
float: none;
|
48 |
+
width: 100%;
|
49 |
+
}
|
50 |
+
|
51 |
+
.rfbp-secondary{
|
52 |
+
padding:0;
|
53 |
+
margin:25px 0;
|
54 |
+
border-left:0;
|
55 |
+
}
|
56 |
+
|
57 |
+
.rfbp-box{
|
58 |
+
border-top: 1px solid #efefef;
|
59 |
+
padding-top:25px;
|
60 |
+
}
|
61 |
+
}
|
assets/css/default.css
CHANGED
@@ -2,9 +2,23 @@
|
|
2 |
|
3 |
.rfbp-post { border-bottom:1px solid #E9E9E9; padding-bottom:15px; margin-bottom:15px; margin-top:0; padding-top:0; }
|
4 |
.rfbp-post-link-wrap { margin-bottom:0 !important; padding-bottom:0; }
|
5 |
-
.rfbp-post-link{ display:block; font-weight:normal; background:none; border:0; padding:1px 0; margin:0; cursor:pointer; text-decoration:none !important; color:#3B5998
|
6 |
.rfbp-post-link:hover{ text-decoration:none !important; color:#3B5998; }
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
.rfbp-timestamp{ color:#999;}
|
9 |
.rfbp-timestamp:hover{ text-decoration:underline; color:#999; font-weight:normal; }
|
10 |
|
@@ -14,7 +28,7 @@
|
|
14 |
.rfbp-like-count > span{ display:none; }
|
15 |
.rfbp-comment-count > span{ display:none; }
|
16 |
|
17 |
-
.rfbp-image-wrap { margin:1em 0; max-width:100%; }
|
18 |
.rfbp-image-link{ margin:0; padding:0; float:none; line-height:0; max-width:100%; display:inline-block; }
|
19 |
.rfbp-image{ margin:0; padding:0; border:1px solid #ccc; }
|
20 |
|
2 |
|
3 |
.rfbp-post { border-bottom:1px solid #E9E9E9; padding-bottom:15px; margin-bottom:15px; margin-top:0; padding-top:0; }
|
4 |
.rfbp-post-link-wrap { margin-bottom:0 !important; padding-bottom:0; }
|
5 |
+
.rfbp-post-link{ display:block; font-weight:normal !important; background:none; border:0; padding:1px 0; margin:0; cursor:pointer; text-decoration:none !important; color:#3B5998; font-size:11px; line-height:15px !important; height:15px; }
|
6 |
.rfbp-post-link:hover{ text-decoration:none !important; color:#3B5998; }
|
7 |
|
8 |
+
.rfbp-link-wrap{ display:block; padding:0 !important; margin:1em 0; max-width:100%; font-weight: normal !important; text-shadow: none !important;
|
9 |
+
background: #f6f7f9; border: 1px solid #d3dae8 !important; font-size:11px; color: gray; overflow: hidden; }
|
10 |
+
a.rfbp-link{ text-decoration: none !important; display:block; color: gray; font-weight: normal; }
|
11 |
+
a.rfbp-link:hover{ text-decoration:none; }
|
12 |
+
|
13 |
+
span.rfbp-link-image-wrap{ margin:0; padding:0; width:114px; line-height: 0; border-right: 1px solid #d3dae8; display:table-cell; vertical-align: middle; }
|
14 |
+
img.rfbp-link-image{ margin:0 !important; padding:0 !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; width:114px; height: auto; display: inline; }
|
15 |
+
|
16 |
+
span.rfbp-link-text-wrap{ padding:8px; color: gray; display:table-cell; }
|
17 |
+
span.rfbp-link-text-wrap span{ line-height:14px; display:block; }
|
18 |
+
span.rfbp-link-name{ font-weight:bold; color: #3b5998; }
|
19 |
+
span.rfbp-link-caption{ }
|
20 |
+
span.rfbp-link-description{ margin-top:12px; }
|
21 |
+
|
22 |
.rfbp-timestamp{ color:#999;}
|
23 |
.rfbp-timestamp:hover{ text-decoration:underline; color:#999; font-weight:normal; }
|
24 |
|
28 |
.rfbp-like-count > span{ display:none; }
|
29 |
.rfbp-comment-count > span{ display:none; }
|
30 |
|
31 |
+
.rfbp-image-wrap { display:block; margin:1em 0; max-width:100%; }
|
32 |
.rfbp-image-link{ margin:0; padding:0; float:none; line-height:0; max-width:100%; display:inline-block; }
|
33 |
.rfbp-image{ margin:0; padding:0; border:1px solid #ccc; }
|
34 |
|
assets/css/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
assets/img/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
assets/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
assets/js/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
includes/RFBP.php
DELETED
@@ -1,303 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class RFBP {
|
4 |
-
|
5 |
-
private static $instance = null;
|
6 |
-
private static $api = null;
|
7 |
-
private $options;
|
8 |
-
public $cache_renewed = false;
|
9 |
-
|
10 |
-
public static function instance() {
|
11 |
-
return self::$instance;
|
12 |
-
}
|
13 |
-
|
14 |
-
public function __construct() {
|
15 |
-
|
16 |
-
self::$instance = $this;
|
17 |
-
|
18 |
-
// both frontend and backend
|
19 |
-
include_once RFBP_PLUGIN_DIR . 'includes/RFBP_Widget.php';
|
20 |
-
add_action( 'widgets_init', array($this, 'register_widget') );
|
21 |
-
|
22 |
-
// finish if this is an AJAX request
|
23 |
-
if(defined("DOING_AJAX") && DOING_AJAX) { return; }
|
24 |
-
|
25 |
-
// starts sessions, fixes app token problem
|
26 |
-
if(!session_id() && !headers_sent()) {
|
27 |
-
session_start();
|
28 |
-
}
|
29 |
-
|
30 |
-
$opts = $this->get_settings();
|
31 |
-
|
32 |
-
// only on frontend
|
33 |
-
if(!is_admin()) {
|
34 |
-
|
35 |
-
add_filter('rfbp_content', 'wpautop');
|
36 |
-
|
37 |
-
include_once RFBP_PLUGIN_DIR . 'includes/helper-functions.php';
|
38 |
-
include_once RFBP_PLUGIN_DIR . 'includes/template-functions.php';
|
39 |
-
|
40 |
-
add_shortcode('recent_facebook_posts', array($this, 'output'));
|
41 |
-
add_shortcode('recent-facebook-posts', array($this, 'output'));
|
42 |
-
|
43 |
-
if($opts['load_css']) {
|
44 |
-
add_action( 'wp_enqueue_scripts', array($this, 'load_css'));
|
45 |
-
}
|
46 |
-
|
47 |
-
} else {
|
48 |
-
// only in admin panel
|
49 |
-
include_once RFBP_PLUGIN_DIR . 'includes/RFBP_Admin.php';
|
50 |
-
new RFBP_Admin();
|
51 |
-
}
|
52 |
-
|
53 |
-
add_action('rfbp_renew_cache', array($this, 'delete_transients'), 10);
|
54 |
-
add_action('rfbp_renew_cache', array($this, 'get_posts'), 11);
|
55 |
-
}
|
56 |
-
|
57 |
-
public function register_widget()
|
58 |
-
{
|
59 |
-
register_widget( "RFBP_Widget" );
|
60 |
-
}
|
61 |
-
|
62 |
-
public function load_css() {
|
63 |
-
wp_register_style('recent-facebook-posts-css', plugins_url('recent-facebook-posts/assets/css/default.css'), array(), RFBP_VERSION );
|
64 |
-
wp_enqueue_style('recent-facebook-posts-css' );
|
65 |
-
}
|
66 |
-
|
67 |
-
public function get_settings() {
|
68 |
-
if(!$this->options) {
|
69 |
-
|
70 |
-
$defaults = array(
|
71 |
-
'app_id' => '',
|
72 |
-
'app_secret' => '',
|
73 |
-
'fb_id' => 'DannyvanKootenCOM',
|
74 |
-
'cache_time' => 7200,
|
75 |
-
'load_css' => 1,
|
76 |
-
'link_text' => 'Find us on Facebook',
|
77 |
-
'link_new_window' => 0,
|
78 |
-
'img_size' => 'normal',
|
79 |
-
'img_width' => '',
|
80 |
-
'img_height' => ''
|
81 |
-
);
|
82 |
-
|
83 |
-
// get user options
|
84 |
-
$options = get_option('rfb_settings');
|
85 |
-
|
86 |
-
// options did not exist yet, add option to database
|
87 |
-
if(!$options) { add_option('rfb_settings', $defaults); }
|
88 |
-
|
89 |
-
$this->options = array_merge($defaults, (array) $options);
|
90 |
-
}
|
91 |
-
|
92 |
-
return $this->options;
|
93 |
-
}
|
94 |
-
|
95 |
-
static public function api()
|
96 |
-
{
|
97 |
-
if(!self::$api) {
|
98 |
-
require_once RFBP_PLUGIN_DIR . 'includes/RFBP_API.php';
|
99 |
-
$opts = RFBP::instance()->get_settings();
|
100 |
-
self::$api = new RFBP_API($opts['app_id'], $opts['app_secret'], $opts['fb_id']);
|
101 |
-
}
|
102 |
-
|
103 |
-
return self::$api;
|
104 |
-
}
|
105 |
-
|
106 |
-
public function get_fallback_posts()
|
107 |
-
{
|
108 |
-
$posts = get_transient('rfbp_posts_fallback');
|
109 |
-
|
110 |
-
if(!$posts) {
|
111 |
-
return array();
|
112 |
-
}
|
113 |
-
|
114 |
-
return $posts;
|
115 |
-
}
|
116 |
-
|
117 |
-
public function get_posts() {
|
118 |
-
|
119 |
-
// try to get posts from cache
|
120 |
-
if(($posts = get_transient('rfbp_posts'))) {
|
121 |
-
return $posts;
|
122 |
-
}
|
123 |
-
|
124 |
-
$opts = $this->get_settings();
|
125 |
-
|
126 |
-
$api = self::api();
|
127 |
-
$data = $api->get_posts();
|
128 |
-
|
129 |
-
// did api call succeed?
|
130 |
-
if(!$data) {
|
131 |
-
return $this->get_fallback_posts();
|
132 |
-
}
|
133 |
-
|
134 |
-
$posts = array();
|
135 |
-
foreach($data as $p) {
|
136 |
-
|
137 |
-
// skip this "post" if it is not of one of the following types
|
138 |
-
if(!in_array($p->type, array('status', 'photo', 'video', 'link'))) {
|
139 |
-
continue;
|
140 |
-
}
|
141 |
-
|
142 |
-
// skip empty status updates and friend approvals
|
143 |
-
if($p->type == 'status' && (!isset($p->message) || empty($p->message))) { continue; }
|
144 |
-
if($p->type == 'status' && $p->status_type == 'approved_friend') { continue; }
|
145 |
-
|
146 |
-
//split user and post ID (userID_postID)
|
147 |
-
$idArray = explode("_", $p->id);
|
148 |
-
|
149 |
-
$post = array();
|
150 |
-
$post['type'] = $p->type;
|
151 |
-
$post['content'] = isset($p->message) ? utf8_encode($p->message) : '';
|
152 |
-
$post['image'] = null;
|
153 |
-
|
154 |
-
// set post content and image
|
155 |
-
if($p->type == 'photo') {
|
156 |
-
|
157 |
-
$image = "//graph.facebook.com/". $p->object_id . '/picture?type=' . $opts['img_size'];
|
158 |
-
$post['image'] = $image;
|
159 |
-
|
160 |
-
} elseif($p->type == 'video') {
|
161 |
-
|
162 |
-
$image = $p->picture;
|
163 |
-
|
164 |
-
// hacky
|
165 |
-
if($opts['img_size'] == 'normal') {
|
166 |
-
$image = str_replace(array("_s.jpg", "_s.png"), array("_n.jpg", "_n.png"), $image);
|
167 |
-
}
|
168 |
-
|
169 |
-
$post['image'] = $image;
|
170 |
-
|
171 |
-
} elseif($p->type == 'link' && !stristr($post['content'], $p->link)) {
|
172 |
-
$post['content'] .= (empty($post['content'])) ? $p->link : "\n\n" . $p->link;
|
173 |
-
}
|
174 |
-
|
175 |
-
// calculate post like and comment counts
|
176 |
-
if(isset($p->likes->summary->total_count)) {
|
177 |
-
$like_count = $p->likes->summary->total_count;
|
178 |
-
} else {
|
179 |
-
$like_count = 0;
|
180 |
-
}
|
181 |
-
|
182 |
-
if(isset($p->comments->summary->total_count)) {
|
183 |
-
$comment_count = $p->comments->summary->total_count;
|
184 |
-
} else {
|
185 |
-
$comment_count = 0;
|
186 |
-
}
|
187 |
-
|
188 |
-
$post['timestamp'] = strtotime($p->created_time);
|
189 |
-
$post['like_count'] = $like_count;
|
190 |
-
$post['comment_count'] = $comment_count;
|
191 |
-
$post['link'] = "http://www.facebook.com/".$opts['fb_id']."/posts/".$idArray[1];
|
192 |
-
$posts[] = $post;
|
193 |
-
|
194 |
-
}
|
195 |
-
|
196 |
-
// store results in cache for later use
|
197 |
-
if($posts) {
|
198 |
-
set_transient('rfbp_posts', $posts, $opts['cache_time']); // user set cache time
|
199 |
-
set_transient('rfbp_posts_fallback', $posts, 2629744); // 1 month
|
200 |
-
$this->cache_renewed = true;
|
201 |
-
}
|
202 |
-
|
203 |
-
return $posts;
|
204 |
-
}
|
205 |
-
|
206 |
-
public function output($atts = array())
|
207 |
-
{
|
208 |
-
extract(shortcode_atts(array(
|
209 |
-
'number' => '5',
|
210 |
-
'likes' => 1,
|
211 |
-
'comments' => 1,
|
212 |
-
'excerpt_length' => 140,
|
213 |
-
'el' => 'div',
|
214 |
-
'origin' => 'shortcode',
|
215 |
-
'show_link' => false
|
216 |
-
), $atts));
|
217 |
-
|
218 |
-
$opts = $this->get_settings();
|
219 |
-
$posts = $this->get_posts();
|
220 |
-
|
221 |
-
ob_start();
|
222 |
-
?>
|
223 |
-
<!-- Recent Facebook Posts v<?php echo RFBP_VERSION; ?> - http://wordpress.org/plugins/recent-facebook-posts/ -->
|
224 |
-
<div class="recent-facebook-posts rfbp rfbp-container rfbp-<?php echo $origin; ?>">
|
225 |
-
<?php
|
226 |
-
|
227 |
-
if($posts && !empty($posts)) {
|
228 |
-
|
229 |
-
if($el == 'li') { echo '<ul class="rfbp-posts-wrap">'; }
|
230 |
-
|
231 |
-
$posts = array_slice($posts, 0, $number);
|
232 |
-
$link_target = ($opts['link_new_window']) ? "_blank" : '';
|
233 |
-
|
234 |
-
foreach($posts as $p) {
|
235 |
-
|
236 |
-
$content = convert_smilies(utf8_decode($p['content']));
|
237 |
-
|
238 |
-
$shortened = false;
|
239 |
-
|
240 |
-
if(strlen($content) > $excerpt_length) {
|
241 |
-
$limit = strpos($content, ' ',$excerpt_length);
|
242 |
-
if($limit) {
|
243 |
-
$content = substr($content, 0, $limit);
|
244 |
-
$shortened = true;
|
245 |
-
}
|
246 |
-
}
|
247 |
-
?>
|
248 |
-
|
249 |
-
<<?php echo $el; ?> class="rfbp-post">
|
250 |
-
<div class="rfbp-text">
|
251 |
-
|
252 |
-
<?php
|
253 |
-
$content = make_clickable($content, $link_target);
|
254 |
-
$content = ($shortened) ? $content . apply_filters('rfbp_read_more', '..', $p['link']) : $content;
|
255 |
-
$content = apply_filters('rfbp_content', $content, $p['link']);
|
256 |
-
|
257 |
-
echo $content; ?>
|
258 |
-
|
259 |
-
</div>
|
260 |
-
<?php if($opts['img_size'] != 'dont_show' && isset($p['image']) && !empty($p['image'])) { ?>
|
261 |
-
<p class="rfbp-image-wrap">
|
262 |
-
<a class="rfbp-image-link" target="<?php echo $link_target; ?>" href="<?php echo $p['link']; ?>" rel="nofollow">
|
263 |
-
<?php $max_img_width = (!empty($opts['img_width'])) ? $opts['img_width'].'px' : '100%'; $max_img_height = (!empty($opts['img_height'])) ? $opts['img_height'].'px' : 'none'; ?>
|
264 |
-
<img class="rfbp-image" src="<?php echo $p['image']; ?>" style="max-width: <?php echo $max_img_width; ?>; max-height: <?php echo $max_img_height; ?>" alt="" />
|
265 |
-
</a>
|
266 |
-
</p>
|
267 |
-
<?php } ?>
|
268 |
-
<p class="rfbp-post-link-wrap">
|
269 |
-
<a target="<?php echo $link_target; ?>" class="rfbp-post-link" href="<?php echo $p['link']; ?>" rel="nofolloW">
|
270 |
-
<?php if($likes) { ?><span class="rfbp-like-count"><?php echo $p['like_count']; ?> <span>likes<?php if($comments) { ?>, <?php } ?></span></span><?php } ?>
|
271 |
-
<?php if($comments) { ?><span class="rfbp-comment-count"><?php echo $p['comment_count']; ?> <span>comments</span></span><?php } ?>
|
272 |
-
<?php if($likes || $comments) { ?> · <?php } ?>
|
273 |
-
<span class="rfbp-timestamp" title="<?php echo date('l, F j, Y', $p['timestamp']) ?> at <?php echo date('G:i', $p['timestamp']); ?>"><?php echo rfbp_time_ago($p['timestamp']); ?></span>
|
274 |
-
</a>
|
275 |
-
</p>
|
276 |
-
</<?php echo $el; ?>>
|
277 |
-
<?php
|
278 |
-
|
279 |
-
} // end foreach $posts
|
280 |
-
|
281 |
-
if($el == 'li') { echo '</ul>'; }
|
282 |
-
|
283 |
-
} else {
|
284 |
-
?><p>No recent Facebook posts to show.</p><?php
|
285 |
-
if(current_user_can('manage_options')) {
|
286 |
-
?><p><strong>Admins only notice:</strong> Did you <a href="<?php echo admin_url('options-general.php?page=rfbp'); ?>">configure the plugin</a> properly?</p><?php
|
287 |
-
}
|
288 |
-
} ?>
|
289 |
-
|
290 |
-
<?php if($show_link) { ?>
|
291 |
-
<p class="rfbp-page-link-wrap"><a class="rfbp-page-link" href="http://www.facebook.com/<?php echo $opts['fb_id']; ?>/" rel="external nofollow" target="<?php echo $link_target; ?>"><?php echo strip_tags($opts['link_text']); ?></a></p>
|
292 |
-
<?php } ?>
|
293 |
-
|
294 |
-
</div>
|
295 |
-
<!-- / Recent Facebook Posts -->
|
296 |
-
<?php
|
297 |
-
$output = ob_get_contents();
|
298 |
-
ob_end_clean();
|
299 |
-
|
300 |
-
return $output;
|
301 |
-
}
|
302 |
-
|
303 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/RFBP_Widget.php
DELETED
@@ -1,104 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class RFBP_Widget extends WP_Widget {
|
4 |
-
|
5 |
-
private $defaults = array(
|
6 |
-
'title' => 'Recent Facebook posts',
|
7 |
-
'number_of_posts' => 5,
|
8 |
-
'excerpt_length' => 140,
|
9 |
-
'show_comment_count' => true,
|
10 |
-
'show_like_count' => true,
|
11 |
-
'show_link' => true
|
12 |
-
);
|
13 |
-
|
14 |
-
public function __construct() {
|
15 |
-
parent::__construct(
|
16 |
-
'rfb_widget', // Base ID
|
17 |
-
'Recent Facebook Posts', // Name
|
18 |
-
array( 'description' => 'Lists a number of your most recent Facebook posts.' )
|
19 |
-
);
|
20 |
-
}
|
21 |
-
|
22 |
-
public function form( $instance ) {
|
23 |
-
|
24 |
-
$instance = array_merge($this->defaults, $instance);
|
25 |
-
extract($instance);
|
26 |
-
|
27 |
-
$opts = RFBP::instance()->get_settings();
|
28 |
-
|
29 |
-
if(empty($opts['app_id'])) { ?>
|
30 |
-
<p style="color:red;">You'll need to <a href="<?php echo admin_url('options-general.php?page=rfbp'); ?>">configure Recent Facebook Posts</a> first before this will work.</p>
|
31 |
-
<?php } ?>
|
32 |
-
<p>
|
33 |
-
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
34 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
|
35 |
-
</p>
|
36 |
-
|
37 |
-
<p>
|
38 |
-
<label for="<?php echo $this->get_field_id( 'number_of_posts' ); ?>"><?php _e( 'Number of posts:' ); ?></label>
|
39 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'number_of_posts' ); ?>" name="<?php echo $this->get_field_name( 'number_of_posts' ); ?>" type="text" value="<?php echo esc_attr( $number_of_posts ); ?>" />
|
40 |
-
</p>
|
41 |
-
|
42 |
-
<p>
|
43 |
-
<label for="<?php echo $this->get_field_id( 'excerpt_length' ); ?>"><?php _e( 'Excerpt length:' ); ?></label>
|
44 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'excerpt_length' ); ?>" name="<?php echo $this->get_field_name( 'excerpt_length' ); ?>" type="text" value="<?php echo esc_attr( $excerpt_length ); ?>" />
|
45 |
-
</p>
|
46 |
-
|
47 |
-
<p>
|
48 |
-
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_like_count' ); ?>" name="<?php echo $this->get_field_name( 'show_like_count' ); ?>" value="1" <?php checked($show_like_count, 1); ?> />
|
49 |
-
<label for="<?php echo $this->get_field_id( 'show_like_count' ); ?>"><?php _e( 'Show Like count?' ); ?></label>
|
50 |
-
</p>
|
51 |
-
|
52 |
-
<p>
|
53 |
-
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_comment_count' ); ?>" name="<?php echo $this->get_field_name( 'show_comment_count' ); ?>" value="1" <?php checked($show_comment_count, 1); ?> />
|
54 |
-
<label for="<?php echo $this->get_field_id( 'show_comment_count' ); ?>"><?php _e( 'Show Comment count?' ); ?></label>
|
55 |
-
</p>
|
56 |
-
|
57 |
-
<p>
|
58 |
-
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_link' ); ?>" name="<?php echo $this->get_field_name( 'show_link' ); ?>" value="1" <?php if($show_link) { ?>checked="1"<?php } ?> />
|
59 |
-
<label for="<?php echo $this->get_field_id( 'show_link' ); ?>"><?php _e( 'Show a link to Facebook page?' ); ?></label>
|
60 |
-
</p>
|
61 |
-
|
62 |
-
<p style="background: #222; color:#eee; padding:10px; ">If you like this plugin, consider <a href="http://dannyvankooten.com/donate/">donating $10, $20 or $50</a> as a token of your appreciation.</p>
|
63 |
-
|
64 |
-
<?php
|
65 |
-
}
|
66 |
-
|
67 |
-
public function update( $new_instance, $old_instance ) {
|
68 |
-
$instance = array();
|
69 |
-
$instance['title'] = strip_tags( $new_instance['title'] );
|
70 |
-
$instance['number_of_posts'] = (int) strip_tags( $new_instance['number_of_posts'] );
|
71 |
-
$instance['excerpt_length'] = (int) strip_tags($new_instance['excerpt_length']);
|
72 |
-
$instance['show_like_count'] = isset($new_instance['show_like_count']);
|
73 |
-
$instance['show_comment_count'] = isset($new_instance['show_comment_count']);
|
74 |
-
$instance['show_link'] = isset($new_instance['show_link']);
|
75 |
-
return $instance;
|
76 |
-
}
|
77 |
-
|
78 |
-
public function widget( $args, $instance = array()) {
|
79 |
-
|
80 |
-
$instance = array_merge($this->defaults, $instance);
|
81 |
-
|
82 |
-
extract($instance);
|
83 |
-
extract( $args );
|
84 |
-
|
85 |
-
$title = apply_filters( 'widget_title', $instance['title'] );
|
86 |
-
|
87 |
-
echo $before_widget;
|
88 |
-
if ( ! empty( $title ) )
|
89 |
-
echo $before_title . $title . $after_title;
|
90 |
-
echo RFBP::instance()->output(array(
|
91 |
-
'origin' => 'widget',
|
92 |
-
'number' => $number_of_posts,
|
93 |
-
'likes' => $show_like_count,
|
94 |
-
'comments' => $show_comment_count,
|
95 |
-
'excerpt_length' => $excerpt_length,
|
96 |
-
'el' => apply_filters('rfbp_widget_element', 'div'),
|
97 |
-
'show_link' => $show_link
|
98 |
-
));
|
99 |
-
echo $after_widget;
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/{RFBP_Admin.php → class-admin.php}
RENAMED
@@ -2,9 +2,9 @@
|
|
2 |
|
3 |
class RFBP_Admin {
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
8 |
|
9 |
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
10 |
add_action( 'admin_menu', array( $this, 'build_menu' ) );
|
@@ -13,25 +13,45 @@ class RFBP_Admin {
|
|
13 |
|
14 |
// handle requests early, but only on rfb settings page
|
15 |
if ( isset( $_GET['page'] ) && $_GET['page'] == 'rfbp' ) {
|
16 |
-
|
17 |
// load css
|
18 |
add_action( 'admin_enqueue_scripts', array( $this, 'load_css' ) );
|
19 |
-
add_action( 'init', array( $this, 'on_init' ) );
|
20 |
}
|
|
|
|
|
21 |
}
|
22 |
|
23 |
public function on_init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
// maybe renew cache file
|
25 |
-
if ( isset( $_POST['
|
|
|
26 |
delete_transient('rfbp_posts');
|
27 |
delete_transient('rfbp_posts_fallback');
|
28 |
|
29 |
-
|
30 |
}
|
31 |
-
}
|
32 |
|
33 |
-
|
34 |
-
|
|
|
35 |
}
|
36 |
|
37 |
public function register_settings() {
|
@@ -39,23 +59,26 @@ class RFBP_Admin {
|
|
39 |
}
|
40 |
|
41 |
public function sanitize_settings( $opts ) {
|
42 |
-
$old_opts =
|
|
|
|
|
43 |
$opts['app_id'] = trim($opts['app_id']);
|
44 |
$opts['app_secret'] = trim($opts['app_secret']);
|
45 |
$opts['fb_id'] = trim($opts['fb_id']);
|
46 |
|
47 |
-
if($old_opts['fb_id'] !== $opts['fb_id'] || $old_opts['
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
if($old_opts['app_id'] !== $opts['app_id'] || !$old_opts['app_secret']) {
|
52 |
-
add_settings_error('rfbp', 'rfbp-cache-invalid', 'You changed important settings, please test your new configuration by renewing the Facebook posts cache. <form action="'. admin_url('options-general.php?page=rfbp') .'" method="post"><input type="hidden" name="renew_cache" value="1" /><input type="submit" class="button-primary" value="Renew Cache" /></form>', "updated");
|
53 |
}
|
54 |
|
55 |
-
|
|
|
56 |
$opts['img_height'] = ( !empty( $opts['img_height'] ) ) ? (int) $opts['img_height'] : '';
|
57 |
$opts['img_width'] = ( !empty( $opts['img_width'] ) ) ? (int) $opts['img_width'] : '';
|
58 |
$opts['load_css'] = ( isset( $opts['load_css'] ) ) ? 1 : 0;
|
|
|
|
|
59 |
return $opts;
|
60 |
}
|
61 |
|
@@ -70,14 +93,11 @@ class RFBP_Admin {
|
|
70 |
|
71 |
public function settings_page() {
|
72 |
|
73 |
-
$opts =
|
74 |
-
|
75 |
-
$ready = (!empty($opts['app_id']) && !empty($opts['app_secret']) && !empty($opts['fb_id']));
|
76 |
-
$api = RFBP::api();
|
77 |
|
78 |
// show user-friendly error message
|
79 |
-
if(
|
80 |
-
$notice = "<strong>Cache
|
81 |
}
|
82 |
|
83 |
include_once RFBP_PLUGIN_DIR . 'includes/views/settings_page.html.php';
|
@@ -89,10 +109,22 @@ class RFBP_Admin {
|
|
89 |
* @param array $links Array containing all the settings links for the various plugins.
|
90 |
* @return array The new array containing all the settings links
|
91 |
*/
|
92 |
-
function add_settings_link( $links ) {
|
93 |
-
$settings_link = '<a href="options-general.php?page=rfbp">Settings</a>';
|
94 |
array_unshift( $links, $settings_link );
|
95 |
|
96 |
return $links;
|
97 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
2 |
|
3 |
class RFBP_Admin {
|
4 |
|
5 |
+
private $cache_cleared = false;
|
6 |
|
7 |
+
public function __construct() {
|
8 |
|
9 |
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
10 |
add_action( 'admin_menu', array( $this, 'build_menu' ) );
|
13 |
|
14 |
// handle requests early, but only on rfb settings page
|
15 |
if ( isset( $_GET['page'] ) && $_GET['page'] == 'rfbp' ) {
|
|
|
16 |
// load css
|
17 |
add_action( 'admin_enqueue_scripts', array( $this, 'load_css' ) );
|
|
|
18 |
}
|
19 |
+
|
20 |
+
add_action( 'init', array( $this, 'on_init' ) );
|
21 |
}
|
22 |
|
23 |
public function on_init() {
|
24 |
+
|
25 |
+
if(version_compare(RFBP_VERSION, get_option('rfbp_version', 0))) {
|
26 |
+
|
27 |
+
// code is newer than database, run upgrade routine
|
28 |
+
delete_transient('rfbp_posts');
|
29 |
+
delete_transient('rfbp_posts_fallback');
|
30 |
+
|
31 |
+
$settings = rfbp_get_settings();
|
32 |
+
|
33 |
+
if(isset($settings['link_text'])) {
|
34 |
+
$settings['page_link_text'] = $settings['link_text'];
|
35 |
+
unset($settings['link_text']);
|
36 |
+
}
|
37 |
+
|
38 |
+
update_option('rfb_settings', $settings);
|
39 |
+
|
40 |
+
update_option('rfbp_version', RFBP_VERSION);
|
41 |
+
}
|
42 |
+
|
43 |
// maybe renew cache file
|
44 |
+
if ( isset( $_POST['rfbp-clear-cache'] ) ) {
|
45 |
+
|
46 |
delete_transient('rfbp_posts');
|
47 |
delete_transient('rfbp_posts_fallback');
|
48 |
|
49 |
+
$this->cache_cleared = true;
|
50 |
}
|
|
|
51 |
|
52 |
+
if(isset($_POST['rfbp-test-config'])) {
|
53 |
+
add_action( 'admin_init', array($this, 'test_facebook_api') );
|
54 |
+
}
|
55 |
}
|
56 |
|
57 |
public function register_settings() {
|
59 |
}
|
60 |
|
61 |
public function sanitize_settings( $opts ) {
|
62 |
+
$old_opts = rfbp_get_settings();
|
63 |
+
|
64 |
+
// fb config
|
65 |
$opts['app_id'] = trim($opts['app_id']);
|
66 |
$opts['app_secret'] = trim($opts['app_secret']);
|
67 |
$opts['fb_id'] = trim($opts['fb_id']);
|
68 |
|
69 |
+
if(($old_opts['fb_id'] !== $opts['fb_id']) || ($old_opts['app_id'] !== $opts['app_id']) || ($old_opts['app_secret'] !== $opts['app_secret'])) {
|
70 |
+
// delete cache transients
|
71 |
+
delete_transient('rfbp_posts');
|
72 |
+
delete_transient('rfbp_posts_fallback');
|
|
|
|
|
73 |
}
|
74 |
|
75 |
+
// appearance opts
|
76 |
+
$opts['page_link_text'] = strip_tags($opts['page_link_text'], '<span><strong><b><em><i><img>');
|
77 |
$opts['img_height'] = ( !empty( $opts['img_height'] ) ) ? (int) $opts['img_height'] : '';
|
78 |
$opts['img_width'] = ( !empty( $opts['img_width'] ) ) ? (int) $opts['img_width'] : '';
|
79 |
$opts['load_css'] = ( isset( $opts['load_css'] ) ) ? 1 : 0;
|
80 |
+
$opts['show_links'] = isset($opts['show_links']) ? 1 : 0;
|
81 |
+
|
82 |
return $opts;
|
83 |
}
|
84 |
|
93 |
|
94 |
public function settings_page() {
|
95 |
|
96 |
+
$opts = rfbp_get_settings();
|
|
|
|
|
|
|
97 |
|
98 |
// show user-friendly error message
|
99 |
+
if($this->cache_cleared) {
|
100 |
+
$notice = __("<strong>Cache cleared!</strong> You succesfully cleared the cache.", 'recent-facebook-posts');
|
101 |
}
|
102 |
|
103 |
include_once RFBP_PLUGIN_DIR . 'includes/views/settings_page.html.php';
|
109 |
* @param array $links Array containing all the settings links for the various plugins.
|
110 |
* @return array The new array containing all the settings links
|
111 |
*/
|
112 |
+
public function add_settings_link( $links ) {
|
113 |
+
$settings_link = '<a href="options-general.php?page=rfbp">'. __('Settings', 'recent-facebook-posts') . '</a>';
|
114 |
array_unshift( $links, $settings_link );
|
115 |
|
116 |
return $links;
|
117 |
}
|
118 |
+
|
119 |
+
public function test_facebook_api()
|
120 |
+
{
|
121 |
+
$api = rfbp_get_api();
|
122 |
+
$ping = $api->ping();
|
123 |
+
|
124 |
+
if($ping) {
|
125 |
+
add_settings_error('rfbp', 'rfbp-api-success', __('Your configuration seems to be okay and working! Nice work.', 'recent-facebook-posts'), "updated");
|
126 |
+
} else {
|
127 |
+
add_settings_error('rfbp', 'rfbp-api-error', __('Facebook returned the following error when testing your configuration.', 'recent-facebook-posts') . '<pre>' . $api->get_error_message() . '</pre>');
|
128 |
+
}
|
129 |
+
}
|
130 |
}
|
includes/{RFBP_API.php → class-api.php}
RENAMED
@@ -16,8 +16,7 @@ class RFBP_API {
|
|
16 |
public function get_posts()
|
17 |
{
|
18 |
$result = $this->call("{$this->fb_id}/posts", array(
|
19 |
-
'fields' => 'id,picture,type,from,message,status_type,object_id,link,created_time,comments.limit(1).summary(true),likes.limit(1).summary(true)'
|
20 |
-
'access_token' => "{$this->app_id}|{$this->app_secret}"
|
21 |
));
|
22 |
|
23 |
if($result) {
|
@@ -32,11 +31,26 @@ class RFBP_API {
|
|
32 |
return false;
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
private function call($endpoint, array $data = array())
|
36 |
{
|
37 |
if(empty($this->app_id) || empty($this->app_secret)) { return false; }
|
38 |
|
39 |
$url = "https://graph.facebook.com/{$endpoint}";
|
|
|
40 |
|
41 |
$url = add_query_arg($data, $url);
|
42 |
|
16 |
public function get_posts()
|
17 |
{
|
18 |
$result = $this->call("{$this->fb_id}/posts", array(
|
19 |
+
'fields' => 'id,picture,type,from,message,status_type,object_id,picture,name,caption,description,link,created_time,comments.limit(1).summary(true),likes.limit(1).summary(true)'
|
|
|
20 |
));
|
21 |
|
22 |
if($result) {
|
31 |
return false;
|
32 |
}
|
33 |
|
34 |
+
public function ping()
|
35 |
+
{
|
36 |
+
$result = $this->call("{$this->fb_id}/posts", array('fields' => 'name', 'limit' => 1) );
|
37 |
+
|
38 |
+
if($result) {
|
39 |
+
if(isset($result->data)) {
|
40 |
+
return true;
|
41 |
+
} else {
|
42 |
+
$this->error = $result->error;
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
private function call($endpoint, array $data = array())
|
49 |
{
|
50 |
if(empty($this->app_id) || empty($this->app_secret)) { return false; }
|
51 |
|
52 |
$url = "https://graph.facebook.com/{$endpoint}";
|
53 |
+
$data['access_token'] = "{$this->app_id}|{$this->app_secret}";
|
54 |
|
55 |
$url = add_query_arg($data, $url);
|
56 |
|
includes/class-public.php
ADDED
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RFBP_Public {
|
4 |
+
|
5 |
+
private static $instance = null;
|
6 |
+
|
7 |
+
public static function instance()
|
8 |
+
{
|
9 |
+
if(!self::$instance) {
|
10 |
+
self::$instance = new RFBP_Public();
|
11 |
+
}
|
12 |
+
|
13 |
+
return self::$instance;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function __construct() {
|
17 |
+
|
18 |
+
$opts = rfbp_get_settings();
|
19 |
+
|
20 |
+
include_once RFBP_PLUGIN_DIR . 'includes/helper-functions.php';
|
21 |
+
include_once RFBP_PLUGIN_DIR . 'includes/template-functions.php';
|
22 |
+
|
23 |
+
add_shortcode( 'recent_facebook_posts', array( $this, 'output' ) );
|
24 |
+
add_shortcode( 'recent-facebook-posts', array( $this, 'output' ) );
|
25 |
+
|
26 |
+
if ( $opts['load_css'] ) {
|
27 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'load_css' ) );
|
28 |
+
}
|
29 |
+
|
30 |
+
add_filter( 'rfbp_content', 'wptexturize' ) ;
|
31 |
+
add_filter( 'rfbp_content', 'convert_smilies' );
|
32 |
+
add_filter( 'rfbp_content', 'convert_chars' );
|
33 |
+
add_filter( 'rfbp_content', 'wpautop' );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function load_css() {
|
37 |
+
wp_register_style( 'recent-facebook-posts-css', plugins_url( 'recent-facebook-posts/assets/css/default.css' ), array(), RFBP_VERSION );
|
38 |
+
wp_enqueue_style( 'recent-facebook-posts-css' );
|
39 |
+
}
|
40 |
+
|
41 |
+
public function get_fallback_posts() {
|
42 |
+
$posts = get_transient( 'rfbp_posts_fallback' );
|
43 |
+
|
44 |
+
if ( !$posts ) {
|
45 |
+
return array();
|
46 |
+
}
|
47 |
+
|
48 |
+
return $posts;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function get_posts() {
|
52 |
+
|
53 |
+
// try to get posts from cache
|
54 |
+
if ( ( $posts = get_transient( 'rfbp_posts' ) ) ) {
|
55 |
+
return $posts;
|
56 |
+
}
|
57 |
+
|
58 |
+
$opts = rfbp_get_settings();
|
59 |
+
|
60 |
+
$api = rfbp_get_api();
|
61 |
+
$data = $api->get_posts();
|
62 |
+
|
63 |
+
// did api call succeed?
|
64 |
+
if ( !$data ) {
|
65 |
+
return $this->get_fallback_posts();
|
66 |
+
}
|
67 |
+
|
68 |
+
$posts = array();
|
69 |
+
foreach ( $data as $p ) {
|
70 |
+
|
71 |
+
// skip this "post" if it is not of one of the following types
|
72 |
+
if ( !in_array( $p->type, array( 'status', 'photo', 'video', 'link' ) ) ) {
|
73 |
+
continue;
|
74 |
+
}
|
75 |
+
|
76 |
+
// skip empty status updates
|
77 |
+
if ($p->type == 'status' && (!isset($p->message) || empty($p->message) ) ) {
|
78 |
+
continue;
|
79 |
+
}
|
80 |
+
|
81 |
+
if ($p->type == 'link' && !isset($p->name) && (!isset($p->message) || empty($p->message))) {
|
82 |
+
continue;
|
83 |
+
}
|
84 |
+
|
85 |
+
// skip friend approvals
|
86 |
+
if ( $p->type == 'status' && $p->status_type == 'approved_friend' ) { continue; }
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
//split user and post ID (userID_postID)
|
92 |
+
$idArray = explode( "_", $p->id );
|
93 |
+
|
94 |
+
$post = array();
|
95 |
+
$post['type'] = $p->type;
|
96 |
+
$post['content'] = isset( $p->message ) ? utf8_encode( $p->message ) : '';
|
97 |
+
$post['image'] = null;
|
98 |
+
|
99 |
+
// set post content and image
|
100 |
+
if ( $p->type == 'photo' ) {
|
101 |
+
|
102 |
+
$image = "//graph.facebook.com/". $p->object_id . '/picture';
|
103 |
+
$post['image'] = $image;
|
104 |
+
|
105 |
+
} elseif ( $p->type == 'video' ) {
|
106 |
+
|
107 |
+
$image = $p->picture;
|
108 |
+
|
109 |
+
// hacky
|
110 |
+
if ( $opts['img_size'] == 'normal' ) {
|
111 |
+
$image = str_replace( array( "_s.jpg", "_s.png" ), array( "_n.jpg", "_n.png" ), $image );
|
112 |
+
}
|
113 |
+
|
114 |
+
$post['image'] = $image;
|
115 |
+
|
116 |
+
} elseif ( $p->type == 'link' ) {
|
117 |
+
$post['link_image'] = ( isset( $p->picture ) ) ? $p->picture : '';
|
118 |
+
$post['link_name'] = ( isset( $p->name ) ) ? $p->name : '';
|
119 |
+
$post['link_caption'] = ( isset( $p->caption ) ) ? $p->caption : '';
|
120 |
+
$post['link_description'] = ( isset( $p->description ) ) ? $p->description : '';
|
121 |
+
$post['link_url'] = $p->link;
|
122 |
+
}
|
123 |
+
|
124 |
+
// calculate post like and comment counts
|
125 |
+
if ( isset( $p->likes->summary->total_count ) ) {
|
126 |
+
$like_count = $p->likes->summary->total_count;
|
127 |
+
} else {
|
128 |
+
$like_count = 0;
|
129 |
+
}
|
130 |
+
|
131 |
+
if ( isset( $p->comments->summary->total_count ) ) {
|
132 |
+
$comment_count = $p->comments->summary->total_count;
|
133 |
+
} else {
|
134 |
+
$comment_count = 0;
|
135 |
+
}
|
136 |
+
|
137 |
+
$post['timestamp'] = strtotime( $p->created_time );
|
138 |
+
$post['like_count'] = $like_count;
|
139 |
+
$post['comment_count'] = $comment_count;
|
140 |
+
$post['url'] = "http://www.facebook.com/".$opts['fb_id']."/posts/".$idArray[1];
|
141 |
+
$posts[] = $post;
|
142 |
+
|
143 |
+
}
|
144 |
+
|
145 |
+
// store results in cache for later use
|
146 |
+
if ( $posts ) {
|
147 |
+
set_transient( 'rfbp_posts', $posts, apply_filters( 'rfbp_cache_time', 3600 ) ); // user set cache time
|
148 |
+
set_transient( 'rfbp_posts_fallback', $posts, 2629744 ); // 1 month
|
149 |
+
}
|
150 |
+
|
151 |
+
return $posts;
|
152 |
+
}
|
153 |
+
|
154 |
+
public function output( $atts = array() ) {
|
155 |
+
|
156 |
+
$opts = rfbp_get_settings();
|
157 |
+
$posts = $this->get_posts();
|
158 |
+
|
159 |
+
if ( isset( $atts['show_link'] ) ) {
|
160 |
+
$atts['show_page_link'] = $atts['show_link'];
|
161 |
+
}
|
162 |
+
|
163 |
+
extract( shortcode_atts( array(
|
164 |
+
'number' => '5',
|
165 |
+
'likes' => 1,
|
166 |
+
'comments' => 1,
|
167 |
+
'excerpt_length' => 140,
|
168 |
+
'el' => 'div',
|
169 |
+
'origin' => 'shortcode',
|
170 |
+
'show_page_link' => false,
|
171 |
+
'show_link_previews' => ( $opts['load_css'] )
|
172 |
+
), $atts ) );
|
173 |
+
|
174 |
+
ob_start();
|
175 |
+
?>
|
176 |
+
<!-- Recent Facebook Posts v<?php echo RFBP_VERSION; ?> - http://wordpress.org/plugins/recent-facebook-posts/ -->
|
177 |
+
<div class="recent-facebook-posts rfbp rfbp-container rfbp-<?php echo $origin; ?>">
|
178 |
+
<?php
|
179 |
+
|
180 |
+
if ( $posts && !empty( $posts ) ) {
|
181 |
+
|
182 |
+
if ( $el == 'li' ) { echo '<ul class="rfbp-posts-wrap">'; }
|
183 |
+
|
184 |
+
$posts = array_slice( $posts, 0, $number );
|
185 |
+
$link_target = ( $opts['link_new_window'] ) ? "_blank" : '';
|
186 |
+
|
187 |
+
foreach ( $posts as $p ) {
|
188 |
+
|
189 |
+
$content = $p['content'];
|
190 |
+
|
191 |
+
$shortened = false;
|
192 |
+
|
193 |
+
if ( strlen( $content ) > $excerpt_length ) {
|
194 |
+
$limit = strpos( $content, ' ', $excerpt_length );
|
195 |
+
if ( $limit ) {
|
196 |
+
$content = substr( $content, 0, $limit );
|
197 |
+
$shortened = true;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
?>
|
201 |
+
|
202 |
+
<<?php echo $el; ?> class="rfbp-post">
|
203 |
+
<div class="rfbp-text">
|
204 |
+
|
205 |
+
<?php
|
206 |
+
$content = make_clickable( $content, $link_target );
|
207 |
+
$content = ( $shortened ) ? $content . apply_filters( 'rfbp_read_more', '..', $p['url'] ) : $content;
|
208 |
+
$content = apply_filters( 'rfbp_content', $content, $p['url'] );
|
209 |
+
|
210 |
+
echo $content; ?>
|
211 |
+
|
212 |
+
</div>
|
213 |
+
|
214 |
+
<?php if ( $show_link_previews && isset( $p['link_url'] ) && !empty( $p['link_url'] ) && !empty( $p['link_name'] ) ) { ?>
|
215 |
+
|
216 |
+
<p class="rfbp-link-wrap">
|
217 |
+
<a class="rfbp-link" href="<?php echo $p['link_url']; ?>" rel="external nofollow" target="<?php echo $link_target; ?>">
|
218 |
+
<?php if ( !empty( $p['link_image'] ) && ( apply_filters( 'rfbp_show_link_images', true ) !== false ) ) { ?>
|
219 |
+
<span class="rfbp-link-image-wrap">
|
220 |
+
<img class="rfbp-link-image" src="<?php echo esc_attr( $p['link_image'] ); ?>" width="114" />
|
221 |
+
</span>
|
222 |
+
<?php } ?>
|
223 |
+
|
224 |
+
<span class="rfbp-link-text-wrap">
|
225 |
+
<span class="rfbp-link-name"><?php echo $p['link_name']; ?></span>
|
226 |
+
<?php if ( isset( $p['link_caption'] ) ) { ?><span class="rfbp-link-caption"><?php echo $p['link_caption']; ?></span><?php } ?>
|
227 |
+
<?php if ( isset( $p['link_description'] ) && !empty( $p['link_description'] ) ) { ?><span class="rfbp-link-description"><?php echo $p['link_description']; ?></span><?php } ?>
|
228 |
+
</span>
|
229 |
+
</a>
|
230 |
+
</p>
|
231 |
+
|
232 |
+
<?php } ?>
|
233 |
+
|
234 |
+
<?php if ( $opts['img_size'] != 'dont_show' && isset( $p['image'] ) && !empty( $p['image'] ) ) { ?>
|
235 |
+
<p class="rfbp-image-wrap">
|
236 |
+
<a class="rfbp-image-link" target="<?php echo $link_target; ?>" href="<?php echo $p['url']; ?>" rel="external nofollow">
|
237 |
+
<?php $max_img_width = ( !empty( $opts['img_width'] ) ) ? $opts['img_width'].'px' : '100%'; $max_img_height = ( !empty( $opts['img_height'] ) ) ? $opts['img_height'].'px' : 'none'; ?>
|
238 |
+
<img class="rfbp-image" src="<?php echo esc_attr($p['image'] . '?type=' . $opts['img_size']); ?>" style="max-width: <?php echo $max_img_width; ?>; max-height: <?php echo $max_img_height; ?>" alt="" />
|
239 |
+
</a>
|
240 |
+
</p>
|
241 |
+
<?php } ?>
|
242 |
+
<p class="rfbp-post-link-wrap">
|
243 |
+
<a target="<?php echo $link_target; ?>" class="rfbp-post-link" href="<?php echo $p['url']; ?>" rel="external nofolloW">
|
244 |
+
<?php if ( $likes ) { ?><span class="rfbp-like-count"><?php echo $p['like_count']; ?> <span><?php _e( "likes", 'recent-facebook-posts' ); ?><?php if ( $comments ) { ?>, <?php } ?></span></span><?php } ?>
|
245 |
+
<?php if ( $comments ) { ?><span class="rfbp-comment-count"><?php echo $p['comment_count']; ?> <span><?php _e( "comments", 'recent-facebook-posts' ); ?></span></span><?php } ?>
|
246 |
+
<?php if ( $likes || $comments ) { ?> ⋅ <?php } ?>
|
247 |
+
<span class="rfbp-timestamp" title="<?php printf( __( '%1$s at %2$s', 'recent-facebook-posts' ), date( 'l, F j, Y', $p['timestamp'] ), date( 'G:i', $p['timestamp'] ) ); ?>"><?php echo rfbp_time_ago( $p['timestamp'] ); ?></span>
|
248 |
+
</a>
|
249 |
+
</p>
|
250 |
+
</<?php echo $el; ?>>
|
251 |
+
<?php
|
252 |
+
|
253 |
+
} // end foreach $posts
|
254 |
+
|
255 |
+
if ( $el == 'li' ) { echo '</ul>'; }
|
256 |
+
|
257 |
+
} else {
|
258 |
+
?><p><?php _e( "No recent Facebook posts to show", 'recent-facebook-posts' ); ?></p><?php
|
259 |
+
if ( current_user_can( 'manage_options' ) ) {
|
260 |
+
?><p><strong><?php _e( "Admins only notice", 'recent-facebook-posts' ); ?>:</strong> Did you <a href="<?php echo admin_url( 'options-general.php?page=rfbp' ); ?>">configure the plugin</a> properly?</p><?php
|
261 |
+
}
|
262 |
+
} ?>
|
263 |
+
|
264 |
+
<?php if ( $show_page_link ) { ?>
|
265 |
+
<p class="rfbp-page-link-wrap"><a class="rfbp-page-link" href="http://www.facebook.com/<?php echo $opts['fb_id']; ?>/" rel="external nofollow" target="<?php echo $link_target; ?>"><?php echo $opts['page_link_text']; ?></a></p>
|
266 |
+
<?php } ?>
|
267 |
+
|
268 |
+
</div>
|
269 |
+
<!-- / Recent Facebook Posts -->
|
270 |
+
<?php
|
271 |
+
$output = ob_get_contents();
|
272 |
+
ob_end_clean();
|
273 |
+
|
274 |
+
return $output;
|
275 |
+
}
|
276 |
+
|
277 |
+
}
|
includes/class-widget.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class RFBP_Widget extends WP_Widget {
|
4 |
+
|
5 |
+
private $defaults;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
parent::__construct(
|
9 |
+
'rfb_widget',
|
10 |
+
'Recent Facebook Posts',
|
11 |
+
array( 'description' => __( 'Lists a number of your most recent Facebook posts.', 'recent-facebook-posts' ) )
|
12 |
+
);
|
13 |
+
|
14 |
+
$this->defaults = array(
|
15 |
+
'title' => __( 'Recent Facebook Posts', 'recent-facebook-posts' ),
|
16 |
+
'number_of_posts' => 5,
|
17 |
+
'excerpt_length' => 140,
|
18 |
+
'show_comment_count' => true,
|
19 |
+
'show_like_count' => true,
|
20 |
+
'show_page_link' => true,
|
21 |
+
'show_link_previews' => false
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function form( $instance ) {
|
26 |
+
|
27 |
+
$instance = array_merge( $this->defaults, $instance );
|
28 |
+
extract( $instance );
|
29 |
+
|
30 |
+
$opts = rfbp_get_settings();
|
31 |
+
|
32 |
+
if ( empty( $opts['app_id'] ) ) { ?>
|
33 |
+
<p style="color:red;">You need to <a href="<?php echo admin_url( 'options-general.php?page=rfbp' ); ?>">configure Recent Facebook Posts</a> first.</p>
|
34 |
+
<?php } ?>
|
35 |
+
|
36 |
+
<p>
|
37 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'recent-facebook-posts' ); ?></label>
|
38 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<p>
|
42 |
+
<label for="<?php echo $this->get_field_id( 'number_of_posts' ); ?>"><?php _e( 'Number of posts:', 'recent-facebook-posts' ); ?></label>
|
43 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'number_of_posts' ); ?>" name="<?php echo $this->get_field_name( 'number_of_posts' ); ?>" type="number" min="1" max="99" value="<?php echo esc_attr( $number_of_posts ); ?>" />
|
44 |
+
</p>
|
45 |
+
|
46 |
+
<p>
|
47 |
+
<label for="<?php echo $this->get_field_id( 'excerpt_length' ); ?>"><?php _e( 'Excerpt length:', 'recent-facebook-posts' ); ?></label>
|
48 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'excerpt_length' ); ?>" name="<?php echo $this->get_field_name( 'excerpt_length' ); ?>" type="number" min="1" max="9999"value="<?php echo esc_attr( $excerpt_length ); ?>" />
|
49 |
+
</p>
|
50 |
+
|
51 |
+
<p>
|
52 |
+
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_like_count' ); ?>" name="<?php echo $this->get_field_name( 'show_like_count' ); ?>" value="1" <?php checked( $show_like_count, 1 ); ?> />
|
53 |
+
<label for="<?php echo $this->get_field_id( 'show_like_count' ); ?>"><?php _e( 'Show like count?', 'recent-facebook-posts' ); ?></label>
|
54 |
+
</p>
|
55 |
+
|
56 |
+
<p>
|
57 |
+
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_comment_count' ); ?>" name="<?php echo $this->get_field_name( 'show_comment_count' ); ?>" value="1" <?php checked( $show_comment_count, 1 ); ?> />
|
58 |
+
<label for="<?php echo $this->get_field_id( 'show_comment_count' ); ?>"><?php _e( 'Show comment count?', 'recent-facebook-posts' ); ?></label>
|
59 |
+
</p>
|
60 |
+
|
61 |
+
<p>
|
62 |
+
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_page_link' ); ?>" name="<?php echo $this->get_field_name( 'show_page_link' ); ?>" value="1" <?php if ( $show_page_link ) { ?>checked="1"<?php } ?> />
|
63 |
+
<label for="<?php echo $this->get_field_id( 'show_page_link' ); ?>"><?php _e( 'Show link to Facebook page?', 'recent-facebook-posts' ); ?></label>
|
64 |
+
</p>
|
65 |
+
|
66 |
+
<p>
|
67 |
+
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_link_previews' ); ?>" name="<?php echo $this->get_field_name( 'show_link_previews' ); ?>" value="1" <?php if ( $show_link_previews ) { ?>checked="1"<?php } ?> />
|
68 |
+
<label for="<?php echo $this->get_field_id( 'show_link_previews' ); ?>"><?php _e( 'Show link previews?', 'recent-facebook-posts' ); ?></label>
|
69 |
+
</p>
|
70 |
+
|
71 |
+
<?php
|
72 |
+
}
|
73 |
+
|
74 |
+
public function update( $new_instance, $old_instance ) {
|
75 |
+
$instance = array();
|
76 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
77 |
+
$instance['number_of_posts'] = (int) strip_tags( $new_instance['number_of_posts'] );
|
78 |
+
$instance['excerpt_length'] = (int) strip_tags( $new_instance['excerpt_length'] );
|
79 |
+
$instance['show_like_count'] = isset( $new_instance['show_like_count'] );
|
80 |
+
$instance['show_comment_count'] = isset( $new_instance['show_comment_count'] );
|
81 |
+
$instance['show_page_link'] = isset( $new_instance['show_page_link'] );
|
82 |
+
$instance['show_link_previews'] = isset( $new_instance['show_link_previews'] );
|
83 |
+
return $instance;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function widget( $args, $instance = array() ) {
|
87 |
+
|
88 |
+
$instance = array_merge( $this->defaults, $instance );
|
89 |
+
|
90 |
+
extract( $instance );
|
91 |
+
extract( $args );
|
92 |
+
|
93 |
+
$title = apply_filters( 'widget_title', $instance['title'] );
|
94 |
+
|
95 |
+
echo $before_widget;
|
96 |
+
|
97 |
+
if ( ! empty( $title ) ) {
|
98 |
+
echo $before_title . $title . $after_title;
|
99 |
+
}
|
100 |
+
|
101 |
+
recent_facebook_posts( array(
|
102 |
+
'origin' => 'widget',
|
103 |
+
'number' => $number_of_posts,
|
104 |
+
'likes' => $show_like_count,
|
105 |
+
'comments' => $show_comment_count,
|
106 |
+
'excerpt_length' => $excerpt_length,
|
107 |
+
'el' => apply_filters( 'rfbp_widget_element', 'div' ),
|
108 |
+
'show_page_link' => $show_page_link,
|
109 |
+
'show_link_previews' => $show_link_previews
|
110 |
+
) );
|
111 |
+
|
112 |
+
|
113 |
+
echo $after_widget;
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
}
|
includes/helper-functions.php
CHANGED
@@ -16,7 +16,7 @@ function rfbp_time_ago($timestamp)
|
|
16 |
$diff = time() - (int) $timestamp;
|
17 |
|
18 |
if ($diff == 0)
|
19 |
-
return 'just now';
|
20 |
|
21 |
$intervals = array
|
22 |
(
|
@@ -30,5 +30,42 @@ function rfbp_time_ago($timestamp)
|
|
30 |
);
|
31 |
|
32 |
$value = floor($diff / $intervals[1][1]);
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
16 |
$diff = time() - (int) $timestamp;
|
17 |
|
18 |
if ($diff == 0)
|
19 |
+
return __('just now', "recent-facebook-posts");
|
20 |
|
21 |
$intervals = array
|
22 |
(
|
30 |
);
|
31 |
|
32 |
$value = floor($diff / $intervals[1][1]);
|
33 |
+
|
34 |
+
$time_unit = $intervals[1][0];
|
35 |
+
|
36 |
+
switch($time_unit) {
|
37 |
+
case 'year':
|
38 |
+
return sprintf(_n('1 year ago', '%d years ago', $value, "recent-facebook-posts"), $value);
|
39 |
+
break;
|
40 |
+
|
41 |
+
case 'month':
|
42 |
+
return sprintf(_n('1 month ago', '%d months ago', $value, "recent-facebook-posts"), $value);
|
43 |
+
break;
|
44 |
+
|
45 |
+
case 'week':
|
46 |
+
return sprintf(_n('1 week ago', '%d weeks ago', $value, "recent-facebook-posts"), $value);
|
47 |
+
break;
|
48 |
+
|
49 |
+
case 'day':
|
50 |
+
return sprintf(_n('1 day ago', '%d days ago', $value, "recent-facebook-posts"), $value);
|
51 |
+
break;
|
52 |
+
|
53 |
+
case 'hour':
|
54 |
+
return sprintf(_n('1 hour ago', '%d hours ago', $value, "recent-facebook-posts"), $value);
|
55 |
+
break;
|
56 |
+
|
57 |
+
case 'minute':
|
58 |
+
return sprintf(_n('1 minute ago', '%d minutes ago', $value, "recent-facebook-posts"), $value);
|
59 |
+
break;
|
60 |
+
|
61 |
+
case 'second':
|
62 |
+
return sprintf(_n('1 second ago', '%d seconds ago', $value, "recent-facebook-posts"), $value);
|
63 |
+
break;
|
64 |
+
|
65 |
+
default:
|
66 |
+
return sprintf(__('Some time ago', "recent-facebook-posts"));
|
67 |
+
break;
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
}
|
includes/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
includes/plugin.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function rfbp_get_settings() {
|
4 |
+
static $settings;
|
5 |
+
|
6 |
+
if ( !$settings ) {
|
7 |
+
|
8 |
+
$defaults = array(
|
9 |
+
'app_id' => '',
|
10 |
+
'app_secret' => '',
|
11 |
+
'fb_id' => '',
|
12 |
+
'load_css' => 1,
|
13 |
+
'page_link_text' => 'Find us on Facebook',
|
14 |
+
'link_new_window' => 0,
|
15 |
+
'img_size' => 'normal',
|
16 |
+
'img_width' => '',
|
17 |
+
'img_height' => ''
|
18 |
+
);
|
19 |
+
|
20 |
+
// get user options
|
21 |
+
$options = get_option( 'rfb_settings' );
|
22 |
+
|
23 |
+
// options did not exist yet, add option to database
|
24 |
+
if ( !$options ) { add_option( 'rfb_settings', $defaults ); }
|
25 |
+
|
26 |
+
$settings = array_merge( $defaults, (array) $options );
|
27 |
+
}
|
28 |
+
|
29 |
+
return $settings;
|
30 |
+
}
|
31 |
+
|
32 |
+
function rfbp_register_widget() {
|
33 |
+
include_once RFBP_PLUGIN_DIR . 'includes/class-widget.php';
|
34 |
+
register_widget( "RFBP_Widget" );
|
35 |
+
}
|
36 |
+
|
37 |
+
add_action('widgets_init', 'rfbp_register_widget');
|
38 |
+
|
39 |
+
function rfbp_load_textdomain() {
|
40 |
+
load_plugin_textdomain( 'recent-facebook-posts', false, 'recent-facebook-posts/languages/' );
|
41 |
+
}
|
42 |
+
|
43 |
+
add_action('plugins_loaded', 'rfbp_load_textdomain');
|
44 |
+
|
45 |
+
function rfbp_get_class() {
|
46 |
+
static $class;
|
47 |
+
|
48 |
+
if(!$class) {
|
49 |
+
require_once RFBP_PLUGIN_DIR . 'includes/class-public.php';
|
50 |
+
$class = new RFBP_Public();
|
51 |
+
}
|
52 |
+
|
53 |
+
return $class;
|
54 |
+
}
|
55 |
+
|
56 |
+
function rfbp_get_api() {
|
57 |
+
static $api;
|
58 |
+
|
59 |
+
if(!$api) {
|
60 |
+
$opts = rfbp_get_settings();
|
61 |
+
require_once RFBP_PLUGIN_DIR . 'includes/class-api.php';
|
62 |
+
$api = new RFBP_API( $opts['app_id'], $opts['app_secret'], $opts['fb_id'] );
|
63 |
+
}
|
64 |
+
|
65 |
+
return $api;
|
66 |
+
}
|
67 |
+
|
68 |
+
function rfbp_valid_config() {
|
69 |
+
$opts = rfbp_get_settings();
|
70 |
+
|
71 |
+
return (!empty($opts['fb_id']) && !empty($opts['app_id']) && !empty($opts['app_secret']) );
|
72 |
+
}
|
includes/template-functions.php
CHANGED
@@ -2,5 +2,6 @@
|
|
2 |
|
3 |
function recent_facebook_posts($args = array())
|
4 |
{
|
5 |
-
|
|
|
6 |
}
|
2 |
|
3 |
function recent_facebook_posts($args = array())
|
4 |
{
|
5 |
+
$rfbp = rfbp_get_class();
|
6 |
+
echo $rfbp->output($args);
|
7 |
}
|
includes/views/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
includes/views/settings_page.html.php
CHANGED
@@ -1,130 +1,143 @@
|
|
|
|
1 |
<div id="rfbp-options" class="wrap">
|
|
|
|
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
<?php if($api->has_error()) { ?>
|
8 |
-
<div id="setting-error-settings_updated" class="settings-error error">
|
9 |
-
<p>
|
10 |
-
<strong>Error:</strong> <?php echo $api->get_error_message(); ?>
|
11 |
-
</p>
|
12 |
-
</div>
|
13 |
-
<?php }
|
14 |
-
|
15 |
-
if(isset($notice)) { ?>
|
16 |
<div id="setting-error-settings_updated" class="updated settings-error">
|
17 |
<p>
|
18 |
<?php echo $notice; ?>
|
19 |
</p>
|
20 |
</div>
|
21 |
-
|
22 |
-
|
23 |
-
?>
|
24 |
|
25 |
-
<h3>Configuration</h3>
|
26 |
<form method="post" action="options.php">
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
<table class="form-table">
|
30 |
-
<
|
31 |
-
<
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
<
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
<
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
</tr>
|
54 |
-
|
55 |
-
<tr valign="top">
|
56 |
-
<th scope="row"><label for="rfb_cache_time">Cache expiry time <small>(in seconds)</small></label></th>
|
57 |
-
<td><input type="number" min="60" max="99999999999" id="rfb_cache_time" name="rfb_settings[cache_time]" value="<?php echo esc_attr($opts['cache_time']); ?>" required /></td>
|
58 |
-
</tr>
|
59 |
-
|
60 |
-
<tr valign="top">
|
61 |
-
<th scope="row"><label for="rfb_img_size">Image size</label></th>
|
62 |
-
<td>
|
63 |
-
<select class="widefat" id="rfb_img_size" name="rfb_settings[img_size]">
|
64 |
-
<option value="dont_show" <?php if($opts['img_size'] == 'dont_show') { echo 'selected'; } ?>>Don't show images</option>
|
65 |
-
<option value="thumbnail" <?php if($opts['img_size'] == 'thumbnail') { echo 'selected'; } ?>>Thumbnail</option>
|
66 |
-
<option value="normal" <?php if($opts['img_size'] == 'normal') { echo 'selected'; } ?>>Normal</option>
|
67 |
-
</select>
|
68 |
-
</tr>
|
69 |
-
</tbody>
|
70 |
-
<tbody id="rfb_img_options" <?php if($opts['img_size'] == 'dont_show') echo 'style="display:none;"'; ?>>
|
71 |
-
<tr valign="top">
|
72 |
-
<th>Image dimensions<br /><small>(in pixels)</small></th>
|
73 |
-
<td>
|
74 |
-
<label style="float:left; margin-right:20px; ">
|
75 |
-
Max Width<br />
|
76 |
-
<input type="number" min="0" max="1600" size="3" id="rfb_img_width" name="rfb_settings[img_width]" value="<?php echo esc_attr($opts['img_width']); ?>" />
|
77 |
-
</label>
|
78 |
-
<label style="float:left; margin-right:20px;">
|
79 |
-
Max Height<br />
|
80 |
-
<input type="number" min="0" max="1600" size="3" id="rfb_img_height" name="rfb_settings[img_height]" value="<?php echo esc_attr($opts['img_height']); ?>" />
|
81 |
-
</label>
|
82 |
-
<small class="help"><br />Leave empty for default sizing (maximum of 100% of containing element)</small>
|
83 |
-
</td>
|
84 |
-
</tr>
|
85 |
-
</tbody>
|
86 |
-
<tbody>
|
87 |
-
<tr valign="top">
|
88 |
-
<th scope="row"><label for="rfb_link_text">Link text</label></th>
|
89 |
-
<td><input type="text" class="widefat" placeholder="Find us on Facebook" id="rfb_link_text" name="rfb_settings[link_text]" value="<?php echo esc_attr($opts['link_text']); ?>" /></td>
|
90 |
-
</tr>
|
91 |
-
|
92 |
-
<tr valign="top">
|
93 |
-
<th scope="row"><label for="rfb_link_new_window">Open links in new window?</label></th>
|
94 |
-
<td><input type="checkbox" id="rfb_link_new_window" name="rfb_settings[link_new_window]" value="1" <?php checked($opts['link_new_window'], 1); ?> /></td>
|
95 |
-
</tr>
|
96 |
-
|
97 |
-
<tr valign="top">
|
98 |
-
<th scope="row"><label for="rfb_load_css">Load some default CSS?</label></th>
|
99 |
-
<td><input type="checkbox" id="rfb_load_css" name="rfb_settings[load_css]" value="1" <?php checked($opts['load_css'], 1); ?> /></td>
|
100 |
-
</tr>
|
101 |
-
</tbody>
|
102 |
</table>
|
|
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
</form>
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
120 |
</div>
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
<
|
127 |
-
|
|
|
128 |
<div class="rfbp-donate">
|
129 |
<form class="donate" action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
130 |
<input type="hidden" name="cmd" value="_donations">
|
@@ -134,40 +147,46 @@
|
|
134 |
<input type="hidden" name="item_number" value="Recent Facebook Posts">
|
135 |
<input type="hidden" name="currency_code" value="USD">
|
136 |
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
|
137 |
-
<
|
138 |
<img alt="" border="0" src="https://www.paypalobjects.com/nl_NL/i/scr/pixel.gif" width="1" height="1">
|
139 |
</form>
|
140 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
-
<
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
<p>Having trouble? Please use the <a href="http://wordpress.org/support/plugin/recent-facebook-posts">support forums</a> on WordPress.org.</p>
|
154 |
-
<p>Take a close look at the <a href="http://wordpress.org/plugins/recent-facebook-posts/installation/">installation instructions</a> for help configuring the plugin and registering your own Facebook application (required).</p>
|
155 |
-
</div>
|
156 |
-
|
157 |
-
<div class="rfbp-box">
|
158 |
-
<h3>Other Useful plugins</h3>
|
159 |
-
<ul class="ul-square">
|
160 |
-
<li><a href="http://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a></li>
|
161 |
-
<li><a href="http://wordpress.org/plugins/wysiwyg-widgets/">WYSIWYG Widgets</a>
|
162 |
-
<li><a href="http://wordpress.org/plugins/newsletter-sign-up/">Newsletter Sign-Up</a></li>
|
163 |
-
</ul>
|
164 |
-
</div>
|
165 |
-
|
166 |
-
<div class="rfbp-box">
|
167 |
-
<h3>About the developer</h3>
|
168 |
-
<p>I am <a href="http://dannyvankooten.com/">Danny</a>, a young Dutch Computer Science student. I seriously enjoy coding, eating, sleeping, playing (sports) and happy clients.</p>
|
169 |
-
<p>I developed a few <a href="http://dannyvankooten.com/wordpress-plugins/">other WordPress plugins</a>, have a look.</p>
|
170 |
-
<p><em>PS: Donations are much appreciated!</em></p>
|
171 |
-
</div>
|
172 |
</div>
|
173 |
-
</div>
|
|
1 |
+
<?php defined("ABSPATH") or exit; ?>
|
2 |
<div id="rfbp-options" class="wrap">
|
3 |
+
<div class="rfbp-container">
|
4 |
+
<div class="rfbp-column rfbp-primary">
|
5 |
|
6 |
+
<h2>Recent Facebook Posts</h2>
|
7 |
|
8 |
+
<?php if(isset($notice)) { ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
<div id="setting-error-settings_updated" class="updated settings-error">
|
10 |
<p>
|
11 |
<?php echo $notice; ?>
|
12 |
</p>
|
13 |
</div>
|
14 |
+
<?php } ?>
|
15 |
+
|
|
|
16 |
|
|
|
17 |
<form method="post" action="options.php">
|
18 |
+
<?php settings_fields( 'rfb_settings_group' ); ?>
|
19 |
+
|
20 |
+
<div class="rfbp-facebook-settings rfbp-<?php echo (rfbp_valid_config()) ? 'valid' : 'invalid'; ?>">
|
21 |
+
<h3><?php _e('Facebook Settings', 'recent-facebook-posts'); ?></h3>
|
22 |
+
|
23 |
+
<?php if(!rfbp_valid_config()) { ?>
|
24 |
+
<div class="rfbp-info">
|
25 |
+
<p>
|
26 |
+
<?php _e('This plugin needs a Facebook application to work.', 'recent-facebook-posts'); ?>
|
27 |
+
<?php _e('Please fill in the Facebook Settings fields after creating your application.', 'recent-facebook-posts'); ?>
|
28 |
+
</p>
|
29 |
+
<p>
|
30 |
+
<?php printf(__('Not sure how to proceed? Please take a close look at the %sInstallation Instructions%s on my website.', 'recent-facebook-posts'), '<a href="http://dannyvankooten.com/wordpress-plugins/recent-facebook-posts/">', '</a>'); ?>
|
31 |
+
</p>
|
32 |
+
</div>
|
33 |
+
<?php } ?>
|
34 |
+
|
35 |
<table class="form-table">
|
36 |
+
<tr valign="top" <?php if(empty($opts['app_id'])) echo 'class="rfbp-row-error"'; ?>>
|
37 |
+
<th scope="row"><label for="rfb_app_id"><?php _e('Facebook App ID/API Key', 'recent-facebook-posts'); ?></label></th>
|
38 |
+
<td>
|
39 |
+
<input type="text" class="widefat" placeholder="Eg: 123456789012345" id="rfb_app_id" name="rfb_settings[app_id]" value="<?php echo esc_attr($opts['app_id']); ?>" required />
|
40 |
+
<small class="help"><a href="https://developers.facebook.com/apps">get from developers.facebook.com/apps</a></small>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
|
44 |
+
<tr valign="top" <?php if(empty($opts['app_secret'])) echo 'class="rfbp-row-error"'; ?>>
|
45 |
+
<th scope="row"><label for="rfb_app_secret"><?php _e('Facebook App Secret', 'recent-facebook-posts'); ?></label></th>
|
46 |
+
<td>
|
47 |
+
<input type="text" class="widefat" placeholder="Eg: 16vgrz4hk45wvh29k2puk45wvk2h29pu" id="rfb_app_secret" name="rfb_settings[app_secret]" value="<?php echo esc_attr($opts['app_secret']); ?>" required />
|
48 |
+
<small class="help"><a href="https://developers.facebook.com/apps">get from developers.facebook.com/apps</a></small>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
|
52 |
+
<tr valign="top" <?php if(empty($opts['fb_id'])) echo 'class="rfbp-row-error"'; ?>>
|
53 |
+
<th scope="row"><label for="rfb_fb_id"><?php _e('Facebook Page ID or Slug', 'recent-facebook-posts'); ?></label></th>
|
54 |
+
<td>
|
55 |
+
<input type="text" class="widefat" placeholder="Eg: DannyvanKootenCOM" id="rfb_fb_id" name="rfb_settings[fb_id]" value="<?php echo esc_attr($opts['fb_id']); ?>" required />
|
56 |
+
<small><a target="_blank" href="http://findmyfacebookid.com/"><?php _e('Use this tool to find the numeric ID of the Facebook page you want to fetch posts from', 'recent-facebook-posts'); ?></a></small>
|
57 |
+
</td>
|
58 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
</table>
|
60 |
+
</div>
|
61 |
|
62 |
+
<h3><?php _e('Appearance', 'recent-facebook-posts'); ?></h3>
|
63 |
+
<table class="form-table">
|
64 |
+
<tbody>
|
65 |
+
<tr valign="top">
|
66 |
+
<th scope="row"><label for="rfb_page_link_text"><?php _e('Link text', 'recent-facebook-posts'); ?></label></th>
|
67 |
+
<td><input type="text" class="widefat" placeholder="Find us on Facebook" id="rfb_page_link_text" name="rfb_settings[page_link_text]" value="<?php echo esc_attr($opts['page_link_text']); ?>" /></td>
|
68 |
+
</tr>
|
69 |
+
|
70 |
+
<tr valign="top">
|
71 |
+
<th scope="row"><label for="rfb_link_new_window"><?php _e('Open links in new window?', 'recent-facebook-posts'); ?></label></th>
|
72 |
+
<td><input type="checkbox" id="rfb_link_new_window" name="rfb_settings[link_new_window]" value="1" <?php checked($opts['link_new_window'], 1); ?> /></td>
|
73 |
+
</tr>
|
74 |
+
|
75 |
+
<tr valign="top">
|
76 |
+
<th scope="row"><label for="rfb_load_css"><?php _e('Load some default CSS?', 'recent-facebook-posts'); ?></label></th>
|
77 |
+
<td><input type="checkbox" id="rfb_load_css" name="rfb_settings[load_css]" value="1" <?php checked($opts['load_css'], 1); ?> /></td>
|
78 |
+
</tr>
|
79 |
+
</tbody>
|
80 |
+
<tbody>
|
81 |
+
<tr valign="top">
|
82 |
+
<th scope="row"><label for="rfb_img_size"><?php _e('Image size', 'recent-facebook-posts'); ?></label></th>
|
83 |
+
<td>
|
84 |
+
<select class="widefat" id="rfb_img_size" name="rfb_settings[img_size]">
|
85 |
+
<option value="dont_show" <?php if($opts['img_size'] == 'dont_show') { echo 'selected'; } ?>><?php _e("Don't show images", 'recent-facebook-posts'); ?></option>
|
86 |
+
<option value="thumbnail" <?php if($opts['img_size'] == 'thumbnail') { echo 'selected'; } ?>><?php _e('Thumbnail', 'recent-facebook-posts'); ?></option>
|
87 |
+
<option value="normal" <?php if($opts['img_size'] == 'normal') { echo 'selected'; } ?>><?php _e('Normal', 'recent-facebook-posts'); ?></option>
|
88 |
+
</select>
|
89 |
+
</td>
|
90 |
+
</tr>
|
91 |
+
</tbody>
|
92 |
+
<tbody id="rfb_img_options" <?php if($opts['img_size'] == 'dont_show') echo 'style="display:none;"'; ?>>
|
93 |
+
<tr valign="top">
|
94 |
+
<th><?php _e('Image dimensions', 'recent-facebook-posts'); ?><br /><small>(in pixels, optional)</small></th>
|
95 |
+
<td>
|
96 |
+
<label style="float:left; margin-right:20px; ">
|
97 |
+
<?php _e('Max Width', 'recent-facebook-posts'); ?><br />
|
98 |
+
<input type="number" min="0" max="1600" size="3" id="rfb_img_width" name="rfb_settings[img_width]" value="<?php echo esc_attr($opts['img_width']); ?>" />
|
99 |
+
</label>
|
100 |
+
<label style="float:left; margin-right:20px;">
|
101 |
+
<?php _e('Max Height', 'recent-facebook-posts'); ?><br />
|
102 |
+
<input type="number" min="0" max="1600" size="3" id="rfb_img_height" name="rfb_settings[img_height]" value="<?php echo esc_attr($opts['img_height']); ?>" />
|
103 |
+
</label>
|
104 |
+
<br />
|
105 |
+
<small class="help"><?php _e('Leave empty for default sizing', 'recent-facebook-posts'); ?></small>
|
106 |
+
</td>
|
107 |
+
</tr>
|
108 |
+
</tbody>
|
109 |
+
</table>
|
110 |
+
|
111 |
+
<p class="submit">
|
112 |
+
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
113 |
+
</p>
|
114 |
|
115 |
</form>
|
116 |
|
117 |
+
<?php if(rfbp_valid_config()) { ?>
|
118 |
+
<h3 class="rfbp-title">Test Configuration</h3>
|
119 |
+
<p><?php _e('Test your plugin configuration using the button below.', 'recent-facebook-posts'); ?></p>
|
120 |
+
<form action="<?php echo admin_url('options-general.php?page=rfbp'); ?>" method="post">
|
121 |
+
<input type="hidden" name="rfbp-test-config" value="1" />
|
122 |
+
<input type="submit" class="button-primary" value="<?php _e('Test Configuration', 'recent-facebook-posts'); ?>" />
|
123 |
+
</form>
|
124 |
+
|
125 |
+
<h3 class="rfbp-title">Facebook Posts Cache</h3>
|
126 |
+
<p><?php _e('Because fetching posts from Facebook is slow the posts are cached for <strong>30 minutes</strong>. You can manually clear the cache using the button below.', 'recent-facebook-posts'); ?></p>
|
127 |
+
<form action="<?php echo admin_url('options-general.php?page=rfbp'); ?>" method="post">
|
128 |
+
<input type="hidden" name="rfbp-clear-cache" value="1" />
|
129 |
+
<input type="submit" class="button-primary" value="<?php _e('Clear Cache', 'recent-facebook-posts'); ?>" />
|
130 |
+
</form>
|
131 |
+
<?php } ?>
|
132 |
</div>
|
133 |
|
134 |
+
<!-- Start RFBP Sidebar -->
|
135 |
+
<div class="rfbp-column rfbp-secondary">
|
136 |
+
|
137 |
+
<div class="rfbp-box">
|
138 |
+
<h3 class="rfbp-title">Donate $10, $20 or $50</h3>
|
139 |
+
<p>I spent a lot of time developing this plugin and offering support for it. If you like it, consider supporting this plugin by donating a token of your appreciation.</p>
|
140 |
+
|
141 |
<div class="rfbp-donate">
|
142 |
<form class="donate" action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
143 |
<input type="hidden" name="cmd" value="_donations">
|
147 |
<input type="hidden" name="item_number" value="Recent Facebook Posts">
|
148 |
<input type="hidden" name="currency_code" value="USD">
|
149 |
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
|
150 |
+
<button name="submit" class="button-primary">Donate with PayPal</button>
|
151 |
<img alt="" border="0" src="https://www.paypalobjects.com/nl_NL/i/scr/pixel.gif" width="1" height="1">
|
152 |
</form>
|
153 |
</div>
|
154 |
+
|
155 |
+
<p>Some other ways to support this plugin</p>
|
156 |
+
<ul class="ul-square">
|
157 |
+
<li><a href="http://wordpress.org/support/view/plugin-reviews/recent-facebook-posts?rate=5#postform" target="_blank">Leave a ★★★★★ review on WordPress.org</a></li>
|
158 |
+
<li><a href="http://dannyvankooten.com/wordpress-plugins/recent-facebook-posts/" target="_blank">Link to the plugin page from your blog</a></li>
|
159 |
+
<li><a href="http://twitter.com/?status=I%20show%20recent%20facebook%20posts%20on%20my%20%23WordPress%20site%20using%20Recent%20Facebook%20Posts%20by%20%40DannyvanKooten%20-%20love%20it!%20http%3A%2F%2Fwordpress.org%2Fplugins%2Frecent-facebook-posts%2F" target="_blank">Tweet about Recent Facebook Posts</a></li>
|
160 |
+
<li><a href="http://wordpress.org/plugins/recent-facebook-posts/#compatibility">Vote "works" on the WordPress.org plugin page</a></li>
|
161 |
+
</ul>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
<div class="rfbp-box">
|
165 |
+
<h3 class="rfbp-title">Looking for support?</h3>
|
166 |
+
<p>Please use the <a href="http://wordpress.org/support/plugin/recent-facebook-posts">plugin support forums</a> on WordPress.org.</p>
|
167 |
+
<p>Take a close look at the <a href="http://wordpress.org/plugins/recent-facebook-posts/installation/">installation instructions</a> for help configuring the plugin and registering your own Facebook application, which is required to get this plugin to work.</p>
|
168 |
+
</div>
|
169 |
+
|
170 |
+
<div class="rfbp-box">
|
171 |
+
<h3 class="rfbp-title">Other Useful plugins</h3>
|
172 |
+
<ul class="ul-square">
|
173 |
+
<li><a href="http://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a></li>
|
174 |
+
<li><a href="http://wordpress.org/plugins/scroll-triggered-boxes/">Scroll Triggered Boxes</a></li>
|
175 |
+
<li><a href="http://wordpress.org/plugins/wysiwyg-widgets/">WYSIWYG Widgets</a></li>
|
176 |
+
</ul>
|
177 |
+
</div>
|
178 |
|
179 |
+
<div class="rfbp-box">
|
180 |
+
<h3 class="rfbp-title">About the developer</h3>
|
181 |
+
<p>My name is <a href="http://dannyvankooten.com/">Danny van Kooten</a>. I develop WordPress plugins which help you build your websites. I love simplicity, happy customers and clean code.</p>
|
182 |
+
<p>Take a look at my other <a href="http://dannyvankooten.com/wordpress-plugins/">plugins for WordPress</a> or <em>like</em> my Facebook page to stay updated.</p>
|
183 |
+
<p><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2FCodeToTheChase&width&layout=standard&action=like&show_faces=true&share=false&appId=225994527565061" scrolling="no" frameborder="0" style="border:none; width: 100%; overflow:hidden; height: 80px;" allowTransparency="true"></iframe></p>
|
184 |
+
<p>You can also follow me on twitter <a href="http://twitter.com/dannyvankooten">here</a>.</p>
|
185 |
+
</div>
|
186 |
+
</div>
|
187 |
+
<!-- End RFBP Sidebar -->
|
188 |
+
|
189 |
+
<br style="clear:both; " />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
</div>
|
191 |
+
</div>
|
192 |
+
|
index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
languages/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// empty index.php to prevent directory listing
|
languages/recent-facebook-posts-nl_NL.mo
ADDED
Binary file
|
languages/recent-facebook-posts-nl_NL.po
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Recent Facebook Posts\n"
|
4 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/recent-facebook-posts\n"
|
5 |
+
"POT-Creation-Date: 2013-11-17 19:04+0100\n"
|
6 |
+
"PO-Revision-Date: 2013-11-17 19:05+0100\n"
|
7 |
+
"Last-Translator: Danny van Kooten <hi@dannyvankooten.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.5.7\n"
|
13 |
+
"X-Poedit-KeywordsList: _e;__;_n:1,2\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
+
"X-Poedit-SearchPath-0: ../.\n"
|
18 |
+
|
19 |
+
#: .././includes/class-admin.php:68
|
20 |
+
msgid "Some settings have changed which invalidated the cached Facebook posts."
|
21 |
+
msgstr ""
|
22 |
+
"Bepaalde instellingen zijn gewijzigd waardoor de gecachte Facebook berichten "
|
23 |
+
"niet meer kloppen."
|
24 |
+
|
25 |
+
#: .././includes/class-admin.php:68
|
26 |
+
msgid "Renew Cache"
|
27 |
+
msgstr "Vernieuw Cache"
|
28 |
+
|
29 |
+
#: .././includes/class-admin.php:99
|
30 |
+
#, fuzzy
|
31 |
+
msgid "<strong>Cache cleared!</strong> You succesfully cleared the cache."
|
32 |
+
msgstr "<strong>Cache geleegd!</strong> De cache is succesvol geleegd."
|
33 |
+
|
34 |
+
#: .././includes/class-admin.php:112
|
35 |
+
msgid "Settings"
|
36 |
+
msgstr "Instellingen"
|
37 |
+
|
38 |
+
#: .././includes/class-public.php:233
|
39 |
+
msgid "likes"
|
40 |
+
msgstr "vind ik leuks"
|
41 |
+
|
42 |
+
#: .././includes/class-public.php:234
|
43 |
+
msgid "comments"
|
44 |
+
msgstr "reacties"
|
45 |
+
|
46 |
+
#: .././includes/class-public.php:236
|
47 |
+
#, php-format
|
48 |
+
msgid "%1$s at %2$s"
|
49 |
+
msgstr "%1$s om %2$s"
|
50 |
+
|
51 |
+
#: .././includes/class-public.php:247
|
52 |
+
msgid "No recent Facebook posts to show"
|
53 |
+
msgstr "Er zijn geen recente Facebook berichten om te tonen."
|
54 |
+
|
55 |
+
#: .././includes/class-public.php:249
|
56 |
+
msgid "Admins only notice"
|
57 |
+
msgstr "Bericht voor Administrators"
|
58 |
+
|
59 |
+
#: .././includes/class-widget.php:11
|
60 |
+
msgid "Lists a number of your most recent Facebook posts."
|
61 |
+
msgstr "Toont de meest recente Facebook updates van een Facebook pagina."
|
62 |
+
|
63 |
+
#: .././includes/class-widget.php:15
|
64 |
+
msgid "Recent Facebook Posts"
|
65 |
+
msgstr "Recente Facebook Berichten"
|
66 |
+
|
67 |
+
#: .././includes/class-widget.php:37
|
68 |
+
msgid "Title:"
|
69 |
+
msgstr "Titel:"
|
70 |
+
|
71 |
+
#: .././includes/class-widget.php:42
|
72 |
+
msgid "Number of posts:"
|
73 |
+
msgstr "Aantal berichten"
|
74 |
+
|
75 |
+
#: .././includes/class-widget.php:47
|
76 |
+
msgid "Excerpt length:"
|
77 |
+
msgstr "Lengte van uitreksel"
|
78 |
+
|
79 |
+
#: .././includes/class-widget.php:53
|
80 |
+
msgid "Show like count?"
|
81 |
+
msgstr "Toon aantal vind-ik-leuks?"
|
82 |
+
|
83 |
+
#: .././includes/class-widget.php:58
|
84 |
+
msgid "Show comment count?"
|
85 |
+
msgstr "Toon aantal reacties?"
|
86 |
+
|
87 |
+
#: .././includes/class-widget.php:63
|
88 |
+
#, fuzzy
|
89 |
+
msgid "Show link to Facebook page?"
|
90 |
+
msgstr "Toon link naar Facebook pagina?"
|
91 |
+
|
92 |
+
#: .././includes/class-widget.php:68
|
93 |
+
msgid "Show link previews?"
|
94 |
+
msgstr "Toon link voorbeelden?"
|
95 |
+
|
96 |
+
#: .././includes/helper-functions.php:19
|
97 |
+
msgid "just now"
|
98 |
+
msgstr "Zojuist"
|
99 |
+
|
100 |
+
#: .././includes/helper-functions.php:38
|
101 |
+
#, php-format
|
102 |
+
msgid "1 year ago"
|
103 |
+
msgid_plural "%d years ago"
|
104 |
+
msgstr[0] "1 jaar geleden"
|
105 |
+
msgstr[1] "%d jaren geleden"
|
106 |
+
|
107 |
+
#: .././includes/helper-functions.php:42
|
108 |
+
#, php-format
|
109 |
+
msgid "1 month ago"
|
110 |
+
msgid_plural "%d months ago"
|
111 |
+
msgstr[0] "1 maand geleden"
|
112 |
+
msgstr[1] "%d maanden geleden"
|
113 |
+
|
114 |
+
#: .././includes/helper-functions.php:46
|
115 |
+
#, php-format
|
116 |
+
msgid "1 week ago"
|
117 |
+
msgid_plural "%d weeks ago"
|
118 |
+
msgstr[0] "1 week geleden"
|
119 |
+
msgstr[1] "%d weken geleden"
|
120 |
+
|
121 |
+
#: .././includes/helper-functions.php:50
|
122 |
+
#, php-format
|
123 |
+
msgid "1 day ago"
|
124 |
+
msgid_plural "%d days ago"
|
125 |
+
msgstr[0] "1 dag geleden"
|
126 |
+
msgstr[1] "%d dagen geleden"
|
127 |
+
|
128 |
+
#: .././includes/helper-functions.php:54
|
129 |
+
#, php-format
|
130 |
+
msgid "1 hour ago"
|
131 |
+
msgid_plural "%d hours ago"
|
132 |
+
msgstr[0] "1 uur geleden"
|
133 |
+
msgstr[1] "%d uren geleden"
|
134 |
+
|
135 |
+
#: .././includes/helper-functions.php:58
|
136 |
+
#, php-format
|
137 |
+
msgid "1 minute ago"
|
138 |
+
msgid_plural "%d minutes ago"
|
139 |
+
msgstr[0] "1 minuut geleden"
|
140 |
+
msgstr[1] "%d minuten geleden"
|
141 |
+
|
142 |
+
#: .././includes/helper-functions.php:62
|
143 |
+
#, php-format
|
144 |
+
msgid "1 second ago"
|
145 |
+
msgid_plural "%d seconds ago"
|
146 |
+
msgstr[0] "1 seconde geleden"
|
147 |
+
msgstr[1] "%d seconden geleden"
|
148 |
+
|
149 |
+
#: .././includes/helper-functions.php:66
|
150 |
+
msgid "Some time ago"
|
151 |
+
msgstr "Een tijdje geleden"
|
152 |
+
|
153 |
+
#: .././includes/views/settings_page.html.php:29
|
154 |
+
msgid "Facebook Settings"
|
155 |
+
msgstr "Facebook Instellingen"
|
156 |
+
|
157 |
+
#: .././includes/views/settings_page.html.php:32
|
158 |
+
msgid "Facebook App ID/API Key"
|
159 |
+
msgstr "ID van Facebook app/API-sleutel"
|
160 |
+
|
161 |
+
#: .././includes/views/settings_page.html.php:40
|
162 |
+
msgid "Facebook App Secret"
|
163 |
+
msgstr "Geheime sleutel van de Facebook app"
|
164 |
+
|
165 |
+
#: .././includes/views/settings_page.html.php:48
|
166 |
+
msgid "Facebook Page ID or Slug"
|
167 |
+
msgstr "Facebook Pagina ID of slug"
|
168 |
+
|
169 |
+
#: .././includes/views/settings_page.html.php:51
|
170 |
+
msgid ""
|
171 |
+
"Use this tool to find the numeric ID of the Facebook page you want to fetch "
|
172 |
+
"posts from"
|
173 |
+
msgstr ""
|
174 |
+
"Gebruik deze website om het numerieke ID van je Facebook pagina te vinden."
|
175 |
+
|
176 |
+
#: .././includes/views/settings_page.html.php:56
|
177 |
+
msgid "Appearance"
|
178 |
+
msgstr "Weergave"
|
179 |
+
|
180 |
+
#: .././includes/views/settings_page.html.php:60
|
181 |
+
msgid "Link text"
|
182 |
+
msgstr "Link tekst"
|
183 |
+
|
184 |
+
#: .././includes/views/settings_page.html.php:65
|
185 |
+
msgid "Open links in new window?"
|
186 |
+
msgstr "Open links in een nieuw venster?"
|
187 |
+
|
188 |
+
#: .././includes/views/settings_page.html.php:70
|
189 |
+
msgid "Load some default CSS?"
|
190 |
+
msgstr "Laad standaard CSS (stijlregels) bestand?"
|
191 |
+
|
192 |
+
#: .././includes/views/settings_page.html.php:76
|
193 |
+
msgid "Image size"
|
194 |
+
msgstr "Afbeeldingsgrootte"
|
195 |
+
|
196 |
+
#: .././includes/views/settings_page.html.php:79
|
197 |
+
msgid "Don't show images"
|
198 |
+
msgstr "Toon geen afbeeldingen"
|
199 |
+
|
200 |
+
#: .././includes/views/settings_page.html.php:80
|
201 |
+
msgid "Thumbnail"
|
202 |
+
msgstr "Thumbnail"
|
203 |
+
|
204 |
+
#: .././includes/views/settings_page.html.php:81
|
205 |
+
msgid "Normal"
|
206 |
+
msgstr "Normaal"
|
207 |
+
|
208 |
+
#: .././includes/views/settings_page.html.php:88
|
209 |
+
msgid "Image dimensions"
|
210 |
+
msgstr "Afbeelding afmetingen"
|
211 |
+
|
212 |
+
#: .././includes/views/settings_page.html.php:91
|
213 |
+
msgid "Max Width"
|
214 |
+
msgstr "Maximale breedte"
|
215 |
+
|
216 |
+
#: .././includes/views/settings_page.html.php:95
|
217 |
+
msgid "Max Height"
|
218 |
+
msgstr "Maximale hoogte"
|
219 |
+
|
220 |
+
#: .././includes/views/settings_page.html.php:99
|
221 |
+
msgid "Leave empty for default sizing"
|
222 |
+
msgstr "Laat leeg voor standaard afmetingen."
|
223 |
+
|
224 |
+
#: .././includes/views/settings_page.html.php:106
|
225 |
+
msgid "Save Changes"
|
226 |
+
msgstr "Wijzigen Opslaan"
|
227 |
+
|
228 |
+
#: .././includes/views/settings_page.html.php:113
|
229 |
+
msgid ""
|
230 |
+
"Because fetching posts from Facebook is slow the posts are cached for "
|
231 |
+
"<strong>30 minutes</strong>. You can manually clear the cache using the "
|
232 |
+
"button below."
|
233 |
+
msgstr ""
|
234 |
+
"Omdat berichten van Facebook afhalen langzaam is worden berichten gecached "
|
235 |
+
"voor <strong>30 minuten</strong>. Je kunt de cache manueel legen met behulp "
|
236 |
+
"van onderstaande button."
|
237 |
+
|
238 |
+
#: .././includes/views/settings_page.html.php:117
|
239 |
+
msgid "Clear Cache"
|
240 |
+
msgstr "Leeg Cache"
|
241 |
+
|
242 |
+
#~ msgid "Renew Facebook Posts"
|
243 |
+
#~ msgstr "Vernieuw Facebook berichten"
|
244 |
+
|
245 |
+
#~ msgid "Show attached links?"
|
246 |
+
#~ msgstr "Toon bijgevoegde links?"
|
247 |
+
|
248 |
+
#~ msgid "Configuration"
|
249 |
+
#~ msgstr "Instellingen"
|
250 |
+
|
251 |
+
#~ msgid "Cache expiry time"
|
252 |
+
#~ msgstr "Cache tijd"
|
253 |
+
|
254 |
+
#~ msgid "(in seconds)"
|
255 |
+
#~ msgstr "(in seconden)"
|
256 |
+
|
257 |
+
#~ msgid ""
|
258 |
+
#~ "Leave empty for default sizing (maximum of 100% of containing element)"
|
259 |
+
#~ msgstr ""
|
260 |
+
#~ "Laat leeg voor een standaard grootte van maximaal 100% van het "
|
261 |
+
#~ "omvattende element."
|
262 |
+
|
263 |
+
#~ msgid "year"
|
264 |
+
#~ msgstr "jaar"
|
265 |
+
|
266 |
+
#~ msgid "month"
|
267 |
+
#~ msgstr "maand"
|
268 |
+
|
269 |
+
#~ msgid "week"
|
270 |
+
#~ msgstr "week"
|
271 |
+
|
272 |
+
#~ msgid "day"
|
273 |
+
#~ msgstr "dag"
|
274 |
+
|
275 |
+
#~ msgid "hour"
|
276 |
+
#~ msgstr "uur"
|
277 |
+
|
278 |
+
#~ msgid "minute"
|
279 |
+
#~ msgstr "minuut"
|
280 |
+
|
281 |
+
#~ msgid "%d %ss ago"
|
282 |
+
#~ msgstr "%d %sen geleden"
|
languages/recent-facebook-posts.mo
ADDED
Binary file
|
languages/recent-facebook-posts.po
ADDED
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Recent Facebook Posts\n"
|
4 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/recent-facebook-posts\n"
|
5 |
+
"POT-Creation-Date: 2013-11-17 19:06+0100\n"
|
6 |
+
"PO-Revision-Date: 2013-11-17 19:06+0100\n"
|
7 |
+
"Last-Translator: Danny van Kooten <hi@dannyvankooten.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.5.7\n"
|
13 |
+
"X-Poedit-KeywordsList: _e;__;_n:1,2\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
+
"X-Poedit-SearchPath-0: ../.\n"
|
18 |
+
|
19 |
+
#: .././includes/class-admin.php:68
|
20 |
+
msgid "Some settings have changed which invalidated the cached Facebook posts."
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: .././includes/class-admin.php:68
|
24 |
+
#: .././includes/views/settings_page.html.php:117
|
25 |
+
msgid "Clear Cache"
|
26 |
+
msgstr ""
|
27 |
+
|
28 |
+
#: .././includes/class-admin.php:99
|
29 |
+
msgid "<strong>Cache cleared!</strong> You succesfully cleared the cache."
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: .././includes/class-admin.php:112
|
33 |
+
msgid "Settings"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#: .././includes/class-public.php:233
|
37 |
+
msgid "likes"
|
38 |
+
msgstr ""
|
39 |
+
|
40 |
+
#: .././includes/class-public.php:234
|
41 |
+
msgid "comments"
|
42 |
+
msgstr ""
|
43 |
+
|
44 |
+
#: .././includes/class-public.php:236
|
45 |
+
#, php-format
|
46 |
+
msgid "%1$s at %2$s"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: .././includes/class-public.php:247
|
50 |
+
msgid "No recent Facebook posts to show"
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: .././includes/class-public.php:249
|
54 |
+
msgid "Admins only notice"
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
#: .././includes/class-widget.php:11
|
58 |
+
msgid "Lists a number of your most recent Facebook posts."
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: .././includes/class-widget.php:15
|
62 |
+
msgid "Recent Facebook Posts"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: .././includes/class-widget.php:37
|
66 |
+
msgid "Title:"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: .././includes/class-widget.php:42
|
70 |
+
msgid "Number of posts:"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: .././includes/class-widget.php:47
|
74 |
+
msgid "Excerpt length:"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: .././includes/class-widget.php:53
|
78 |
+
msgid "Show like count?"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: .././includes/class-widget.php:58
|
82 |
+
msgid "Show comment count?"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: .././includes/class-widget.php:63
|
86 |
+
msgid "Show link to Facebook page?"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: .././includes/class-widget.php:68
|
90 |
+
msgid "Show link previews?"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: .././includes/helper-functions.php:19
|
94 |
+
msgid "just now"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: .././includes/helper-functions.php:38
|
98 |
+
#, php-format
|
99 |
+
msgid "1 year ago"
|
100 |
+
msgid_plural "%d years ago"
|
101 |
+
msgstr[0] ""
|
102 |
+
msgstr[1] ""
|
103 |
+
|
104 |
+
#: .././includes/helper-functions.php:42
|
105 |
+
#, php-format
|
106 |
+
msgid "1 month ago"
|
107 |
+
msgid_plural "%d months ago"
|
108 |
+
msgstr[0] ""
|
109 |
+
msgstr[1] ""
|
110 |
+
|
111 |
+
#: .././includes/helper-functions.php:46
|
112 |
+
#, php-format
|
113 |
+
msgid "1 week ago"
|
114 |
+
msgid_plural "%d weeks ago"
|
115 |
+
msgstr[0] ""
|
116 |
+
msgstr[1] ""
|
117 |
+
|
118 |
+
#: .././includes/helper-functions.php:50
|
119 |
+
#, php-format
|
120 |
+
msgid "1 day ago"
|
121 |
+
msgid_plural "%d days ago"
|
122 |
+
msgstr[0] ""
|
123 |
+
msgstr[1] ""
|
124 |
+
|
125 |
+
#: .././includes/helper-functions.php:54
|
126 |
+
#, php-format
|
127 |
+
msgid "1 hour ago"
|
128 |
+
msgid_plural "%d hours ago"
|
129 |
+
msgstr[0] ""
|
130 |
+
msgstr[1] ""
|
131 |
+
|
132 |
+
#: .././includes/helper-functions.php:58
|
133 |
+
#, php-format
|
134 |
+
msgid "1 minute ago"
|
135 |
+
msgid_plural "%d minutes ago"
|
136 |
+
msgstr[0] ""
|
137 |
+
msgstr[1] ""
|
138 |
+
|
139 |
+
#: .././includes/helper-functions.php:62
|
140 |
+
#, php-format
|
141 |
+
msgid "1 second ago"
|
142 |
+
msgid_plural "%d seconds ago"
|
143 |
+
msgstr[0] ""
|
144 |
+
msgstr[1] ""
|
145 |
+
|
146 |
+
#: .././includes/helper-functions.php:66
|
147 |
+
msgid "Some time ago"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: .././includes/views/settings_page.html.php:29
|
151 |
+
msgid "Facebook Settings"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: .././includes/views/settings_page.html.php:32
|
155 |
+
msgid "Facebook App ID/API Key"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: .././includes/views/settings_page.html.php:40
|
159 |
+
msgid "Facebook App Secret"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: .././includes/views/settings_page.html.php:48
|
163 |
+
msgid "Facebook Page ID or Slug"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: .././includes/views/settings_page.html.php:51
|
167 |
+
msgid ""
|
168 |
+
"Use this tool to find the numeric ID of the Facebook page you want to fetch "
|
169 |
+
"posts from"
|
170 |
+
msgstr ""
|
171 |
+
|
172 |
+
#: .././includes/views/settings_page.html.php:56
|
173 |
+
msgid "Appearance"
|
174 |
+
msgstr ""
|
175 |
+
|
176 |
+
#: .././includes/views/settings_page.html.php:60
|
177 |
+
msgid "Link text"
|
178 |
+
msgstr ""
|
179 |
+
|
180 |
+
#: .././includes/views/settings_page.html.php:65
|
181 |
+
msgid "Open links in new window?"
|
182 |
+
msgstr ""
|
183 |
+
|
184 |
+
#: .././includes/views/settings_page.html.php:70
|
185 |
+
msgid "Load some default CSS?"
|
186 |
+
msgstr ""
|
187 |
+
|
188 |
+
#: .././includes/views/settings_page.html.php:76
|
189 |
+
msgid "Image size"
|
190 |
+
msgstr ""
|
191 |
+
|
192 |
+
#: .././includes/views/settings_page.html.php:79
|
193 |
+
msgid "Don't show images"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: .././includes/views/settings_page.html.php:80
|
197 |
+
msgid "Thumbnail"
|
198 |
+
msgstr ""
|
199 |
+
|
200 |
+
#: .././includes/views/settings_page.html.php:81
|
201 |
+
msgid "Normal"
|
202 |
+
msgstr ""
|
203 |
+
|
204 |
+
#: .././includes/views/settings_page.html.php:88
|
205 |
+
msgid "Image dimensions"
|
206 |
+
msgstr ""
|
207 |
+
|
208 |
+
#: .././includes/views/settings_page.html.php:91
|
209 |
+
msgid "Max Width"
|
210 |
+
msgstr ""
|
211 |
+
|
212 |
+
#: .././includes/views/settings_page.html.php:95
|
213 |
+
msgid "Max Height"
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
#: .././includes/views/settings_page.html.php:99
|
217 |
+
msgid "Leave empty for default sizing"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: .././includes/views/settings_page.html.php:106
|
221 |
+
msgid "Save Changes"
|
222 |
+
msgstr ""
|
223 |
+
|
224 |
+
#: .././includes/views/settings_page.html.php:113
|
225 |
+
msgid ""
|
226 |
+
"Because fetching posts from Facebook is slow the posts are cached for "
|
227 |
+
"<strong>30 minutes</strong>. You can manually clear the cache using the "
|
228 |
+
"button below."
|
229 |
+
msgstr ""
|
230 |
+
|
231 |
+
#~ msgid "Show attached links?"
|
232 |
+
#~ msgstr "Toon bijgevoegde links?"
|
233 |
+
|
234 |
+
#~ msgid "Configuration"
|
235 |
+
#~ msgstr "Instellingen"
|
236 |
+
|
237 |
+
#~ msgid "Cache expiry time"
|
238 |
+
#~ msgstr "Cache tijd"
|
239 |
+
|
240 |
+
#~ msgid "(in seconds)"
|
241 |
+
#~ msgstr "(in seconden)"
|
242 |
+
|
243 |
+
#~ msgid ""
|
244 |
+
#~ "Leave empty for default sizing (maximum of 100% of containing element)"
|
245 |
+
#~ msgstr ""
|
246 |
+
#~ "Laat leeg voor een standaard grootte van maximaal 100% van het "
|
247 |
+
#~ "omvattende element."
|
248 |
+
|
249 |
+
#~ msgid "year"
|
250 |
+
#~ msgstr "jaar"
|
251 |
+
|
252 |
+
#~ msgid "month"
|
253 |
+
#~ msgstr "maand"
|
254 |
+
|
255 |
+
#~ msgid "week"
|
256 |
+
#~ msgstr "week"
|
257 |
+
|
258 |
+
#~ msgid "day"
|
259 |
+
#~ msgstr "dag"
|
260 |
+
|
261 |
+
#~ msgid "hour"
|
262 |
+
#~ msgstr "uur"
|
263 |
+
|
264 |
+
#~ msgid "minute"
|
265 |
+
#~ msgstr "minuut"
|
266 |
+
|
267 |
+
#~ msgid "%d %ss ago"
|
268 |
+
#~ msgstr "%d %sen geleden"
|
license.txt
ADDED
@@ -0,0 +1,621 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: DvanKooten
|
|
3 |
Donate link: http://dannyvankooten.com/donate/
|
4 |
Tags: facebook,posts,fanpage,recent posts,fb,like box alternative,widget,facebook widget,widgets,facebook updates,like button,fb posts
|
5 |
Requires at least: 3.1
|
6 |
-
Tested up to: 3.7
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -26,6 +26,7 @@ Display a list of your most recent Facebook posts in your posts or pages using t
|
|
26 |
* High performance. Facebook posts are cached for a customizable period.
|
27 |
* Customizable. Your Facebook updates will blend in with your theme perfectly and can be easily styled because of smart CSS selectors.
|
28 |
* Easy Configuration, the plugin comes with a comprehensive [installation guide](http://wordpress.org/plugins/recent-facebook-posts/installation/) and [screenshots](http://wordpress.org/plugins/recent-facebook-posts/screenshots/).
|
|
|
29 |
|
30 |
**Demo**
|
31 |
|
@@ -56,7 +57,6 @@ This plugin requires a Facebook application to fetch posts from Facebook.
|
|
56 |
1. Copy and paste your Facebook `App ID/API Key` and `App Secret` into the setting fields.
|
57 |
1. Find the numeric Facebook ID of your public Facebook page using [this website](http://findmyfacebookid.com/).
|
58 |
1. Copy paste the ID in the `Facebook Page ID` field.
|
59 |
-
1. Test if fetching posts works by clicking the "Renew Facebook Posts" button.
|
60 |
1. Add `[recent_facebook_posts]` to the page where you would like to show a list of recent Facebook posts or use the widget.
|
61 |
|
62 |
= Extra notes =
|
@@ -73,8 +73,8 @@ With this plugin you can show a list of the most recent Facebook posts of a publ
|
|
73 |
= How to configure this plugin? =
|
74 |
You need to create a Facebook application for this plugin to work. Have a **close** look at the [installation instructions](http://wordpress.org/plugins/recent-facebook-posts/installation/).
|
75 |
|
76 |
-
=
|
77 |
-
|
78 |
|
79 |
= I want to apply custom styling to the Facebook posts. How do I go about this? =
|
80 |
You can add custom CSS rules to your theme stylesheet. This file is usually located here in `/wp-content/themes/your-theme-name/style.css`.
|
@@ -90,12 +90,13 @@ likes = 1 // show like count, 1 = yes, 0 = no
|
|
90 |
comments = 1 // show comment count, 1 = yes, 0 = no
|
91 |
excerpt_length = 140 // the number of characters to show from each post
|
92 |
number = 5 // number of posts to show,
|
93 |
-
|
94 |
el = div // which element to use as a post container?
|
|
|
95 |
`
|
96 |
|
97 |
*Shortcode example*
|
98 |
-
`[recent_facebook_posts number=10 likes=1 comments=1 excerpt_length=250
|
99 |
|
100 |
= Do you have a function I can use in template files? =
|
101 |
Use `<?php recent_facebook_posts(array('likes' => 1, 'excerpt_length => 140')); ?>` in your theme files. The parameter is optional, it can be an array of the same values available for the shortcode.
|
@@ -127,6 +128,15 @@ function my_rfbp_content($content, $link)
|
|
127 |
add_filter('rfbp_content', 'my_rfbp_content', 10, 2);
|
128 |
`
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
== Screenshots ==
|
132 |
|
@@ -136,6 +146,41 @@ add_filter('rfbp_content', 'my_rfbp_content', 10, 2);
|
|
136 |
|
137 |
== Changelog ==
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
= 1.7.3 - October 28, 2013 =
|
140 |
* Added: `rfbp_read_more` filter.
|
141 |
* Added: `rfbp_content` filter.
|
@@ -272,5 +317,11 @@ add_filter('rfbp_content', 'my_rfbp_content', 10, 2);
|
|
272 |
|
273 |
== Upgrade Notice ==
|
274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
= 1.6 =
|
276 |
CSS and HTML output have changed. If you're using custom CSS styles you will have to edit them after updating.
|
3 |
Donate link: http://dannyvankooten.com/donate/
|
4 |
Tags: facebook,posts,fanpage,recent posts,fb,like box alternative,widget,facebook widget,widgets,facebook updates,like button,fb posts
|
5 |
Requires at least: 3.1
|
6 |
+
Tested up to: 3.7.1
|
7 |
+
Stable tag: 1.8.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
26 |
* High performance. Facebook posts are cached for a customizable period.
|
27 |
* Customizable. Your Facebook updates will blend in with your theme perfectly and can be easily styled because of smart CSS selectors.
|
28 |
* Easy Configuration, the plugin comes with a comprehensive [installation guide](http://wordpress.org/plugins/recent-facebook-posts/installation/) and [screenshots](http://wordpress.org/plugins/recent-facebook-posts/screenshots/).
|
29 |
+
* Translation ready!
|
30 |
|
31 |
**Demo**
|
32 |
|
57 |
1. Copy and paste your Facebook `App ID/API Key` and `App Secret` into the setting fields.
|
58 |
1. Find the numeric Facebook ID of your public Facebook page using [this website](http://findmyfacebookid.com/).
|
59 |
1. Copy paste the ID in the `Facebook Page ID` field.
|
|
|
60 |
1. Add `[recent_facebook_posts]` to the page where you would like to show a list of recent Facebook posts or use the widget.
|
61 |
|
62 |
= Extra notes =
|
73 |
= How to configure this plugin? =
|
74 |
You need to create a Facebook application for this plugin to work. Have a **close** look at the [installation instructions](http://wordpress.org/plugins/recent-facebook-posts/installation/).
|
75 |
|
76 |
+
= No posts are showing.. =
|
77 |
+
The plugin is only able to fetch posts from **public** pages with posts which are publicly available. Check your page its privacy settings and make sure you are using a page instead of a personal profile or group.
|
78 |
|
79 |
= I want to apply custom styling to the Facebook posts. How do I go about this? =
|
80 |
You can add custom CSS rules to your theme stylesheet. This file is usually located here in `/wp-content/themes/your-theme-name/style.css`.
|
90 |
comments = 1 // show comment count, 1 = yes, 0 = no
|
91 |
excerpt_length = 140 // the number of characters to show from each post
|
92 |
number = 5 // number of posts to show,
|
93 |
+
show_page_link = 0 // show a link to Facebook page after posts?
|
94 |
el = div // which element to use as a post container?
|
95 |
+
show_link_previews = 1 // show preview of attached links?
|
96 |
`
|
97 |
|
98 |
*Shortcode example*
|
99 |
+
`[recent_facebook_posts number=10 likes=1 comments=1 excerpt_length=250 show_page_link=1 show_link_previews=1]`
|
100 |
|
101 |
= Do you have a function I can use in template files? =
|
102 |
Use `<?php recent_facebook_posts(array('likes' => 1, 'excerpt_length => 140')); ?>` in your theme files. The parameter is optional, it can be an array of the same values available for the shortcode.
|
128 |
add_filter('rfbp_content', 'my_rfbp_content', 10, 2);
|
129 |
`
|
130 |
|
131 |
+
= How do I change the time posts are cached? =
|
132 |
+
`
|
133 |
+
function my_rfbp_cache_time($time)
|
134 |
+
{
|
135 |
+
return 3600; // 1 hour
|
136 |
+
}
|
137 |
+
|
138 |
+
add_filter('rfbp_cache_time', 'my_rfbp_cache_time');
|
139 |
+
`
|
140 |
|
141 |
== Screenshots ==
|
142 |
|
146 |
|
147 |
== Changelog ==
|
148 |
|
149 |
+
= 1.8.4 - December 2, 2013 =
|
150 |
+
* Fixed: Empty events won't show
|
151 |
+
* Improved: a cache renewal is no longer required after changing the image size
|
152 |
+
* Improved: after changing important settings, cache will automatically be cleared
|
153 |
+
* Improved: added a *test configuration* button which performs a simple ping to Facebook.
|
154 |
+
* Improved: added an info message for new users
|
155 |
+
* Improved: filters are now added the "WordPress way", which means they can be disabled
|
156 |
+
* Improved: namespaced the trigger for renewing the cache
|
157 |
+
* Improved: added empty `index.php` files to prevent directory listings
|
158 |
+
* Improved: code clean-up
|
159 |
+
|
160 |
+
= 1.8.3 - November 17, 2013 =
|
161 |
+
* Fixed: removed weird character between comment count and timestamp
|
162 |
+
|
163 |
+
= 1.8.2 - November 17, 2013 =
|
164 |
+
* Fixed: some translated strings in settings pages were not printed.
|
165 |
+
* Improved: plugin file can no longer be access directly
|
166 |
+
* Improved: better plugin code loading
|
167 |
+
* Improved: disabled plugin directory listing
|
168 |
+
* Added: domain path
|
169 |
+
* Added: license file
|
170 |
+
* Updated Dutch translations
|
171 |
+
|
172 |
+
= 1.8.1 - November 4, 2013 =
|
173 |
+
* Fixed: link previews without images not showing
|
174 |
+
* Added: filter `rfbp_show_link_images` to hide link preview images
|
175 |
+
* Improved: Link preview CSS
|
176 |
+
|
177 |
+
= 1.8 - November 3, 2013 =
|
178 |
+
* Added: previews of attached links, with image and short description (like Facebook)
|
179 |
+
* Added: Translation files
|
180 |
+
* Added: Dutch translations
|
181 |
+
* Improved: Moved cache time to a filter.
|
182 |
+
* Improved: Removed `session_start()` call.
|
183 |
+
|
184 |
= 1.7.3 - October 28, 2013 =
|
185 |
* Added: `rfbp_read_more` filter.
|
186 |
* Added: `rfbp_content` filter.
|
317 |
|
318 |
== Upgrade Notice ==
|
319 |
|
320 |
+
= 1.8.1 =
|
321 |
+
Added link previews (like Facebook) and Dutch translations. Please update your settings after updating.
|
322 |
+
|
323 |
+
= 1.8 =
|
324 |
+
Added link previews (like Facebook) and Dutch translations. Please update your settings after updating.
|
325 |
+
|
326 |
= 1.6 =
|
327 |
CSS and HTML output have changed. If you're using custom CSS styles you will have to edit them after updating.
|
recent-facebook-posts.php
CHANGED
@@ -3,40 +3,50 @@
|
|
3 |
Plugin Name: Recent Facebook Posts
|
4 |
Plugin URI: http://dannyvankooten.com/wordpress-plugins/recent-facebook-posts/
|
5 |
Description: Lists most recent posts from a public Facebook page.
|
6 |
-
Version: 1.
|
7 |
Author: Danny van Kooten
|
8 |
Author URI: http://dannyvankooten.com/
|
9 |
-
|
10 |
-
|
|
|
11 |
|
12 |
-
|
|
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
26 |
*/
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
define("RFBP_PLUGIN_DIR", plugin_dir_path(__FILE__));
|
30 |
|
31 |
// define WP_CONTENT_DIR since we're using it..
|
32 |
if ( ! defined( 'WP_CONTENT_DIR' ) ) { define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); }
|
33 |
|
34 |
-
require RFBP_PLUGIN_DIR . 'includes/
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
-
function custom_read_more($more, $link)
|
38 |
-
{
|
39 |
-
return '.. <a href="'.$link.'">Read more.</a>';
|
40 |
}
|
41 |
|
42 |
-
add_filter('rfbp_read_more', 'custom_read_more', 10, 2);
|
3 |
Plugin Name: Recent Facebook Posts
|
4 |
Plugin URI: http://dannyvankooten.com/wordpress-plugins/recent-facebook-posts/
|
5 |
Description: Lists most recent posts from a public Facebook page.
|
6 |
+
Version: 1.8.4
|
7 |
Author: Danny van Kooten
|
8 |
Author URI: http://dannyvankooten.com/
|
9 |
+
Text Domain: recent-facebook-posts
|
10 |
+
Domain Path: /languages/
|
11 |
+
License: GPL3 or later
|
12 |
|
13 |
+
Recent Facebook Posts Plugin
|
14 |
+
Copyright (C) 2012-2013, Danny van Kooten, hi@dannyvankooten.com
|
15 |
|
16 |
+
This program is free software: you can redistribute it and/or modify
|
17 |
+
it under the terms of the GNU General Public License as published by
|
18 |
+
the Free Software Foundation, either version 3 of the License, or
|
19 |
+
(at your option) any later version.
|
20 |
|
21 |
+
This program is distributed in the hope that it will be useful,
|
22 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
+
GNU General Public License for more details.
|
25 |
|
26 |
+
You should have received a copy of the GNU General Public License
|
27 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
28 |
*/
|
29 |
|
30 |
+
if(! defined("ABSPATH") ) {
|
31 |
+
exit;
|
32 |
+
}
|
33 |
+
|
34 |
+
define("RFBP_VERSION", "1.8.4");
|
35 |
define("RFBP_PLUGIN_DIR", plugin_dir_path(__FILE__));
|
36 |
|
37 |
// define WP_CONTENT_DIR since we're using it..
|
38 |
if ( ! defined( 'WP_CONTENT_DIR' ) ) { define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); }
|
39 |
|
40 |
+
require RFBP_PLUGIN_DIR . 'includes/plugin.php';
|
41 |
+
|
42 |
+
if(!is_admin()) {
|
43 |
+
|
44 |
+
rfbp_get_class();
|
45 |
+
|
46 |
+
} elseif(!defined("DOING_AJAX") || !DOING_AJAX) {
|
47 |
+
|
48 |
+
require RFBP_PLUGIN_DIR . 'includes/class-admin.php';
|
49 |
+
new RFBP_Admin();
|
50 |
|
|
|
|
|
|
|
51 |
}
|
52 |
|
|