FeedWordPress - Version 2008.1214

Version Description

Download this release

Release Info

Developer radgeek
Plugin Icon wp plugin FeedWordPress
Version 2008.1214
Comparing to
See all releases

Code changes from version 2008.1105 to 2008.1214

ChangeLog.text CHANGED
@@ -1,6 +1,45 @@
1
  FeedWordPress Change Log
2
  ========================
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  Changes from 2008.1101 to 2008.1105
5
  -----------------------------------
6
 
1
  FeedWordPress Change Log
2
  ========================
3
 
4
+ Changes from 2008.1105 to 2008.1214
5
+ -----------------------------------
6
+
7
+ * WORDPRESS 2.7 COMPATIBILITY: FeedWordPress has been tested for
8
+ compatibility with the newly released WordPress 2.7. WordPress 2.7 has
9
+ deprecated the Snoopy library for HTTP requests, which caused a fatal
10
+ error for users who had not installed the MagpieRSS upgrade (or whose
11
+ installation of the MagpieRSS upgrade was overwritten by a recent update
12
+ of WordPress). FeedWordPress now handles things gracefully when Snoopy
13
+ is not immediately available.
14
+
15
+ * INTERFACE SPIFFED UP: Interface elements have been updated so that
16
+ FeedWordPress's management interface fits in more naturally with the
17
+ WordPress 2.7 interface (including a new logo and a number of small
18
+ interface tweaks).
19
+
20
+ * BUG WITH TAGS FOR SYNDICATED ARTICLES FIXED: Several users encountered a
21
+ bug with the option to add tags to all syndicated posts under
22
+ Syndication --> Settings -- if you told FeedWordPress to add more than
23
+ one tag to all syndicated posts, instead of doing so correctly, it would
24
+ add a *single* tag instead, whose name was composed of the names of all
25
+ the tags you asked it to add. This bug was the result of nothing more
26
+ dignified than a typographical error on my part. It has now been fixed.
27
+
28
+ * MORE INFORMATION AVAILABLE WHEN FEEDWORDPRESS CAN'T FIND A FEED: When
29
+ you enter a URL for a new syndication source, FeedWordPress uses a
30
+ simple feed-finding algorithm (originally based on Mark Pilgrim's
31
+ Universal Feed Finder) to try to determine whether the URL is the URL
32
+ for a feed, or, if the URL points to an ordinary website rather than to
33
+ a feed, whether there is a feed for that website. All well and good, but
34
+ if FeedWordPress failed to find a feed, for whatever reason, it would
35
+ typically return nothing more than a nasty little note to the effect of
36
+ "no feed found," without any explanation of what went wrong.
37
+ FeedWordPress now keeps track of error conditions from the HTTP
38
+ requests that it uses in the course of looking for the feed, and so may
39
+ be able to give you a bit more information about the nature of the
40
+ problem if something goes wrong.
41
+
42
+
43
  Changes from 2008.1101 to 2008.1105
44
  -----------------------------------
45
 
MagpieRSS-upgrade/rss.php CHANGED
@@ -1176,7 +1176,9 @@ if (!function_exists('array_change_key_case')) {
1176
  ## WordPress: Load in Snoopy from wp-includes ##################################
1177
  ################################################################################
1178
 
1179
- require_once( dirname(__FILE__) . '/class-snoopy.php');
 
 
1180
 
1181
  ################################################################################
1182
  ## rss_fetch.inc: from MagpieRSS 0.8a ##########################################
@@ -1274,7 +1276,7 @@ function fetch_rss ($url) {
1274
  // setup headers
1275
  if ( $cache_status == 'STALE' ) {
1276
  $rss = $cache->get( $cache_key );
1277
- if ( $rss and $rss->etag and $rss->last_modified ) {
1278
  $request_headers['If-None-Match'] = $rss->etag;
1279
  $request_headers['If-Last-Modified'] = $rss->last_modified;
1280
  }
@@ -1390,18 +1392,40 @@ function magpie_error ($errormsg="") {
1390
  Output: an HTTP response object (see Snoopy.class.inc)
1391
  \*=======================================================================*/
1392
  function _fetch_remote_file ($url, $headers = "" ) {
1393
- // Snoopy is an HTTP client in PHP
1394
- $client = new Snoopy();
1395
- $client->agent = MAGPIE_USER_AGENT;
1396
- $client->read_timeout = MAGPIE_FETCH_TIME_OUT;
1397
- $client->use_gzip = MAGPIE_USE_GZIP;
1398
- if (is_array($headers) ) {
1399
- $client->rawheaders = $headers;
1400
- }
1401
-
1402
- @$client->fetch($url);
1403
- return $client;
1404
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1405
  }
1406
 
1407
  /*=======================================================================*\
1176
  ## WordPress: Load in Snoopy from wp-includes ##################################
1177
  ################################################################################
1178
 
1179
+ if (!function_exists('wp_remote_request')) :
1180
+ require_once( dirname(__FILE__) . '/class-snoopy.php');
1181
+ endif;
1182
 
1183
  ################################################################################
1184
  ## rss_fetch.inc: from MagpieRSS 0.8a ##########################################
1276
  // setup headers
1277
  if ( $cache_status == 'STALE' ) {
1278
  $rss = $cache->get( $cache_key );
1279
+ if ( $rss and isset($rss->etag) and $rss->last_modified ) {
1280
  $request_headers['If-None-Match'] = $rss->etag;
1281
  $request_headers['If-Last-Modified'] = $rss->last_modified;
1282
  }
1392
  Output: an HTTP response object (see Snoopy.class.inc)
1393
  \*=======================================================================*/
1394
  function _fetch_remote_file ($url, $headers = "" ) {
1395
+ // WordPress 2.7 has deprecated Snoopy. It's still there, for now, but
1396
+ // I'd rather not rely on it.
1397
+ if (function_exists('wp_remote_request')) :
1398
+ $resp = wp_remote_request($url, array(
1399
+ 'headers' => $headers,
1400
+ 'timeout' => MAGPIE_FETCH_TIME_OUT)
1401
+ );
1402
+
1403
+ if ( is_wp_error($resp) ) :
1404
+ $error = array_shift($resp->errors);
1405
+
1406
+ $client = new stdClass;
1407
+ $client->status = 500;
1408
+ $client->response_code = 500;
1409
+ $client->error = $error[0] . "\n"; //\n = Snoopy compatibility
1410
+ else :
1411
+ $client = new stdClass;
1412
+ $client->status = $resp['response']['code'];
1413
+ $client->response_code = $resp['response']['code'];
1414
+ $client->headers = $resp['headers'];
1415
+ $client->results = $resp['body'];
1416
+ endif;
1417
+ else :
1418
+ // Snoopy is an HTTP client in PHP
1419
+ $client = new Snoopy();
1420
+ $client->agent = MAGPIE_USER_AGENT;
1421
+ $client->read_timeout = MAGPIE_FETCH_TIME_OUT;
1422
+ $client->use_gzip = MAGPIE_USE_GZIP;
1423
+ if (is_array($headers) ) {
1424
+ $client->rawheaders = $headers;
1425
+ }
1426
+ @$client->fetch($url);
1427
+ endif;
1428
+ return $client;
1429
  }
1430
 
1431
  /*=======================================================================*\
admin-ui.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
  function fwp_linkedit_single_submit ($status = NULL) {
3
- global $wp_db_version;
4
- if (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25) :
5
  ?>
6
  <div class="submitbox" id="submitlink">
7
  <div id="previewview"></div>
@@ -33,8 +32,7 @@ function fwp_linkedit_single_submit ($status = NULL) {
33
  }
34
 
35
  function fwp_linkedit_periodic_submit ($caption = NULL) {
36
- global $wp_db_version;
37
- if (!(isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25)) :
38
  if (is_null($caption)) : $caption = __('Save Changes &raquo;'); endif;
39
  ?>
40
  <p class="submit">
@@ -44,6 +42,17 @@ function fwp_linkedit_periodic_submit ($caption = NULL) {
44
  endif;
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
47
  function fwp_authors_single_submit ($link = NULL) {
48
  global $wp_db_version;
49
 
@@ -109,7 +118,7 @@ function fwp_tags_box ($tags) {
109
  function fwp_category_box ($checked, $object, $tags = array()) {
110
  global $wp_db_version;
111
 
112
- if (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_25) : // WordPress 2.5.x
113
  ?>
114
  <div id="category-adder" class="wp-hidden-children">
115
  <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
@@ -134,7 +143,7 @@ function fwp_category_box ($checked, $object, $tags = array()) {
134
  </ul>
135
  </div>
136
  <?php
137
- elseif (isset($wp_db_version) and $wp_db_version >= FWP_SCHEMA_20) : // WordPress 2.x
138
  ?>
139
  <div id="moremeta">
140
  <div id="grabit" class="dbx-group">
@@ -143,17 +152,18 @@ function fwp_category_box ($checked, $object, $tags = array()) {
143
  <div class="dbx-content">
144
  <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p>
145
  <p id="jaxcat"></p>
146
- <ul id="categorychecklist"><?php fwp_category_checklist(NULL, false, $checked); ?></ul></div>
 
147
  </fieldset>
148
  </div>
149
  </div>
150
  <?php
151
  else : // WordPress 1.5
152
  ?>
153
- <fieldset id="categorydiv" style="width: 20%; margin-right: 2em">
154
  <legend><?php _e('Categories') ?></legend>
155
  <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p>
156
- <div style="height: 20em"><?php fwp_category_checklist(NULL, false, $checked); ?></div>
157
  </fieldset>
158
  <?php
159
  endif;
@@ -171,11 +181,22 @@ function update_feeds_finish ($feed, $added, $dt) {
171
  function fwp_author_list () {
172
  global $wpdb;
173
  $ret = array();
174
- $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY display_name");
 
 
 
 
 
 
 
 
175
  if (is_array($users)) :
176
  foreach ($users as $user) :
177
  $id = (int) $user->ID;
178
- $ret[$id] = $user->display_name;
 
 
 
179
  endforeach;
180
  endif;
181
  return $ret;
1
  <?php
2
  function fwp_linkedit_single_submit ($status = NULL) {
3
+ if (fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_27)) :
 
4
  ?>
5
  <div class="submitbox" id="submitlink">
6
  <div id="previewview"></div>
32
  }
33
 
34
  function fwp_linkedit_periodic_submit ($caption = NULL) {
35
+ if (!fwp_test_wp_version(FWP_SCHEMA_25)) :
 
36
  if (is_null($caption)) : $caption = __('Save Changes &raquo;'); endif;
37
  ?>
38
  <p class="submit">
42
  endif;
43
  }
44
 
45
+ function fwp_linkedit_single_submit_closer ($caption = NULL) {
46
+ if (fwp_test_wp_version(FWP_SCHEMA_27)) :
47
+ if (is_null($caption)) : $caption = __('Save Changes'); endif;
48
+ ?>
49
+ <p class="submit">
50
+ <input class="button-primary" type="submit" name="submit" value="<?php print $caption; ?>" />
51
+ </p>
52
+ <?php
53
+ endif;
54
+ }
55
+
56
  function fwp_authors_single_submit ($link = NULL) {
57
  global $wp_db_version;
58
 
118
  function fwp_category_box ($checked, $object, $tags = array()) {
119
  global $wp_db_version;
120
 
121
+ if (fwp_test_wp_version(FWP_SCHEMA_25)) : // WordPress 2.5.x
122
  ?>
123
  <div id="category-adder" class="wp-hidden-children">
124
  <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
143
  </ul>
144
  </div>
145
  <?php
146
+ elseif (fwp_test_wp_version(FWP_SCHEMA_20)) : // WordPress 2.x
147
  ?>
148
  <div id="moremeta">
149
  <div id="grabit" class="dbx-group">
152
  <div class="dbx-content">
153
  <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p>
154
  <p id="jaxcat"></p>
155
+ <div id="categorychecklist"><?php fwp_category_checklist(NULL, false, $checked); ?></div>
156
+ </div>
157
  </fieldset>
158
  </div>
159
  </div>
160
  <?php
161
  else : // WordPress 1.5
162
  ?>
163
+ <fieldset style="width: 60%;">
164
  <legend><?php _e('Categories') ?></legend>
165
  <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p>
166
+ <div style="height: 10em; overflow: scroll;"><?php fwp_category_checklist(NULL, false, $checked); ?></div>
167
  </fieldset>
168
  <?php
169
  endif;
181
  function fwp_author_list () {
182
  global $wpdb;
183
  $ret = array();
184
+
185
+ // display_name introduced in WP 2.0
186
+ if (fwp_test_wp_version(FWP_SCHEMA_20)) :
187
+ $name_column = 'display_name';
188
+ else :
189
+ $name_column = 'user_nickname';
190
+ endif;
191
+
192
+ $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY {$name_column}");
193
  if (is_array($users)) :
194
  foreach ($users as $user) :
195
  $id = (int) $user->ID;
196
+ $ret[$id] = $user->{$name_column};
197
+ if (strlen(trim($ret[$id])) == 0) :
198
+ $ret[$id] = $user->user_login;
199
+ endif;
200
  endforeach;
201
  endif;
202
  return $ret;
authors.php CHANGED
@@ -155,6 +155,9 @@ function fwp_authors_page () {
155
  $updated_link = true;
156
 
157
  // reload link information from DB
 
 
 
158
  $link =& new SyndicatedLink($link_id);
159
  else :
160
  if ('newuser'==$GLOBALS['fwp_post']['unfamiliar_author']) :
@@ -251,9 +254,60 @@ function fwp_authors_page () {
251
  <?php endif; ?>
252
 
253
  <?php $links = FeedWordPress::syndicated_links(); ?>
 
 
 
254
  <h2>Syndicated Author Settings<?php if (!is_null($link) and $link->found()) : ?>: <?php echo wp_specialchars($link->link->link_name, 1); ?><?php endif; ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  <p id="post-search">
256
- <select name="link_id" style="max-width: 20.0em">
257
  <option value="*"<?php if (is_null($link) or !$link->found()) : ?> selected="selected"<?php endif; ?>>- defaults for all feeds -</option>
258
  <?php if ($links) : foreach ($links as $ddlink) : ?>
259
  <option value="<?php print (int) $ddlink->link_id; ?>"<?php if (!is_null($link) and ($link->link->link_id==$ddlink->link_id)) : ?> selected="selected"<?php endif; ?>><?php print wp_specialchars($ddlink->link_name, 1); ?></option>
@@ -261,6 +315,7 @@ function fwp_authors_page () {
261
  </select>
262
  <input class="button" type="submit" name="go" value="<?php _e('Go') ?> &raquo;" />
263
  </p>
 
264
 
265
  <?php if (!is_null($link) and $link->found()) : ?>
266
  <p>These settings only affect posts syndicated from
@@ -270,7 +325,6 @@ function fwp_authors_page () {
270
  by settings for that specific feed.</p>
271
  <?php endif; ?>
272
 
273
- <h3>Assigning posts to authors</h3>
274
  <?php
275
  $authorlist = fwp_author_list();
276
  ?>
@@ -363,7 +417,7 @@ if (is_object($link) and $link->found()) :
363
  </tr>
364
  <?php else : ?>
365
  <th scope="row">Fixing mis-matched authors:</th>
366
- <td><p>Take all the posts from this feed attributed to
367
  <select name="fix_mismatch_from">
368
  <?php foreach ($authorlist as $author_id => $author_name) : ?>
369
  <option value="<?php echo $author_id; ?>"><?php echo $author_name; ?></option>
@@ -386,6 +440,10 @@ and instead
386
  </tbody>
387
  </table>
388
 
 
 
 
 
389
  <script type="text/javascript">
390
  contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser', 'inline');
391
  <?php if (is_object($link) and $link->found()) : ?>
@@ -398,10 +456,6 @@ and instead
398
  contextual_appearance('match-author-by-email', 'unless-null-email', null, 'yes', 'block', /*checkbox=*/ true);
399
  <?php endif; ?>
400
  </script>
401
-
402
- <p class="submit">
403
- <input type="submit" name="save" value="Save Changes" />
404
- </p>
405
  </form>
406
  </div> <!-- class="wrap" -->
407
  <?php
155
  $updated_link = true;
156
 
157
  // reload link information from DB
158
+ if (function_exists('clean_bookmark_cache')) :
159
+ clean_bookmark_cache($link_id);
160
+ endif;
161
  $link =& new SyndicatedLink($link_id);
162
  else :
163
  if ('newuser'==$GLOBALS['fwp_post']['unfamiliar_author']) :
254
  <?php endif; ?>
255
 
256
  <?php $links = FeedWordPress::syndicated_links(); ?>
257
+ <?php if (fwp_test_wp_version(FWP_SCHEMA_27)) : ?>
258
+ <div class="icon32"><img src="<?php print htmlspecialchars(WP_PLUGIN_URL.'/'.$GLOBALS['fwp_path'].'/feedwordpress.png'); ?>" alt="" /></div>
259
+ <?php endif; ?>
260
  <h2>Syndicated Author Settings<?php if (!is_null($link) and $link->found()) : ?>: <?php echo wp_specialchars($link->link->link_name, 1); ?><?php endif; ?></h2>
261
+ <?php if (fwp_test_wp_version(FWP_SCHEMA_27)) : ?>
262
+ <style type="text/css">
263
+ #post-search {
264
+ float: right;
265
+ margin:11px 12px 0;
266
+ min-width: 130px;
267
+ position:relative;
268
+ }
269
+ .fwpfs {
270
+ color: #dddddd;
271
+ background:#797979 url(<?php bloginfo('home') ?>/wp-admin/images/fav.png) repeat-x scroll left center;
272
+ border-color:#777777 #777777 #666666 !important; -moz-border-radius-bottomleft:12px;
273
+ -moz-border-radius-bottomright:12px;
274
+ -moz-border-radius-topleft:12px;
275
+ -moz-border-radius-topright:12px;
276
+ border-style:solid;
277
+ border-width:1px;
278
+ line-height:15px;
279
+ padding:3px 30px 4px 12px;
280
+ }
281
+ .fwpfs.slide-down {
282
+ border-bottom-color: #626262;
283
+ -moz-border-radius-bottomleft:0;
284
+ -moz-border-radius-bottomright:0;
285
+ -moz-border-radius-topleft:12px;
286
+ -moz-border-radius-topright:12px;
287
+ background-image:url(<?php bloginfo('home') ?>/wp-admin/images/fav-top.png);
288
+ background-position:0 top;
289
+ background-repeat:repeat-x;
290
+ border-bottom-style:solid;
291
+ border-bottom-width:1px;
292
+ }
293
+ </style>
294
+
295
+ <script type="text/javascript">
296
+ jQuery(document).ready(function($){
297
+ $('.fwpfs').toggle(
298
+ function(){$('.fwpfs').removeClass('slideUp').addClass('slideDown'); setTimeout(function(){if ( $('.fwpfs').hasClass('slideDown') ) { $('.fwpfs').addClass('slide-down'); }}, 10) },
299
+ function(){$('.fwpfs').removeClass('slideDown').addClass('slideUp'); setTimeout(function(){if ( $('.fwpfs').hasClass('slideUp') ) { $('.fwpfs').removeClass('slide-down'); }}, 10) }
300
+ );
301
+ $('.fwpfs').bind(
302
+ 'change',
303
+ function () { this.form.submit(); }
304
+ );
305
+ $('#post-search .button').css( 'display', 'none' );
306
+ });
307
+ </script>
308
+ <?php endif; /* else : */?>
309
  <p id="post-search">
310
+ <select name="link_id" class="fwpfs" style="max-width: 20.0em;">
311
  <option value="*"<?php if (is_null($link) or !$link->found()) : ?> selected="selected"<?php endif; ?>>- defaults for all feeds -</option>
312
  <?php if ($links) : foreach ($links as $ddlink) : ?>
313
  <option value="<?php print (int) $ddlink->link_id; ?>"<?php if (!is_null($link) and ($link->link->link_id==$ddlink->link_id)) : ?> selected="selected"<?php endif; ?>><?php print wp_specialchars($ddlink->link_name, 1); ?></option>
315
  </select>
316
  <input class="button" type="submit" name="go" value="<?php _e('Go') ?> &raquo;" />
317
  </p>
318
+ <?php /* endif; */ ?>
319
 
320
  <?php if (!is_null($link) and $link->found()) : ?>
321
  <p>These settings only affect posts syndicated from
325
  by settings for that specific feed.</p>
326
  <?php endif; ?>
327
 
 
328
  <?php
329
  $authorlist = fwp_author_list();
330
  ?>
417
  </tr>
418
  <?php else : ?>
419
  <th scope="row">Fixing mis-matched authors:</th>
420
+ <td><p style="margin: 0.5em 0px">Take all the posts from this feed attributed to
421
  <select name="fix_mismatch_from">
422
  <?php foreach ($authorlist as $author_id => $author_name) : ?>
423
  <option value="<?php echo $author_id; ?>"><?php echo $author_name; ?></option>
440
  </tbody>
441
  </table>
442
 
443
+ <p class="submit">
444
+ <input class="button-primary" type="submit" name="save" value="Save Changes" />
445
+ </p>
446
+
447
  <script type="text/javascript">
448
  contextual_appearance('unfamiliar-author', 'unfamiliar-author-newuser', 'unfamiliar-author-default', 'newuser', 'inline');
449
  <?php if (is_object($link) and $link->found()) : ?>
456
  contextual_appearance('match-author-by-email', 'unless-null-email', null, 'yes', 'block', /*checkbox=*/ true);
457
  <?php endif; ?>
458
  </script>
 
 
 
 
459
  </form>
460
  </div> <!-- class="wrap" -->
461
  <?php
compatability.php CHANGED
@@ -15,6 +15,13 @@ function fwp_test_wp_version ($floor, $ceiling = NULL) {
15
  return $good;
16
  } /* function fwp_test_wp_version () */
17
 
 
 
 
 
 
 
 
18
  if (!function_exists('get_option')) {
19
  function get_option ($option) {
20
  return get_settings($option);
@@ -46,7 +53,7 @@ if (!function_exists('current_user_can')) {
46
  $fwp_capability['manage_links'] = 'manage_links';
47
  }
48
  if (!function_exists('sanitize_user')) {
49
- function sanitize_user ($text, $strict) {
50
  return $text; // Don't munge it if it wasn't munged going in...
51
  }
52
  }
@@ -82,18 +89,35 @@ function fwp_category_checklist ($post_id = 0, $descendents_and_self = 0, $selec
82
  if (function_exists('wp_category_checklist')) :
83
  wp_category_checklist($post_id, $descendents_and_self, $selected_cats);
84
  else :
85
- global $checked_categories;
86
-
87
  // selected_cats is an array of integer cat_IDs / term_ids for
88
  // the categories that should be checked
89
- $cats = array();
90
- if ($post_id) : $cats = wp_get_post_categories($post_id);
91
- else : $cats = $selected_cats;
92
- endif;
93
 
94
- $checked_categories = $cats;
95
- dropdown_categories();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  endif;
 
97
  }
98
 
99
  ################################################################################
15
  return $good;
16
  } /* function fwp_test_wp_version () */
17
 
18
+ if (!function_exists('stripslashes_deep')) {
19
+ function stripslashes_deep($value) {
20
+ $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
21
+ return $value;
22
+ }
23
+ }
24
+
25
  if (!function_exists('get_option')) {
26
  function get_option ($option) {
27
  return get_settings($option);
53
  $fwp_capability['manage_links'] = 'manage_links';
54
  }
55
  if (!function_exists('sanitize_user')) {
56
+ function sanitize_user ($text, $strict = false) {
57
  return $text; // Don't munge it if it wasn't munged going in...
58
  }
59
  }
89
  if (function_exists('wp_category_checklist')) :
90
  wp_category_checklist($post_id, $descendents_and_self, $selected_cats);
91
  else :
 
 
92
  // selected_cats is an array of integer cat_IDs / term_ids for
93
  // the categories that should be checked
94
+ global $post_ID;
95
+
96
+ $cats = get_nested_categories();
 
97
 
98
+ // Undo damage from usort() in WP 2.0
99
+ $dogs = array();
100
+ foreach ($cats as $cat) :
101
+ $dogs[$cat['cat_ID']] = $cat;
102
+ endforeach;
103
+ foreach ($selected_cats as $cat_id) :
104
+ $dogs[$cat_id]['checked'] = true;
105
+ endforeach;
106
+ write_nested_categories($dogs);
107
+ endif;
108
+ }
109
+
110
+ function fwp_time_elapsed ($ts) {
111
+ if (function_exists('human_time_diff')) :
112
+ if ($ts >= time()) :
113
+ $ret = __(human_time_diff($ts)." from now");
114
+ else :
115
+ $ret = __(human_time_diff($ts)." ago");
116
+ endif;
117
+ else :
118
+ $ret = strftime('%x %X', $ts);
119
  endif;
120
+ return $ret;
121
  }
122
 
123
  ################################################################################
feedwordpress-tiny.png ADDED
Binary file
feedwordpress.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: FeedWordPress
4
  Plugin URI: http://projects.radgeek.com/feedwordpress
5
  Description: simple and flexible Atom/RSS syndication for WordPress
6
- Version: 2008.1105
7
  Author: Charles Johnson
8
  Author URI: http://radgeek.com/
9
  License: GPL
10
- Last modified: 2008-11-05 4:35pm PST
11
  */
12
 
13
  # This uses code derived from:
@@ -16,18 +16,20 @@ Last modified: 2008-11-05 4:35pm PST
16
  # - Ultra-Liberal Feed Finder by Mark Pilgrim <mark@diveintomark.org>
17
  # according to the terms of the GNU General Public License.
18
  #
19
- # INSTALLATION: see README.text or <http://projects.radgeek.com/install>
20
  #
21
  # USAGE: once FeedWordPress is installed, you manage just about everything from
22
- # the WordPress Dashboard, under Options --> Syndication or Links --> Syndicated
23
- # To ensure that fresh content is added as it becomes available, get your
24
- # contributors to put your XML-RPC URI (if WordPress is installed at
25
  # <http://www.zyx.com/blog>, XML-RPC requests should be sent to
26
- # <http://www.zyx.com/blog/xmlrpc.php>), or see `update-feeds.php`
 
 
27
 
28
  # -- Don't change these unless you know what you're doing...
29
 
30
- define ('FEEDWORDPRESS_VERSION', '2008.1105');
31
  define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact');
32
  define ('DEFAULT_SYNDICATION_CATEGORY', 'Contributors');
33
 
@@ -46,6 +48,7 @@ define ('FWP_SCHEMA_21', 4772); // Database schema # for WP 2.1
46
  define ('FWP_SCHEMA_23', 5495); // Database schema # for WP 2.3
47
  define ('FWP_SCHEMA_25', 7558); // Database schema # for WP 2.5
48
  define ('FWP_SCHEMA_26', 8201); // Database schema # for WP 2.6
 
49
 
50
  if (FEEDWORDPRESS_DEBUG) :
51
  // Help us to pick out errors, if any.
@@ -422,10 +425,25 @@ function fwp_add_pages () {
422
  global $fwp_capability;
423
  global $fwp_path;
424
 
425
- add_menu_page('Syndicated Sites', 'Syndication', $fwp_capability['manage_links'], $fwp_path.'/syndication.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  add_submenu_page($fwp_path.'/syndication.php', 'Syndicated Authors', 'Authors', $fwp_capability['manage_options'], $fwp_path.'/authors.php');
427
- add_submenu_page($fwp_path.'/syndication.php', 'Syndication Options', 'Options', $fwp_capability['manage_options'], $fwp_path.'/syndication-options.php');
428
- add_options_page('Syndication Options', 'Syndication', $fwp_capability['manage_options'], $fwp_path.'/syndication-options.php');
 
429
  } // function fwp_add_pages () */
430
 
431
  ################################################################################
@@ -695,7 +713,7 @@ class FeedWordPress {
695
  $link_id = wp_insert_link(array(
696
  "link_name" => $name,
697
  "link_url" => $uri,
698
- "link_category" => array($cat_id),
699
  "link_rss" => $rss
700
  ));
701
  } else { // WordPress 1.5.x
@@ -801,10 +819,10 @@ class FeedWordPress {
801
  $term = wp_insert_term($cat, 'link_category');
802
  $cat_id = $term['term_id'];
803
  // WordPress 2.1, 2.2 category API. By the way, why the fuck is this API function only available in a wp-admin module?
804
- elseif (function_exists('wp_insert_category')) :
805
  $cat_id = wp_insert_category(array('cat_name' => $cat));
806
  // WordPress 1.5 and 2.0.x
807
- elseif (!isset($wp_db_version) or $wp_db_version < FWP_SCHEMA_21) :
808
  $result = $wpdb->query("
809
  INSERT INTO $wpdb->linkcategories
810
  SET
@@ -950,6 +968,12 @@ class FeedWordPress {
950
  echo $varname.": "; var_dump($var); echo "\n";
951
  die;
952
  }
 
 
 
 
 
 
953
  } // class FeedWordPress
954
 
955
  class SyndicatedPost {
@@ -1148,7 +1172,7 @@ class SyndicatedPost {
1148
  // Tags: start with default tags, if any
1149
  $ft = get_option("feedwordpress_syndication_tags");
1150
  if ($ft) :
1151
- $this->post['tags_input'] = explode('FEEDWORDPRESS_CAT_SEPARATOR', $ft);
1152
  else :
1153
  $this->post['tags_input'] = array();
1154
  endif;
@@ -1742,7 +1766,7 @@ class SyndicatedPost {
1742
  elseif (get_category($cat_id)) :
1743
  $cat_ids[] = $cat_id;
1744
  endif;
1745
- else :
1746
  $esc = $wpdb->escape($cat_name);
1747
  $resc = $wpdb->escape(preg_quote($cat_name));
1748
 
@@ -1766,7 +1790,11 @@ class SyndicatedPost {
1766
  $tags[] = $cat_name;
1767
  elseif ('create'===$unfamiliar_category) :
1768
  $term = wp_insert_term($cat_name, 'category');
1769
- $cat_ids[] = $term['term_id'];
 
 
 
 
1770
  endif;
1771
 
1772
  // WordPress 1.5.x - 2.2.x
@@ -2488,6 +2516,7 @@ class FeedFinder {
2488
  var $verify = FALSE;
2489
 
2490
  var $_data = NULL;
 
2491
  var $_head = NULL;
2492
 
2493
  # -- Recognition patterns
@@ -2544,6 +2573,10 @@ class FeedFinder {
2544
  return $this->_data;
2545
  }
2546
 
 
 
 
 
2547
  function is_feed ($uri = NULL) {
2548
  $data = $this->data($uri);
2549
 
@@ -2564,21 +2597,21 @@ class FeedFinder {
2564
 
2565
  // Is the result not yet cached?
2566
  if ($this->_cache_uri !== $this->uri) :
2567
- // Snoopy is an HTTP client in PHP
2568
- $client = new Snoopy();
2569
-
2570
- // Prepare headers and internal settings
2571
- $client->rawheaders['Connection'] = 'close';
2572
- $client->accept = 'application/atom+xml application/rdf+xml application/rss+xml application/xml text/html */*';
2573
- $client->agent = 'feedfinder/1.2 (compatible; PHP FeedFinder) +http://projects.radgeek.com/feedwordpress';
2574
- $client->read_timeout = 25;
2575
-
2576
- // Fetch the HTML or feed
2577
- @$client->fetch($this->uri);
2578
- $this->_data = $client->results;
2579
-
2580
- // Kilroy was here
2581
- $this->_cache_uri = $this->uri;
2582
  endif;
2583
  } /* FeedFinder::_get () */
2584
 
3
  Plugin Name: FeedWordPress
4
  Plugin URI: http://projects.radgeek.com/feedwordpress
5
  Description: simple and flexible Atom/RSS syndication for WordPress
6
+ Version: 2008.1214
7
  Author: Charles Johnson
8
  Author URI: http://radgeek.com/
9
  License: GPL
10
+ Last modified: 2008-12-14 4:29pm PST
11
  */
12
 
13
  # This uses code derived from:
16
  # - Ultra-Liberal Feed Finder by Mark Pilgrim <mark@diveintomark.org>
17
  # according to the terms of the GNU General Public License.
18
  #
19
+ # INSTALLATION: see readme.txt or <http://projects.radgeek.com/install>
20
  #
21
  # USAGE: once FeedWordPress is installed, you manage just about everything from
22
+ # the WordPress Dashboard, under the Syndication menu. To ensure that fresh
23
+ # content is added as it becomes available, you can convince your contributors
24
+ # to put your XML-RPC URI (if WordPress is installed at
25
  # <http://www.zyx.com/blog>, XML-RPC requests should be sent to
26
+ # <http://www.zyx.com/blog/xmlrpc.php>), or update manually under the
27
+ # Syndication menu, or set up automatic updates under Syndication --> Settings,
28
+ # or use a cron job.
29
 
30
  # -- Don't change these unless you know what you're doing...
31
 
32
+ define ('FEEDWORDPRESS_VERSION', '2008.1214');
33
  define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact');
34
  define ('DEFAULT_SYNDICATION_CATEGORY', 'Contributors');
35
 
48
  define ('FWP_SCHEMA_23', 5495); // Database schema # for WP 2.3
49
  define ('FWP_SCHEMA_25', 7558); // Database schema # for WP 2.5
50
  define ('FWP_SCHEMA_26', 8201); // Database schema # for WP 2.6
51
+ define ('FWP_SCHEMA_27', 9872); // Database schema # for WP 2.7
52
 
53
  if (FEEDWORDPRESS_DEBUG) :
54
  // Help us to pick out errors, if any.
425
  global $fwp_capability;
426
  global $fwp_path;
427
 
428
+ $menu = array('Syndicated Sites', 'Syndication', $fwp_capability['manage_links'], $fwp_path.'/syndication.php', NULL);
429
+ if (fwp_test_wp_version(FWP_SCHEMA_27)) :
430
+ // add icon parameter
431
+ $menu[] = WP_PLUGIN_URL.'/'.$fwp_path.'/feedwordpress-tiny.png';
432
+ endif;
433
+
434
+ if (fwp_test_wp_version(FWP_SCHEMA_26)) :
435
+ $options = __('Settings');
436
+ $longoptions = __('Syndication Settings');
437
+ else :
438
+ $options = __('Options');
439
+ $longoptions = __('Syndication Options');
440
+ endif;
441
+
442
+ call_user_func_array('add_menu_page', $menu);
443
  add_submenu_page($fwp_path.'/syndication.php', 'Syndicated Authors', 'Authors', $fwp_capability['manage_options'], $fwp_path.'/authors.php');
444
+ add_submenu_page($fwp_path.'/syndication.php', $longoptions, $options, $fwp_capability['manage_options'], $fwp_path.'/syndication-options.php');
445
+
446
+ add_options_page($longoptions, 'Syndication', $fwp_capability['manage_options'], $fwp_path.'/syndication-options.php');
447
  } // function fwp_add_pages () */
448
 
449
  ################################################################################
713
  $link_id = wp_insert_link(array(
714
  "link_name" => $name,
715
  "link_url" => $uri,
716
+ "link_category" => (fwp_test_wp_version(0, FWP_SCHEMA_21) ? $cat_id : array($cat_id)),
717
  "link_rss" => $rss
718
  ));
719
  } else { // WordPress 1.5.x
819
  $term = wp_insert_term($cat, 'link_category');
820
  $cat_id = $term['term_id'];
821
  // WordPress 2.1, 2.2 category API. By the way, why the fuck is this API function only available in a wp-admin module?
822
+ elseif (function_exists('wp_insert_category') and !fwp_test_wp_version(FWP_SCHEMA_20, FWP_SCHEMA_21)) :
823
  $cat_id = wp_insert_category(array('cat_name' => $cat));
824
  // WordPress 1.5 and 2.0.x
825
+ elseif (fwp_test_wp_version(0, FWP_SCHEMA_21)) :
826
  $result = $wpdb->query("
827
  INSERT INTO $wpdb->linkcategories
828
  SET
968
  echo $varname.": "; var_dump($var); echo "\n";
969
  die;
970
  }
971
+
972
+ function noncritical_bug ($varname, $var, $line) {
973
+ if (FEEDWORDPRESS_DEBUG) : // halt only when we are doing debugging
974
+ FeedWordPress::critical_bug($varname, $var, $line);
975
+ endif;
976
+ }
977
  } // class FeedWordPress
978
 
979
  class SyndicatedPost {
1172
  // Tags: start with default tags, if any
1173
  $ft = get_option("feedwordpress_syndication_tags");
1174
  if ($ft) :
1175
+ $this->post['tags_input'] = explode(FEEDWORDPRESS_CAT_SEPARATOR, $ft);
1176
  else :
1177
  $this->post['tags_input'] = array();
1178
  endif;
1766
  elseif (get_category($cat_id)) :
1767
  $cat_ids[] = $cat_id;
1768
  endif;
1769
+ elseif (strlen($cat_name) > 0) :
1770
  $esc = $wpdb->escape($cat_name);
1771
  $resc = $wpdb->escape(preg_quote($cat_name));
1772
 
1790
  $tags[] = $cat_name;
1791
  elseif ('create'===$unfamiliar_category) :
1792
  $term = wp_insert_term($cat_name, 'category');
1793
+ if (is_wp_error($term)) :
1794
+ FeedWordPress::noncritical_bug('term insertion problem', array('cat_name' => $cat_name, 'term' => $term, 'this' => $this), __LINE__);
1795
+ else :
1796
+ $cat_ids[] = $term['term_id'];
1797
+ endif;
1798
  endif;
1799
 
1800
  // WordPress 1.5.x - 2.2.x
2516
  var $verify = FALSE;
2517
 
2518
  var $_data = NULL;
2519
+ var $_error = NULL;
2520
  var $_head = NULL;
2521
 
2522
  # -- Recognition patterns
2573
  return $this->_data;
2574
  }
2575
 
2576
+ function error () {
2577
+ return $this->_error;
2578
+ }
2579
+
2580
  function is_feed ($uri = NULL) {
2581
  $data = $this->data($uri);
2582
 
2597
 
2598
  // Is the result not yet cached?
2599
  if ($this->_cache_uri !== $this->uri) :
2600
+ $headers['Connection'] = 'close';
2601
+ $headers['Accept'] = 'application/atom+xml application/rdf+xml application/rss+xml application/xml text/html */*';
2602
+ $headers['User-Agent'] = 'feedfinder/1.2 (compatible; PHP FeedFinder) +http://projects.radgeek.com/feedwordpress';
2603
+
2604
+ // Use function provided by MagpieRSS package
2605
+ $client = _fetch_remote_file($this->uri, $headers);
2606
+ if (isset($client->error)) :
2607
+ $this->_error = $client->error;
2608
+ else :
2609
+ $this->_error = NULL;
2610
+ endif;
2611
+ $this->_data = $client->results;
2612
+
2613
+ // Kilroy was here
2614
+ $this->_cache_uri = $this->uri;
2615
  endif;
2616
  } /* FeedFinder::_get () */
2617
 
feedwordpress.png ADDED
Binary file
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Charles Johnson
3
  Donate link: http://projects.radgeek.com/feedwordpress/
4
  Tags: syndication, aggregation, feed, atom, rss
5
  Requires at least: 1.5
6
- Tested up to: 2.6.3
7
- Stable tag: 2008.1105
8
 
9
  FeedWordPress syndicates content from feeds you choose into your WordPress weblog.
10
 
@@ -23,13 +23,14 @@ to use at [Feminist Blogs](http://feministblogs.org/).
23
 
24
  FeedWordPress is designed with flexibility, ease of use, and ease of
25
  configuration in mind. You'll need a working installation of WordPress or
26
- WordPress MU (versions [2.6][], [2.5][], [2.3][], [2.2][], [2.1][], [2.0][] or
27
  [1.5][]), and also FTP or SFTP access to your web host. The ability to create
28
  cron jobs on your web host is helpful but not absolutely necessary. You *don't*
29
  need to tweak any plain-text configuration files and you *don't* need shell
30
  access to your web host to make it work. (Although, I should point out, web
31
  hosts that *don't* offer shell access are *bad web hosts*.)
32
 
 
33
  [2.6]: http://codex.wordpress.org/Version_2.6
34
  [2.5]: http://codex.wordpress.org/Version_2.5
35
  [2.3]: http://codex.wordpress.org/Version_2.3
3
  Donate link: http://projects.radgeek.com/feedwordpress/
4
  Tags: syndication, aggregation, feed, atom, rss
5
  Requires at least: 1.5
6
+ Tested up to: 2.7
7
+ Stable tag: 2008.1214
8
 
9
  FeedWordPress syndicates content from feeds you choose into your WordPress weblog.
10
 
23
 
24
  FeedWordPress is designed with flexibility, ease of use, and ease of
25
  configuration in mind. You'll need a working installation of WordPress or
26
+ WordPress MU (versions [2.7][], [2.6][], [2.5][], [2.3][], [2.2][], [2.1][], [2.0][] or
27
  [1.5][]), and also FTP or SFTP access to your web host. The ability to create
28
  cron jobs on your web host is helpful but not absolutely necessary. You *don't*
29
  need to tweak any plain-text configuration files and you *don't* need shell
30
  access to your web host to make it work. (Although, I should point out, web
31
  hosts that *don't* offer shell access are *bad web hosts*.)
32
 
33
+ [2.7]: http://codex.wordpress.org/Version_2.7
34
  [2.6]: http://codex.wordpress.org/Version_2.6
35
  [2.5]: http://codex.wordpress.org/Version_2.5
36
  [2.3]: http://codex.wordpress.org/Version_2.3
syndication-options.php CHANGED
@@ -2,7 +2,7 @@
2
  require_once(dirname(__FILE__) . '/admin-ui.php');
3
 
4
  function fwp_syndication_options_page () {
5
- global $wpdb, $wp_db_version;
6
 
7
  if (FeedWordPress::needs_upgrade()) :
8
  fwp_upgrade_page();
@@ -204,6 +204,18 @@ function fwp_syndication_options_page () {
204
  $tags = array_map('trim',
205
  preg_split(FEEDWORDPRESS_CAT_SEPARATOR_PATTERN, get_option('feedwordpress_syndication_tags'))
206
  );
 
 
 
 
 
 
 
 
 
 
 
 
207
  ?>
208
  <script type="text/javascript">
209
  function contextual_appearance (item, appear, disappear, value, checkbox) {
@@ -223,7 +235,8 @@ function fwp_syndication_options_page () {
223
  </script>
224
 
225
  <div class="wrap">
226
- <h2>Syndication Options</h2>
 
227
  <div id="poststuff">
228
  <form action="" method="post">
229
  <?php fwp_linkedit_single_submit(); ?>
@@ -336,9 +349,11 @@ problem.</p>
336
  <td><p>When one of the categories on a syndicated post is a category that FeedWordPress has not encountered before ...</p>
337
  <ul style="margin: 0; padding:0; list-style:none">
338
  <li><label><input type="radio" name="unfamiliar_category" value="create"<?php echo $unfamiliar_category['create']; ?>/> create a new category</label></li>
 
339
  <li><label><input type="radio" name="unfamiliar_category" value="tag"<?php echo $unfamiliar_category['tag']; ?>/> create a new tag</label></li>
340
- <li><label><input type="radio" name="unfamiliar_category" value="default"<?php echo $unfamiliar_category['default']; ?>/> don't create new categories or tags</li>
341
- <li><label><input type="radio" name="unfamiliar_category" value="filter"<?php echo $unfamiliar_category['filter']; ?>/> don't create new categories or tags and don't syndicate posts unless they match at least one familiar category</label></li>
 
342
  </ul></td></tr>
343
  </table>
344
  <?php
@@ -441,6 +456,7 @@ FeedWordPress installations.</p></td>
441
  <?php
442
  fwp_option_box_closer();
443
  fwp_linkedit_periodic_submit();
 
444
  ?>
445
  </div>
446
  </form>
2
  require_once(dirname(__FILE__) . '/admin-ui.php');
3
 
4
  function fwp_syndication_options_page () {
5
+ global $wpdb, $wp_db_version, $fwp_path;
6
 
7
  if (FeedWordPress::needs_upgrade()) :
8
  fwp_upgrade_page();
204
  $tags = array_map('trim',
205
  preg_split(FEEDWORDPRESS_CAT_SEPARATOR_PATTERN, get_option('feedwordpress_syndication_tags'))
206
  );
207
+
208
+ if (fwp_test_wp_version(FWP_SCHEMA_27)) :
209
+ $icon = '<div class="icon32"><img src="'.htmlspecialchars(WP_PLUGIN_URL.'/'.$fwp_path.'/feedwordpress.png').'" alt="" /></div>';
210
+ else :
211
+ $icon = '';
212
+ endif;
213
+
214
+ if (fwp_test_wp_version(FWP_SCHEMA_26)) :
215
+ $options = __('Settings');
216
+ else :
217
+ $options = __('Options');
218
+ endif;
219
  ?>
220
  <script type="text/javascript">
221
  function contextual_appearance (item, appear, disappear, value, checkbox) {
235
  </script>
236
 
237
  <div class="wrap">
238
+ <?php print $icon; ?>
239
+ <h2>Syndication <?php print $options; ?></h2>
240
  <div id="poststuff">
241
  <form action="" method="post">
242
  <?php fwp_linkedit_single_submit(); ?>
349
  <td><p>When one of the categories on a syndicated post is a category that FeedWordPress has not encountered before ...</p>
350
  <ul style="margin: 0; padding:0; list-style:none">
351
  <li><label><input type="radio" name="unfamiliar_category" value="create"<?php echo $unfamiliar_category['create']; ?>/> create a new category</label></li>
352
+ <?php if (fwp_test_wp_version(FWP_SCHEMA_23)) : ?>
353
  <li><label><input type="radio" name="unfamiliar_category" value="tag"<?php echo $unfamiliar_category['tag']; ?>/> create a new tag</label></li>
354
+ <?php endif; ?>
355
+ <li><label><input type="radio" name="unfamiliar_category" value="default"<?php echo $unfamiliar_category['default']; ?>/> don't create new categories<?php if (fwp_test_wp_version(FWP_SCHEMA_23)) : ?> or tags<?php endif; ?></li>
356
+ <li><label><input type="radio" name="unfamiliar_category" value="filter"<?php echo $unfamiliar_category['filter']; ?>/> don't create new categories<?php if (fwp_test_wp_version(FWP_SCHEMA_23)) : ?> or tags<?php endif; ?> and don't syndicate posts unless they match at least one familiar category</label></li>
357
  </ul></td></tr>
358
  </table>
359
  <?php
456
  <?php
457
  fwp_option_box_closer();
458
  fwp_linkedit_periodic_submit();
459
+ fwp_linkedit_single_submit_closer();
460
  ?>
461
  </div>
462
  </form>
syndication.php CHANGED
@@ -119,34 +119,93 @@ if ($cont):
119
  ?>
120
  <?php
121
  $links = FeedWordPress::syndicated_links();
122
-
 
 
 
 
 
123
  if (fwp_test_wp_version(0, FWP_SCHEMA_25)) :
124
  fwp_dashboard_update_if_requested();
125
  endif;
126
 
127
- if ($links): // only display Update panel if there are some links to update....
128
- ?>
129
- <form action="" method="POST">
130
- <?php if (fwp_test_wp_version(FWP_SCHEMA_25)) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  <div class="wrap">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  <div id="rightnow">
133
- <h3 class="reallynow"><span>Update feeds now</span>
134
  <input type="hidden" name="update_uri" value="*" /><input style="float: right; border: none;" class="rbutton" type="submit" name="update" value="Update" />
135
  <br class="clear"/></h3>
136
- <?php else : ?>
137
- <div class="wrap">
138
- <h2>Update feeds now</h2>
139
  <?php endif; ?>
140
 
141
- <?php
142
  if (fwp_test_wp_version(FWP_SCHEMA_25)) :
143
  fwp_dashboard_update_if_requested();
144
  else :
145
  ?>
146
  <p>Check currently scheduled feeds for new and updated posts.</p>
147
- <?php
148
- endif;
149
- ?>
150
 
151
  <?php if (!get_option('feedwordpress_automatic_updates')) : ?>
152
  <p class="youhave"><strong>Note:</strong> Automatic updates are currently turned
@@ -156,22 +215,31 @@ if ($cont):
156
  Options</a>.</p>
157
  <?php endif; ?>
158
 
159
- <?php if (fwp_test_wp_version(0, FWP_SCHEMA_25)) : ?>
160
- <div class="submit"><input type="hidden" name="update_uri" value="*" /><input type="submit" name="update" value="Update" /></div>
161
  <?php endif; ?>
162
-
163
- <?php if (fwp_test_wp_version(FWP_SCHEMA_25)) : ?>
 
 
164
  </div> <!-- id="rightnow" -->
 
 
 
165
  <?php endif; ?>
166
- </div> <!-- class="wrap" -->
167
  </form>
168
  <?php
169
- endif;
 
 
 
170
  ?>
 
 
 
 
171
 
172
- <div class="wrap">
173
  <form id="syndicated-links" action="admin.php?page=<?php print $GLOBALS['fwp_path']; ?>/<?php echo basename(__FILE__); ?>" method="post">
174
- <h2>Syndicated Sites</h2>
175
  <?php $alt_row = true; ?>
176
 
177
  <?php if (fwp_test_wp_version(FWP_SCHEMA_25)) : ?>
@@ -216,13 +284,12 @@ jQuery(document).ready( function () {
216
  <?php endif; ?>
217
  <thead>
218
  <tr>
219
- <?php if (fwp_test_wp_version(FWP_SCHEMA_25)) : $span = 3; ?>
220
- <th class="check-column" scope="col"><input type="checkbox" <?php if (fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_26)) : ?>onclick="checkAll(document.getElementById('syndicated-links'));"<?php endif; ?> /></th>
221
- <?php else : $span = 4; ?>
222
- <?php endif; ?>
223
- <th width="20%" scope="col"><?php _e('Name'); ?></th>
224
- <th width="40%" scope="col"><?php _e('Feed'); ?></th>
225
- <th class="action-links" scope="col" colspan="<?php print $span; ?>"><?php _e('Action'); ?></th>
226
  </tr>
227
  </thead>
228
 
@@ -230,14 +297,24 @@ jQuery(document).ready( function () {
230
  <?php if (count($links) > 0): foreach ($links as $link):
231
  $alt_row = !$alt_row; ?>
232
  <tr<?php echo ($alt_row?' class="alternate"':''); ?>>
233
- <?php if (fwp_test_wp_version(FWP_SCHEMA_25)) : ?>
234
  <th class="check-column" scope="row"><input type="checkbox" name="link_ids[]" value="<?php echo $link->link_id; ?>" /></th>
235
- <?php endif; ?>
236
-
237
- <td><a href="<?php echo wp_specialchars($link->link_url, 'both'); ?>"><?php echo wp_specialchars($link->link_name, 'both'); ?></a></td>
 
 
 
 
 
 
 
 
 
 
 
 
238
  <?php
239
  if (strlen($link->link_rss) > 0):
240
- $caption='Switch Feed';
241
  $uri_bits = parse_url($link->link_rss);
242
  $uri_bits['host'] = preg_replace('/^www\./i', '', $uri_bits['host']);
243
  $display_uri =
@@ -248,26 +325,37 @@ jQuery(document).ready( function () {
248
  .(isset($uri_bits['query'])?'?'.$uri_bits['query']:'');
249
  if (strlen($display_uri) > 32) : $display_uri = substr($display_uri, 0, 32).'&#8230;'; endif;
250
  ?>
251
- <td>
252
- <strong><a href="<?php echo wp_specialchars($link->link_rss, 'both'); ?>"><?php echo wp_specialchars($display_uri, 'both'); ?></a></strong></td>
253
- <?php
254
- else:
255
- $caption='Find Feed';
256
- ?>
257
  <td style="background-color:#FFFFD0"><p><strong>no
258
  feed assigned</strong></p></td>
259
- <?php
 
 
 
 
 
 
 
260
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  ?>
262
- <td><a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&amp;link_id=<?php echo $link->link_id; ?>&amp;action=linkedit" class="edit"><?php _e('Edit')?></a></td>
263
- <td><a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&amp;link_id=<?php echo $link->link_id; ?>&amp;action=feedfinder" class="edit"><?php echo $caption; ?></a></td>
264
- <td><a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&amp;link_id=<?php echo $link->link_id; ?>&amp;action=Unsubscribe" class="delete"><?php _e('Unsubscribe'); ?></a></td>
265
- <?php if (fwp_test_wp_version(0, FWP_SCHEMA_25)) : ?>
266
- <td><input type="checkbox" name="link_ids[]" value="<?php echo $link->link_id; ?>" /></td>
267
  <?php
268
- endif;
269
- echo "\n\t</tr>";
270
- endforeach;
271
  else :
272
  ?>
273
  <tr><td colspan="<?php print $span+2; ?>"><p>There are no websites currently listed for syndication.</p></td></tr>
@@ -284,29 +372,8 @@ jQuery(document).ready( function () {
284
  <?php endif; ?>
285
 
286
  </form>
287
-
288
- </div> <!-- class="wrap" -->
289
-
290
- <?php if (fwp_test_wp_version(0, FWP_SCHEMA_25)) : ?>
291
- <div class="wrap">
292
- <form action="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>" method="post">
293
- <h2>Add a new syndicated site:</h2>
294
- <div>
295
- <label for="add-uri">Website or newsfeed:</label>
296
- <input type="text" name="lookup" id="add-uri" value="URI" size="64" />
297
- <input type="hidden" name="action" value="feedfinder" />
298
- </div>
299
- <div class="submit"><input type="submit" value="Syndicate &raquo;" /></div>
300
- </form>
301
- </div> <!-- class="wrap" -->
302
- <?php endif; ?>
303
-
304
- <div style="display: none">
305
- <div id="tags-input"></div> <!-- avoid JS error from WP 2.5 bug -->
306
- </div>
307
  <?php
308
- endif;
309
- }
310
 
311
  function fwp_feedfinder_page () {
312
  global $wpdb;
@@ -325,7 +392,7 @@ function fwp_feedfinder_page () {
325
  die (__("Cheatin' uh ?"));
326
  endif;
327
  else:
328
- $name = "New Syndicated Feed";
329
  $link_id = 0;
330
  endif;
331
  ?>
@@ -340,6 +407,21 @@ function fwp_feedfinder_page () {
340
  if ($rss):
341
  $feed_title = isset($rss->channel['title'])?$rss->channel['title']:$rss->channel['link'];
342
  $feed_link = isset($rss->channel['link'])?$rss->channel['link']:'';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  ?>
344
  <form action="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>" method="post">
345
  <fieldset style="clear: both">
@@ -386,10 +468,14 @@ function fwp_feedfinder_page () {
386
  </div>
387
  </fieldset>
388
  </form>
389
- <?php endif;
390
  endforeach;
391
  else:
392
- echo "<p><strong>no feed found</strong></p>";
 
 
 
 
393
  endif;
394
  ?>
395
  </div>
@@ -689,6 +775,9 @@ function fwp_linkedit_page () {
689
  $updated_link = true;
690
 
691
  // reload link information from DB
 
 
 
692
  $link =& new SyndicatedLink($link_id);
693
  else :
694
  $updated_link = false;
@@ -837,7 +926,7 @@ function fwp_linkedit_page () {
837
  <th width="20%"><?php _e('Last update') ?>:</th>
838
  <td colspan="2"><?php
839
  if (isset($link->settings['update/last'])) :
840
- echo strftime('%x %X', $link->settings['update/last'])." ";
841
  else :
842
  echo " none yet";
843
  endif;
@@ -921,9 +1010,11 @@ endif;
921
  <li><label><input type="radio" name="unfamiliar_category" value="site-default"<?php echo $unfamiliar['category']['site-default']; ?> /> use the site-wide setting from <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/syndication-options.php">Syndication Options</a>
922
  (currently <strong><?php echo FeedWordPress::on_unfamiliar('category'); ?></strong>)</label></li>
923
  <li><label><input type="radio" name="unfamiliar_category" value="create"<?php echo $unfamiliar['category']['create']; ?> /> create a new category</label></li>
 
924
  <li><label><input type="radio" name="unfamiliar_category" value="tag"<?php echo $unfamiliar['category']['tag']; ?>/> create a new tag</label></li>
925
- <li><label><input type="radio" name="unfamiliar_category" value="default"<?php echo $unfamiliar['category']['default']; ?> /> don't create new categories or tags</label></li>
926
- <li><label><input type="radio" name="unfamiliar_category" value="filter"<?php echo $unfamiliar['category']['filter']; ?> /> don't create new categories or tags and don't syndicate posts unless they match at least one familiar category</label></li>
 
927
  </ul></td>
928
  </tr>
929
 
@@ -1084,6 +1175,7 @@ endif; ?>
1084
  <?php fwp_option_box_closer(); ?>
1085
 
1086
  <?php fwp_linkedit_periodic_submit(); ?>
 
1087
  </div> <!-- id="post-body" -->
1088
  </div> <!-- id="poststuff" -->
1089
  </div>
119
  ?>
120
  <?php
121
  $links = FeedWordPress::syndicated_links();
122
+ ?>
123
+ <div class="wrap">
124
+ <?php if (fwp_test_wp_version(FWP_SCHEMA_27)) : ?>
125
+ <div class="icon32"><img src="<?php print htmlspecialchars(WP_PLUGIN_URL.'/'.$GLOBALS['fwp_path'].'/feedwordpress.png'); ?>" alt="" /></div>
126
+ <h2>Syndicated Sites</h2>
127
+ <?php endif;
128
  if (fwp_test_wp_version(0, FWP_SCHEMA_25)) :
129
  fwp_dashboard_update_if_requested();
130
  endif;
131
 
132
+ if (fwp_test_wp_version(FWP_SCHEMA_27)) :
133
+ ?>
134
+ <script type="text/javascript">
135
+ jQuery(document).ready( function($) {
136
+ // In case someone got here first.
137
+ $('.postbox h3, .postbox .handlediv').unbind('click');
138
+ $('.hide-postbox-tog').unbind('click');
139
+ $('.meta-box-sortables').sortable('destroy');
140
+
141
+ postboxes.add_postbox_toggles('feedwordpress_syndication');
142
+ } );
143
+ </script>
144
+ <?php
145
+ echo "<form style='display: none' method='get' action=''>\n<p>\n";
146
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
147
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
148
+ echo "</p>\n</form>\n";
149
+
150
+ if ($links) :
151
+ add_meta_box('feedwordpress_update_box', __('Update feeds now'), 'fwp_syndication_manage_page_update_box', /*page=*/ 'feedwordpress_syndication', /*context =*/ 'normal');
152
+ endif;
153
+ add_meta_box('feedwordpress_feeds_box', __('Syndicated sources'), 'fwp_syndication_manage_page_links_box', /*page=*/ 'feedwordpress_syndication', /*context =*/ 'normal');
154
+ ?>
155
+ <div class="metabox-holder">
156
+ <div id="feedwordpress-sortables" class="meta-box-sortables ui-sortable">
157
+ <?php
158
+ do_meta_boxes('feedwordpress_syndication', 'normal', NULL);
159
+ else :
160
+ if ($links): // only display Update panel if there are some links to update....
161
+ fwp_syndication_manage_page_update_box();
162
+ endif;
163
+ fwp_syndication_manage_page_links_box();
164
+ ?>
165
+ </div> <!-- class="wrap" -->
166
+
167
+ <?php if (fwp_test_wp_version(0, FWP_SCHEMA_25)) : ?>
168
  <div class="wrap">
169
+ <form action="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>" method="post">
170
+ <h2>Add a new syndicated site:</h2>
171
+ <div>
172
+ <label for="add-uri">Website or newsfeed:</label>
173
+ <input type="text" name="lookup" id="add-uri" value="URI" size="64" />
174
+ <input type="hidden" name="action" value="feedfinder" />
175
+ </div>
176
+ <div class="submit"><input type="submit" value="Syndicate &raquo;" /></div>
177
+ </form>
178
+ </div> <!-- class="wrap" -->
179
+ <?php endif; ?>
180
+
181
+ <div style="display: none">
182
+ <div id="tags-input"></div> <!-- avoid JS error from WP 2.5 bug -->
183
+ </div>
184
+ <?php
185
+ endif;
186
+ endif;
187
+ } /* function fwp_syndication_manage_page () */
188
+
189
+ function fwp_syndication_manage_page_update_box ($object = NULL, $box = NULL) {
190
+ $updateFeedsNow = __('Update feeds now');
191
+ ?>
192
+ <form action="" method="POST">
193
+ <?php if (fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_27)) : ?>
194
  <div id="rightnow">
195
+ <h3 class="reallynow"><span><?php print $updateFeedsNow; ?></span>
196
  <input type="hidden" name="update_uri" value="*" /><input style="float: right; border: none;" class="rbutton" type="submit" name="update" value="Update" />
197
  <br class="clear"/></h3>
198
+ <?php elseif (fwp_test_wp_version(0, FWP_SCHEMA_25)) : ?>
199
+ <h2><?php print $updateFeedsNow; ?></h2>
 
200
  <?php endif; ?>
201
 
202
+ <?php
203
  if (fwp_test_wp_version(FWP_SCHEMA_25)) :
204
  fwp_dashboard_update_if_requested();
205
  else :
206
  ?>
207
  <p>Check currently scheduled feeds for new and updated posts.</p>
208
+ <?php endif; ?>
 
 
209
 
210
  <?php if (!get_option('feedwordpress_automatic_updates')) : ?>
211
  <p class="youhave"><strong>Note:</strong> Automatic updates are currently turned
215
  Options</a>.</p>
216
  <?php endif; ?>
217
 
218
+ <?php if (!fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_27)) : ?>
219
+ <div class="submit"><input type="hidden" name="update_uri" value="*" /><input class="button-primary" type="submit" name="update" value="Update" /></div>
220
  <?php endif; ?>
221
+
222
+ <?php if (fwp_test_wp_version(FWP_SCHEMA_27)) : ?>
223
+ <br style="clear: both" />
224
+ <?php elseif (fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_27)) : ?>
225
  </div> <!-- id="rightnow" -->
226
+ </div> <!-- class="wrap" -->
227
+ <?php elseif (fwp_test_wp_version(0, FWP_SCHEMA_25)) : ?>
228
+ </div> <!-- class="wrap" -->
229
  <?php endif; ?>
 
230
  </form>
231
  <?php
232
+ } /* function fwp_syndication_manage_page_update_box () */
233
+
234
+ function fwp_syndication_manage_page_links_box ($object = NULL, $box = NULL) {
235
+ $links = FeedWordPress::syndicated_links();
236
  ?>
237
+ <?php if (!fwp_test_wp_version(FWP_SCHEMA_27)) : ?>
238
+ <div class="wrap">
239
+ <h2>Syndicated Sites</h2>
240
+ <?php endif; ?>
241
 
 
242
  <form id="syndicated-links" action="admin.php?page=<?php print $GLOBALS['fwp_path']; ?>/<?php echo basename(__FILE__); ?>" method="post">
 
243
  <?php $alt_row = true; ?>
244
 
245
  <?php if (fwp_test_wp_version(FWP_SCHEMA_25)) : ?>
284
  <?php endif; ?>
285
  <thead>
286
  <tr>
287
+ <th class="check-column" scope="col"><?php if (fwp_test_wp_version(FWP_SCHEMA_25)) : ?>
288
+ <input type="checkbox" <?php if (fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_26)) : ?>onclick="checkAll(document.getElementById('syndicated-links'));"<?php endif; ?> />
289
+ <?php endif; ?></th>
290
+ <th scope="col"><?php _e('Name'); ?></th>
291
+ <th scope="col"><?php _e('Feed'); ?></th>
292
+ <th scope="col"><?php _e('Updated'); ?></th>
 
293
  </tr>
294
  </thead>
295
 
297
  <?php if (count($links) > 0): foreach ($links as $link):
298
  $alt_row = !$alt_row; ?>
299
  <tr<?php echo ($alt_row?' class="alternate"':''); ?>>
 
300
  <th class="check-column" scope="row"><input type="checkbox" name="link_ids[]" value="<?php echo $link->link_id; ?>" /></th>
301
+ <?php
302
+ if (strlen($link->link_rss) > 0):
303
+ $caption=__('Switch Feed');
304
+ else :
305
+ $caption=__('Find Feed');
306
+ endif;
307
+ ?>
308
+ <td>
309
+ <strong><a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&amp;link_id=<?php echo $link->link_id; ?>&amp;action=linkedit"><?php echo wp_specialchars($link->link_name, 'both'); ?></a></strong>
310
+ <div class="row-actions"><a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&amp;link_id=<?php echo $link->link_id; ?>&amp;action=linkedit"><?php _e('Edit'); ?></a>
311
+ | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&amp;link_id=<?php echo $link->link_id; ?>&amp;action=feedfinder"><?php echo $caption; ?></a>
312
+ | <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>&amp;link_id=<?php echo $link->link_id; ?>&amp;action=Unsubscribe"><?php _e('Unsubscribe'); ?></a>
313
+ | <a href="<?php echo wp_specialchars($link->link_url, 'both'); ?>"><?php _e('View')?></a>
314
+ </div>
315
+ </td>
316
  <?php
317
  if (strlen($link->link_rss) > 0):
 
318
  $uri_bits = parse_url($link->link_rss);
319
  $uri_bits['host'] = preg_replace('/^www\./i', '', $uri_bits['host']);
320
  $display_uri =
325
  .(isset($uri_bits['query'])?'?'.$uri_bits['query']:'');
326
  if (strlen($display_uri) > 32) : $display_uri = substr($display_uri, 0, 32).'&#8230;'; endif;
327
  ?>
328
+ <td><a href="<?php echo wp_specialchars($link->link_rss, 'both'); ?>"><?php echo wp_specialchars($display_uri, 'both'); ?></a></td>
329
+ <?php else: ?>
 
 
 
 
330
  <td style="background-color:#FFFFD0"><p><strong>no
331
  feed assigned</strong></p></td>
332
+ <?php endif; ?>
333
+
334
+ <td><?php
335
+ $sLink =& new SyndicatedLink($link->link_id);
336
+ if (isset($sLink->settings['update/last'])) :
337
+ print fwp_time_elapsed($sLink->settings['update/last']);
338
+ else :
339
+ _e('None yet');
340
  endif;
341
+
342
+ print "<div style='font-style:italic;size:0.9em'>Ready for next update ";
343
+ if (isset($sLink->settings['update/ttl']) and is_numeric($sLink->settings['update/ttl'])) :
344
+ if (isset($sLink->settings['update/timed']) and $sLink->settings['update/timed']=='automatically') :
345
+ $next = $sLink->settings['update/last'] + ((int) $sLink->settings['update/ttl'] * 60);
346
+ print fwp_time_elapsed($next);
347
+ else :
348
+ echo "every ".$sLink->settings['update/ttl']." minute".(($sLink->settings['update/ttl']!=1)?"s":"");
349
+ endif;
350
+ else:
351
+ echo "as soon as possible";
352
+ endif;
353
+ print "</div>";
354
  ?>
355
+ </td>
356
+ </tr>
 
 
 
357
  <?php
358
+ endforeach;
 
 
359
  else :
360
  ?>
361
  <tr><td colspan="<?php print $span+2; ?>"><p>There are no websites currently listed for syndication.</p></td></tr>
372
  <?php endif; ?>
373
 
374
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  <?php
376
+ } /* function fwp_syndication_manage_page_links_box() */
 
377
 
378
  function fwp_feedfinder_page () {
379
  global $wpdb;
392
  die (__("Cheatin' uh ?"));
393
  endif;
394
  else:
395
+ $name = "<code>".htmlspecialchars($lookup)."</code>";
396
  $link_id = 0;
397
  endif;
398
  ?>
407
  if ($rss):
408
  $feed_title = isset($rss->channel['title'])?$rss->channel['title']:$rss->channel['link'];
409
  $feed_link = isset($rss->channel['link'])?$rss->channel['link']:'';
410
+ else :
411
+ // Give us some sucky defaults
412
+ $uri_bits = parse_url($lookup);
413
+ $uri_bits['host'] = preg_replace('/^www\./i', '', $uri_bits['host']);
414
+ $display_uri =
415
+ (isset($uri_bits['user'])?$uri_bits['user'].'@':'')
416
+ .(isset($uri_bits['host'])?$uri_bits['host']:'')
417
+ .(isset($uri_bits['port'])?':'.$uri_bits['port']:'')
418
+ .(isset($uri_bits['path'])?$uri_bits['path']:'')
419
+ .(isset($uri_bits['query'])?'?'.$uri_bits['query']:'');
420
+ if (strlen($display_uri) > 32) : $display_uri = substr($display_uri, 0, 32).'&#8230;'; endif;
421
+
422
+ $feed_title = $display_uri;
423
+ $feed_link = $lookup;
424
+ endif;
425
  ?>
426
  <form action="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php echo basename(__FILE__); ?>" method="post">
427
  <fieldset style="clear: both">
468
  </div>
469
  </fieldset>
470
  </form>
471
+ <?php
472
  endforeach;
473
  else:
474
+ print "<p><strong>".__('Error').":</strong> ".__("I couldn't find any feeds at").' <code><a href="'.htmlspecialchars($lookup).'">'.htmlspecialchars($lookup).'</a></code>';
475
+ if (!is_null($f->error())) :
476
+ print " [".__('HTTP request error').": ".htmlspecialchars(trim($f->error()))."]";
477
+ endif;
478
+ print ". ".__('Try another URL')."</p>";
479
  endif;
480
  ?>
481
  </div>
775
  $updated_link = true;
776
 
777
  // reload link information from DB
778
+ if (function_exists('clean_bookmark_cache')) :
779
+ clean_bookmark_cache($link_id);
780
+ endif;
781
  $link =& new SyndicatedLink($link_id);
782
  else :
783
  $updated_link = false;
926
  <th width="20%"><?php _e('Last update') ?>:</th>
927
  <td colspan="2"><?php
928
  if (isset($link->settings['update/last'])) :
929
+ echo fwp_time_elapsed($link->settings['update/last'])." ";
930
  else :
931
  echo " none yet";
932
  endif;
1010
  <li><label><input type="radio" name="unfamiliar_category" value="site-default"<?php echo $unfamiliar['category']['site-default']; ?> /> use the site-wide setting from <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/syndication-options.php">Syndication Options</a>
1011
  (currently <strong><?php echo FeedWordPress::on_unfamiliar('category'); ?></strong>)</label></li>
1012
  <li><label><input type="radio" name="unfamiliar_category" value="create"<?php echo $unfamiliar['category']['create']; ?> /> create a new category</label></li>
1013
+ <?php if (fwp_test_wp_version(FWP_SCHEMA_23)) : ?>
1014
  <li><label><input type="radio" name="unfamiliar_category" value="tag"<?php echo $unfamiliar['category']['tag']; ?>/> create a new tag</label></li>
1015
+ <?php endif; ?>
1016
+ <li><label><input type="radio" name="unfamiliar_category" value="default"<?php echo $unfamiliar['category']['default']; ?> /> don't create new categories<?php if (fwp_test_wp_version(FWP_SCHEMA_23)) : ?> or tags<?php endif; ?></label></li>
1017
+ <li><label><input type="radio" name="unfamiliar_category" value="filter"<?php echo $unfamiliar['category']['filter']; ?> /> don't create new categories<?php if (fwp_test_wp_version(FWP_SCHEMA_23)) : ?> or tags<?php endif; ?> and don't syndicate posts unless they match at least one familiar category</label></li>
1018
  </ul></td>
1019
  </tr>
1020
 
1175
  <?php fwp_option_box_closer(); ?>
1176
 
1177
  <?php fwp_linkedit_periodic_submit(); ?>
1178
+ <?php fwp_linkedit_single_submit_closer(); ?>
1179
  </div> <!-- id="post-body" -->
1180
  </div> <!-- id="poststuff" -->
1181
  </div>