RSSImport - Version 4.6.0

Version Description

Download this release

Release Info

Developer Bueltge
Plugin Icon wp plugin RSSImport
Version 4.6.0
Comparing to
See all releases

Code changes from version 4.5.1 to 4.6.0

Files changed (2) hide show
  1. readme.txt +25 -31
  2. rssimport.php +1260 -927
readme.txt CHANGED
@@ -1,18 +1,18 @@
1
  === RSSImport ===
2
- Contributors: Bueltge, inpsyde, took77
3
  Plugin URI: https://bueltge.de/wp-rss-import-plugin/55/
4
  Author: Frank Bültge
5
  Author URI: https://bueltge.de/
6
  Donate link: https://bueltge.de/wunschliste/
7
  Tags: rss, post, content, post, feed
8
  Requires at least: 1.5
9
- Tested up to: 4.9
10
- Stable tag: 4.5.1
11
 
12
  Display feeds on your blog, using PHP in your templates or Shortcode in your posts and pages.
13
 
14
  == Description ==
15
- Display feeds in your blog, using PHP, a Widget or Shortcode. The plugin uses only standard WordPress functionality, so no external libraries are required. For older versions of Wordpress, the built-in [MagpieRSS library](http://magpierss.sourceforge.net/) is used. For WordPress 2.8 and newer, there is a setting available to enable the built-in [SimplePie library](http://simplepie.org/) for parsing feeds.
16
 
17
  As with all other content you publish, make sure you are allowed to (re-)publish the content of the feeds you are about to import!
18
 
@@ -20,18 +20,18 @@ You can insert the following code into a PHP plugin or in a template, for exampl
20
 
21
 
22
  _Example:_
23
- `<?php RSSImport(10, 'http://bueltge.de/feed/'); ?>`
24
 
25
  This is the minimal code needed for using the plugin. The plugin accepts a number of parameters for customizing the feed content import. See below for the full list of available parameters. You can also use any of the parameters with Shortcode in posts and pages.
26
 
27
  _Example Shortcode:_
28
- `[RSSImport display="5" feedurl="http://bueltge.de/feed/" use_simplepie="true"]`
29
 
30
  For all (bool) parameters you can either use the strings `true` and `false` or the integer values `1` and `0`.
31
 
32
 
33
  1. `display` - The number of items to display. Default is `5`.
34
- 1. `feedurl` - The feed address. Default is `http://bueltge.de/feed/`.
35
  1. `before_desc` - The HTML or string to insert before the description. Default is `empty`. You can use some variables which will be replaced, see below.
36
  1. `displaydescriptions` - (bool) When set to true, the description for each entry will be displayed. Default is `false`.
37
  1. `after_desc` - The HTML or string to insert after the description. Default is `empty`. You can use some variables which will be replaced, see below.
@@ -43,7 +43,7 @@ For all (bool) parameters you can either use the strings `true` and `false` or t
43
  1. `before_date` - The HTML or string to insert before the date. Default is ` <small>`.
44
  1. `date` - (bool) If true, display the date of the item. Default is `false`.
45
  1. `after_date` - The HTML or string to insert after the date. Default is `</small>`.
46
- 1. `date_format`- The date format string. Leave empty to use the format of your WordPress installation. If a different date format is desired, specify a PHP date string, for example: `F j, Y`. See also [the date and time formatting page in the WordPress Codex](http://codex.wordpress.org/Formatting_Date_and_Time).
47
  1. `before_creator` - The HTML or string to insert before the creator of the item. Default is ` <small>`.
48
  1. `creator` - (bool) If true, display the creator of the item. Default is `false`.
49
  1. `after_creator` - The HTML or string to insert after creator of the item. Default is `</small>`.
@@ -70,6 +70,7 @@ For all (bool) parameters you can either use the strings `true` and `false` or t
70
  1. `use_simplepie` - (bool) If true, use SimplePie to parse the feed. SimplePie is included in WordPress 2.8 and newer and can parse both RSS and ATOM feeds. Default is `false` if used with Shortcode, `true` if used with the PHP function.
71
  1. `view` - (bool) If true, calling the `RSSImport()` function will print the rendered HTML directly to the output. If false, the rendered HTML will be returned by the function as a string value and nothing will be output. Default when using PHP code is `true`. Default when using Shortcode is `false`.
72
  1. `random_sort` - (bool) If true, Items will be displayed in random order. Default when using Shortcode is `false`.
 
73
 
74
  The parameters `before_desc`, `after_desc`, `start_item` and `end_item` accepts the following variables which will be replaced:
75
 
@@ -87,7 +88,7 @@ You can use any of the parameters in the php function `RSSImport()` in your temp
87
  _Using the PHP function with many parameters:_
88
 
89
  RSSImport(
90
- $display = 5, $feedurl = 'http://bueltge.de/feed/',
91
  $before_desc = '', $displaydescriptions = false, $after_desc = '', $html = false, $truncatedescchar = 200, $truncatedescstring = ' ... ',
92
  $truncatetitlechar = '', $truncatetitlestring = ' ... ',
93
  $before_date = ' <small>', $date = false, $after_date = '</small>',
@@ -100,7 +101,7 @@ Please note that for the PHP function the parameters are expected in the order i
100
 
101
  _Using Shortcode with several parameters:_
102
 
103
- [RSSImport display="10" feedurl="http://your_feed_url/"
104
  displaydescriptions="true" html="true"
105
  start_items="<ol>" end_items="</ol>" paging="true" use_simplepie="true"]
106
 
@@ -108,7 +109,7 @@ _Add a "more" link to the output:_
108
 
109
  RSSImport(
110
  $display = 5,
111
- $feedurl = 'http://bueltge.de/feed/',
112
  $before_desc = '',
113
  $displaydescriptions = true,
114
  $after_desc = ' <a href="%href%" target="_blank">show more</a>'
@@ -116,20 +117,20 @@ _Add a "more" link to the output:_
116
 
117
  or
118
 
119
- [RSSImport feedurl="http://www.ichdruck3d.de/feed/" after_desc=" <a href='%href%' target='_blank'>show more</a>" displaydescriptions="true" use_simplepie="true"]
120
 
121
  _Enable Thumbnail Pictures:_
122
 
123
  RSSImport(
124
  $display = 5,
125
- $feedurl = 'http://www.thestage.co.uk/opinion/shenton/feed/',
126
  $before_desc = '<img src="%picture_url%" alt="">',
127
  $displaydescriptions = true
128
  );
129
 
130
  or
131
 
132
- [RSSImport feedurl="http://www.thestage.co.uk/opinion/shenton/feed/" displaydescriptions="true" before_desc="<div><img src='%picture_url%' width='50px' alt='' style='float:left;' />" after_desc="</div>" use_simplepie="true"]
133
 
134
  == Installation ==
135
  1. Unpack the download package.
@@ -143,6 +144,11 @@ or
143
  1. Widget support
144
 
145
  == Changelog ==
 
 
 
 
 
146
  = v4.5.1 (2017-12-14) =
147
  * Fix escaping in widget admin form
148
 
@@ -176,8 +182,8 @@ or
176
  = v4.4.12 (04/02/2012) =
177
  * Bugfix: restored RSSImport QuickTag for Wordpress 3.3 and later
178
  * Improvement: avoid PHP-notice when description is missing for an item
179
- * TODO: add parameter to allow prefix of url (see http://wordpress.org/support/topic/plugin-rssimport-fix-for-headline-links-without-full-paths)
180
- * TODO: check documentation of call to function (PHP), see http://wordpress.org/support/topic/plugin-rssimport-change-feed-display
181
  * Documentation: corrected 'after_desc' (thanks to elricky for reporting)
182
 
183
  = v4.4.11 (13/12/2011) =
@@ -231,27 +237,15 @@ or
231
  * add rel attribut for links
232
  * add widget support, WP 2.8 and higher
233
 
234
- See on [the official website](http://bueltge.de/wp-rss-import-plugin/55/#historie "RSSImport Changelog") for older entries on changelog.
235
 
236
 
237
  == Other Notes ==
238
  = Acknowledgements =
239
  Thanks to [Dave Wolf](http://www.davewolf.net, "Dave Wolf") for the idea, to [Thomas Fischer](http://www.securityfocus.de "Thomas Fischer") and [Gunnar Tillmann](http://www.gunnart.de "Gunnar Tillmann") for better code and Ilya Shindyapin, http://skookum.com for the idea and solution of pagination.
240
 
241
- = Localizations =
242
- * German language files by me [Frank B&uuml;ltge](http://bueltge.de/) ;-)
243
- * Russian translation by Fat Cow
244
- * Ukrainian translation by [WordPress Ukraine](http://wpp.pp.ua/)
245
- * French translation by [Martin Korolczuk](http://petitnuage.fr)
246
- * Hungarian translation by [Feriman](http://feriman.com)
247
- * Hindi translation by [Ashish Jha](http://outshinesolutions.com)
248
- * Italian translation by [Gianni Diurno](http://gidibao.net/)
249
- * Romanian language files, thanks to [Alexander Ovsov](http://webhostinggeeks.com/)
250
- * Lithuanian translation files by [Vincent G](http://www.host1plus.com)
251
- * Portuguese translation files by [Miguel Patricio Angelo](http://www.miguelpatricio.com/)
252
-
253
  = License =
254
- Good news, this plugin is free for everyone! Since it's released under the GPL, you can use it free of charge on your personal or commercial blog. But if you enjoy this plugin, you can thank me by leaving a [small donation](http://bueltge.de/wunschliste/ "Wish lists and donations") for the time I've spent writing and supporting this plugin. And I really don't want to know how many hours of my life this plugin has already eaten ;)
255
 
256
  = Translations =
257
- The plugin comes with various translations, please refer to the [WordPress Codex](http://codex.wordpress.org/Installing_WordPress_in_Your_Language "Installing WordPress in Your Language") for more information about activating the translation. If you want to help to translate the plugin to your language, please have a look at the sitemap.pot file which contains all defintions and may be used with a [gettext](http://www.gnu.org/software/gettext/) editor like [Poedit](http://www.poedit.net/) (Windows).
1
  === RSSImport ===
2
+ Contributors: Bueltge, took77
3
  Plugin URI: https://bueltge.de/wp-rss-import-plugin/55/
4
  Author: Frank Bültge
5
  Author URI: https://bueltge.de/
6
  Donate link: https://bueltge.de/wunschliste/
7
  Tags: rss, post, content, post, feed
8
  Requires at least: 1.5
9
+ Tested up to: 5.3
10
+ Stable tag: 4.6.0
11
 
12
  Display feeds on your blog, using PHP in your templates or Shortcode in your posts and pages.
13
 
14
  == Description ==
15
+ Display feeds in your blog, using PHP, a Widget or Shortcode. The plugin uses only standard WordPress functionality, so no external libraries are required. For older versions of Wordpress, the built-in [MagpieRSS library](https://magpierss.sourceforge.net/) is used. For WordPress 2.8 and newer, there is a setting available to enable the built-in [SimplePie library](https://simplepie.org/) for parsing feeds.
16
 
17
  As with all other content you publish, make sure you are allowed to (re-)publish the content of the feeds you are about to import!
18
 
20
 
21
 
22
  _Example:_
23
+ `&lt;?php RSSImport(10, 'https://bueltge.de/feed/'); ?&gt;`
24
 
25
  This is the minimal code needed for using the plugin. The plugin accepts a number of parameters for customizing the feed content import. See below for the full list of available parameters. You can also use any of the parameters with Shortcode in posts and pages.
26
 
27
  _Example Shortcode:_
28
+ `[RSSImport display="5" feedurl="https://bueltge.de/feed/" use_simplepie="true"]`
29
 
30
  For all (bool) parameters you can either use the strings `true` and `false` or the integer values `1` and `0`.
31
 
32
 
33
  1. `display` - The number of items to display. Default is `5`.
34
+ 1. `feedurl` - The feed address. Default is `https://bueltge.de/feed/`.
35
  1. `before_desc` - The HTML or string to insert before the description. Default is `empty`. You can use some variables which will be replaced, see below.
36
  1. `displaydescriptions` - (bool) When set to true, the description for each entry will be displayed. Default is `false`.
37
  1. `after_desc` - The HTML or string to insert after the description. Default is `empty`. You can use some variables which will be replaced, see below.
43
  1. `before_date` - The HTML or string to insert before the date. Default is ` <small>`.
44
  1. `date` - (bool) If true, display the date of the item. Default is `false`.
45
  1. `after_date` - The HTML or string to insert after the date. Default is `</small>`.
46
+ 1. `date_format`- The date format string. Leave empty to use the format of your WordPress installation. If a different date format is desired, specify a PHP date string, for example: `F j, Y`. See also [the date and time formatting page in the WordPress Codex](https://codex.wordpress.org/Formatting_Date_and_Time).
47
  1. `before_creator` - The HTML or string to insert before the creator of the item. Default is ` <small>`.
48
  1. `creator` - (bool) If true, display the creator of the item. Default is `false`.
49
  1. `after_creator` - The HTML or string to insert after creator of the item. Default is `</small>`.
70
  1. `use_simplepie` - (bool) If true, use SimplePie to parse the feed. SimplePie is included in WordPress 2.8 and newer and can parse both RSS and ATOM feeds. Default is `false` if used with Shortcode, `true` if used with the PHP function.
71
  1. `view` - (bool) If true, calling the `RSSImport()` function will print the rendered HTML directly to the output. If false, the rendered HTML will be returned by the function as a string value and nothing will be output. Default when using PHP code is `true`. Default when using Shortcode is `false`.
72
  1. `random_sort` - (bool) If true, Items will be displayed in random order. Default when using Shortcode is `false`.
73
+ 1. `order` - (string) Order of the filds Date, Title, Creator, Description. Use a comma separated string for your order. Default is `date,title,creator,description`
74
 
75
  The parameters `before_desc`, `after_desc`, `start_item` and `end_item` accepts the following variables which will be replaced:
76
 
88
  _Using the PHP function with many parameters:_
89
 
90
  RSSImport(
91
+ $display = 5, $feedurl = 'https://bueltge.de/feed/',
92
  $before_desc = '', $displaydescriptions = false, $after_desc = '', $html = false, $truncatedescchar = 200, $truncatedescstring = ' ... ',
93
  $truncatetitlechar = '', $truncatetitlestring = ' ... ',
94
  $before_date = ' <small>', $date = false, $after_date = '</small>',
101
 
102
  _Using Shortcode with several parameters:_
103
 
104
+ [RSSImport display="10" feedurl="https://your_feed_url/"
105
  displaydescriptions="true" html="true"
106
  start_items="<ol>" end_items="</ol>" paging="true" use_simplepie="true"]
107
 
109
 
110
  RSSImport(
111
  $display = 5,
112
+ $feedurl = 'https://bueltge.de/feed/',
113
  $before_desc = '',
114
  $displaydescriptions = true,
115
  $after_desc = ' <a href="%href%" target="_blank">show more</a>'
117
 
118
  or
119
 
120
+ [RSSImport feedurl="https://wordpress.org/news/feed/" after_desc=" <a href='%href%' target='_blank'>show more</a>" displaydescriptions="true" use_simplepie="true"]
121
 
122
  _Enable Thumbnail Pictures:_
123
 
124
  RSSImport(
125
  $display = 5,
126
+ $feedurl = 'https://bueltge.de/feed/',
127
  $before_desc = '<img src="%picture_url%" alt="">',
128
  $displaydescriptions = true
129
  );
130
 
131
  or
132
 
133
+ [RSSImport feedurl="https://wordpress.org/news/feed/" displaydescriptions="true" before_desc="<div><img src='%picture_url%' width='50px' alt='' style='float:left;' />" after_desc="</div>" use_simplepie="true"]
134
 
135
  == Installation ==
136
  1. Unpack the download package.
144
  1. Widget support
145
 
146
  == Changelog ==
147
+ = v4.6.0 (2019-12-23) =
148
+ * Add new parameter to set the order of date, title, creator and description.
149
+ * Maintain simple topics inside the code.
150
+ * Ready for usage in PHP 7.2*, replace `create_function`
151
+
152
  = v4.5.1 (2017-12-14) =
153
  * Fix escaping in widget admin form
154
 
182
  = v4.4.12 (04/02/2012) =
183
  * Bugfix: restored RSSImport QuickTag for Wordpress 3.3 and later
184
  * Improvement: avoid PHP-notice when description is missing for an item
185
+ * TODO: add parameter to allow prefix of url (see https://wordpress.org/support/topic/plugin-rssimport-fix-for-headline-links-without-full-paths)
186
+ * TODO: check documentation of call to function (PHP), see https://wordpress.org/support/topic/plugin-rssimport-change-feed-display
187
  * Documentation: corrected 'after_desc' (thanks to elricky for reporting)
188
 
189
  = v4.4.11 (13/12/2011) =
237
  * add rel attribut for links
238
  * add widget support, WP 2.8 and higher
239
 
240
+ See on [the official website](https://bueltge.de/wp-rss-import-plugin/55/#historie "RSSImport Changelog") for older entries on changelog.
241
 
242
 
243
  == Other Notes ==
244
  = Acknowledgements =
245
  Thanks to [Dave Wolf](http://www.davewolf.net, "Dave Wolf") for the idea, to [Thomas Fischer](http://www.securityfocus.de "Thomas Fischer") and [Gunnar Tillmann](http://www.gunnart.de "Gunnar Tillmann") for better code and Ilya Shindyapin, http://skookum.com for the idea and solution of pagination.
246
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  = License =
248
+ Good news, this plugin is free for everyone! Since it's released under the GPL, you can use it free of charge on your personal or commercial blog. But if you enjoy this plugin, you can thank me by leaving a [small donation](https://bueltge.de/wunschliste/ "Wish lists and donations") for the time I've spent writing and supporting this plugin. And I really don't want to know how many hours of my life this plugin has already eaten ;)
249
 
250
  = Translations =
251
+ The plugin comes with various translations, please refer to the [WordPress Codex](https://codex.wordpress.org/Installing_WordPress_in_Your_Language "Installing WordPress in Your Language") for more information about activating the translation. Please helpt [to translate or improve](https://translate.wordpress.org/projects/wp-plugins/rss-import/) the translations of this plugin.
rssimport.php CHANGED
@@ -6,9 +6,9 @@
6
  * Domain Path: /languages
7
  * Description: Display Feeds in your blog. Use the function <code>RSSImport()</code>, a Widget or the Shortcode <code>[RSSImport]</code>.
8
  * Author: Frank Bültge, took77
9
- * Version: 4.5.0
10
  * License: GPLv3+
11
- * Last change: 2017-11-29
12
  */
13
 
14
  /*
@@ -17,12 +17,12 @@
17
  ------------------------------------------------------------
18
  Original and Idea: Dave Wolf, http://www.davewolf.net
19
  Thx to Thomas Fischer, http://www.securityfocus.de and
20
- Gunnar Tillmann http://www.gunnart.de for a better code
21
- Paging: Ilya Shindyapin, http://skookum.com
22
 
23
  ------------------------------------------------------------
24
  USAGE: Use following code with a PHP-Plugin for WordPress:
25
- Example: <?php RSSImport(10, "http://bueltge.de/feed/"); ?>
26
  ------------------------------------------------------------
27
  */
28
 
@@ -56,13 +56,12 @@ if ( function_exists( 'add_action' ) ) {
56
 
57
  // plugin definitions
58
  define( 'FB_RSSI_BASENAME', plugin_basename( __FILE__ ) );
59
- define( 'FB_RSSI_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) );
60
  define( 'FB_RSSI_TEXTDOMAIN', 'rssimport' );
61
  define( 'FB_RSSI_QUICKTAG', true );
62
  }
63
 
64
  function RSSImport_textdomain() {
65
-
66
  if ( function_exists( 'load_plugin_textdomain' ) ) {
67
  load_plugin_textdomain( FB_RSSI_TEXTDOMAIN, false, dirname( FB_RSSI_BASENAME ) . '/languages' );
68
  }
@@ -75,52 +74,53 @@ if ( ! defined( 'MAGPIE_CACHE_AGE' ) ) {
75
  }
76
 
77
  /**
78
- * @param int $display
79
- * @param string $feedurl
80
- * @param string $before_desc
81
- * @param int $displaydescriptions
82
- * @param string $after_desc
83
- * @param int $html
84
- * @param int $truncatedescchar
85
- * @param string $truncatedescstring
86
- * @param int $truncatetitlechar
87
- * @param string $truncatetitlestring
88
- * @param string $before_date
89
- * @param int $date
90
- * @param string $after_date
91
- * @param string $date_format
92
- * @param string $before_creator
93
  * @param int|string $creator
94
- * @param string $after_creator
95
- * @param string $start_items
96
- * @param string $end_items
97
- * @param string $start_item
98
- * @param string $end_item
99
- * @param string $target
100
- * @param string $rel
101
- * @param int $desc4title
102
- * @param int $charsetscan
103
- * @param int $debug
104
- * @param string $before_noitems
105
- * @param string $noitems
106
- * @param string $after_noitems
107
- * @param string $before_error
108
- * @param string $error
109
- * @param string $after_error
110
- * @param int $paging
111
- * @param string $prev_paging_link
112
- * @param string $next_paging_link
113
- * @param string $prev_paging_title
114
- * @param string $next_paging_title
115
- * @param int $use_simplepie
116
- * @param int $view
117
- * @param int $random_sort
 
118
  *
119
  * @return string
120
  */
121
  function RSSImport(
122
  $display = 5,
123
- $feedurl = 'http://bueltge.de/feed/',
124
  $before_desc = '',
125
  $displaydescriptions = 0,
126
  $after_desc = '',
@@ -149,7 +149,7 @@ function RSSImport(
149
  $noitems = 'No items, feed is empty.',
150
  $after_noitems = '</p>',
151
  $before_error = '<p>',
152
- $error = 'Error: Feed has an error or is not valid',
153
  $after_error = '</p>',
154
  $paging = 0,
155
  $prev_paging_link = '&laquo; Previous',
@@ -158,9 +158,9 @@ function RSSImport(
158
  $next_paging_title = 'more items',
159
  $use_simplepie = 1,
160
  $view = 1,
161
- $random_sort = 0
 
162
  ) {
163
-
164
  // replace for yahoo pipes urls
165
  $feedurl = str_replace( '&#038;', '&', $feedurl );
166
 
@@ -186,26 +186,28 @@ function RSSImport(
186
  if ( file_exists( ABSPATH . WPINC . '/class-simplepie.php' ) ) {
187
  @require ABSPATH . WPINC . '/class-simplepie.php';
188
  } else {
189
- wp_die( __( 'Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The WordPress file "class-simplepie.php" with class SimplePie could not be included.' ) );
 
 
 
 
190
  }
191
  }
 
 
 
 
 
 
192
  } else {
193
- // For function fetch_rss from wp-core
194
- if ( file_exists( ABSPATH . WPINC . '/rss.php' ) ) {
195
- require_once ABSPATH . WPINC . '/rss.php';
196
- // It's WordPress 2.x. since it has been loaded successfully
197
- } elseif ( file_exists( ABSPATH . WPINC . '/rss-functions.php' ) ) {
198
- require_once ABSPATH . WPINC . '/rss-functions.php';
199
- // In WordPress < 2.1
200
- } else {
201
- wp_die( __( 'Error in file: ' . __FILE__ . ' on line: ' . __LINE__
202
- . '.<br>The WordPress file "rss-functions.php" or "rss.php" could not be included.' ) );
203
- }
204
  }
205
 
206
  $display = (int) $display;
207
- $page = ( ( ! empty( $_GET[ 'rsspage' ] ) && (int) $_GET[ 'rsspage' ] > 0 )
208
- ? (int) $_GET[ 'rsspage' ] : 1 );
 
209
  $truncatedescchar = (int) $truncatedescchar;
210
  $truncatetitlechar = (int) $truncatetitlechar;
211
  $echo = '<!--via MagpieRSS with RSSImport-->';
@@ -228,7 +230,6 @@ function RSSImport(
228
  }
229
 
230
  if ( $rss && ! is_wp_error( $rss ) ) {
231
-
232
  // the follow print_r list all items in array, for debug purpose
233
  if ( $debug ) {
234
  print '<pre>';
@@ -253,15 +254,9 @@ function RSSImport(
253
  $displayitems = $display;
254
  $displaylimit = ( $page * $display );
255
  $display = ( ( $page - 1 ) * $display );
256
- $nextitems = true;
257
- $previousitems = false;
258
- if ( $page > 1 ) {
259
- $previousitems = true;
260
- }
261
 
262
- $picked = array();
263
-
264
- if ( $use_simplepie && ( 1 === $paging || $random_sort) ) {
265
  /** @var SimplePie $rss */
266
  $items = $rss->get_items();
267
  } elseif ( $use_simplepie ) {
@@ -271,20 +266,18 @@ function RSSImport(
271
  /** @var MagpieRSS $rss */
272
  $items = $rss->items;
273
  }
274
- $cnt_items = count($items);
275
 
276
  while ( $display < $displaylimit ) {
277
-
278
  $i = $display;
279
- if ($random_sort) {
280
- do {
281
- $i = rand(0, $cnt_items-1);
282
- } while (in_array($i, $picked) && count($picked) < $cnt_items);
283
  $picked[] = $i;
284
- }
285
 
286
  if ( array_key_exists( $i, $items ) ) {
287
-
288
  if ( $use_simplepie ) {
289
  /** @var SimplePie $rss */
290
  $item = $rss->get_item( $i );
@@ -296,15 +289,15 @@ function RSSImport(
296
  $title = '';
297
  if ( $use_simplepie ) {
298
  $title = esc_attr( strip_tags( $item->get_title() ) );
299
- } elseif ( isset( $item[ 'title' ] ) ) {
300
- $title = esc_attr( strip_tags( $item[ 'title' ] ) );
301
  }
302
  // import link
303
  $href = '';
304
  if ( $use_simplepie ) {
305
  $href = wp_filter_kses( $item->get_link() );
306
- } elseif ( isset( $item[ 'link' ] ) ) {
307
- $href = wp_filter_kses( $item[ 'link' ] );
308
  }
309
  // import picture_url
310
  $picture_url = '';
@@ -312,37 +305,34 @@ function RSSImport(
312
  $picture_url = wp_filter_kses( $enclosure->get_thumbnail() );
313
  }
314
 
315
- $start_item_temp = str_replace( '%title%', $title, $start_item );
316
- $start_item_temp = str_replace( '%href%', $href, $start_item_temp );
317
- $start_item_temp = str_replace( '%picture_url%', $picture_url, $start_item_temp );
318
  $echo .= $start_item_temp;
319
 
320
  // import date
321
  if ( $use_simplepie && $date ) {
322
  $pubDate = date_i18n( $date_format, strtotime( $item->get_date() ) );
323
- } elseif ( $date && isset( $item[ 'pubdate' ] ) ) {
324
- $pubDate = date_i18n( $date_format, strtotime( $item[ 'pubdate' ] ) );
325
  }
326
  // import creator
327
  if ( $use_simplepie && $creator ) {
328
  /** @var SimplePie $item */
329
- $creator = $item->get_author();
330
- if ( is_object( $creator ) ) {
331
- $creator = $creator->get_name();
332
- $creator = ' <cite>' . esc_html( strip_tags( $creator ) ) . '</cite>';
333
- }
334
- } elseif ( $creator && isset( $item[ 'dc' ][ 'creator' ] ) ) {
335
- $creator = esc_html( $item[ 'dc' ][ 'creator' ] );
336
- } elseif ( $creator && isset( $item[ 'creator' ] ) ) {
337
- $creator = esc_html( $item[ 'creator' ] );
338
  }
339
  // import desc
340
  if ( $use_simplepie && $displaydescriptions && $html ) {
341
  $desc = @html_entity_decode( $item->get_content(), ENT_QUOTES, get_option( 'blog_charset' ) );
342
  } // For import with HTML
343
- elseif ( $use_simplepie && $displaydescriptions && ! $html ) {
344
  $desc = str_replace(
345
- array( "\n", "\r" ), ' ',
 
346
  esc_attr( strip_tags(
347
  @html_entity_decode(
348
  $item->get_description(),
@@ -351,18 +341,27 @@ function RSSImport(
351
  )
352
  );
353
  } // For import without HTML
354
- elseif ( $displaydescriptions && $html && isset( $item[ 'content' ][ 'encoded' ] ) && $item[ 'content' ][ 'encoded' ] !== 'A' ) {
355
- $desc = $item[ 'content' ][ 'encoded' ];
 
 
 
356
  } // For import with HTML
357
- elseif ( $displaydescriptions && $html && isset( $item[ 'content' ][ 'atom_content' ] ) && $item[ 'content' ][ 'atom_content' ] !== 'A' ) {
358
- $desc = $item[ 'content' ][ 'atom_content' ];
 
 
 
359
  } // For import with HTML
360
- elseif ( $displaydescriptions && $html && isset( $item[ 'content' ] ) && ! is_array( $item[ 'content' ] ) ) {
361
- $desc = $item[ 'content' ];
362
- } elseif ( $displaydescriptions && $html && isset( $item[ 'description' ] ) ) {
363
- $desc = $item[ 'description' ];
364
- } elseif ( $displaydescriptions && ! $html && isset( $item[ 'description' ] ) ) {
365
- $desc = esc_html( strip_tags( $item[ 'description' ] ) );
 
 
 
366
  } // For import without HTML
367
 
368
  if ( isset( $a ) && false !== stripos( $a, 'ISO' ) ) {
@@ -415,7 +414,7 @@ function RSSImport(
415
  $desc = '';
416
  if ( $use_simplepie ) {
417
  $desc = str_replace(
418
- array( "\n", "\r" ),
419
  ' ',
420
  esc_attr( strip_tags(
421
  @html_entity_decode(
@@ -427,38 +426,59 @@ function RSSImport(
427
  )
428
  );
429
  } // For import without HTML
430
- else if ( isset( $item[ 'description' ] ) ) {
431
- $desc = esc_html( strip_tags( $item[ 'description' ] ) );
432
  }
433
  $atitle = wp_html_excerpt( $desc, $truncatedescchar ) . $truncatedescstring;
434
  } else {
435
  $atitle = $title;
436
  }
437
 
438
- $echo .= '<a' . $target . $rel . ' href="' . $href . '" title="' . $atitle . '">' . $title . '</a>';
439
-
440
- if ( isset( $pubDate ) && $date && '' !== $pubDate ) {
441
- $echo .= $before_date . $pubDate . $after_date;
442
- }
443
- if ( isset( $creator ) && $creator && '' !== $creator ) {
444
- $echo .= $before_creator . $creator . $after_creator;
445
- }
446
- if ( isset( $desc ) && $displaydescriptions && '' !== $desc ) {
447
- $after_desc_temp = stripslashes_deep( $after_desc );
448
- $after_desc_temp = str_replace( '%title%', $title, $after_desc_temp );
449
- $after_desc_temp = str_replace( '%href%', $href, $after_desc_temp );
450
- $after_desc_temp = str_replace( '%picture_url%', $picture_url, $after_desc_temp );
451
- $before_desc_temp = str_replace( '%title%', $title, $before_desc );
452
- $before_desc_temp = str_replace( '%href%', $href, $before_desc_temp );
453
- $before_desc_temp = str_replace( '%picture_url%', $picture_url, $before_desc_temp );
454
- $echo .= $before_desc_temp . $desc . $after_desc_temp;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  }
456
- $end_item_temp = str_replace( '%title%', $title, $end_item );
457
- $end_item_temp = str_replace( '%href%', $href, $end_item_temp );
458
- $end_item_temp = str_replace( '%picture_url%', $picture_url, $end_item_temp );
 
459
  $echo .= $end_item_temp;
460
- } else {
461
- $nextitems = false;
462
  }
463
 
464
  $display ++;
@@ -469,24 +489,40 @@ function RSSImport(
469
  } else {
470
  $echo = wptexturize( $before_noitems . $noitems . $after_noitems );
471
  }
472
-
473
  } else {
474
  /** @noinspection MissingIssetImplementationInspection */
475
  if ( empty( $rss->ERROR ) ) {
476
- $rss->ERROR = NULL;
477
  }
478
  $echo = wptexturize( $before_error . $error . $rss->ERROR . $after_error );
479
  }
480
 
481
  if ( $paging ) {
 
 
 
 
 
482
  $echo .= '<div class="rsspaging">';
483
  if ( $previousitems ) {
484
- $echo .= '<a href="' . add_query_arg( 'rsspage',
485
- ( $page - 1 ) ) . '" class="rsspaging_prev" title="' . $prev_paging_title . '">' . $prev_paging_link . '</a>';
 
 
 
 
 
 
486
  }
487
  if ( $nextitems ) {
488
- $echo .= '<a href="' . add_query_arg( 'rsspage',
489
- ( $page + 1 ) ) . '" class="rsspaging_next" title="' . $next_paging_title . '">' . $next_paging_link . '</a>';
 
 
 
 
 
 
490
  }
491
  $echo .= '<br style="clear: both" />';
492
  $echo .= '</div>';
@@ -494,13 +530,16 @@ function RSSImport(
494
 
495
  if ( $view ) {
496
  echo $echo;
497
- } else {
498
- return $echo;
499
  }
 
500
  }
501
 
 
 
 
 
 
502
  function utf8dec( $s_String ) {
503
-
504
  if ( PHP_VERSION_ID >= 50000 ) {
505
  $s_String = html_entity_decode(
506
  htmlentities( $s_String . ' ', ENT_COMPAT, 'UTF-8' )
@@ -512,8 +551,12 @@ function utf8dec( $s_String ) {
512
  return substr( $s_String, 0, - 1 );
513
  }
514
 
 
 
 
 
 
515
  function isodec( $s_String ) {
516
-
517
  if ( PHP_VERSION_ID >= 50000 ) {
518
  $s_String = html_entity_decode( htmlentities( $s_String . ' ', ENT_COMPAT, 'ISO-8859-1' ) );
519
  } else {
@@ -523,10 +566,14 @@ function isodec( $s_String ) {
523
  return substr( $s_String, 0, - 1 );
524
  }
525
 
 
 
 
 
 
526
  function all_convert( $s_String ) {
527
-
528
  // Array for entities
529
- $umlaute = array(
530
  '„',
531
  '“',
532
  '–',
@@ -910,10 +957,10 @@ function all_convert( $s_String ) {
910
  chr( 253 ),
911
  chr( 254 ),
912
  chr( 255 ),
913
- chr( 256 )
914
- );
915
 
916
- $htmlcode = array(
917
  '&bdquo;',
918
  '&ldquo;',
919
  '&ndash;',
@@ -1296,11 +1343,10 @@ function all_convert( $s_String ) {
1296
  '&uuml;',
1297
  '&yacute;',
1298
  '&thorn;',
1299
- '&yuml;'
1300
- );
1301
 
1302
- //$s_String = str_replace($umlaute, $htmlcode, $s_String);
1303
- if ( version_compare( phpversion(), '5.0.0', '>=' ) ) {
1304
  $s_String = utf8_encode( html_entity_decode( str_replace( $umlaute, $htmlcode, $s_String ) ) );
1305
  } else {
1306
  $s_String = utf8_encode( RSSImport_html_entity_decode_php4( str_replace( $umlaute, $htmlcode, $s_String ) ) );
@@ -1313,19 +1359,22 @@ function all_convert( $s_String ) {
1313
 
1314
  // &mdash; , &#8212;
1315
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9D~', '&mdash;', $s_String );
1316
- $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '&mdash;',
 
1317
  $s_String );
1318
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x80\x9D~', '&mdash;', $s_String );
1319
 
1320
  // &ndash; , &#8211;
1321
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9C~', '&ndash;', $s_String );
1322
- $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC5\x93~', '&ndash;',
 
1323
  $s_String );
1324
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x80\x9C~', '&ndash;', $s_String );
1325
 
1326
  // &rsquo; , &#8217;
1327
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x84\xA2~', '&rsquo;', $s_String );
1328
- $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '&rsquo;',
 
1329
  $s_String );
1330
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x84\xA2~', '&rsquo;', $s_String );
1331
  $s_String = preg_replace( '~\xD0\xBF\xD1\x97\xD0\x85~', '&rsquo;', $s_String );
@@ -1341,7 +1390,8 @@ function all_convert( $s_String ) {
1341
 
1342
  // &ldquo; , &#8220;
1343
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xC5\x93~', '&ldquo;', $s_String );
1344
- $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x85\xE2\x80\x9C~', '&ldquo;',
 
1345
  $s_String );
1346
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xD1\x9A~', '&ldquo;', $s_String );
1347
 
@@ -1372,7 +1422,6 @@ function all_convert( $s_String ) {
1372
  * @return string
1373
  */
1374
  function RSSImport_end_on_word( $str ) {
1375
-
1376
  $arr = explode( ' ', trim( $str ) );
1377
  array_pop( $arr );
1378
 
@@ -1380,11 +1429,10 @@ function RSSImport_end_on_word( $str ) {
1380
  }
1381
 
1382
  function RSSImport_Shortcode( $atts ) {
1383
-
1384
  $args = shortcode_atts(
1385
- array(
1386
  'display' => 5,
1387
- 'feedurl' => 'http://bueltge.de/feed/',
1388
  'before_desc' => '<br />',
1389
  'displaydescriptions' => 0,
1390
  'after_desc' => '',
@@ -1413,7 +1461,7 @@ function RSSImport_Shortcode( $atts ) {
1413
  'noitems' => __( 'No items, feed is empty.', FB_RSSI_TEXTDOMAIN ),
1414
  'after_noitems' => '</p>',
1415
  'before_error' => '<p>',
1416
- 'error' => __( 'Error: Feed has an error or is not valid',
1417
  FB_RSSI_TEXTDOMAIN ),
1418
  'after_error' => '</p>',
1419
  'paging' => 0,
@@ -1424,114 +1472,141 @@ function RSSImport_Shortcode( $atts ) {
1424
  'use_simplepie' => 1,
1425
  'view' => 0,
1426
  'random_sort' => 0,
1427
- ),
 
1428
  $atts
1429
  );
1430
 
1431
- $display = (int) $args[ 'display' ];
1432
- $feedurl = html_entity_decode( $args[ 'feedurl' ] ); // novaclic: undo encoding due to wordpress WYSIWYG editor
1433
- if ( 'true' === strtolower( $args[ 'html' ] ) ) {
1434
- $args[ 'html' ] = 1;
1435
  }
1436
- $before_desc = $args[ 'before_desc' ];
1437
- $html = (int) $args[ 'html' ];
1438
- if ( 'true' === strtolower( $args[ 'displaydescriptions' ] ) ) {
1439
- $args[ 'displaydescriptions' ] = 1;
1440
  }
1441
- $after_desc = $args[ 'after_desc' ];
1442
- $displaydescriptions = (int) $args[ 'displaydescriptions' ];
1443
- if ( 'true' === strtolower( $args[ 'truncatedescchar' ] ) ) {
1444
- $args[ 'truncatedescchar' ] = 1;
1445
  }
1446
- $truncatedescchar = (int) $args[ 'truncatedescchar' ];
1447
- if ( 'true' === strtolower( $args[ 'truncatetitlechar' ] ) ) {
1448
- $args[ 'truncatetitlechar' ] = 1;
1449
  }
1450
- $truncatedescstring = $args[ 'truncatedescstring' ];
1451
- $truncatetitlestring = $args[ 'truncatetitlestring' ];
1452
- $truncatetitlechar = (int) $args[ 'truncatetitlechar' ];
1453
- $before_date = $args[ 'before_date' ];
1454
- if ( 'true' === strtolower( $args[ 'date' ] ) ) {
1455
- $args[ 'date' ] = 1;
1456
  }
1457
- $date = (int) $args[ 'date' ];
1458
- $after_date = $args[ 'after_date' ];
1459
- $date_format = $args[ 'date_format' ];
1460
- if ( 'true' === strtolower( $args[ 'creator' ] ) ) {
1461
- $args[ 'creator' ] = 1;
1462
  }
1463
- $before_creator = $args[ 'before_creator' ];
1464
- $creator = (int) $args[ 'creator' ];
1465
- $after_creator = $args[ 'after_creator' ];
1466
- $start_items = $args[ 'start_items' ];
1467
- $end_items = $args[ 'end_items' ];
1468
- $start_item = $args[ 'start_item' ];
1469
- $end_item = $args[ 'end_item' ];
1470
- $target = $args[ 'target' ];
1471
- $rel = $args[ 'rel' ];
1472
- $desc4title = $args[ 'desc4title' ];
1473
- if ( 'true' === strtolower( $args[ 'charsetscan' ] ) ) {
1474
- $args[ 'charsetscan' ] = 1;
1475
  }
1476
- $charsetscan = (int) $args[ 'charsetscan' ];
1477
- if ( 'true' === strtolower( $args[ 'debug' ] ) ) {
1478
- $args[ 'debug' ] = 1;
1479
  }
1480
- $debug = (int) $args[ 'debug' ];
1481
- $before_noitems = $args[ 'before_noitems' ];
1482
- $noitems = $args[ 'noitems' ];
1483
- $after_noitems = $args[ 'after_noitems' ];
1484
- $before_error = $args[ 'before_error' ];
1485
- $error = $args[ 'error' ];
1486
- $after_error = $args[ 'after_error' ];
1487
- if ( 'true' === strtolower( $args[ 'paging' ] ) ) {
1488
- $args[ 'paging' ] = 1;
1489
  }
1490
- $paging = (int) $args[ 'paging' ];
1491
- if ( 'true' === strtolower( $args[ 'use_simplepie' ] ) ) {
1492
- $args[ 'use_simplepie' ] = 1;
1493
  }
1494
- $prev_paging_link = $args[ 'prev_paging_link' ];
1495
- $next_paging_link = $args[ 'next_paging_link' ];
1496
- $prev_paging_title = $args[ 'prev_paging_title' ];
1497
- $next_paging_title = $args[ 'next_paging_title' ];
1498
- $use_simplepie = (int) $args[ 'use_simplepie' ];
1499
- $view = $args[ 'view' ];
1500
- $random_sort = $args[ 'random_sort' ];
1501
-
1502
- $return = RSSImport(
1503
- $display, $feedurl,
1504
- $before_desc, $displaydescriptions, $after_desc, $html,
1505
- $truncatedescchar, $truncatedescstring,
1506
- $truncatetitlechar, $truncatetitlestring,
1507
- $before_date, $date, $after_date, $date_format,
1508
- $before_creator, $creator, $after_creator,
1509
- $start_items, $end_items,
1510
- $start_item, $end_item,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1511
  $target,
1512
  $rel,
1513
  $desc4title,
1514
- $charsetscan, $debug,
1515
- $before_noitems, $noitems, $after_noitems,
1516
- $before_error, $error, $after_error,
1517
- $paging, $prev_paging_link, $next_paging_link, $prev_paging_title, $next_paging_title,
 
 
 
 
 
 
 
 
 
1518
  $use_simplepie,
1519
  $view,
1520
- $random_sort
 
1521
  );
1522
-
1523
- return $return;
1524
  }
1525
 
 
 
 
 
 
1526
  function RSSImport_shortcode_quot( $pee ) {
1527
-
1528
  global $shortcode_tags;
1529
 
1530
  if ( ! empty( $shortcode_tags ) && is_array( $shortcode_tags ) ) {
1531
  $tagnames = array_keys( $shortcode_tags );
1532
  $tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) );
1533
  $pee = preg_replace(
1534
- '/\\s*?(\\[(' . $tagregexp . ')\\b.*?\\/?\\](?:.+?\\[\\/\\2\\])?)\\s*/s',
1535
  '$1',
1536
  $pee
1537
  );
@@ -1543,19 +1618,17 @@ function RSSImport_shortcode_quot( $pee ) {
1543
  /**
1544
  * Add Quicktag-button to editor.
1545
  */
1546
-
1547
  function RSSImport_insert_button() {
1548
-
1549
  global $pagenow;
1550
 
1551
- $post_page_pages = array( 'post-new.php', 'post.php', 'page-new.php', 'page.php' );
1552
  if ( ! in_array( $pagenow, $post_page_pages, true ) ) {
1553
  return;
1554
  }
1555
 
1556
  ?>
1557
- <script type="text/javascript" charset="utf-8">
1558
- /* Adding Quicktag buttons to the editor WordPress ver. 3.3 and above
1559
  * - Button HTML ID (required)
1560
  * - Button display, value="" attribute (required)
1561
  * - Opening Tag (required)
@@ -1564,30 +1637,32 @@ function RSSImport_insert_button() {
1564
  * - Title, title="" attribute (optional)
1565
  * - Priority/position on bar, 1-9 = first, 11-19 = second, 21-29 = third, etc. (optional)
1566
  */
1567
- var id = 'rssimport',
1568
- text = '<?php _e( 'RSSImport', FB_RSSI_TEXTDOMAIN ); ?>',
1569
- start = '[RSSImport display="5" feedurl="http://feedurl.com/" before_desc="<br />" displaydescriptions="TRUE" after_desc=" " ' +
1570
- 'html="FALSE" truncatedescchar="200" truncatedescstring=" ... " truncatetitlechar="" truncatetitlestring=" ... " ' +
1571
- 'before_date=" <small>" date="FALSE" after_date="</small>" date_format="" before_creator=" <small>" creator="FALSE" ' +
1572
- 'after_creator="</small>" start_items="<ul>" end_items="</ul>" start_item="<li>" end_item="</li>" target="" rel="" ' +
1573
- 'desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>" noitems="No items, feed is empty." ' +
1574
- 'after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid" after_error="</p>" ' +
1575
- 'paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;" prev_paging_title="more items" ' +
1576
- 'next_paging_title="more items" use_simplepie="FALSE" random_sort="FALSE"]',
1577
- end = '',
1578
- access = 'r',
1579
- title = '<?php _e( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ); ?>';
1580
-
1581
- QTags.addButton(id, text, start, end, access);
1582
- </script>
1583
  <?php
1584
  }
1585
 
 
 
 
1586
  function RSSImport_insert_button_old() {
1587
-
1588
  global $pagenow;
1589
 
1590
- $post_page_pages = array( 'post-new.php', 'post.php', 'page-new.php', 'page.php' );
1591
  if ( ! in_array( $pagenow, $post_page_pages, true ) ) {
1592
  return;
1593
  }
@@ -1601,13 +1676,20 @@ function RSSImport_insert_button_old() {
1601
  content;
1602
 
1603
  edButtons[length] = new edButton(
1604
- \'RSSImport\', \'$context\', \'[RSSImport display="5" feedurl="http://feedurl.com/"' .
1605
- ' before_desc="<br />" displaydescriptions="TRUE" after_desc=" " html="FALSE" truncatedescchar="200" truncatedescstring=" ... "' .
1606
- ' truncatetitlechar=" " truncatetitlestring=" ... " before_date=" <small>" date="FALSE" after_date="</small>"' .
1607
- ' date_format="" before_creator=" <small>" creator="FALSE" after_creator="</small>" start_items="<ul>" end_items="</ul>"' .
1608
- ' start_item="<li>" end_item="</li>" target="" rel="" desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>"' .
1609
- ' noitems="No items, feed is empty." after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid"' .
1610
- ' after_error="</p>" paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;"' .
 
 
 
 
 
 
 
1611
  ' prev_paging_title="more items" next_paging_title="more items" use_simplepie="FALSE"]\', \'\', \'\'
1612
  );
1613
 
@@ -1617,8 +1699,10 @@ function RSSImport_insert_button_old() {
1617
  }
1618
  jQuery( document ).ready( function() {
1619
  content = \'<input id="RSSImport_\' + length + \'" class="ed_button" type="button" value="'
1620
- . __( 'RSSImport', FB_RSSI_TEXTDOMAIN ) . '" title="'
1621
- . __( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ) . '" onclick="RSSImport_tag(this.id);" />\';
 
 
1622
  jQuery( "#ed_toolbar" ).append( content );
1623
  } );
1624
  }
@@ -1627,7 +1711,7 @@ function RSSImport_insert_button_old() {
1627
  }
1628
 
1629
  if ( FB_RSSI_QUICKTAG && is_admin() ) {
1630
- if ( version_compare( $GLOBALS[ 'wp_version' ], '3.3alpha', '>=' ) ) {
1631
  add_action( 'admin_print_footer_scripts', 'RSSImport_insert_button' );
1632
  } else {
1633
  add_action( 'admin_footer', 'RSSImport_insert_button_old' );
@@ -1646,15 +1730,25 @@ add_action( 'init', 'RSSImport_textdomain' );
1646
  * @package WP-RSSImport
1647
  */
1648
  function RSSImport_code_to_utf8( $num ) {
1649
-
1650
  if ( $num <= 0x7F ) {
1651
  return chr( $num );
1652
- } elseif ( $num <= 0x7FF ) {
 
 
1653
  return chr( ( $num >> 0x06 ) + 0xC0 ) . chr( ( $num & 0x3F ) + 128 );
1654
- } elseif ( $num <= 0xFFFF ) {
1655
- return chr( ( $num >> 0x0C ) + 0xE0 ) . chr( ( ( $num >> 0x06 ) & 0x3F ) + 0x80 ) . chr( ( $num & 0x3F ) + 0x80 );
1656
- } elseif ( $num <= 0x1FFFFF ) {
1657
- return chr( ( $num >> 0x12 ) + 0xF0 ) . chr( ( ( $num >> 0x0C ) & 0x3F ) + 0x80 ) . chr( ( ( $num >> 0x06 ) & 0x3F ) + 0x80 ) . chr( ( $num & 0x3F ) + 0x80 );
 
 
 
 
 
 
 
 
 
1658
  }
1659
 
1660
  return '';
@@ -1666,409 +1760,501 @@ function RSSImport_code_to_utf8( $num ) {
1666
  * @package WP-RSSImport
1667
  */
1668
  function RSSImport_html_entity_decode_php4( $str ) {
1669
-
1670
- $htmlentities = array(
1671
- "&Aacute;" => chr( 195 ) . chr( 129 ),
1672
- "&aacute;" => chr( 195 ) . chr( 161 ),
1673
- "&Acirc;" => chr( 195 ) . chr( 130 ),
1674
- "&acirc;" => chr( 195 ) . chr( 162 ),
1675
- "&acute;" => chr( 194 ) . chr( 180 ),
1676
- "&AElig;" => chr( 195 ) . chr( 134 ),
1677
- "&aelig;" => chr( 195 ) . chr( 166 ),
1678
- "&Agrave;" => chr( 195 ) . chr( 128 ),
1679
- "&agrave;" => chr( 195 ) . chr( 160 ),
1680
- "&alefsym;" => chr( 226 ) . chr( 132 ) . chr( 181 ),
1681
- "&Alpha;" => chr( 206 ) . chr( 145 ),
1682
- "&alpha;" => chr( 206 ) . chr( 177 ),
1683
- "&amp;" => chr( 38 ),
1684
- "&and;" => chr( 226 ) . chr( 136 ) . chr( 167 ),
1685
- "&ang;" => chr( 226 ) . chr( 136 ) . chr( 160 ),
1686
- "&Aring;" => chr( 195 ) . chr( 133 ),
1687
- "&aring;" => chr( 195 ) . chr( 165 ),
1688
- "&asymp;" => chr( 226 ) . chr( 137 ) . chr( 136 ),
1689
- "&Atilde;" => chr( 195 ) . chr( 131 ),
1690
- "&atilde;" => chr( 195 ) . chr( 163 ),
1691
- "&Auml;" => chr( 195 ) . chr( 132 ),
1692
- "&auml;" => chr( 195 ) . chr( 164 ),
1693
- "&bdquo;" => chr( 226 ) . chr( 128 ) . chr( 158 ),
1694
- "&Beta;" => chr( 206 ) . chr( 146 ),
1695
- "&beta;" => chr( 206 ) . chr( 178 ),
1696
- "&brvbar;" => chr( 194 ) . chr( 166 ),
1697
- "&bull;" => chr( 226 ) . chr( 128 ) . chr( 162 ),
1698
- "&cap;" => chr( 226 ) . chr( 136 ) . chr( 169 ),
1699
- "&Ccedil;" => chr( 195 ) . chr( 135 ),
1700
- "&ccedil;" => chr( 195 ) . chr( 167 ),
1701
- "&cedil;" => chr( 194 ) . chr( 184 ),
1702
- "&cent;" => chr( 194 ) . chr( 162 ),
1703
- "&Chi;" => chr( 206 ) . chr( 167 ),
1704
- "&chi;" => chr( 207 ) . chr( 135 ),
1705
- "&circ;" => chr( 203 ) . chr( 134 ),
1706
- "&clubs;" => chr( 226 ) . chr( 153 ) . chr( 163 ),
1707
- "&cong;" => chr( 226 ) . chr( 137 ) . chr( 133 ),
1708
- "&copy;" => chr( 194 ) . chr( 169 ),
1709
- "&crarr;" => chr( 226 ) . chr( 134 ) . chr( 181 ),
1710
- "&cup;" => chr( 226 ) . chr( 136 ) . chr( 170 ),
1711
- "&curren;" => chr( 194 ) . chr( 164 ),
1712
- "&dagger;" => chr( 226 ) . chr( 128 ) . chr( 160 ),
1713
- "&Dagger;" => chr( 226 ) . chr( 128 ) . chr( 161 ),
1714
- "&darr;" => chr( 226 ) . chr( 134 ) . chr( 147 ),
1715
- "&dArr;" => chr( 226 ) . chr( 135 ) . chr( 147 ),
1716
- "&deg;" => chr( 194 ) . chr( 176 ),
1717
- "&Delta;" => chr( 206 ) . chr( 148 ),
1718
- "&delta;" => chr( 206 ) . chr( 180 ),
1719
- "&diams;" => chr( 226 ) . chr( 153 ) . chr( 166 ),
1720
- "&divide;" => chr( 195 ) . chr( 183 ),
1721
- "&Eacute;" => chr( 195 ) . chr( 137 ),
1722
- "&eacute;" => chr( 195 ) . chr( 169 ),
1723
- "&Ecirc;" => chr( 195 ) . chr( 138 ),
1724
- "&ecirc;" => chr( 195 ) . chr( 170 ),
1725
- "&Egrave;" => chr( 195 ) . chr( 136 ),
1726
- "&egrave;" => chr( 195 ) . chr( 168 ),
1727
- "&empty;" => chr( 226 ) . chr( 136 ) . chr( 133 ),
1728
- "&emsp;" => chr( 226 ) . chr( 128 ) . chr( 131 ),
1729
- "&ensp;" => chr( 226 ) . chr( 128 ) . chr( 130 ),
1730
- "&Epsilon;" => chr( 206 ) . chr( 149 ),
1731
- "&epsilon;" => chr( 206 ) . chr( 181 ),
1732
- "&equiv;" => chr( 226 ) . chr( 137 ) . chr( 161 ),
1733
- "&Eta;" => chr( 206 ) . chr( 151 ),
1734
- "&eta;" => chr( 206 ) . chr( 183 ),
1735
- "&ETH;" => chr( 195 ) . chr( 144 ),
1736
- "&eth;" => chr( 195 ) . chr( 176 ),
1737
- "&Euml;" => chr( 195 ) . chr( 139 ),
1738
- "&euml;" => chr( 195 ) . chr( 171 ),
1739
- "&euro;" => chr( 226 ) . chr( 130 ) . chr( 172 ),
1740
- "&exist;" => chr( 226 ) . chr( 136 ) . chr( 131 ),
1741
- "&fnof;" => chr( 198 ) . chr( 146 ),
1742
- "&forall;" => chr( 226 ) . chr( 136 ) . chr( 128 ),
1743
- "&frac12;" => chr( 194 ) . chr( 189 ),
1744
- "&frac14;" => chr( 194 ) . chr( 188 ),
1745
- "&frac34;" => chr( 194 ) . chr( 190 ),
1746
- "&frasl;" => chr( 226 ) . chr( 129 ) . chr( 132 ),
1747
- "&Gamma;" => chr( 206 ) . chr( 147 ),
1748
- "&gamma;" => chr( 206 ) . chr( 179 ),
1749
- "&ge;" => chr( 226 ) . chr( 137 ) . chr( 165 ),
1750
- "&harr;" => chr( 226 ) . chr( 134 ) . chr( 148 ),
1751
- "&hArr;" => chr( 226 ) . chr( 135 ) . chr( 148 ),
1752
- "&hearts;" => chr( 226 ) . chr( 153 ) . chr( 165 ),
1753
- "&hellip;" => chr( 226 ) . chr( 128 ) . chr( 166 ),
1754
- "&Iacute;" => chr( 195 ) . chr( 141 ),
1755
- "&iacute;" => chr( 195 ) . chr( 173 ),
1756
- "&Icirc;" => chr( 195 ) . chr( 142 ),
1757
- "&icirc;" => chr( 195 ) . chr( 174 ),
1758
- "&iexcl;" => chr( 194 ) . chr( 161 ),
1759
- "&Igrave;" => chr( 195 ) . chr( 140 ),
1760
- "&igrave;" => chr( 195 ) . chr( 172 ),
1761
- "&image;" => chr( 226 ) . chr( 132 ) . chr( 145 ),
1762
- "&infin;" => chr( 226 ) . chr( 136 ) . chr( 158 ),
1763
- "&int;" => chr( 226 ) . chr( 136 ) . chr( 171 ),
1764
- "&Iota;" => chr( 206 ) . chr( 153 ),
1765
- "&iota;" => chr( 206 ) . chr( 185 ),
1766
- "&iquest;" => chr( 194 ) . chr( 191 ),
1767
- "&isin;" => chr( 226 ) . chr( 136 ) . chr( 136 ),
1768
- "&Iuml;" => chr( 195 ) . chr( 143 ),
1769
- "&iuml;" => chr( 195 ) . chr( 175 ),
1770
- "&Kappa;" => chr( 206 ) . chr( 154 ),
1771
- "&kappa;" => chr( 206 ) . chr( 186 ),
1772
- "&Lambda;" => chr( 206 ) . chr( 155 ),
1773
- "&lambda;" => chr( 206 ) . chr( 187 ),
1774
- "&lang;" => chr( 226 ) . chr( 140 ) . chr( 169 ),
1775
- "&laquo;" => chr( 194 ) . chr( 171 ),
1776
- "&larr;" => chr( 226 ) . chr( 134 ) . chr( 144 ),
1777
- "&lArr;" => chr( 226 ) . chr( 135 ) . chr( 144 ),
1778
- "&lceil;" => chr( 226 ) . chr( 140 ) . chr( 136 ),
1779
- "&ldquo;" => chr( 226 ) . chr( 128 ) . chr( 156 ),
1780
- "&le;" => chr( 226 ) . chr( 137 ) . chr( 164 ),
1781
- "&lfloor;" => chr( 226 ) . chr( 140 ) . chr( 138 ),
1782
- "&lowast;" => chr( 226 ) . chr( 136 ) . chr( 151 ),
1783
- "&loz;" => chr( 226 ) . chr( 151 ) . chr( 138 ),
1784
- "&lrm;" => chr( 226 ) . chr( 128 ) . chr( 142 ),
1785
- "&lsaquo;" => chr( 226 ) . chr( 128 ) . chr( 185 ),
1786
- "&lsquo;" => chr( 226 ) . chr( 128 ) . chr( 152 ),
1787
- "&macr;" => chr( 194 ) . chr( 175 ),
1788
- "&mdash;" => chr( 226 ) . chr( 128 ) . chr( 148 ),
1789
- "&micro;" => chr( 194 ) . chr( 181 ),
1790
- "&middot;" => chr( 194 ) . chr( 183 ),
1791
- "&minus;" => chr( 226 ) . chr( 136 ) . chr( 146 ),
1792
- "&Mu;" => chr( 206 ) . chr( 156 ),
1793
- "&mu;" => chr( 206 ) . chr( 188 ),
1794
- "&nabla;" => chr( 226 ) . chr( 136 ) . chr( 135 ),
1795
- "&nbsp;" => chr( 194 ) . chr( 160 ),
1796
- "&ndash;" => chr( 226 ) . chr( 128 ) . chr( 147 ),
1797
- "&ne;" => chr( 226 ) . chr( 137 ) . chr( 160 ),
1798
- "&ni;" => chr( 226 ) . chr( 136 ) . chr( 139 ),
1799
- "&not;" => chr( 194 ) . chr( 172 ),
1800
- "&notin;" => chr( 226 ) . chr( 136 ) . chr( 137 ),
1801
- "&nsub;" => chr( 226 ) . chr( 138 ) . chr( 132 ),
1802
- "&Ntilde;" => chr( 195 ) . chr( 145 ),
1803
- "&ntilde;" => chr( 195 ) . chr( 177 ),
1804
- "&Nu;" => chr( 206 ) . chr( 157 ),
1805
- "&nu;" => chr( 206 ) . chr( 189 ),
1806
- "&Oacute;" => chr( 195 ) . chr( 147 ),
1807
- "&oacute;" => chr( 195 ) . chr( 179 ),
1808
- "&Ocirc;" => chr( 195 ) . chr( 148 ),
1809
- "&ocirc;" => chr( 195 ) . chr( 180 ),
1810
- "&OElig;" => chr( 197 ) . chr( 146 ),
1811
- "&oelig;" => chr( 197 ) . chr( 147 ),
1812
- "&Ograve;" => chr( 195 ) . chr( 146 ),
1813
- "&ograve;" => chr( 195 ) . chr( 178 ),
1814
- "&oline;" => chr( 226 ) . chr( 128 ) . chr( 190 ),
1815
- "&Omega;" => chr( 206 ) . chr( 169 ),
1816
- "&omega;" => chr( 207 ) . chr( 137 ),
1817
- "&Omicron;" => chr( 206 ) . chr( 159 ),
1818
- "&omicron;" => chr( 206 ) . chr( 191 ),
1819
- "&oplus;" => chr( 226 ) . chr( 138 ) . chr( 149 ),
1820
- "&or;" => chr( 226 ) . chr( 136 ) . chr( 168 ),
1821
- "&ordf;" => chr( 194 ) . chr( 170 ),
1822
- "&ordm;" => chr( 194 ) . chr( 186 ),
1823
- "&Oslash;" => chr( 195 ) . chr( 152 ),
1824
- "&oslash;" => chr( 195 ) . chr( 184 ),
1825
- "&Otilde;" => chr( 195 ) . chr( 149 ),
1826
- "&otilde;" => chr( 195 ) . chr( 181 ),
1827
- "&otimes;" => chr( 226 ) . chr( 138 ) . chr( 151 ),
1828
- "&Ouml;" => chr( 195 ) . chr( 150 ),
1829
- "&ouml;" => chr( 195 ) . chr( 182 ),
1830
- "&para;" => chr( 194 ) . chr( 182 ),
1831
- "&part;" => chr( 226 ) . chr( 136 ) . chr( 130 ),
1832
- "&permil;" => chr( 226 ) . chr( 128 ) . chr( 176 ),
1833
- "&perp;" => chr( 226 ) . chr( 138 ) . chr( 165 ),
1834
- "&Phi;" => chr( 206 ) . chr( 166 ),
1835
- "&phi;" => chr( 207 ) . chr( 134 ),
1836
- "&Pi;" => chr( 206 ) . chr( 160 ),
1837
- "&pi;" => chr( 207 ) . chr( 128 ),
1838
- "&piv;" => chr( 207 ) . chr( 150 ),
1839
- "&plusmn;" => chr( 194 ) . chr( 177 ),
1840
- "&pound;" => chr( 194 ) . chr( 163 ),
1841
- "&prime;" => chr( 226 ) . chr( 128 ) . chr( 178 ),
1842
- "&Prime;" => chr( 226 ) . chr( 128 ) . chr( 179 ),
1843
- "&prod;" => chr( 226 ) . chr( 136 ) . chr( 143 ),
1844
- "&prop;" => chr( 226 ) . chr( 136 ) . chr( 157 ),
1845
- "&Psi;" => chr( 206 ) . chr( 168 ),
1846
- "&psi;" => chr( 207 ) . chr( 136 ),
1847
- "&radic;" => chr( 226 ) . chr( 136 ) . chr( 154 ),
1848
- "&rang;" => chr( 226 ) . chr( 140 ) . chr( 170 ),
1849
- "&raquo;" => chr( 194 ) . chr( 187 ),
1850
- "&rarr;" => chr( 226 ) . chr( 134 ) . chr( 146 ),
1851
- "&rArr;" => chr( 226 ) . chr( 135 ) . chr( 146 ),
1852
- "&rceil;" => chr( 226 ) . chr( 140 ) . chr( 137 ),
1853
- "&rdquo;" => chr( 226 ) . chr( 128 ) . chr( 157 ),
1854
- "&real;" => chr( 226 ) . chr( 132 ) . chr( 156 ),
1855
- "&reg;" => chr( 194 ) . chr( 174 ),
1856
- "&rfloor;" => chr( 226 ) . chr( 140 ) . chr( 139 ),
1857
- "&Rho;" => chr( 206 ) . chr( 161 ),
1858
- "&rho;" => chr( 207 ) . chr( 129 ),
1859
- "&rlm;" => chr( 226 ) . chr( 128 ) . chr( 143 ),
1860
- "&rsaquo;" => chr( 226 ) . chr( 128 ) . chr( 186 ),
1861
- "&rsquo;" => chr( 226 ) . chr( 128 ) . chr( 153 ),
1862
- "&sbquo;" => chr( 226 ) . chr( 128 ) . chr( 154 ),
1863
- "&Scaron;" => chr( 197 ) . chr( 160 ),
1864
- "&scaron;" => chr( 197 ) . chr( 161 ),
1865
- "&sdot;" => chr( 226 ) . chr( 139 ) . chr( 133 ),
1866
- "&sect;" => chr( 194 ) . chr( 167 ),
1867
- "&shy;" => chr( 194 ) . chr( 173 ),
1868
- "&Sigma;" => chr( 206 ) . chr( 163 ),
1869
- "&sigma;" => chr( 207 ) . chr( 131 ),
1870
- "&sigmaf;" => chr( 207 ) . chr( 130 ),
1871
- "&sim;" => chr( 226 ) . chr( 136 ) . chr( 188 ),
1872
- "&spades;" => chr( 226 ) . chr( 153 ) . chr( 160 ),
1873
- "&sub;" => chr( 226 ) . chr( 138 ) . chr( 130 ),
1874
- "&sube;" => chr( 226 ) . chr( 138 ) . chr( 134 ),
1875
- "&sum;" => chr( 226 ) . chr( 136 ) . chr( 145 ),
1876
- "&sup1;" => chr( 194 ) . chr( 185 ),
1877
- "&sup2;" => chr( 194 ) . chr( 178 ),
1878
- "&sup3;" => chr( 194 ) . chr( 179 ),
1879
- "&sup;" => chr( 226 ) . chr( 138 ) . chr( 131 ),
1880
- "&supe;" => chr( 226 ) . chr( 138 ) . chr( 135 ),
1881
- "&szlig;" => chr( 195 ) . chr( 159 ),
1882
- "&Tau;" => chr( 206 ) . chr( 164 ),
1883
- "&tau;" => chr( 207 ) . chr( 132 ),
1884
- "&there4;" => chr( 226 ) . chr( 136 ) . chr( 180 ),
1885
- "&Theta;" => chr( 206 ) . chr( 152 ),
1886
- "&theta;" => chr( 206 ) . chr( 184 ),
1887
- "&thetasym;" => chr( 207 ) . chr( 145 ),
1888
- "&thinsp;" => chr( 226 ) . chr( 128 ) . chr( 137 ),
1889
- "&THORN;" => chr( 195 ) . chr( 158 ),
1890
- "&thorn;" => chr( 195 ) . chr( 190 ),
1891
- "&tilde;" => chr( 203 ) . chr( 156 ),
1892
- "&times;" => chr( 195 ) . chr( 151 ),
1893
- "&trade;" => chr( 226 ) . chr( 132 ) . chr( 162 ),
1894
- "&Uacute;" => chr( 195 ) . chr( 154 ),
1895
- "&uacute;" => chr( 195 ) . chr( 186 ),
1896
- "&uarr;" => chr( 226 ) . chr( 134 ) . chr( 145 ),
1897
- "&uArr;" => chr( 226 ) . chr( 135 ) . chr( 145 ),
1898
- "&Ucirc;" => chr( 195 ) . chr( 155 ),
1899
- "&ucirc;" => chr( 195 ) . chr( 187 ),
1900
- "&Ugrave;" => chr( 195 ) . chr( 153 ),
1901
- "&ugrave;" => chr( 195 ) . chr( 185 ),
1902
- "&uml;" => chr( 194 ) . chr( 168 ),
1903
- "&upsih;" => chr( 207 ) . chr( 146 ),
1904
- "&Upsilon;" => chr( 206 ) . chr( 165 ),
1905
- "&upsilon;" => chr( 207 ) . chr( 133 ),
1906
- "&Uuml;" => chr( 195 ) . chr( 156 ),
1907
- "&uuml;" => chr( 195 ) . chr( 188 ),
1908
- "&weierp;" => chr( 226 ) . chr( 132 ) . chr( 152 ),
1909
- "&Xi;" => chr( 206 ) . chr( 158 ),
1910
- "&xi;" => chr( 206 ) . chr( 190 ),
1911
- "&Yacute;" => chr( 195 ) . chr( 157 ),
1912
- "&yacute;" => chr( 195 ) . chr( 189 ),
1913
- "&yen;" => chr( 194 ) . chr( 165 ),
1914
- "&yuml;" => chr( 195 ) . chr( 191 ),
1915
- "&Yuml;" => chr( 197 ) . chr( 184 ),
1916
- "&Zeta;" => chr( 206 ) . chr( 150 ),
1917
- "&zeta;" => chr( 206 ) . chr( 182 ),
1918
- "&zwj;" => chr( 226 ) . chr( 128 ) . chr( 141 ),
1919
- "&zwnj;" => chr( 226 ) . chr( 128 ) . chr( 140 ),
1920
- "&gt;" => ">",
1921
- "&lt;" => "<",
1922
- );
1923
 
1924
  $return = strtr( $str, $htmlentities );
1925
- $return = preg_replace( '~&#x([0-9a-f]+);i', 'RSSImport_code_to_utf8( hexdec( "\\1" ) )', $return );
1926
- $return = preg_replace( '~&#([0-9]+);', 'RSSImport_code_to_utf8( \\1 )', $return );
1927
 
1928
  return $return;
1929
  }
1930
 
1931
  // check class wp_widget exists
1932
  if ( class_exists( 'WP_Widget' ) ) {
1933
-
1934
  class RSSImport_Widget extends WP_Widget {
1935
 
1936
  public function __construct() {
1937
-
1938
- $widget_ops = array(
1939
  'classname' => 'rssimport',
1940
  'description' => __( 'Entries from any RSS or Atom feed', FB_RSSI_TEXTDOMAIN ),
1941
- );
1942
  parent::__construct( 'rssimport', __( 'RSSImport' ), $widget_ops );
1943
  }
1944
 
1945
  public function widget( $args, $instance ) {
1946
-
1947
- $title = empty( $instance[ 'title' ] ) ? '&nbsp;'
1948
- : apply_filters( 'widget_title', $instance[ 'title' ] );
1949
- $titlelink = empty( $instance[ 'titlelink' ] ) ? '' : $instance[ 'titlelink' ];
1950
- $display = empty( $instance[ 'display' ] ) ? '5' : $instance[ 'display' ];
1951
- $feedurl = empty( $instance[ 'feedurl' ] ) ? 'http://bueltge.de/feed/' : $instance[ 'feedurl' ];
1952
- $before_desc = empty( $instance[ 'before_desc' ] ) ? '' : $instance[ 'before_desc' ];
1953
- $displaydescriptions = empty( $instance[ 'displaydescriptions' ] ) ? '0'
1954
- : $instance[ 'displaydescriptions' ];
1955
- $after_desc = empty( $instance[ 'after_desc' ] ) ? '' : $instance[ 'after_desc' ];
1956
- $html = empty( $instance[ 'html' ] ) ? '0' : $instance[ 'html' ];
1957
- $truncatedescchar = empty( $instance[ 'truncatedescchar' ] ) ? '200' : $instance[ 'truncatedescchar' ];
1958
- $truncatedescstring = empty( $instance[ 'truncatedescstring' ] ) ? '' : $instance[ 'truncatedescstring' ];
1959
- $truncatetitlechar = empty( $instance[ 'truncatetitlechar' ] ) ? '' : $instance[ 'truncatetitlechar' ];
1960
- $truncatetitlestring = empty( $instance[ 'truncatetitlestring' ] ) ? ' ... '
1961
- : $instance[ 'truncatetitlestring' ];
1962
- $before_date = empty( $instance[ 'before_date' ] ) ? ' <small>' : $instance[ 'before_date' ];
1963
- $date = empty( $instance[ 'date' ] ) ? '0' : $instance[ 'date' ];
1964
- $after_date = empty( $instance[ 'after_date' ] ) ? '</small>' : $instance[ 'after_date' ];
1965
- $date_format = empty( $instance[ 'date_format' ] ) ? '' : $instance[ 'date_format' ];
1966
- $before_creator = empty( $instance[ 'before_creator' ] ) ? ' <small>' : $instance[ 'before_creator' ];
1967
- $creator = empty( $instance[ 'creator' ] ) ? '0' : $instance[ 'creator' ];
1968
- $after_creator = empty( $instance[ 'after_creator' ] ) ? '</small>' : $instance[ 'after_creator' ];
1969
- $start_items = empty( $instance[ 'start_items' ] ) ? '<ul>' : $instance[ 'start_items' ];
1970
- $end_items = empty( $instance[ 'end_items' ] ) ? '</ul>' : $instance[ 'end_items' ];
1971
- $start_item = empty( $instance[ 'start_item' ] ) ? '<li>' : $instance[ 'start_item' ];
1972
- $end_item = empty( $instance[ 'end_item' ] ) ? '</li>' : $instance[ 'end_item' ];
1973
- $target = empty( $instance[ 'target' ] ) ? '' : $instance[ 'target' ];
1974
- $rel = empty( $instance[ 'rel' ] ) ? '' : $instance[ 'rel' ];
1975
- $desc4title = empty( $instance[ 'desc4title' ] ) ? '0' : $instance[ 'desc4title' ];
1976
- $charsetscan = empty( $instance[ 'charsetscan' ] ) ? '0' : $instance[ 'charsetscan' ];
1977
- $debug = empty( $instance[ 'debug' ] ) ? '0' : $instance[ 'debug' ];
1978
- $before_noitems = empty( $instance[ 'before_noitems' ] ) ? '<p>' : $instance[ 'before_noitems' ];
1979
- $noitems = empty( $instance[ 'noitems' ] ) ? __( 'No items, feed is empty.',
1980
- FB_RSSI_TEXTDOMAIN ) : $instance[ 'noitems' ];
1981
- $after_noitems = empty( $instance[ 'after_noitems' ] ) ? '</p>' : $instance[ 'after_noitems' ];
1982
- $before_error = empty( $instance[ 'before_error' ] ) ? '<p>' : $instance[ 'before_error' ];
1983
- $error = empty( $instance[ 'error' ] ) ? __( 'Error: Feed has an error or is not valid',
1984
- FB_RSSI_TEXTDOMAIN ) : $instance[ 'error' ];
1985
- $after_error = empty( $instance[ 'after_error' ] ) ? '</p>' : $instance[ 'after_error' ];
1986
- $paging = empty( $instance[ 'paging' ] ) ? '0' : $instance[ 'paging' ];
1987
- $prev_paging_link = empty( $instance[ 'prev_paging_link' ] ) ? __( '&laquo; Previous',
1988
- FB_RSSI_TEXTDOMAIN )
1989
- : $instance[ 'prev_paging_link' ];
1990
- $next_paging_link = empty( $instance[ 'next_paging_link' ] ) ? __( 'Next &raquo;', FB_RSSI_TEXTDOMAIN )
1991
- : $instance[ 'next_paging_link' ];
1992
- $prev_paging_title = empty( $instance[ 'prev_paging_title' ] ) ? __( 'more items', FB_RSSI_TEXTDOMAIN )
1993
- : $instance[ 'prev_paging_title' ];
1994
- $next_paging_title = empty( $instance[ 'next_paging_title' ] ) ? __( 'more items', FB_RSSI_TEXTDOMAIN )
1995
- : $instance[ 'next_paging_title' ];
1996
- $use_simplepie = $instance[ 'use_simplepie' ];
1997
- $view = $instance[ 'view' ];
1998
- $random_sort = $instance[ 'random_sort' ];
1999
-
2000
- echo $args[ 'before_widget' ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2001
  if ( '' !== $titlelink ) {
2002
  $title = '<a href="' . $titlelink . '">' . $title . '</a>';
2003
  }
2004
- echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
2005
  RSSImport(
2006
- $display, $feedurl,
2007
- $before_desc, $displaydescriptions, $after_desc, $html, $truncatedescchar, $truncatedescstring,
2008
- $truncatetitlechar, $truncatetitlestring,
2009
- $before_date, $date, $after_date, $date_format,
2010
- $before_creator, $creator, $after_creator,
2011
- $start_items, $end_items,
2012
- $start_item, $end_item,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2013
  $target,
2014
  $rel,
2015
  $desc4title,
2016
- $charsetscan, $debug,
2017
- $before_noitems, $noitems, $after_noitems,
2018
- $before_error, $error, $after_error,
2019
- $paging, $prev_paging_link, $next_paging_link, $prev_paging_title, $next_paging_title,
 
 
 
 
 
 
 
 
 
2020
  $use_simplepie,
2021
  $view,
2022
- $random_sort
 
2023
  );
2024
- echo $args[ 'after_widget' ];
2025
  }
2026
 
2027
  public function update( $new_instance, $old_instance ) {
2028
-
2029
- $instance[ 'instance' ] = $old_instance;
2030
- $instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
2031
- $instance[ 'titlelink' ] = esc_url( $new_instance[ 'titlelink' ] );
2032
- $instance[ 'display' ] = (int) $new_instance[ 'display' ];
2033
- $instance[ 'feedurl' ] = $new_instance[ 'feedurl' ];
2034
- $instance[ 'before_desc' ] = $new_instance[ 'before_desc' ];
2035
- $instance[ 'displaydescriptions' ] = (int) $new_instance[ 'displaydescriptions' ];
2036
- $instance[ 'after_desc' ] = stripslashes_deep( $new_instance[ 'after_desc' ] );
2037
- $instance[ 'html' ] = (int) $new_instance[ 'html' ];
2038
- $instance[ 'truncatedescchar' ] = (int) $new_instance[ 'truncatedescchar' ];
2039
- $instance[ 'truncatedescstring' ] = $new_instance[ 'truncatedescstring' ];
2040
- $instance[ 'truncatetitlechar' ] = (int) $new_instance[ 'truncatetitlechar' ];
2041
- $instance[ 'truncatetitlestring' ] = $new_instance[ 'truncatetitlestring' ];
2042
- $instance[ 'before_date' ] = $new_instance[ 'before_date' ];
2043
- $instance[ 'date' ] = (int) $new_instance[ 'date' ];
2044
- $instance[ 'after_date' ] = $new_instance[ 'after_date' ];
2045
- $instance[ 'date_format' ] = $new_instance[ 'date_format' ];
2046
- $instance[ 'before_creator' ] = $new_instance[ 'before_creator' ];
2047
- $instance[ 'creator' ] = (int) $new_instance[ 'creator' ];
2048
- $instance[ 'after_creator' ] = $new_instance[ 'after_creator' ];
2049
- $instance[ 'start_items' ] = $new_instance[ 'start_items' ];
2050
- $instance[ 'end_items' ] = $new_instance[ 'end_items' ];
2051
- $instance[ 'start_item' ] = $new_instance[ 'start_item' ];
2052
- $instance[ 'end_item' ] = $new_instance[ 'end_item' ];
2053
- $instance[ 'target' ] = $new_instance[ 'target' ];
2054
- $instance[ 'rel' ] = $new_instance[ 'rel' ];
2055
- $instance[ 'desc4title' ] = (int) $new_instance[ 'desc4title' ];
2056
- $instance[ 'charsetscan' ] = (int) $new_instance[ 'charsetscan' ];
2057
- $instance[ 'debug' ] = (int) $new_instance[ 'debug' ];
2058
- $instance[ 'view' ] = (int) $new_instance[ 'view' ];
2059
- $instance[ 'before_noitems' ] = $new_instance[ 'before_noitems' ];
2060
- $instance[ 'noitems' ] = $new_instance[ 'noitems' ];
2061
- $instance[ 'after_noitems' ] = $new_instance[ 'after_noitems' ];
2062
- $instance[ 'before_error' ] = $new_instance[ 'before_error' ];
2063
- $instance[ 'error' ] = $new_instance[ 'error' ];
2064
- $instance[ 'after_error' ] = $new_instance[ 'after_error' ];
2065
- $instance[ 'paging' ] = (int) $new_instance[ 'paging' ];
2066
- $instance[ 'prev_paging_link' ] = $new_instance[ 'prev_paging_link' ];
2067
- $instance[ 'next_paging_link' ] = $new_instance[ 'next_paging_link' ];
2068
- $instance[ 'prev_paging_title' ] = $new_instance[ 'prev_paging_title' ];
2069
- $instance[ 'next_paging_title' ] = $new_instance[ 'next_paging_title' ];
2070
- $instance[ 'use_simplepie' ] = (int) $new_instance[ 'use_simplepie' ];
2071
- $instance[ 'random_sort' ] = (int) $new_instance[ 'random_sort' ];
2072
 
2073
  if ( current_user_can( 'unfiltered_html' ) ) {
2074
  return $instance;
@@ -2078,9 +2264,9 @@ if ( class_exists( 'WP_Widget' ) ) {
2078
  }
2079
 
2080
  public function form( $instance ) {
2081
-
2082
  $instance = wp_parse_args(
2083
- (array) $instance, array(
 
2084
  'title' => '',
2085
  'titlelink' => '',
2086
  'display' => 5,
@@ -2124,365 +2310,512 @@ if ( class_exists( 'WP_Widget' ) ) {
2124
  'next_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
2125
  'use_simplepie' => 1,
2126
  'random_sort' => 0,
2127
- )
 
2128
  );
2129
 
2130
- $title = format_to_edit( strip_tags( $instance[ 'title' ] ) );
2131
- $titlelink = format_to_edit( esc_url( $instance[ 'titlelink' ] ) );
2132
- $display = (int) $instance[ 'display' ];
2133
- $feedurl = format_to_edit( $instance[ 'feedurl' ] );
2134
- $before_desc = format_to_edit( $instance[ 'before_desc' ] );
2135
- $displaydescriptions = (int) $instance[ 'displaydescriptions' ];
2136
- $after_desc = format_to_edit( $instance[ 'after_desc' ] );
2137
- $html = (int) $instance[ 'html' ];
2138
- $truncatedescchar = (int) $instance[ 'truncatedescchar' ];
2139
- $truncatedescstring = (int) $instance[ 'truncatedescstring' ];
2140
- $truncatetitlechar = format_to_edit( $instance[ 'truncatetitlechar' ] );
2141
- $truncatetitlestring = format_to_edit( $instance[ 'truncatetitlestring' ] );
2142
- $before_date = format_to_edit( $instance[ 'before_date' ] );
2143
- $date = (int) $instance[ 'date' ];
2144
- $after_date = format_to_edit( $instance[ 'after_date' ] );
2145
- $date_format = format_to_edit( $instance[ 'date_format' ] );
2146
- $before_creator = format_to_edit( $instance[ 'before_creator' ] );
2147
- $creator = (int) $instance[ 'creator' ];
2148
- $after_creator = format_to_edit( $instance[ 'after_creator' ] );
2149
- $start_items = format_to_edit( $instance[ 'start_items' ] );
2150
- $end_items = format_to_edit( $instance[ 'end_items' ] );
2151
- $start_item = format_to_edit( $instance[ 'start_item' ] );
2152
- $end_item = format_to_edit( $instance[ 'end_item' ] );
2153
- $target = format_to_edit( $instance[ 'target' ] );
2154
- $rel = format_to_edit( $instance[ 'rel' ] );
2155
- $desc4title = (int) $instance[ 'desc4title' ];
2156
- $charsetscan = (int) $instance[ 'charsetscan' ];
2157
- $debug = (int) $instance[ 'debug' ];
2158
- $before_noitems = format_to_edit( $instance[ 'before_noitems' ] );
2159
- $noitems = format_to_edit( $instance[ 'noitems' ] );
2160
- $after_noitems = format_to_edit( $instance[ 'after_noitems' ] );
2161
- $before_error = format_to_edit( $instance[ 'before_error' ] );
2162
- $error = format_to_edit( $instance[ 'error' ] );
2163
- $after_error = format_to_edit( $instance[ 'after_error' ] );
2164
- $paging = (int) $instance[ 'paging' ];
2165
- $prev_paging_link = format_to_edit( $instance[ 'prev_paging_link' ] );
2166
- $next_paging_link = format_to_edit( $instance[ 'next_paging_link' ] );
2167
- $prev_paging_title = format_to_edit( $instance[ 'prev_paging_title' ] );
2168
- $next_paging_title = format_to_edit( $instance[ 'next_paging_title' ] );
2169
- $use_simplepie = (int) $instance[ 'use_simplepie' ];
2170
- $view = (int) $instance[ 'view' ];
2171
- $random_sort = (int) $instance[ 'random_sort' ];
 
2172
  ?>
2173
- <p>
2174
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', FB_RSSI_TEXTDOMAIN ) ?>
2175
- <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 ); ?>" /></label>
2176
- </p>
2177
- <p>
2178
- <label for="<?php echo $this->get_field_id( 'titlelink' ); ?>"><?php _e( 'URL for Title (incl. http://):',
 
 
 
 
2179
  FB_RSSI_TEXTDOMAIN ) ?>
2180
- <input class="widefat" id="<?php echo $this->get_field_id( 'titlelink' ); ?>" name="<?php echo $this->get_field_name( 'titlelink' ); ?>" type="text" value="<?php echo esc_url( $titlelink ); ?>" /></label>
2181
- </p>
2182
- <p>
2183
- <label for="<?php echo $this->get_field_id( 'display' ); ?>"><?php _e( 'Display:',
 
 
 
 
2184
  FB_RSSI_TEXTDOMAIN ) ?>
2185
- <input class="widefat" id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>" type="text" value="<?php echo esc_attr( $display ); ?>" /></label>
2186
- </p>
2187
- <p>
2188
- <label for="<?php echo $this->get_field_id( 'feedurl' ); ?>"><?php _e( 'FeedURL:',
 
 
 
 
2189
  FB_RSSI_TEXTDOMAIN ) ?>
2190
- <input class="widefat" id="<?php echo $this->get_field_id( 'feedurl' ); ?>" name="<?php echo $this->get_field_name( 'feedurl' ); ?>" type="text" value="<?php echo $feedurl; ?>" /></label>
2191
- </p>
2192
- <p>
2193
- <label for="<?php echo $this->get_field_id( 'before_desc' ); ?>"><?php _e( 'Before Description:',
 
 
 
 
2194
  FB_RSSI_TEXTDOMAIN ) ?>
2195
- <input class="widefat" id="<?php echo $this->get_field_id( 'before_desc' ); ?>" name="<?php echo $this->get_field_name( 'before_desc' ); ?>" type="text" value="<?php echo $before_desc; ?>" /></label>
2196
- </p>
2197
- <p>
2198
- <label for="<?php echo $this->get_field_id( 'displaydescriptions' ); ?>"><?php _e( 'Display Description:',
 
 
 
 
2199
  FB_RSSI_TEXTDOMAIN ) ?>
2200
- <select id="<?php echo $this->get_field_id( 'displaydescriptions' ); ?>" name="<?php echo $this->get_field_name( 'displaydescriptions' ); ?>">
2201
- <option value="0"<?php if ( $displaydescriptions == '0' ) {
 
2202
  echo ' selected="selected"';
2203
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2204
- <option value="1"<?php if ( $displaydescriptions == '1' ) {
2205
  echo ' selected="selected"';
2206
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2207
- </select>
2208
- </label>
2209
- </p>
2210
- <p>
2211
- <label for="<?php echo $this->get_field_id( 'after_desc' ); ?>"><?php _e( 'After Description:',
2212
  FB_RSSI_TEXTDOMAIN ) ?>
2213
- <input class="widefat code" id="<?php echo $this->get_field_id( 'after_desc' ); ?>" name="<?php echo $this->get_field_name( 'after_desc' ); ?>" type="text" value="<?php echo $after_desc; ?>" /></label>
2214
- <br />
2215
- <small><?php _e( 'You can use the following strings to create custom links:', FB_RSSI_TEXTDOMAIN ); ?>
2216
- <code>%title%</code>, <code>%href%</code>
2217
- <br /><?php _e( 'Example:', FB_RSSI_TEXTDOMAIN ); ?>
2218
- <code>&lt;a href="%href%" target="self" rel="follow"&gt;%title%&lt;/a&gt;</code></small>
2219
- </p>
2220
- <p>
2221
- <label for="<?php echo $this->get_field_id( 'html' ); ?>"><?php _e( 'HTML:', FB_RSSI_TEXTDOMAIN ) ?>
2222
- <select id="<?php echo $this->get_field_id( 'html' ); ?>" name="<?php echo $this->get_field_name( 'html' ); ?>">
2223
- <option value="0"<?php if ( ! $html ) {
 
 
 
 
 
2224
  echo ' selected="selected"';
2225
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2226
- <option value="1"<?php if ( $html ) {
2227
  echo ' selected="selected"';
2228
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2229
- </select>
2230
- </label>
2231
- </p>
2232
- <p>
2233
- <label for="<?php echo $this->get_field_id( 'truncatedescchar' ); ?>"><?php _e( 'Truncate Description Char:',
2234
  FB_RSSI_TEXTDOMAIN ) ?>
2235
- <input class="widefat" id="<?php echo $this->get_field_id( 'truncatedescchar' ); ?>" name="<?php echo $this->get_field_name( 'truncatedescchar' ); ?>" type="text" value="<?php echo esc_attr( $truncatedescchar ); ?>" /></label>
2236
- </p>
2237
- <p>
2238
- <label for="<?php echo $this->get_field_id( 'truncatedescstring' ); ?>"><?php _e( 'Truncate Description String (HTML):',
 
 
 
 
2239
  FB_RSSI_TEXTDOMAIN ) ?>
2240
- <input class="widefat code" id="<?php echo $this->get_field_id( 'truncatedescstring' ); ?>" name="<?php echo $this->get_field_name( 'truncatedescstring' ); ?>" type="text" value="<?php echo $truncatedescstring; ?>" /></label>
2241
- </p>
2242
- <p>
2243
- <label for="<?php echo $this->get_field_id( 'truncatetitlechar' ); ?>"><?php _e( 'Truncate Title Char:',
 
 
 
 
2244
  FB_RSSI_TEXTDOMAIN ) ?>
2245
- <input class="widefat" id="<?php echo $this->get_field_id( 'truncatetitlechar' ); ?>" name="<?php echo $this->get_field_name( 'truncatetitlechar' ); ?>" type="text" value="<?php echo esc_attr( $truncatetitlechar ); ?>" /></label>
2246
- </p>
2247
- <p>
2248
- <label for="<?php echo $this->get_field_id( 'truncatetitlestring' ); ?>"><?php _e( 'Truncate Title String (HTML):',
 
 
 
 
2249
  FB_RSSI_TEXTDOMAIN ) ?>
2250
- <input class="widefat code" id="<?php echo $this->get_field_id( 'truncatetitlestring' ); ?>" name="<?php echo $this->get_field_name( 'truncatetitlestring' ); ?>" type="text" value="<?php echo $truncatetitlestring; ?>" /></label>
2251
- </p>
2252
- <p>
2253
- <label for="<?php echo $this->get_field_id( 'before_date' ); ?>"><?php _e( 'Before Date (HTML):',
 
 
 
 
2254
  FB_RSSI_TEXTDOMAIN ) ?>
2255
- <input class="widefat code" id="<?php echo $this->get_field_id( 'before_date' ); ?>" name="<?php echo $this->get_field_name( 'before_date' ); ?>" type="text" value="<?php echo $before_date; ?>" /></label>
2256
- </p>
2257
- <p>
2258
- <label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Date:', FB_RSSI_TEXTDOMAIN ) ?>
2259
- <select id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>">
2260
- <option value="0"<?php if ( ! $date ) {
 
 
 
 
 
2261
  echo ' selected="selected"';
2262
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2263
- <option value="1"<?php if ( $date ) {
2264
  echo ' selected="selected"';
2265
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2266
- </select>
2267
- </label>
2268
- </p>
2269
- <p>
2270
- <label for="<?php echo $this->get_field_id( 'after_date' ); ?>"><?php _e( 'After Date (HTML):',
2271
  FB_RSSI_TEXTDOMAIN ) ?>
2272
- <input class="widefat code" id="<?php echo $this->get_field_id( 'after_date' ); ?>" name="<?php echo $this->get_field_name( 'after_date' ); ?>" type="text" value="<?php echo $after_date; ?>" /></label>
2273
- </p>
2274
- <p>
2275
- <label for="<?php echo $this->get_field_id( 'date_format' ); ?>"><?php _e( 'Date Formatting:',
 
 
 
 
2276
  FB_RSSI_TEXTDOMAIN ) ?>
2277
- <input class="widefat" id="<?php echo $this->get_field_id( 'date_format' ); ?>" name="<?php echo $this->get_field_name( 'date_format' ); ?>" type="text" value="<?php echo $date_format; ?>" /></label>
2278
- <br />
2279
- <small><?php _e( 'Leave empty for use the date format of your WordPress settings.',
 
 
 
 
2280
  FB_RSSI_TEXTDOMAIN ); ?>
2281
- <a href="http://codex.wordpress.org/Formatting_Date_and_Time"><?php _e( 'Documentation on date formatting',
2282
  FB_RSSI_TEXTDOMAIN ); ?></a>
2283
- </small>
2284
- </p>
2285
- <p>
2286
- <label for="<?php echo $this->get_field_id( 'before_creator' ); ?>"><?php _e( 'Before Creator (HTML):',
2287
  FB_RSSI_TEXTDOMAIN ) ?>
2288
- <input class="widefat code" id="<?php echo $this->get_field_id( 'before_creator' ); ?>" name="<?php echo $this->get_field_name( 'before_creator' ); ?>" type="text" value="<?php echo $before_creator; ?>" /></label>
2289
- </p>
2290
- <p>
2291
- <label for="<?php echo $this->get_field_id( 'creator' ); ?>"><?php _e( 'Creator:',
 
 
 
 
2292
  FB_RSSI_TEXTDOMAIN ) ?>
2293
- <select id="<?php echo $this->get_field_id( 'creator' ); ?>" name="<?php echo $this->get_field_name( 'creator' ); ?>">
2294
- <option value="0"<?php if ( ! $creator ) {
 
2295
  echo ' selected="selected"';
2296
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2297
- <option value="1"<?php if ( $creator ) {
2298
  echo ' selected="selected"';
2299
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2300
- </select>
2301
- </label>
2302
- </p>
2303
- <p>
2304
- <label for="<?php echo $this->get_field_id( 'after_creator' ); ?>"><?php _e( 'After Creator (HTML):',
2305
  FB_RSSI_TEXTDOMAIN ) ?>
2306
- <input class="widefat code" id="<?php echo $this->get_field_id( 'after_creator' ); ?>" name="<?php echo $this->get_field_name( 'after_creator' ); ?>" type="text" value="<?php echo $after_creator; ?>" /></label>
2307
- </p>
2308
- <p>
2309
- <label for="<?php echo $this->get_field_id( 'start_items' ); ?>"><?php _e( 'Before Items (HTML):',
 
 
 
 
2310
  FB_RSSI_TEXTDOMAIN ) ?>
2311
- <input class="widefat code" id="<?php echo $this->get_field_id( 'start_items' ); ?>" name="<?php echo $this->get_field_name( 'start_items' ); ?>" type="text" value="<?php echo $start_items; ?>" /></label>
2312
- </p>
2313
- <p>
2314
- <label for="<?php echo $this->get_field_id( 'end_items' ); ?>"><?php _e( 'After Items (HTML):',
 
 
 
 
2315
  FB_RSSI_TEXTDOMAIN ) ?>
2316
- <input class="widefat code" id="<?php echo $this->get_field_id( 'end_items' ); ?>" name="<?php echo $this->get_field_name( 'end_items' ); ?>" type="text" value="<?php echo $end_items; ?>" /></label>
2317
- </p>
2318
- <p>
2319
- <label for="<?php echo $this->get_field_id( 'start_item' ); ?>"><?php _e( 'Before Item (HTML):',
 
 
 
 
2320
  FB_RSSI_TEXTDOMAIN ) ?>
2321
- <input class="widefat code" id="<?php echo $this->get_field_id( 'start_item' ); ?>" name="<?php echo $this->get_field_name( 'start_item' ); ?>" type="text" value="<?php echo $start_item; ?>" /></label>
2322
- </p>
2323
- <p>
2324
- <label for="<?php echo $this->get_field_id( 'end_item' ); ?>"><?php _e( 'After Item (HTML):',
 
 
 
 
2325
  FB_RSSI_TEXTDOMAIN ) ?>
2326
- <input class="widefat code" id="<?php echo $this->get_field_id( 'end_item' ); ?>" name="<?php echo $this->get_field_name( 'end_item' ); ?>" type="text" value="<?php echo $end_item; ?>" /></label>
2327
- </p>
2328
- <p>
2329
- <label for="<?php echo $this->get_field_id( 'target' ); ?>"><?php _e( 'Target Attribut:',
 
 
 
 
2330
  FB_RSSI_TEXTDOMAIN ) ?>
2331
- <input class="widefat" id="<?php echo $this->get_field_id( 'target' ); ?>" name="<?php echo $this->get_field_name( 'target' ); ?>" type="text" value="<?php echo esc_attr( $target ); ?>" /></label>
2332
- </p>
2333
- <p>
2334
- <label for="<?php echo $this->get_field_id( 'rel' ); ?>"><?php _e( 'Rel Attribut:',
 
 
 
 
2335
  FB_RSSI_TEXTDOMAIN ) ?>
2336
- <input class="widefat" id="<?php echo $this->get_field_id( 'rel' ); ?>" name="<?php echo $this->get_field_name( 'rel' ); ?>" type="text" value="<?php echo esc_attr( $rel ); ?>" /></label>
2337
- </p>
2338
- <p>
2339
- <label for="<?php echo $this->get_field_id( 'desc4title' ); ?>"><?php _e( 'Desc4Title:',
 
 
 
 
2340
  FB_RSSI_TEXTDOMAIN ) ?>
2341
- <select id="<?php echo $this->get_field_id( 'desc4title' ); ?>" name="<?php echo $this->get_field_name( 'desc4title' ); ?>">
2342
- <option value="0"<?php if ( ! $desc4title ) {
 
2343
  echo ' selected="selected"';
2344
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2345
- <option value="1"<?php if ( $desc4title ) {
2346
  echo ' selected="selected"';
2347
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2348
- </select>
2349
- </label>
2350
- <br />
2351
- <small><?php _e( 'Description for title-Attribut on Title-Link', FB_RSSI_TEXTDOMAIN ); ?></small>
2352
- </p>
2353
- <p>
2354
- <label for="<?php echo $this->get_field_id( 'charsetscan' ); ?>"><?php _e( 'Charsetscan:',
2355
  FB_RSSI_TEXTDOMAIN ) ?>
2356
- <select id="<?php echo $this->get_field_id( 'charsetscan' ); ?>" name="<?php echo $this->get_field_name( 'charsetscan' ); ?>">
2357
- <option value="0"<?php if ( ! $charsetscan ) {
 
2358
  echo ' selected="selected"';
2359
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2360
- <option value="1"<?php if ( $charsetscan ) {
2361
  echo ' selected="selected"';
2362
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2363
- </select>
2364
- </label>
2365
- </p>
2366
- <p>
2367
- <label for="<?php echo $this->get_field_id( 'debug' ); ?>"><?php _e( 'Debug mode:',
2368
  FB_RSSI_TEXTDOMAIN ) ?>
2369
- <select id="<?php echo $this->get_field_id( 'debug' ); ?>" name="<?php echo $this->get_field_name( 'debug' ); ?>">
2370
- <option value="0"<?php if ( ! $debug ) {
 
2371
  echo ' selected="selected"';
2372
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2373
- <option value="1"<?php if ( $debug ) {
2374
  echo ' selected="selected"';
2375
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2376
- </select>
2377
- </label>
2378
- </p>
2379
- <p>
2380
- <label for="<?php echo $this->get_field_id( 'before_noitems' ); ?>"><?php _e( 'Before <em>No</em> Items Message (HTML):',
2381
  FB_RSSI_TEXTDOMAIN ) ?>
2382
- <input class="widefat code" id="<?php echo $this->get_field_id( 'before_noitems' ); ?>" name="<?php echo $this->get_field_name( 'before_noitems' ); ?>" type="text" value="<?php echo $before_noitems; ?>" /></label>
2383
- </p>
2384
- <p>
2385
- <label for="<?php echo $this->get_field_id( 'noitems' ); ?>"><?php _e( '<em>No</em> Items Message:',
 
 
 
 
2386
  FB_RSSI_TEXTDOMAIN ) ?>
2387
- <input class="widefat" id="<?php echo $this->get_field_id( 'noitems' ); ?>" name="<?php echo $this->get_field_name( 'noitems' ); ?>" type="text" value="<?php echo esc_attr( $noitems ); ?>" /></label>
2388
- </p>
2389
- <p>
2390
- <label for="<?php echo $this->get_field_id( 'after_noitems' ); ?>"><?php _e( 'After <em>No</em> Items Message (HTML):',
 
 
 
 
2391
  FB_RSSI_TEXTDOMAIN ) ?>
2392
- <input class="widefat code" id="<?php echo $this->get_field_id( 'after_noitems' ); ?>" name="<?php echo $this->get_field_name( 'after_noitems' ); ?>" type="text" value="<?php echo $after_noitems; ?>" /></label>
2393
- </p>
2394
- <p>
2395
- <label for="<?php echo $this->get_field_id( 'before_error' ); ?>"><?php _e( 'Before Error Message (HTML):',
 
 
 
 
2396
  FB_RSSI_TEXTDOMAIN ) ?>
2397
- <input class="widefat code" id="<?php echo $this->get_field_id( 'before_error' ); ?>" name="<?php echo $this->get_field_name( 'before_error' ); ?>" type="text" value="<?php echo $before_error; ?>" /></label>
2398
- </p>
2399
- <p>
2400
- <label for="<?php echo $this->get_field_id( 'error' ); ?>"><?php _e( 'Error Message:',
 
 
 
 
2401
  FB_RSSI_TEXTDOMAIN ) ?>
2402
- <input class="widefat" id="<?php echo $this->get_field_id( 'error' ); ?>" name="<?php echo $this->get_field_name( 'error' ); ?>" type="text" value="<?php echo esc_attr( $error ); ?>" /></label>
2403
- </p>
2404
- <p>
2405
- <label for="<?php echo $this->get_field_id( 'after_error' ); ?>"><?php _e( 'After Error Message (HTML):',
 
 
 
 
2406
  FB_RSSI_TEXTDOMAIN ) ?>
2407
- <input class="widefat code" id="<?php echo $this->get_field_id( 'after_error' ); ?>" name="<?php echo $this->get_field_name( 'after_error' ); ?>" type="text" value="<?php echo $after_error; ?>" /></label>
2408
- </p>
2409
- <p>
2410
- <label for="<?php echo $this->get_field_id( 'paging' ); ?>"><?php _e( 'Pagination:',
 
 
 
 
2411
  FB_RSSI_TEXTDOMAIN ) ?>
2412
- <select id="<?php echo $this->get_field_id( 'paging' ); ?>" name="<?php echo $this->get_field_name( 'paging' ); ?>">
2413
- <option value="0"<?php if ( ! $paging ) {
 
2414
  echo ' selected="selected"';
2415
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2416
- <option value="1"<?php if ( $paging ) {
2417
  echo ' selected="selected"';
2418
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2419
- </select>
2420
- </label>
2421
- </p>
2422
- <p>
2423
- <label for="<?php echo $this->get_field_id( 'prev_paging_link' ); ?>"><?php _e( 'Previous Pagination Link String:',
2424
  FB_RSSI_TEXTDOMAIN ) ?>
2425
- <input class="widefat" id="<?php echo $this->get_field_id( 'prev_paging_link' ); ?>" name="<?php echo $this->get_field_name( 'prev_paging_link' ); ?>" type="text" value="<?php echo esc_attr( $prev_paging_link ); ?>" /></label>
2426
- </p>
2427
- <p>
2428
- <label for="<?php echo $this->get_field_id( 'next_paging_link' ); ?>"><?php _e( 'Next Pagination Link String:',
 
 
 
 
2429
  FB_RSSI_TEXTDOMAIN ) ?>
2430
- <input class="widefat" id="<?php echo $this->get_field_id( 'next_paging_link' ); ?>" name="<?php echo $this->get_field_name( 'next_paging_link' ); ?>" type="text" value="<?php echo esc_attr( $next_paging_link ); ?>" /></label>
2431
- </p>
2432
- <p>
2433
- <label for="<?php echo $this->get_field_id( 'prev_paging_title' ); ?>"><?php _e( 'Previous Pagination Title String:',
 
 
 
 
2434
  FB_RSSI_TEXTDOMAIN ) ?>
2435
- <input class="widefat" id="<?php echo $this->get_field_id( 'prev_paging_title' ); ?>" name="<?php echo $this->get_field_name( 'prev_paging_title' ); ?>" type="text" value="<?php echo esc_attr( $prev_paging_title ); ?>" /></label>
2436
- </p>
2437
- <p>
2438
- <label for="<?php echo $this->get_field_id( 'next_paging_title' ); ?>"><?php _e( 'Next Pagination Title String:',
 
 
 
 
2439
  FB_RSSI_TEXTDOMAIN ) ?>
2440
- <input class="widefat" id="<?php echo $this->get_field_id( 'next_paging_title' ); ?>" name="<?php echo $this->get_field_name( 'next_paging_title' ); ?>" type="text" value="<?php echo esc_attr( $next_paging_title ); ?>" /></label>
2441
- </p>
2442
- <p>
2443
- <label for="<?php echo $this->get_field_id( 'use_simplepie' ); ?>"><?php _e( 'Use SimplePie class:',
 
 
 
 
2444
  FB_RSSI_TEXTDOMAIN ) ?>
2445
- <select id="<?php echo $this->get_field_id( 'use_simplepie' ); ?>" name="<?php echo $this->get_field_name( 'use_simplepie' ); ?>">
2446
- <option value="0"<?php if ( ! $use_simplepie ) {
 
2447
  echo ' selected="selected"';
2448
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2449
- <option value="1"<?php if ( $use_simplepie ) {
2450
  echo ' selected="selected"';
2451
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2452
- </select>
2453
- </label>
2454
- </p>
2455
- <p>
2456
- <label for="<?php echo $this->get_field_id( 'view' ); ?>"><?php _e( 'Echo/Return:',
2457
  FB_RSSI_TEXTDOMAIN ) ?>
2458
- <select id="<?php echo $this->get_field_id( 'view' ); ?>" name="<?php echo $this->get_field_name( 'view' ); ?>">
2459
- <option value="0"<?php if ( ! $view ) {
 
2460
  echo ' selected="selected"';
2461
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2462
- <option value="1"<?php if ( $view ) {
2463
  echo ' selected="selected"';
2464
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2465
- </select>
2466
- </label>
2467
- </p>
2468
- <p>
2469
- <label for="<?php echo $this->get_field_id( 'random_sort' ); ?>"><?php _e( 'Random Order:',
2470
  FB_RSSI_TEXTDOMAIN ) ?>
2471
- <select id="<?php echo $this->get_field_id( 'random_sort' ); ?>" name="<?php echo $this->get_field_name( 'random_sort' ); ?>">
2472
- <option value="0"<?php if ( ! $random_sort ) {
 
2473
  echo ' selected="selected"';
2474
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2475
- <option value="1"<?php if ( $random_sort ) {
2476
  echo ' selected="selected"';
2477
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2478
- </select>
2479
- </label>
2480
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
2481
  <?php
2482
-
2483
  }
2484
  }
2485
 
2486
- add_action( 'widgets_init', create_function( '', 'return register_widget("RSSImport_Widget");' ) );
2487
-
2488
  } // end if class wp_widget exists
6
  * Domain Path: /languages
7
  * Description: Display Feeds in your blog. Use the function <code>RSSImport()</code>, a Widget or the Shortcode <code>[RSSImport]</code>.
8
  * Author: Frank Bültge, took77
9
+ * Version: 4.6.0
10
  * License: GPLv3+
11
+ * Last change: 2019-12-23
12
  */
13
 
14
  /*
17
  ------------------------------------------------------------
18
  Original and Idea: Dave Wolf, http://www.davewolf.net
19
  Thx to Thomas Fischer, http://www.securityfocus.de and
20
+ Gunnar Tillmann http://www.gunnart.de for a rearrange code,
21
+ Ilya Shindyapin, http://skookum.com for adding of paging
22
 
23
  ------------------------------------------------------------
24
  USAGE: Use following code with a PHP-Plugin for WordPress:
25
+ Example: <?php RSSImport(10, "https://bueltge.de/feed/"); ?>
26
  ------------------------------------------------------------
27
  */
28
 
56
 
57
  // plugin definitions
58
  define( 'FB_RSSI_BASENAME', plugin_basename( __FILE__ ) );
59
+ define( 'FB_RSSI_BASEFOLDER', plugin_basename( __DIR__ ) );
60
  define( 'FB_RSSI_TEXTDOMAIN', 'rssimport' );
61
  define( 'FB_RSSI_QUICKTAG', true );
62
  }
63
 
64
  function RSSImport_textdomain() {
 
65
  if ( function_exists( 'load_plugin_textdomain' ) ) {
66
  load_plugin_textdomain( FB_RSSI_TEXTDOMAIN, false, dirname( FB_RSSI_BASENAME ) . '/languages' );
67
  }
74
  }
75
 
76
  /**
77
+ * @param int $display
78
+ * @param string $feedurl
79
+ * @param string $before_desc
80
+ * @param int $displaydescriptions
81
+ * @param string $after_desc
82
+ * @param int $html
83
+ * @param int $truncatedescchar
84
+ * @param string $truncatedescstring
85
+ * @param int $truncatetitlechar
86
+ * @param string $truncatetitlestring
87
+ * @param string $before_date
88
+ * @param int $date
89
+ * @param string $after_date
90
+ * @param string $date_format
91
+ * @param string $before_creator
92
  * @param int|string $creator
93
+ * @param string $after_creator
94
+ * @param string $start_items
95
+ * @param string $end_items
96
+ * @param string $start_item
97
+ * @param string $end_item
98
+ * @param string $target
99
+ * @param string $rel
100
+ * @param int $desc4title
101
+ * @param int $charsetscan
102
+ * @param int $debug
103
+ * @param string $before_noitems
104
+ * @param string $noitems
105
+ * @param string $after_noitems
106
+ * @param string $before_error
107
+ * @param string $error
108
+ * @param string $after_error
109
+ * @param int $paging
110
+ * @param string $prev_paging_link
111
+ * @param string $next_paging_link
112
+ * @param string $prev_paging_title
113
+ * @param string $next_paging_title
114
+ * @param int $use_simplepie
115
+ * @param int $view
116
+ * @param int $random_sort
117
+ * @param string $order
118
  *
119
  * @return string
120
  */
121
  function RSSImport(
122
  $display = 5,
123
+ $feedurl = 'https://bueltge.de/feed/',
124
  $before_desc = '',
125
  $displaydescriptions = 0,
126
  $after_desc = '',
149
  $noitems = 'No items, feed is empty.',
150
  $after_noitems = '</p>',
151
  $before_error = '<p>',
152
+ $error = 'Error: Feed has an error or is not valid.',
153
  $after_error = '</p>',
154
  $paging = 0,
155
  $prev_paging_link = '&laquo; Previous',
158
  $next_paging_title = 'more items',
159
  $use_simplepie = 1,
160
  $view = 1,
161
+ $random_sort = 0,
162
+ $order = 'date,title,creator,description'
163
  ) {
 
164
  // replace for yahoo pipes urls
165
  $feedurl = str_replace( '&#038;', '&', $feedurl );
166
 
186
  if ( file_exists( ABSPATH . WPINC . '/class-simplepie.php' ) ) {
187
  @require ABSPATH . WPINC . '/class-simplepie.php';
188
  } else {
189
+ wp_die( __( 'Error in file: '
190
+ . __FILE__
191
+ . ' on line: '
192
+ . __LINE__
193
+ . '.<br />The WordPress file "class-simplepie.php" with class SimplePie could not be included.' ) );
194
  }
195
  }
196
+ } elseif ( file_exists( ABSPATH . WPINC . '/rss.php' ) ) {
197
+ require_once ABSPATH . WPINC . '/rss.php';
198
+ // It's WordPress 2.x. since it has been loaded successfully
199
+ } elseif ( file_exists( ABSPATH . WPINC . '/rss-functions.php' ) ) {
200
+ require_once ABSPATH . WPINC . '/rss-functions.php';
201
+ // In WordPress < 2.1
202
  } else {
203
+ wp_die( __( 'Error in file: ' . __FILE__ . ' on line: ' . __LINE__
204
+ . '.<br>The WordPress file "rss-functions.php" or "rss.php" could not be included.' ) );
 
 
 
 
 
 
 
 
 
205
  }
206
 
207
  $display = (int) $display;
208
+ $page = ( ( ! empty( $_GET['rsspage'] ) && (int) $_GET['rsspage'] > 0 )
209
+ ? (int) $_GET['rsspage']
210
+ : 1 );
211
  $truncatedescchar = (int) $truncatedescchar;
212
  $truncatetitlechar = (int) $truncatetitlechar;
213
  $echo = '<!--via MagpieRSS with RSSImport-->';
230
  }
231
 
232
  if ( $rss && ! is_wp_error( $rss ) ) {
 
233
  // the follow print_r list all items in array, for debug purpose
234
  if ( $debug ) {
235
  print '<pre>';
254
  $displayitems = $display;
255
  $displaylimit = ( $page * $display );
256
  $display = ( ( $page - 1 ) * $display );
257
+ $picked = [];
 
 
 
 
258
 
259
+ if ( $use_simplepie && ( 1 === $paging || $random_sort ) ) {
 
 
260
  /** @var SimplePie $rss */
261
  $items = $rss->get_items();
262
  } elseif ( $use_simplepie ) {
266
  /** @var MagpieRSS $rss */
267
  $items = $rss->items;
268
  }
269
+ $cnt_items = count( $items );
270
 
271
  while ( $display < $displaylimit ) {
 
272
  $i = $display;
273
+ if ( $random_sort ) {
274
+ do {
275
+ $i = mt_rand( 0, $cnt_items - 1 );
276
+ } while ( in_array( $i, $picked, true ) && count( $picked ) < $cnt_items );
277
  $picked[] = $i;
278
+ }
279
 
280
  if ( array_key_exists( $i, $items ) ) {
 
281
  if ( $use_simplepie ) {
282
  /** @var SimplePie $rss */
283
  $item = $rss->get_item( $i );
289
  $title = '';
290
  if ( $use_simplepie ) {
291
  $title = esc_attr( strip_tags( $item->get_title() ) );
292
+ } elseif ( isset( $item['title'] ) ) {
293
+ $title = esc_attr( strip_tags( $item['title'] ) );
294
  }
295
  // import link
296
  $href = '';
297
  if ( $use_simplepie ) {
298
  $href = wp_filter_kses( $item->get_link() );
299
+ } elseif ( isset( $item['link'] ) ) {
300
+ $href = wp_filter_kses( $item['link'] );
301
  }
302
  // import picture_url
303
  $picture_url = '';
305
  $picture_url = wp_filter_kses( $enclosure->get_thumbnail() );
306
  }
307
 
308
+ $start_item_temp = str_replace( [ '%title%', '%href%', '%picture_url%' ],
309
+ [ $title, $href, $picture_url ],
310
+ $start_item );
311
  $echo .= $start_item_temp;
312
 
313
  // import date
314
  if ( $use_simplepie && $date ) {
315
  $pubDate = date_i18n( $date_format, strtotime( $item->get_date() ) );
316
+ } elseif ( $date && isset( $item['pubdate'] ) ) {
317
+ $pubDate = date_i18n( $date_format, strtotime( $item['pubdate'] ) );
318
  }
319
  // import creator
320
  if ( $use_simplepie && $creator ) {
321
  /** @var SimplePie $item */
322
+ $creator = ' <cite>' . esc_html( strip_tags( $item->get_author()->get_name() ) ) . '</cite>';
323
+ } elseif ( $creator && isset( $item['dc']['creator'] ) ) {
324
+ $creator = esc_html( $item['dc']['creator'] );
325
+ } elseif ( $creator && isset( $item['creator'] ) ) {
326
+ $creator = esc_html( $item['creator'] );
 
 
 
 
327
  }
328
  // import desc
329
  if ( $use_simplepie && $displaydescriptions && $html ) {
330
  $desc = @html_entity_decode( $item->get_content(), ENT_QUOTES, get_option( 'blog_charset' ) );
331
  } // For import with HTML
332
+ elseif ( $use_simplepie && $displaydescriptions && ! $html ) {
333
  $desc = str_replace(
334
+ [ "\n", "\r" ],
335
+ ' ',
336
  esc_attr( strip_tags(
337
  @html_entity_decode(
338
  $item->get_description(),
341
  )
342
  );
343
  } // For import without HTML
344
+ elseif ( $displaydescriptions
345
+ && $html
346
+ && isset( $item['content']['encoded'] )
347
+ && $item['content']['encoded'] !== 'A' ) {
348
+ $desc = $item['content']['encoded'];
349
  } // For import with HTML
350
+ elseif ( $displaydescriptions
351
+ && $html
352
+ && isset( $item['content']['atom_content'] )
353
+ && $item['content']['atom_content'] !== 'A' ) {
354
+ $desc = $item['content']['atom_content'];
355
  } // For import with HTML
356
+ elseif ( $displaydescriptions
357
+ && $html
358
+ && isset( $item['content'] )
359
+ && ! is_array( $item['content'] ) ) {
360
+ $desc = $item['content'];
361
+ } elseif ( $displaydescriptions && $html && isset( $item['description'] ) ) {
362
+ $desc = $item['description'];
363
+ } elseif ( $displaydescriptions && ! $html && isset( $item['description'] ) ) {
364
+ $desc = esc_html( strip_tags( $item['description'] ) );
365
  } // For import without HTML
366
 
367
  if ( isset( $a ) && false !== stripos( $a, 'ISO' ) ) {
414
  $desc = '';
415
  if ( $use_simplepie ) {
416
  $desc = str_replace(
417
+ [ "\n", "\r" ],
418
  ' ',
419
  esc_attr( strip_tags(
420
  @html_entity_decode(
426
  )
427
  );
428
  } // For import without HTML
429
+ elseif ( isset( $item['description'] ) ) {
430
+ $desc = esc_html( strip_tags( $item['description'] ) );
431
  }
432
  $atitle = wp_html_excerpt( $desc, $truncatedescchar ) . $truncatedescstring;
433
  } else {
434
  $atitle = $title;
435
  }
436
 
437
+ // Read order settings and rearrange them before output.
438
+ $order_array = explode( ',', $order );
439
+ foreach ( $order_array as $objects ) {
440
+ switch ( $objects ) {
441
+ case 'date':
442
+ if ( isset( $pubDate ) && $date && '' !== $pubDate ) {
443
+ $echo .= $before_date . $pubDate . $after_date;
444
+ }
445
+ break;
446
+ case 'title':
447
+ $echo .= '<a'
448
+ . $target
449
+ . $rel
450
+ . ' href="'
451
+ . $href
452
+ . '" title="'
453
+ . $atitle
454
+ . '">'
455
+ . $title
456
+ . '</a>';
457
+ break;
458
+ case 'creator':
459
+ if ( isset( $creator ) && $creator && '' !== $creator ) {
460
+ $echo .= $before_creator . $creator . $after_creator;
461
+ }
462
+ break;
463
+ case 'description':
464
+ if ( isset( $desc ) && $displaydescriptions && '' !== $desc ) {
465
+ $after_desc_temp = stripslashes_deep( $after_desc );
466
+ $after_desc_temp = str_replace( [ '%title%', '%href%', '%picture_url%' ],
467
+ [ $title, $href, $picture_url ],
468
+ $after_desc_temp );
469
+ $before_desc_temp = str_replace( [ '%title%', '%href%', '%picture_url%' ],
470
+ [ $title, $href, $picture_url ],
471
+ $before_desc );
472
+ $echo .= $before_desc_temp . $desc . $after_desc_temp;
473
+ }
474
+ break;
475
+ }
476
  }
477
+
478
+ $end_item_temp = str_replace( [ '%title%', '%href%', '%picture_url%' ],
479
+ [ $title, $href, $picture_url ],
480
+ $end_item );
481
  $echo .= $end_item_temp;
 
 
482
  }
483
 
484
  $display ++;
489
  } else {
490
  $echo = wptexturize( $before_noitems . $noitems . $after_noitems );
491
  }
 
492
  } else {
493
  /** @noinspection MissingIssetImplementationInspection */
494
  if ( empty( $rss->ERROR ) ) {
495
+ $rss->ERROR = null;
496
  }
497
  $echo = wptexturize( $before_error . $error . $rss->ERROR . $after_error );
498
  }
499
 
500
  if ( $paging ) {
501
+ $nextitems = true;
502
+ $previousitems = false;
503
+ if ( $page > 1 ) {
504
+ $previousitems = true;
505
+ }
506
  $echo .= '<div class="rsspaging">';
507
  if ( $previousitems ) {
508
+ $echo .= '<a href="'
509
+ . add_query_arg( 'rsspage',
510
+ ( $page - 1 ) )
511
+ . '" class="rsspaging_prev" title="'
512
+ . $prev_paging_title
513
+ . '">'
514
+ . $prev_paging_link
515
+ . '</a>';
516
  }
517
  if ( $nextitems ) {
518
+ $echo .= '<a href="'
519
+ . add_query_arg( 'rsspage',
520
+ ( $page + 1 ) )
521
+ . '" class="rsspaging_next" title="'
522
+ . $next_paging_title
523
+ . '">'
524
+ . $next_paging_link
525
+ . '</a>';
526
  }
527
  $echo .= '<br style="clear: both" />';
528
  $echo .= '</div>';
530
 
531
  if ( $view ) {
532
  echo $echo;
 
 
533
  }
534
+ return $echo;
535
  }
536
 
537
+ /**
538
+ * @param $s_String
539
+ *
540
+ * @return false|string
541
+ */
542
  function utf8dec( $s_String ) {
 
543
  if ( PHP_VERSION_ID >= 50000 ) {
544
  $s_String = html_entity_decode(
545
  htmlentities( $s_String . ' ', ENT_COMPAT, 'UTF-8' )
551
  return substr( $s_String, 0, - 1 );
552
  }
553
 
554
+ /**
555
+ * @param $s_String
556
+ *
557
+ * @return false|string
558
+ */
559
  function isodec( $s_String ) {
 
560
  if ( PHP_VERSION_ID >= 50000 ) {
561
  $s_String = html_entity_decode( htmlentities( $s_String . ' ', ENT_COMPAT, 'ISO-8859-1' ) );
562
  } else {
566
  return substr( $s_String, 0, - 1 );
567
  }
568
 
569
+ /**
570
+ * @param $s_String
571
+ *
572
+ * @return string|string[]|null
573
+ */
574
  function all_convert( $s_String ) {
 
575
  // Array for entities
576
+ $umlaute = [
577
  '„',
578
  '“',
579
  '–',
957
  chr( 253 ),
958
  chr( 254 ),
959
  chr( 255 ),
960
+ chr( 256 ),
961
+ ];
962
 
963
+ $htmlcode = [
964
  '&bdquo;',
965
  '&ldquo;',
966
  '&ndash;',
1343
  '&uuml;',
1344
  '&yacute;',
1345
  '&thorn;',
1346
+ '&yuml;',
1347
+ ];
1348
 
1349
+ if ( PHP_VERSION_ID >= 50000 ) {
 
1350
  $s_String = utf8_encode( html_entity_decode( str_replace( $umlaute, $htmlcode, $s_String ) ) );
1351
  } else {
1352
  $s_String = utf8_encode( RSSImport_html_entity_decode_php4( str_replace( $umlaute, $htmlcode, $s_String ) ) );
1359
 
1360
  // &mdash; , &#8212;
1361
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9D~', '&mdash;', $s_String );
1362
+ $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC2\x9D~',
1363
+ '&mdash;',
1364
  $s_String );
1365
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x80\x9D~', '&mdash;', $s_String );
1366
 
1367
  // &ndash; , &#8211;
1368
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9C~', '&ndash;', $s_String );
1369
+ $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC5\x93~',
1370
+ '&ndash;',
1371
  $s_String );
1372
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x80\x9C~', '&ndash;', $s_String );
1373
 
1374
  // &rsquo; , &#8217;
1375
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x84\xA2~', '&rsquo;', $s_String );
1376
+ $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x80\x9E\xC2\xA2~',
1377
+ '&rsquo;',
1378
  $s_String );
1379
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x84\xA2~', '&rsquo;', $s_String );
1380
  $s_String = preg_replace( '~\xD0\xBF\xD1\x97\xD0\x85~', '&rsquo;', $s_String );
1390
 
1391
  // &ldquo; , &#8220;
1392
  $s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xC5\x93~', '&ldquo;', $s_String );
1393
+ $s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x85\xE2\x80\x9C~',
1394
+ '&ldquo;',
1395
  $s_String );
1396
  $s_String = preg_replace( '~\xD0\xB2\xD0\x82\xD1\x9A~', '&ldquo;', $s_String );
1397
 
1422
  * @return string
1423
  */
1424
  function RSSImport_end_on_word( $str ) {
 
1425
  $arr = explode( ' ', trim( $str ) );
1426
  array_pop( $arr );
1427
 
1429
  }
1430
 
1431
  function RSSImport_Shortcode( $atts ) {
 
1432
  $args = shortcode_atts(
1433
+ [
1434
  'display' => 5,
1435
+ 'feedurl' => 'https://bueltge.de/feed/',
1436
  'before_desc' => '<br />',
1437
  'displaydescriptions' => 0,
1438
  'after_desc' => '',
1461
  'noitems' => __( 'No items, feed is empty.', FB_RSSI_TEXTDOMAIN ),
1462
  'after_noitems' => '</p>',
1463
  'before_error' => '<p>',
1464
+ 'error' => __( 'Error: Feed has an error or is not valid.',
1465
  FB_RSSI_TEXTDOMAIN ),
1466
  'after_error' => '</p>',
1467
  'paging' => 0,
1472
  'use_simplepie' => 1,
1473
  'view' => 0,
1474
  'random_sort' => 0,
1475
+ 'order' => 'date,title,creator,description',
1476
+ ],
1477
  $atts
1478
  );
1479
 
1480
+ $display = (int) $args['display'];
1481
+ $feedurl = html_entity_decode( $args['feedurl'] ); // novaclic: undo encoding due to wordpress WYSIWYG editor
1482
+ if ( 'true' === strtolower( $args['html'] ) ) {
1483
+ $args['html'] = 1;
1484
  }
1485
+ $before_desc = $args['before_desc'];
1486
+ $html = (int) $args['html'];
1487
+ if ( 'true' === strtolower( $args['displaydescriptions'] ) ) {
1488
+ $args['displaydescriptions'] = 1;
1489
  }
1490
+ $after_desc = $args['after_desc'];
1491
+ $displaydescriptions = (int) $args['displaydescriptions'];
1492
+ if ( 'true' === strtolower( $args['truncatedescchar'] ) ) {
1493
+ $args['truncatedescchar'] = 1;
1494
  }
1495
+ $truncatedescchar = (int) $args['truncatedescchar'];
1496
+ if ( 'true' === strtolower( $args['truncatetitlechar'] ) ) {
1497
+ $args['truncatetitlechar'] = 1;
1498
  }
1499
+ $truncatedescstring = $args['truncatedescstring'];
1500
+ $truncatetitlestring = $args['truncatetitlestring'];
1501
+ $truncatetitlechar = (int) $args['truncatetitlechar'];
1502
+ $before_date = $args['before_date'];
1503
+ if ( 'true' === strtolower( $args['date'] ) ) {
1504
+ $args['date'] = 1;
1505
  }
1506
+ $date = (int) $args['date'];
1507
+ $after_date = $args['after_date'];
1508
+ $date_format = $args['date_format'];
1509
+ if ( 'true' === strtolower( $args['creator'] ) ) {
1510
+ $args['creator'] = 1;
1511
  }
1512
+ $before_creator = $args['before_creator'];
1513
+ $creator = (int) $args['creator'];
1514
+ $after_creator = $args['after_creator'];
1515
+ $start_items = $args['start_items'];
1516
+ $end_items = $args['end_items'];
1517
+ $start_item = $args['start_item'];
1518
+ $end_item = $args['end_item'];
1519
+ $target = $args['target'];
1520
+ $rel = $args['rel'];
1521
+ $desc4title = $args['desc4title'];
1522
+ if ( 'true' === strtolower( $args['charsetscan'] ) ) {
1523
+ $args['charsetscan'] = 1;
1524
  }
1525
+ $charsetscan = (int) $args['charsetscan'];
1526
+ if ( 'true' === strtolower( $args['debug'] ) ) {
1527
+ $args['debug'] = 1;
1528
  }
1529
+ $debug = (int) $args['debug'];
1530
+ $before_noitems = $args['before_noitems'];
1531
+ $noitems = $args['noitems'];
1532
+ $after_noitems = $args['after_noitems'];
1533
+ $before_error = $args['before_error'];
1534
+ $error = $args['error'];
1535
+ $after_error = $args['after_error'];
1536
+ if ( 'true' === strtolower( $args['paging'] ) ) {
1537
+ $args['paging'] = 1;
1538
  }
1539
+ $paging = (int) $args['paging'];
1540
+ if ( 'true' === strtolower( $args['use_simplepie'] ) ) {
1541
+ $args['use_simplepie'] = 1;
1542
  }
1543
+ $prev_paging_link = $args['prev_paging_link'];
1544
+ $next_paging_link = $args['next_paging_link'];
1545
+ $prev_paging_title = $args['prev_paging_title'];
1546
+ $next_paging_title = $args['next_paging_title'];
1547
+ $use_simplepie = (int) $args['use_simplepie'];
1548
+ $view = $args['view'];
1549
+ $random_sort = $args['random_sort'];
1550
+ $order = $args['order'];
1551
+
1552
+ RSSImport(
1553
+ $display,
1554
+ $feedurl,
1555
+ $before_desc,
1556
+ $displaydescriptions,
1557
+ $after_desc,
1558
+ $html,
1559
+ $truncatedescchar,
1560
+ $truncatedescstring,
1561
+ $truncatetitlechar,
1562
+ $truncatetitlestring,
1563
+ $before_date,
1564
+ $date,
1565
+ $after_date,
1566
+ $date_format,
1567
+ $before_creator,
1568
+ $creator,
1569
+ $after_creator,
1570
+ $start_items,
1571
+ $end_items,
1572
+ $start_item,
1573
+ $end_item,
1574
  $target,
1575
  $rel,
1576
  $desc4title,
1577
+ $charsetscan,
1578
+ $debug,
1579
+ $before_noitems,
1580
+ $noitems,
1581
+ $after_noitems,
1582
+ $before_error,
1583
+ $error,
1584
+ $after_error,
1585
+ $paging,
1586
+ $prev_paging_link,
1587
+ $next_paging_link,
1588
+ $prev_paging_title,
1589
+ $next_paging_title,
1590
  $use_simplepie,
1591
  $view,
1592
+ $random_sort,
1593
+ $order
1594
  );
 
 
1595
  }
1596
 
1597
+ /**
1598
+ * @param $pee
1599
+ *
1600
+ * @return string|string[]|null
1601
+ */
1602
  function RSSImport_shortcode_quot( $pee ) {
 
1603
  global $shortcode_tags;
1604
 
1605
  if ( ! empty( $shortcode_tags ) && is_array( $shortcode_tags ) ) {
1606
  $tagnames = array_keys( $shortcode_tags );
1607
  $tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) );
1608
  $pee = preg_replace(
1609
+ '/\\s*?(\\[(' . $tagregexp . ')\\b.*?\\/?](?:.+?\\[\\/\\2])?)\\s*/s',
1610
  '$1',
1611
  $pee
1612
  );
1618
  /**
1619
  * Add Quicktag-button to editor.
1620
  */
 
1621
  function RSSImport_insert_button() {
 
1622
  global $pagenow;
1623
 
1624
+ $post_page_pages = [ 'post-new.php', 'post.php', 'page-new.php', 'page.php' ];
1625
  if ( ! in_array( $pagenow, $post_page_pages, true ) ) {
1626
  return;
1627
  }
1628
 
1629
  ?>
1630
+ <script type="text/javascript" charset="utf-8">
1631
+ /* Adding Quicktag buttons to the editor WordPress ver. 3.3 and above
1632
  * - Button HTML ID (required)
1633
  * - Button display, value="" attribute (required)
1634
  * - Opening Tag (required)
1637
  * - Title, title="" attribute (optional)
1638
  * - Priority/position on bar, 1-9 = first, 11-19 = second, 21-29 = third, etc. (optional)
1639
  */
1640
+ var id = 'rssimport',
1641
+ text = '<?php _e( 'RSSImport', FB_RSSI_TEXTDOMAIN ); ?>',
1642
+ start = '[RSSImport display="5" feedurl="http://feedurl.com/" before_desc="<br />" displaydescriptions="TRUE" after_desc=" " ' +
1643
+ 'html="FALSE" truncatedescchar="200" truncatedescstring=" ... " truncatetitlechar="" truncatetitlestring=" ... " ' +
1644
+ 'before_date=" <small>" date="FALSE" after_date="</small>" date_format="" before_creator=" <small>" creator="FALSE" ' +
1645
+ 'after_creator="</small>" start_items="<ul>" end_items="</ul>" start_item="<li>" end_item="</li>" target="" rel="" ' +
1646
+ 'desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>" noitems="No items, feed is empty." ' +
1647
+ 'after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid" after_error="</p>" ' +
1648
+ 'paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;" prev_paging_title="more items" ' +
1649
+ 'next_paging_title="more items" use_simplepie="FALSE" random_sort="FALSE"]',
1650
+ end = '',
1651
+ access = 'r',
1652
+ title = '<?php _e( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ); ?>';
1653
+
1654
+ QTags.addButton(id, text, start, end, access);
1655
+ </script>
1656
  <?php
1657
  }
1658
 
1659
+ /**
1660
+ *
1661
+ */
1662
  function RSSImport_insert_button_old() {
 
1663
  global $pagenow;
1664
 
1665
+ $post_page_pages = [ 'post-new.php', 'post.php', 'page-new.php', 'page.php' ];
1666
  if ( ! in_array( $pagenow, $post_page_pages, true ) ) {
1667
  return;
1668
  }
1676
  content;
1677
 
1678
  edButtons[length] = new edButton(
1679
+ \'RSSImport\', \'$context\', \'[RSSImport display="5" feedurl="http://feedurl.com/"'
1680
+ .
1681
+ ' before_desc="<br />" displaydescriptions="TRUE" after_desc=" " html="FALSE" truncatedescchar="200" truncatedescstring=" ... "'
1682
+ .
1683
+ ' truncatetitlechar=" " truncatetitlestring=" ... " before_date=" <small>" date="FALSE" after_date="</small>"'
1684
+ .
1685
+ ' date_format="" before_creator=" <small>" creator="FALSE" after_creator="</small>" start_items="<ul>" end_items="</ul>"'
1686
+ .
1687
+ ' start_item="<li>" end_item="</li>" target="" rel="" desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>"'
1688
+ .
1689
+ ' noitems="No items, feed is empty." after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid"'
1690
+ .
1691
+ ' after_error="</p>" paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;"'
1692
+ .
1693
  ' prev_paging_title="more items" next_paging_title="more items" use_simplepie="FALSE"]\', \'\', \'\'
1694
  );
1695
 
1699
  }
1700
  jQuery( document ).ready( function() {
1701
  content = \'<input id="RSSImport_\' + length + \'" class="ed_button" type="button" value="'
1702
+ . __( 'RSSImport', FB_RSSI_TEXTDOMAIN )
1703
+ . '" title="'
1704
+ . __( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN )
1705
+ . '" onclick="RSSImport_tag(this.id);" />\';
1706
  jQuery( "#ed_toolbar" ).append( content );
1707
  } );
1708
  }
1711
  }
1712
 
1713
  if ( FB_RSSI_QUICKTAG && is_admin() ) {
1714
+ if ( version_compare( $GLOBALS['wp_version'], '3.3alpha', '>=' ) ) {
1715
  add_action( 'admin_print_footer_scripts', 'RSSImport_insert_button' );
1716
  } else {
1717
  add_action( 'admin_footer', 'RSSImport_insert_button_old' );
1730
  * @package WP-RSSImport
1731
  */
1732
  function RSSImport_code_to_utf8( $num ) {
 
1733
  if ( $num <= 0x7F ) {
1734
  return chr( $num );
1735
+ }
1736
+
1737
+ if ( $num <= 0x7FF ) {
1738
  return chr( ( $num >> 0x06 ) + 0xC0 ) . chr( ( $num & 0x3F ) + 128 );
1739
+ }
1740
+
1741
+ if ( $num <= 0xFFFF ) {
1742
+ return chr( ( $num >> 0x0C ) + 0xE0 ) . chr( ( ( $num >> 0x06 ) & 0x3F ) + 0x80 ) . chr( ( $num & 0x3F )
1743
+ + 0x80 );
1744
+ }
1745
+
1746
+ if ( $num <= 0x1FFFFF ) {
1747
+ return chr( ( $num >> 0x12 ) + 0xF0 )
1748
+ . chr( ( ( $num >> 0x0C ) & 0x3F ) + 0x80 )
1749
+ . chr( ( ( $num >> 0x06 )
1750
+ & 0x3F ) + 0x80 )
1751
+ . chr( ( $num & 0x3F ) + 0x80 );
1752
  }
1753
 
1754
  return '';
1760
  * @package WP-RSSImport
1761
  */
1762
  function RSSImport_html_entity_decode_php4( $str ) {
1763
+ $htmlentities = [
1764
+ '&Aacute;' => chr( 195 ) . chr( 129 ),
1765
+ '&aacute;' => chr( 195 ) . chr( 161 ),
1766
+ '&Acirc;' => chr( 195 ) . chr( 130 ),
1767
+ '&acirc;' => chr( 195 ) . chr( 162 ),
1768
+ '&acute;' => chr( 194 ) . chr( 180 ),
1769
+ '&AElig;' => chr( 195 ) . chr( 134 ),
1770
+ '&aelig;' => chr( 195 ) . chr( 166 ),
1771
+ '&Agrave;' => chr( 195 ) . chr( 128 ),
1772
+ '&agrave;' => chr( 195 ) . chr( 160 ),
1773
+ '&alefsym;' => chr( 226 ) . chr( 132 ) . chr( 181 ),
1774
+ '&Alpha;' => chr( 206 ) . chr( 145 ),
1775
+ '&alpha;' => chr( 206 ) . chr( 177 ),
1776
+ '&amp;' => chr( 38 ),
1777
+ '&and;' => chr( 226 ) . chr( 136 ) . chr( 167 ),
1778
+ '&ang;' => chr( 226 ) . chr( 136 ) . chr( 160 ),
1779
+ '&Aring;' => chr( 195 ) . chr( 133 ),
1780
+ '&aring;' => chr( 195 ) . chr( 165 ),
1781
+ '&asymp;' => chr( 226 ) . chr( 137 ) . chr( 136 ),
1782
+ '&Atilde;' => chr( 195 ) . chr( 131 ),
1783
+ '&atilde;' => chr( 195 ) . chr( 163 ),
1784
+ '&Auml;' => chr( 195 ) . chr( 132 ),
1785
+ '&auml;' => chr( 195 ) . chr( 164 ),
1786
+ '&bdquo;' => chr( 226 ) . chr( 128 ) . chr( 158 ),
1787
+ '&Beta;' => chr( 206 ) . chr( 146 ),
1788
+ '&beta;' => chr( 206 ) . chr( 178 ),
1789
+ '&brvbar;' => chr( 194 ) . chr( 166 ),
1790
+ '&bull;' => chr( 226 ) . chr( 128 ) . chr( 162 ),
1791
+ '&cap;' => chr( 226 ) . chr( 136 ) . chr( 169 ),
1792
+ '&Ccedil;' => chr( 195 ) . chr( 135 ),
1793
+ '&ccedil;' => chr( 195 ) . chr( 167 ),
1794
+ '&cedil;' => chr( 194 ) . chr( 184 ),
1795
+ '&cent;' => chr( 194 ) . chr( 162 ),
1796
+ '&Chi;' => chr( 206 ) . chr( 167 ),
1797
+ '&chi;' => chr( 207 ) . chr( 135 ),
1798
+ '&circ;' => chr( 203 ) . chr( 134 ),
1799
+ '&clubs;' => chr( 226 ) . chr( 153 ) . chr( 163 ),
1800
+ '&cong;' => chr( 226 ) . chr( 137 ) . chr( 133 ),
1801
+ '&copy;' => chr( 194 ) . chr( 169 ),
1802
+ '&crarr;' => chr( 226 ) . chr( 134 ) . chr( 181 ),
1803
+ '&cup;' => chr( 226 ) . chr( 136 ) . chr( 170 ),
1804
+ '&curren;' => chr( 194 ) . chr( 164 ),
1805
+ '&dagger;' => chr( 226 ) . chr( 128 ) . chr( 160 ),
1806
+ '&Dagger;' => chr( 226 ) . chr( 128 ) . chr( 161 ),
1807
+ '&darr;' => chr( 226 ) . chr( 134 ) . chr( 147 ),
1808
+ '&dArr;' => chr( 226 ) . chr( 135 ) . chr( 147 ),
1809
+ '&deg;' => chr( 194 ) . chr( 176 ),
1810
+ '&Delta;' => chr( 206 ) . chr( 148 ),
1811
+ '&delta;' => chr( 206 ) . chr( 180 ),
1812
+ '&diams;' => chr( 226 ) . chr( 153 ) . chr( 166 ),
1813
+ '&divide;' => chr( 195 ) . chr( 183 ),
1814
+ '&Eacute;' => chr( 195 ) . chr( 137 ),
1815
+ '&eacute;' => chr( 195 ) . chr( 169 ),
1816
+ '&Ecirc;' => chr( 195 ) . chr( 138 ),
1817
+ '&ecirc;' => chr( 195 ) . chr( 170 ),
1818
+ '&Egrave;' => chr( 195 ) . chr( 136 ),
1819
+ '&egrave;' => chr( 195 ) . chr( 168 ),
1820
+ '&empty;' => chr( 226 ) . chr( 136 ) . chr( 133 ),
1821
+ '&emsp;' => chr( 226 ) . chr( 128 ) . chr( 131 ),
1822
+ '&ensp;' => chr( 226 ) . chr( 128 ) . chr( 130 ),
1823
+ '&Epsilon;' => chr( 206 ) . chr( 149 ),
1824
+ '&epsilon;' => chr( 206 ) . chr( 181 ),
1825
+ '&equiv;' => chr( 226 ) . chr( 137 ) . chr( 161 ),
1826
+ '&Eta;' => chr( 206 ) . chr( 151 ),
1827
+ '&eta;' => chr( 206 ) . chr( 183 ),
1828
+ '&ETH;' => chr( 195 ) . chr( 144 ),
1829
+ '&eth;' => chr( 195 ) . chr( 176 ),
1830
+ '&Euml;' => chr( 195 ) . chr( 139 ),
1831
+ '&euml;' => chr( 195 ) . chr( 171 ),
1832
+ '&euro;' => chr( 226 ) . chr( 130 ) . chr( 172 ),
1833
+ '&exist;' => chr( 226 ) . chr( 136 ) . chr( 131 ),
1834
+ '&fnof;' => chr( 198 ) . chr( 146 ),
1835
+ '&forall;' => chr( 226 ) . chr( 136 ) . chr( 128 ),
1836
+ '&frac12;' => chr( 194 ) . chr( 189 ),
1837
+ '&frac14;' => chr( 194 ) . chr( 188 ),
1838
+ '&frac34;' => chr( 194 ) . chr( 190 ),
1839
+ '&frasl;' => chr( 226 ) . chr( 129 ) . chr( 132 ),
1840
+ '&Gamma;' => chr( 206 ) . chr( 147 ),
1841
+ '&gamma;' => chr( 206 ) . chr( 179 ),
1842
+ '&ge;' => chr( 226 ) . chr( 137 ) . chr( 165 ),
1843
+ '&harr;' => chr( 226 ) . chr( 134 ) . chr( 148 ),
1844
+ '&hArr;' => chr( 226 ) . chr( 135 ) . chr( 148 ),
1845
+ '&hearts;' => chr( 226 ) . chr( 153 ) . chr( 165 ),
1846
+ '&hellip;' => chr( 226 ) . chr( 128 ) . chr( 166 ),
1847
+ '&Iacute;' => chr( 195 ) . chr( 141 ),
1848
+ '&iacute;' => chr( 195 ) . chr( 173 ),
1849
+ '&Icirc;' => chr( 195 ) . chr( 142 ),
1850
+ '&icirc;' => chr( 195 ) . chr( 174 ),
1851
+ '&iexcl;' => chr( 194 ) . chr( 161 ),
1852
+ '&Igrave;' => chr( 195 ) . chr( 140 ),
1853
+ '&igrave;' => chr( 195 ) . chr( 172 ),
1854
+ '&image;' => chr( 226 ) . chr( 132 ) . chr( 145 ),
1855
+ '&infin;' => chr( 226 ) . chr( 136 ) . chr( 158 ),
1856
+ '&int;' => chr( 226 ) . chr( 136 ) . chr( 171 ),
1857
+ '&Iota;' => chr( 206 ) . chr( 153 ),
1858
+ '&iota;' => chr( 206 ) . chr( 185 ),
1859
+ '&iquest;' => chr( 194 ) . chr( 191 ),
1860
+ '&isin;' => chr( 226 ) . chr( 136 ) . chr( 136 ),
1861
+ '&Iuml;' => chr( 195 ) . chr( 143 ),
1862
+ '&iuml;' => chr( 195 ) . chr( 175 ),
1863
+ '&Kappa;' => chr( 206 ) . chr( 154 ),
1864
+ '&kappa;' => chr( 206 ) . chr( 186 ),
1865
+ '&Lambda;' => chr( 206 ) . chr( 155 ),
1866
+ '&lambda;' => chr( 206 ) . chr( 187 ),
1867
+ '&lang;' => chr( 226 ) . chr( 140 ) . chr( 169 ),
1868
+ '&laquo;' => chr( 194 ) . chr( 171 ),
1869
+ '&larr;' => chr( 226 ) . chr( 134 ) . chr( 144 ),
1870
+ '&lArr;' => chr( 226 ) . chr( 135 ) . chr( 144 ),
1871
+ '&lceil;' => chr( 226 ) . chr( 140 ) . chr( 136 ),
1872
+ '&ldquo;' => chr( 226 ) . chr( 128 ) . chr( 156 ),
1873
+ '&le;' => chr( 226 ) . chr( 137 ) . chr( 164 ),
1874
+ '&lfloor;' => chr( 226 ) . chr( 140 ) . chr( 138 ),
1875
+ '&lowast;' => chr( 226 ) . chr( 136 ) . chr( 151 ),
1876
+ '&loz;' => chr( 226 ) . chr( 151 ) . chr( 138 ),
1877
+ '&lrm;' => chr( 226 ) . chr( 128 ) . chr( 142 ),
1878
+ '&lsaquo;' => chr( 226 ) . chr( 128 ) . chr( 185 ),
1879
+ '&lsquo;' => chr( 226 ) . chr( 128 ) . chr( 152 ),
1880
+ '&macr;' => chr( 194 ) . chr( 175 ),
1881
+ '&mdash;' => chr( 226 ) . chr( 128 ) . chr( 148 ),
1882
+ '&micro;' => chr( 194 ) . chr( 181 ),
1883
+ '&middot;' => chr( 194 ) . chr( 183 ),
1884
+ '&minus;' => chr( 226 ) . chr( 136 ) . chr( 146 ),
1885
+ '&Mu;' => chr( 206 ) . chr( 156 ),
1886
+ '&mu;' => chr( 206 ) . chr( 188 ),
1887
+ '&nabla;' => chr( 226 ) . chr( 136 ) . chr( 135 ),
1888
+ '&nbsp;' => chr( 194 ) . chr( 160 ),
1889
+ '&ndash;' => chr( 226 ) . chr( 128 ) . chr( 147 ),
1890
+ '&ne;' => chr( 226 ) . chr( 137 ) . chr( 160 ),
1891
+ '&ni;' => chr( 226 ) . chr( 136 ) . chr( 139 ),
1892
+ '&not;' => chr( 194 ) . chr( 172 ),
1893
+ '&notin;' => chr( 226 ) . chr( 136 ) . chr( 137 ),
1894
+ '&nsub;' => chr( 226 ) . chr( 138 ) . chr( 132 ),
1895
+ '&Ntilde;' => chr( 195 ) . chr( 145 ),
1896
+ '&ntilde;' => chr( 195 ) . chr( 177 ),
1897
+ '&Nu;' => chr( 206 ) . chr( 157 ),
1898
+ '&nu;' => chr( 206 ) . chr( 189 ),
1899
+ '&Oacute;' => chr( 195 ) . chr( 147 ),
1900
+ '&oacute;' => chr( 195 ) . chr( 179 ),
1901
+ '&Ocirc;' => chr( 195 ) . chr( 148 ),
1902
+ '&ocirc;' => chr( 195 ) . chr( 180 ),
1903
+ '&OElig;' => chr( 197 ) . chr( 146 ),
1904
+ '&oelig;' => chr( 197 ) . chr( 147 ),
1905
+ '&Ograve;' => chr( 195 ) . chr( 146 ),
1906
+ '&ograve;' => chr( 195 ) . chr( 178 ),
1907
+ '&oline;' => chr( 226 ) . chr( 128 ) . chr( 190 ),
1908
+ '&Omega;' => chr( 206 ) . chr( 169 ),
1909
+ '&omega;' => chr( 207 ) . chr( 137 ),
1910
+ '&Omicron;' => chr( 206 ) . chr( 159 ),
1911
+ '&omicron;' => chr( 206 ) . chr( 191 ),
1912
+ '&oplus;' => chr( 226 ) . chr( 138 ) . chr( 149 ),
1913
+ '&or;' => chr( 226 ) . chr( 136 ) . chr( 168 ),
1914
+ '&ordf;' => chr( 194 ) . chr( 170 ),
1915
+ '&ordm;' => chr( 194 ) . chr( 186 ),
1916
+ '&Oslash;' => chr( 195 ) . chr( 152 ),
1917
+ '&oslash;' => chr( 195 ) . chr( 184 ),
1918
+ '&Otilde;' => chr( 195 ) . chr( 149 ),
1919
+ '&otilde;' => chr( 195 ) . chr( 181 ),
1920
+ '&otimes;' => chr( 226 ) . chr( 138 ) . chr( 151 ),
1921
+ '&Ouml;' => chr( 195 ) . chr( 150 ),
1922
+ '&ouml;' => chr( 195 ) . chr( 182 ),
1923
+ '&para;' => chr( 194 ) . chr( 182 ),
1924
+ '&part;' => chr( 226 ) . chr( 136 ) . chr( 130 ),
1925
+ '&permil;' => chr( 226 ) . chr( 128 ) . chr( 176 ),
1926
+ '&perp;' => chr( 226 ) . chr( 138 ) . chr( 165 ),
1927
+ '&Phi;' => chr( 206 ) . chr( 166 ),
1928
+ '&phi;' => chr( 207 ) . chr( 134 ),
1929
+ '&Pi;' => chr( 206 ) . chr( 160 ),
1930
+ '&pi;' => chr( 207 ) . chr( 128 ),
1931
+ '&piv;' => chr( 207 ) . chr( 150 ),
1932
+ '&plusmn;' => chr( 194 ) . chr( 177 ),
1933
+ '&pound;' => chr( 194 ) . chr( 163 ),
1934
+ '&prime;' => chr( 226 ) . chr( 128 ) . chr( 178 ),
1935
+ '&Prime;' => chr( 226 ) . chr( 128 ) . chr( 179 ),
1936
+ '&prod;' => chr( 226 ) . chr( 136 ) . chr( 143 ),
1937
+ '&prop;' => chr( 226 ) . chr( 136 ) . chr( 157 ),
1938
+ '&Psi;' => chr( 206 ) . chr( 168 ),
1939
+ '&psi;' => chr( 207 ) . chr( 136 ),
1940
+ '&radic;' => chr( 226 ) . chr( 136 ) . chr( 154 ),
1941
+ '&rang;' => chr( 226 ) . chr( 140 ) . chr( 170 ),
1942
+ '&raquo;' => chr( 194 ) . chr( 187 ),
1943
+ '&rarr;' => chr( 226 ) . chr( 134 ) . chr( 146 ),
1944
+ '&rArr;' => chr( 226 ) . chr( 135 ) . chr( 146 ),
1945
+ '&rceil;' => chr( 226 ) . chr( 140 ) . chr( 137 ),
1946
+ '&rdquo;' => chr( 226 ) . chr( 128 ) . chr( 157 ),
1947
+ '&real;' => chr( 226 ) . chr( 132 ) . chr( 156 ),
1948
+ '&reg;' => chr( 194 ) . chr( 174 ),
1949
+ '&rfloor;' => chr( 226 ) . chr( 140 ) . chr( 139 ),
1950
+ '&Rho;' => chr( 206 ) . chr( 161 ),
1951
+ '&rho;' => chr( 207 ) . chr( 129 ),
1952
+ '&rlm;' => chr( 226 ) . chr( 128 ) . chr( 143 ),
1953
+ '&rsaquo;' => chr( 226 ) . chr( 128 ) . chr( 186 ),
1954
+ '&rsquo;' => chr( 226 ) . chr( 128 ) . chr( 153 ),
1955
+ '&sbquo;' => chr( 226 ) . chr( 128 ) . chr( 154 ),
1956
+ '&Scaron;' => chr( 197 ) . chr( 160 ),
1957
+ '&scaron;' => chr( 197 ) . chr( 161 ),
1958
+ '&sdot;' => chr( 226 ) . chr( 139 ) . chr( 133 ),
1959
+ '&sect;' => chr( 194 ) . chr( 167 ),
1960
+ '&shy;' => chr( 194 ) . chr( 173 ),
1961
+ '&Sigma;' => chr( 206 ) . chr( 163 ),
1962
+ '&sigma;' => chr( 207 ) . chr( 131 ),
1963
+ '&sigmaf;' => chr( 207 ) . chr( 130 ),
1964
+ '&sim;' => chr( 226 ) . chr( 136 ) . chr( 188 ),
1965
+ '&spades;' => chr( 226 ) . chr( 153 ) . chr( 160 ),
1966
+ '&sub;' => chr( 226 ) . chr( 138 ) . chr( 130 ),
1967
+ '&sube;' => chr( 226 ) . chr( 138 ) . chr( 134 ),
1968
+ '&sum;' => chr( 226 ) . chr( 136 ) . chr( 145 ),
1969
+ '&sup1;' => chr( 194 ) . chr( 185 ),
1970
+ '&sup2;' => chr( 194 ) . chr( 178 ),
1971
+ '&sup3;' => chr( 194 ) . chr( 179 ),
1972
+ '&sup;' => chr( 226 ) . chr( 138 ) . chr( 131 ),
1973
+ '&supe;' => chr( 226 ) . chr( 138 ) . chr( 135 ),
1974
+ '&szlig;' => chr( 195 ) . chr( 159 ),
1975
+ '&Tau;' => chr( 206 ) . chr( 164 ),
1976
+ '&tau;' => chr( 207 ) . chr( 132 ),
1977
+ '&there4;' => chr( 226 ) . chr( 136 ) . chr( 180 ),
1978
+ '&Theta;' => chr( 206 ) . chr( 152 ),
1979
+ '&theta;' => chr( 206 ) . chr( 184 ),
1980
+ '&thetasym;' => chr( 207 ) . chr( 145 ),
1981
+ '&thinsp;' => chr( 226 ) . chr( 128 ) . chr( 137 ),
1982
+ '&THORN;' => chr( 195 ) . chr( 158 ),
1983
+ '&thorn;' => chr( 195 ) . chr( 190 ),
1984
+ '&tilde;' => chr( 203 ) . chr( 156 ),
1985
+ '&times;' => chr( 195 ) . chr( 151 ),
1986
+ '&trade;' => chr( 226 ) . chr( 132 ) . chr( 162 ),
1987
+ '&Uacute;' => chr( 195 ) . chr( 154 ),
1988
+ '&uacute;' => chr( 195 ) . chr( 186 ),
1989
+ '&uarr;' => chr( 226 ) . chr( 134 ) . chr( 145 ),
1990
+ '&uArr;' => chr( 226 ) . chr( 135 ) . chr( 145 ),
1991
+ '&Ucirc;' => chr( 195 ) . chr( 155 ),
1992
+ '&ucirc;' => chr( 195 ) . chr( 187 ),
1993
+ '&Ugrave;' => chr( 195 ) . chr( 153 ),
1994
+ '&ugrave;' => chr( 195 ) . chr( 185 ),
1995
+ '&uml;' => chr( 194 ) . chr( 168 ),
1996
+ '&upsih;' => chr( 207 ) . chr( 146 ),
1997
+ '&Upsilon;' => chr( 206 ) . chr( 165 ),
1998
+ '&upsilon;' => chr( 207 ) . chr( 133 ),
1999
+ '&Uuml;' => chr( 195 ) . chr( 156 ),
2000
+ '&uuml;' => chr( 195 ) . chr( 188 ),
2001
+ '&weierp;' => chr( 226 ) . chr( 132 ) . chr( 152 ),
2002
+ '&Xi;' => chr( 206 ) . chr( 158 ),
2003
+ '&xi;' => chr( 206 ) . chr( 190 ),
2004
+ '&Yacute;' => chr( 195 ) . chr( 157 ),
2005
+ '&yacute;' => chr( 195 ) . chr( 189 ),
2006
+ '&yen;' => chr( 194 ) . chr( 165 ),
2007
+ '&yuml;' => chr( 195 ) . chr( 191 ),
2008
+ '&Yuml;' => chr( 197 ) . chr( 184 ),
2009
+ '&Zeta;' => chr( 206 ) . chr( 150 ),
2010
+ '&zeta;' => chr( 206 ) . chr( 182 ),
2011
+ '&zwj;' => chr( 226 ) . chr( 128 ) . chr( 141 ),
2012
+ '&zwnj;' => chr( 226 ) . chr( 128 ) . chr( 140 ),
2013
+ '&gt;' => '>',
2014
+ '&lt;' => '<',
2015
+ ];
 
2016
 
2017
  $return = strtr( $str, $htmlentities );
2018
+ $return = preg_replace( '/~&#x([0-9a-f]+);i/', 'RSSImport_code_to_utf8( hexdec( "\\1" ) )', $return );
2019
+ $return = preg_replace( '/~&#(\d+);/', 'RSSImport_code_to_utf8( \\1 )', $return );
2020
 
2021
  return $return;
2022
  }
2023
 
2024
  // check class wp_widget exists
2025
  if ( class_exists( 'WP_Widget' ) ) {
 
2026
  class RSSImport_Widget extends WP_Widget {
2027
 
2028
  public function __construct() {
2029
+ $widget_ops = [
 
2030
  'classname' => 'rssimport',
2031
  'description' => __( 'Entries from any RSS or Atom feed', FB_RSSI_TEXTDOMAIN ),
2032
+ ];
2033
  parent::__construct( 'rssimport', __( 'RSSImport' ), $widget_ops );
2034
  }
2035
 
2036
  public function widget( $args, $instance ) {
2037
+ $title = empty( $instance['title'] )
2038
+ ? '&nbsp;'
2039
+ : apply_filters( 'widget_title', $instance['title'] );
2040
+ $titlelink = empty( $instance['titlelink'] )
2041
+ ? ''
2042
+ : $instance['titlelink'];
2043
+ $display = empty( $instance['display'] )
2044
+ ? '5'
2045
+ : $instance['display'];
2046
+ $feedurl = empty( $instance['feedurl'] )
2047
+ ? 'http://bueltge.de/feed/'
2048
+ : $instance['feedurl'];
2049
+ $before_desc = empty( $instance['before_desc'] )
2050
+ ? ''
2051
+ : $instance['before_desc'];
2052
+ $displaydescriptions = empty( $instance['displaydescriptions'] )
2053
+ ? '0'
2054
+ : $instance['displaydescriptions'];
2055
+ $after_desc = empty( $instance['after_desc'] )
2056
+ ? ''
2057
+ : $instance['after_desc'];
2058
+ $html = empty( $instance['html'] )
2059
+ ? '0'
2060
+ : $instance['html'];
2061
+ $truncatedescchar = empty( $instance['truncatedescchar'] )
2062
+ ? '200'
2063
+ : $instance['truncatedescchar'];
2064
+ $truncatedescstring = empty( $instance['truncatedescstring'] )
2065
+ ? ''
2066
+ : $instance['truncatedescstring'];
2067
+ $truncatetitlechar = empty( $instance['truncatetitlechar'] )
2068
+ ? ''
2069
+ : $instance['truncatetitlechar'];
2070
+ $truncatetitlestring = empty( $instance['truncatetitlestring'] )
2071
+ ? ' ... '
2072
+ : $instance['truncatetitlestring'];
2073
+ $before_date = empty( $instance['before_date'] )
2074
+ ? ' <small>'
2075
+ : $instance['before_date'];
2076
+ $date = empty( $instance['date'] )
2077
+ ? '0'
2078
+ : $instance['date'];
2079
+ $after_date = empty( $instance['after_date'] )
2080
+ ? '</small>'
2081
+ : $instance['after_date'];
2082
+ $date_format = empty( $instance['date_format'] )
2083
+ ? ''
2084
+ : $instance['date_format'];
2085
+ $before_creator = empty( $instance['before_creator'] )
2086
+ ? ' <small>'
2087
+ : $instance['before_creator'];
2088
+ $creator = empty( $instance['creator'] )
2089
+ ? '0'
2090
+ : $instance['creator'];
2091
+ $after_creator = empty( $instance['after_creator'] )
2092
+ ? '</small>'
2093
+ : $instance['after_creator'];
2094
+ $start_items = empty( $instance['start_items'] )
2095
+ ? '<ul>'
2096
+ : $instance['start_items'];
2097
+ $end_items = empty( $instance['end_items'] )
2098
+ ? '</ul>'
2099
+ : $instance['end_items'];
2100
+ $start_item = empty( $instance['start_item'] )
2101
+ ? '<li>'
2102
+ : $instance['start_item'];
2103
+ $end_item = empty( $instance['end_item'] )
2104
+ ? '</li>'
2105
+ : $instance['end_item'];
2106
+ $target = empty( $instance['target'] )
2107
+ ? ''
2108
+ : $instance['target'];
2109
+ $rel = empty( $instance['rel'] )
2110
+ ? ''
2111
+ : $instance['rel'];
2112
+ $desc4title = empty( $instance['desc4title'] )
2113
+ ? '0'
2114
+ : $instance['desc4title'];
2115
+ $charsetscan = empty( $instance['charsetscan'] )
2116
+ ? '0'
2117
+ : $instance['charsetscan'];
2118
+ $debug = empty( $instance['debug'] )
2119
+ ? '0'
2120
+ : $instance['debug'];
2121
+ $before_noitems = empty( $instance['before_noitems'] )
2122
+ ? '<p>'
2123
+ : $instance['before_noitems'];
2124
+ $noitems = empty( $instance['noitems'] )
2125
+ ? __( 'No items, feed is empty.',
2126
+ FB_RSSI_TEXTDOMAIN )
2127
+ : $instance['noitems'];
2128
+ $after_noitems = empty( $instance['after_noitems'] )
2129
+ ? '</p>'
2130
+ : $instance['after_noitems'];
2131
+ $before_error = empty( $instance['before_error'] )
2132
+ ? '<p>'
2133
+ : $instance['before_error'];
2134
+ $error = empty( $instance['error'] )
2135
+ ? __( 'Error: Feed has an error or is not valid',
2136
+ FB_RSSI_TEXTDOMAIN )
2137
+ : $instance['error'];
2138
+ $after_error = empty( $instance['after_error'] )
2139
+ ? '</p>'
2140
+ : $instance['after_error'];
2141
+ $paging = empty( $instance['paging'] )
2142
+ ? '0'
2143
+ : $instance['paging'];
2144
+ $prev_paging_link = empty( $instance['prev_paging_link'] )
2145
+ ? __( '&laquo; Previous',
2146
+ FB_RSSI_TEXTDOMAIN )
2147
+ : $instance['prev_paging_link'];
2148
+ $next_paging_link = empty( $instance['next_paging_link'] )
2149
+ ? __( 'Next &raquo;', FB_RSSI_TEXTDOMAIN )
2150
+ : $instance['next_paging_link'];
2151
+ $prev_paging_title = empty( $instance['prev_paging_title'] )
2152
+ ? __( 'more items', FB_RSSI_TEXTDOMAIN )
2153
+ : $instance['prev_paging_title'];
2154
+ $next_paging_title = empty( $instance['next_paging_title'] )
2155
+ ? __( 'more items', FB_RSSI_TEXTDOMAIN )
2156
+ : $instance['next_paging_title'];
2157
+ $use_simplepie = $instance['use_simplepie'];
2158
+ $view = $instance['view'];
2159
+ $random_sort = $instance['random_sort'];
2160
+ $order = $instance['order'];
2161
+
2162
+ echo $args['before_widget'];
2163
  if ( '' !== $titlelink ) {
2164
  $title = '<a href="' . $titlelink . '">' . $title . '</a>';
2165
  }
2166
+ echo $args['before_title'] . $title . $args['after_title'];
2167
  RSSImport(
2168
+ $display,
2169
+ $feedurl,
2170
+ $before_desc,
2171
+ $displaydescriptions,
2172
+ $after_desc,
2173
+ $html,
2174
+ $truncatedescchar,
2175
+ $truncatedescstring,
2176
+ $truncatetitlechar,
2177
+ $truncatetitlestring,
2178
+ $before_date,
2179
+ $date,
2180
+ $after_date,
2181
+ $date_format,
2182
+ $before_creator,
2183
+ $creator,
2184
+ $after_creator,
2185
+ $start_items,
2186
+ $end_items,
2187
+ $start_item,
2188
+ $end_item,
2189
  $target,
2190
  $rel,
2191
  $desc4title,
2192
+ $charsetscan,
2193
+ $debug,
2194
+ $before_noitems,
2195
+ $noitems,
2196
+ $after_noitems,
2197
+ $before_error,
2198
+ $error,
2199
+ $after_error,
2200
+ $paging,
2201
+ $prev_paging_link,
2202
+ $next_paging_link,
2203
+ $prev_paging_title,
2204
+ $next_paging_title,
2205
  $use_simplepie,
2206
  $view,
2207
+ $random_sort,
2208
+ $order
2209
  );
2210
+ echo $args['after_widget'];
2211
  }
2212
 
2213
  public function update( $new_instance, $old_instance ) {
2214
+ $instance['instance'] = $old_instance;
2215
+ $instance['title'] = strip_tags( $new_instance['title'] );
2216
+ $instance['titlelink'] = esc_url( $new_instance['titlelink'] );
2217
+ $instance['display'] = (int) $new_instance['display'];
2218
+ $instance['feedurl'] = $new_instance['feedurl'];
2219
+ $instance['before_desc'] = $new_instance['before_desc'];
2220
+ $instance['displaydescriptions'] = (int) $new_instance['displaydescriptions'];
2221
+ $instance['after_desc'] = stripslashes_deep( $new_instance['after_desc'] );
2222
+ $instance['html'] = (int) $new_instance['html'];
2223
+ $instance['truncatedescchar'] = (int) $new_instance['truncatedescchar'];
2224
+ $instance['truncatedescstring'] = $new_instance['truncatedescstring'];
2225
+ $instance['truncatetitlechar'] = (int) $new_instance['truncatetitlechar'];
2226
+ $instance['truncatetitlestring'] = $new_instance['truncatetitlestring'];
2227
+ $instance['before_date'] = $new_instance['before_date'];
2228
+ $instance['date'] = (int) $new_instance['date'];
2229
+ $instance['after_date'] = $new_instance['after_date'];
2230
+ $instance['date_format'] = $new_instance['date_format'];
2231
+ $instance['before_creator'] = $new_instance['before_creator'];
2232
+ $instance['creator'] = (int) $new_instance['creator'];
2233
+ $instance['after_creator'] = $new_instance['after_creator'];
2234
+ $instance['start_items'] = $new_instance['start_items'];
2235
+ $instance['end_items'] = $new_instance['end_items'];
2236
+ $instance['start_item'] = $new_instance['start_item'];
2237
+ $instance['end_item'] = $new_instance['end_item'];
2238
+ $instance['target'] = $new_instance['target'];
2239
+ $instance['rel'] = $new_instance['rel'];
2240
+ $instance['desc4title'] = (int) $new_instance['desc4title'];
2241
+ $instance['charsetscan'] = (int) $new_instance['charsetscan'];
2242
+ $instance['debug'] = (int) $new_instance['debug'];
2243
+ $instance['view'] = (int) $new_instance['view'];
2244
+ $instance['before_noitems'] = $new_instance['before_noitems'];
2245
+ $instance['noitems'] = $new_instance['noitems'];
2246
+ $instance['after_noitems'] = $new_instance['after_noitems'];
2247
+ $instance['before_error'] = $new_instance['before_error'];
2248
+ $instance['error'] = $new_instance['error'];
2249
+ $instance['after_error'] = $new_instance['after_error'];
2250
+ $instance['paging'] = (int) $new_instance['paging'];
2251
+ $instance['prev_paging_link'] = $new_instance['prev_paging_link'];
2252
+ $instance['next_paging_link'] = $new_instance['next_paging_link'];
2253
+ $instance['prev_paging_title'] = $new_instance['prev_paging_title'];
2254
+ $instance['next_paging_title'] = $new_instance['next_paging_title'];
2255
+ $instance['use_simplepie'] = (int) $new_instance['use_simplepie'];
2256
+ $instance['random_sort'] = (int) $new_instance['random_sort'];
2257
+ $instance['order'] = $new_instance['order'];
2258
 
2259
  if ( current_user_can( 'unfiltered_html' ) ) {
2260
  return $instance;
2264
  }
2265
 
2266
  public function form( $instance ) {
 
2267
  $instance = wp_parse_args(
2268
+ (array) $instance,
2269
+ [
2270
  'title' => '',
2271
  'titlelink' => '',
2272
  'display' => 5,
2310
  'next_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
2311
  'use_simplepie' => 1,
2312
  'random_sort' => 0,
2313
+ 'order' => 'date,title,creator,description',
2314
+ ]
2315
  );
2316
 
2317
+ $title = format_to_edit( strip_tags( $instance['title'] ) );
2318
+ $titlelink = format_to_edit( esc_url( $instance['titlelink'] ) );
2319
+ $display = (int) $instance['display'];
2320
+ $feedurl = format_to_edit( $instance['feedurl'] );
2321
+ $before_desc = format_to_edit( $instance['before_desc'] );
2322
+ $displaydescriptions = (int) $instance['displaydescriptions'];
2323
+ $after_desc = format_to_edit( $instance['after_desc'] );
2324
+ $html = (int) $instance['html'];
2325
+ $truncatedescchar = (int) $instance['truncatedescchar'];
2326
+ $truncatedescstring = (int) $instance['truncatedescstring'];
2327
+ $truncatetitlechar = format_to_edit( $instance['truncatetitlechar'] );
2328
+ $truncatetitlestring = format_to_edit( $instance['truncatetitlestring'] );
2329
+ $before_date = format_to_edit( $instance['before_date'] );
2330
+ $date = (int) $instance['date'];
2331
+ $after_date = format_to_edit( $instance['after_date'] );
2332
+ $date_format = format_to_edit( $instance['date_format'] );
2333
+ $before_creator = format_to_edit( $instance['before_creator'] );
2334
+ $creator = (int) $instance['creator'];
2335
+ $after_creator = format_to_edit( $instance['after_creator'] );
2336
+ $start_items = format_to_edit( $instance['start_items'] );
2337
+ $end_items = format_to_edit( $instance['end_items'] );
2338
+ $start_item = format_to_edit( $instance['start_item'] );
2339
+ $end_item = format_to_edit( $instance['end_item'] );
2340
+ $target = format_to_edit( $instance['target'] );
2341
+ $rel = format_to_edit( $instance['rel'] );
2342
+ $desc4title = (int) $instance['desc4title'];
2343
+ $charsetscan = (int) $instance['charsetscan'];
2344
+ $debug = (int) $instance['debug'];
2345
+ $before_noitems = format_to_edit( $instance['before_noitems'] );
2346
+ $noitems = format_to_edit( $instance['noitems'] );
2347
+ $after_noitems = format_to_edit( $instance['after_noitems'] );
2348
+ $before_error = format_to_edit( $instance['before_error'] );
2349
+ $error = format_to_edit( $instance['error'] );
2350
+ $after_error = format_to_edit( $instance['after_error'] );
2351
+ $paging = (int) $instance['paging'];
2352
+ $prev_paging_link = format_to_edit( $instance['prev_paging_link'] );
2353
+ $next_paging_link = format_to_edit( $instance['next_paging_link'] );
2354
+ $prev_paging_title = format_to_edit( $instance['prev_paging_title'] );
2355
+ $next_paging_title = format_to_edit( $instance['next_paging_title'] );
2356
+ $use_simplepie = (int) $instance['use_simplepie'];
2357
+ $view = (int) $instance['view'];
2358
+ $random_sort = (int) $instance['random_sort'];
2359
+ $order = format_to_edit( $instance['order'] );
2360
  ?>
2361
+ <p>
2362
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', FB_RSSI_TEXTDOMAIN ) ?>
2363
+ <input class="widefat"
2364
+ id="<?php echo $this->get_field_id( 'title' ); ?>"
2365
+ name="<?php echo $this->get_field_name( 'title' ); ?>"
2366
+ type="text"
2367
+ value="<?php echo esc_attr( $title ); ?>" /></label>
2368
+ </p>
2369
+ <p>
2370
+ <label for="<?php echo $this->get_field_id( 'titlelink' ); ?>"><?php _e( 'URL for Title (incl. http://):',
2371
  FB_RSSI_TEXTDOMAIN ) ?>
2372
+ <input class="widefat"
2373
+ id="<?php echo $this->get_field_id( 'titlelink' ); ?>"
2374
+ name="<?php echo $this->get_field_name( 'titlelink' ); ?>"
2375
+ type="text"
2376
+ value="<?php echo esc_url( $titlelink ); ?>" /></label>
2377
+ </p>
2378
+ <p>
2379
+ <label for="<?php echo $this->get_field_id( 'display' ); ?>"><?php _e( 'Display:',
2380
  FB_RSSI_TEXTDOMAIN ) ?>
2381
+ <input class="widefat"
2382
+ id="<?php echo $this->get_field_id( 'display' ); ?>"
2383
+ name="<?php echo $this->get_field_name( 'display' ); ?>"
2384
+ type="text"
2385
+ value="<?php echo esc_attr( $display ); ?>" /></label>
2386
+ </p>
2387
+ <p>
2388
+ <label for="<?php echo $this->get_field_id( 'feedurl' ); ?>"><?php _e( 'FeedURL:',
2389
  FB_RSSI_TEXTDOMAIN ) ?>
2390
+ <input class="widefat"
2391
+ id="<?php echo $this->get_field_id( 'feedurl' ); ?>"
2392
+ name="<?php echo $this->get_field_name( 'feedurl' ); ?>"
2393
+ type="text"
2394
+ value="<?php echo $feedurl; ?>" /></label>
2395
+ </p>
2396
+ <p>
2397
+ <label for="<?php echo $this->get_field_id( 'before_desc' ); ?>"><?php _e( 'Before Description:',
2398
  FB_RSSI_TEXTDOMAIN ) ?>
2399
+ <input class="widefat"
2400
+ id="<?php echo $this->get_field_id( 'before_desc' ); ?>"
2401
+ name="<?php echo $this->get_field_name( 'before_desc' ); ?>"
2402
+ type="text"
2403
+ value="<?php echo $before_desc; ?>" /></label>
2404
+ </p>
2405
+ <p>
2406
+ <label for="<?php echo $this->get_field_id( 'displaydescriptions' ); ?>"><?php _e( 'Display Description:',
2407
  FB_RSSI_TEXTDOMAIN ) ?>
2408
+ <select id="<?php echo $this->get_field_id( 'displaydescriptions' ); ?>"
2409
+ name="<?php echo $this->get_field_name( 'displaydescriptions' ); ?>">
2410
+ <option value="0"<?php if ( $displaydescriptions === '0' ) {
2411
  echo ' selected="selected"';
2412
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2413
+ <option value="1"<?php if ( $displaydescriptions === '1' ) {
2414
  echo ' selected="selected"';
2415
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2416
+ </select>
2417
+ </label>
2418
+ </p>
2419
+ <p>
2420
+ <label for="<?php echo $this->get_field_id( 'after_desc' ); ?>"><?php _e( 'After Description:',
2421
  FB_RSSI_TEXTDOMAIN ) ?>
2422
+ <input class="widefat code"
2423
+ id="<?php echo $this->get_field_id( 'after_desc' ); ?>"
2424
+ name="<?php echo $this->get_field_name( 'after_desc' ); ?>"
2425
+ type="text"
2426
+ value="<?php echo $after_desc; ?>" /></label>
2427
+ <br />
2428
+ <small><?php _e( 'You can use the following strings to create custom links:', FB_RSSI_TEXTDOMAIN ); ?>
2429
+ <code>%title%</code>, <code>%href%</code>
2430
+ <br /><?php _e( 'Example:', FB_RSSI_TEXTDOMAIN ); ?>
2431
+ <code>&lt;a href="%href%" target="self" rel="follow"&gt;%title%&lt;/a&gt;</code></small>
2432
+ </p>
2433
+ <p>
2434
+ <label for="<?php echo $this->get_field_id( 'html' ); ?>"><?php _e( 'HTML:', FB_RSSI_TEXTDOMAIN ) ?>
2435
+ <select id="<?php echo $this->get_field_id( 'html' ); ?>"
2436
+ name="<?php echo $this->get_field_name( 'html' ); ?>">
2437
+ <option value="0"<?php if ( ! $html ) {
2438
  echo ' selected="selected"';
2439
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2440
+ <option value="1"<?php if ( $html ) {
2441
  echo ' selected="selected"';
2442
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2443
+ </select>
2444
+ </label>
2445
+ </p>
2446
+ <p>
2447
+ <label for="<?php echo $this->get_field_id( 'truncatedescchar' ); ?>"><?php _e( 'Truncate Description Char:',
2448
  FB_RSSI_TEXTDOMAIN ) ?>
2449
+ <input class="widefat"
2450
+ id="<?php echo $this->get_field_id( 'truncatedescchar' ); ?>"
2451
+ name="<?php echo $this->get_field_name( 'truncatedescchar' ); ?>"
2452
+ type="text"
2453
+ value="<?php echo esc_attr( $truncatedescchar ); ?>" /></label>
2454
+ </p>
2455
+ <p>
2456
+ <label for="<?php echo $this->get_field_id( 'truncatedescstring' ); ?>"><?php _e( 'Truncate Description String (HTML):',
2457
  FB_RSSI_TEXTDOMAIN ) ?>
2458
+ <input class="widefat code"
2459
+ id="<?php echo $this->get_field_id( 'truncatedescstring' ); ?>"
2460
+ name="<?php echo $this->get_field_name( 'truncatedescstring' ); ?>"
2461
+ type="text"
2462
+ value="<?php echo $truncatedescstring; ?>" /></label>
2463
+ </p>
2464
+ <p>
2465
+ <label for="<?php echo $this->get_field_id( 'truncatetitlechar' ); ?>"><?php _e( 'Truncate Title Char:',
2466
  FB_RSSI_TEXTDOMAIN ) ?>
2467
+ <input class="widefat"
2468
+ id="<?php echo $this->get_field_id( 'truncatetitlechar' ); ?>"
2469
+ name="<?php echo $this->get_field_name( 'truncatetitlechar' ); ?>"
2470
+ type="text"
2471
+ value="<?php echo esc_attr( $truncatetitlechar ); ?>" /></label>
2472
+ </p>
2473
+ <p>
2474
+ <label for="<?php echo $this->get_field_id( 'truncatetitlestring' ); ?>"><?php _e( 'Truncate Title String (HTML):',
2475
  FB_RSSI_TEXTDOMAIN ) ?>
2476
+ <input class="widefat code"
2477
+ id="<?php echo $this->get_field_id( 'truncatetitlestring' ); ?>"
2478
+ name="<?php echo $this->get_field_name( 'truncatetitlestring' ); ?>"
2479
+ type="text"
2480
+ value="<?php echo $truncatetitlestring; ?>" /></label>
2481
+ </p>
2482
+ <p>
2483
+ <label for="<?php echo $this->get_field_id( 'before_date' ); ?>"><?php _e( 'Before Date (HTML):',
2484
  FB_RSSI_TEXTDOMAIN ) ?>
2485
+ <input class="widefat code"
2486
+ id="<?php echo $this->get_field_id( 'before_date' ); ?>"
2487
+ name="<?php echo $this->get_field_name( 'before_date' ); ?>"
2488
+ type="text"
2489
+ value="<?php echo $before_date; ?>" /></label>
2490
+ </p>
2491
+ <p>
2492
+ <label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Date:', FB_RSSI_TEXTDOMAIN ) ?>
2493
+ <select id="<?php echo $this->get_field_id( 'date' ); ?>"
2494
+ name="<?php echo $this->get_field_name( 'date' ); ?>">
2495
+ <option value="0"<?php if ( ! $date ) {
2496
  echo ' selected="selected"';
2497
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2498
+ <option value="1"<?php if ( $date ) {
2499
  echo ' selected="selected"';
2500
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2501
+ </select>
2502
+ </label>
2503
+ </p>
2504
+ <p>
2505
+ <label for="<?php echo $this->get_field_id( 'after_date' ); ?>"><?php _e( 'After Date (HTML):',
2506
  FB_RSSI_TEXTDOMAIN ) ?>
2507
+ <input class="widefat code"
2508
+ id="<?php echo $this->get_field_id( 'after_date' ); ?>"
2509
+ name="<?php echo $this->get_field_name( 'after_date' ); ?>"
2510
+ type="text"
2511
+ value="<?php echo $after_date; ?>" /></label>
2512
+ </p>
2513
+ <p>
2514
+ <label for="<?php echo $this->get_field_id( 'date_format' ); ?>"><?php _e( 'Date Formatting:',
2515
  FB_RSSI_TEXTDOMAIN ) ?>
2516
+ <input class="widefat"
2517
+ id="<?php echo $this->get_field_id( 'date_format' ); ?>"
2518
+ name="<?php echo $this->get_field_name( 'date_format' ); ?>"
2519
+ type="text"
2520
+ value="<?php echo $date_format; ?>" /></label>
2521
+ <br />
2522
+ <small><?php _e( 'Leave empty for use the date format of your WordPress settings.',
2523
  FB_RSSI_TEXTDOMAIN ); ?>
2524
+ <a href="http://codex.wordpress.org/Formatting_Date_and_Time"><?php _e( 'Documentation on date formatting',
2525
  FB_RSSI_TEXTDOMAIN ); ?></a>
2526
+ </small>
2527
+ </p>
2528
+ <p>
2529
+ <label for="<?php echo $this->get_field_id( 'before_creator' ); ?>"><?php _e( 'Before Creator (HTML):',
2530
  FB_RSSI_TEXTDOMAIN ) ?>
2531
+ <input class="widefat code"
2532
+ id="<?php echo $this->get_field_id( 'before_creator' ); ?>"
2533
+ name="<?php echo $this->get_field_name( 'before_creator' ); ?>"
2534
+ type="text"
2535
+ value="<?php echo $before_creator; ?>" /></label>
2536
+ </p>
2537
+ <p>
2538
+ <label for="<?php echo $this->get_field_id( 'creator' ); ?>"><?php _e( 'Creator:',
2539
  FB_RSSI_TEXTDOMAIN ) ?>
2540
+ <select id="<?php echo $this->get_field_id( 'creator' ); ?>"
2541
+ name="<?php echo $this->get_field_name( 'creator' ); ?>">
2542
+ <option value="0"<?php if ( ! $creator ) {
2543
  echo ' selected="selected"';
2544
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2545
+ <option value="1"<?php if ( $creator ) {
2546
  echo ' selected="selected"';
2547
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2548
+ </select>
2549
+ </label>
2550
+ </p>
2551
+ <p>
2552
+ <label for="<?php echo $this->get_field_id( 'after_creator' ); ?>"><?php _e( 'After Creator (HTML):',
2553
  FB_RSSI_TEXTDOMAIN ) ?>
2554
+ <input class="widefat code"
2555
+ id="<?php echo $this->get_field_id( 'after_creator' ); ?>"
2556
+ name="<?php echo $this->get_field_name( 'after_creator' ); ?>"
2557
+ type="text"
2558
+ value="<?php echo $after_creator; ?>" /></label>
2559
+ </p>
2560
+ <p>
2561
+ <label for="<?php echo $this->get_field_id( 'start_items' ); ?>"><?php _e( 'Before Items (HTML):',
2562
  FB_RSSI_TEXTDOMAIN ) ?>
2563
+ <input class="widefat code"
2564
+ id="<?php echo $this->get_field_id( 'start_items' ); ?>"
2565
+ name="<?php echo $this->get_field_name( 'start_items' ); ?>"
2566
+ type="text"
2567
+ value="<?php echo $start_items; ?>" /></label>
2568
+ </p>
2569
+ <p>
2570
+ <label for="<?php echo $this->get_field_id( 'end_items' ); ?>"><?php _e( 'After Items (HTML):',
2571
  FB_RSSI_TEXTDOMAIN ) ?>
2572
+ <input class="widefat code"
2573
+ id="<?php echo $this->get_field_id( 'end_items' ); ?>"
2574
+ name="<?php echo $this->get_field_name( 'end_items' ); ?>"
2575
+ type="text"
2576
+ value="<?php echo $end_items; ?>" /></label>
2577
+ </p>
2578
+ <p>
2579
+ <label for="<?php echo $this->get_field_id( 'start_item' ); ?>"><?php _e( 'Before Item (HTML):',
2580
  FB_RSSI_TEXTDOMAIN ) ?>
2581
+ <input class="widefat code"
2582
+ id="<?php echo $this->get_field_id( 'start_item' ); ?>"
2583
+ name="<?php echo $this->get_field_name( 'start_item' ); ?>"
2584
+ type="text"
2585
+ value="<?php echo $start_item; ?>" /></label>
2586
+ </p>
2587
+ <p>
2588
+ <label for="<?php echo $this->get_field_id( 'end_item' ); ?>"><?php _e( 'After Item (HTML):',
2589
  FB_RSSI_TEXTDOMAIN ) ?>
2590
+ <input class="widefat code"
2591
+ id="<?php echo $this->get_field_id( 'end_item' ); ?>"
2592
+ name="<?php echo $this->get_field_name( 'end_item' ); ?>"
2593
+ type="text"
2594
+ value="<?php echo $end_item; ?>" /></label>
2595
+ </p>
2596
+ <p>
2597
+ <label for="<?php echo $this->get_field_id( 'target' ); ?>"><?php _e( 'Target Attribut:',
2598
  FB_RSSI_TEXTDOMAIN ) ?>
2599
+ <input class="widefat"
2600
+ id="<?php echo $this->get_field_id( 'target' ); ?>"
2601
+ name="<?php echo $this->get_field_name( 'target' ); ?>"
2602
+ type="text"
2603
+ value="<?php echo esc_attr( $target ); ?>" /></label>
2604
+ </p>
2605
+ <p>
2606
+ <label for="<?php echo $this->get_field_id( 'rel' ); ?>"><?php _e( 'Rel Attribut:',
2607
  FB_RSSI_TEXTDOMAIN ) ?>
2608
+ <input class="widefat"
2609
+ id="<?php echo $this->get_field_id( 'rel' ); ?>"
2610
+ name="<?php echo $this->get_field_name( 'rel' ); ?>"
2611
+ type="text"
2612
+ value="<?php echo esc_attr( $rel ); ?>" /></label>
2613
+ </p>
2614
+ <p>
2615
+ <label for="<?php echo $this->get_field_id( 'desc4title' ); ?>"><?php _e( 'Desc4Title:',
2616
  FB_RSSI_TEXTDOMAIN ) ?>
2617
+ <select id="<?php echo $this->get_field_id( 'desc4title' ); ?>"
2618
+ name="<?php echo $this->get_field_name( 'desc4title' ); ?>">
2619
+ <option value="0"<?php if ( ! $desc4title ) {
2620
  echo ' selected="selected"';
2621
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2622
+ <option value="1"<?php if ( $desc4title ) {
2623
  echo ' selected="selected"';
2624
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2625
+ </select>
2626
+ </label>
2627
+ <br />
2628
+ <small><?php _e( 'Description for title-Attribut on Title-Link', FB_RSSI_TEXTDOMAIN ); ?></small>
2629
+ </p>
2630
+ <p>
2631
+ <label for="<?php echo $this->get_field_id( 'charsetscan' ); ?>"><?php _e( 'Charsetscan:',
2632
  FB_RSSI_TEXTDOMAIN ) ?>
2633
+ <select id="<?php echo $this->get_field_id( 'charsetscan' ); ?>"
2634
+ name="<?php echo $this->get_field_name( 'charsetscan' ); ?>">
2635
+ <option value="0"<?php if ( ! $charsetscan ) {
2636
  echo ' selected="selected"';
2637
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2638
+ <option value="1"<?php if ( $charsetscan ) {
2639
  echo ' selected="selected"';
2640
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2641
+ </select>
2642
+ </label>
2643
+ </p>
2644
+ <p>
2645
+ <label for="<?php echo $this->get_field_id( 'debug' ); ?>"><?php _e( 'Debug mode:',
2646
  FB_RSSI_TEXTDOMAIN ) ?>
2647
+ <select id="<?php echo $this->get_field_id( 'debug' ); ?>"
2648
+ name="<?php echo $this->get_field_name( 'debug' ); ?>">
2649
+ <option value="0"<?php if ( ! $debug ) {
2650
  echo ' selected="selected"';
2651
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2652
+ <option value="1"<?php if ( $debug ) {
2653
  echo ' selected="selected"';
2654
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2655
+ </select>
2656
+ </label>
2657
+ </p>
2658
+ <p>
2659
+ <label for="<?php echo $this->get_field_id( 'before_noitems' ); ?>"><?php _e( 'Before <em>No</em> Items Message (HTML):',
2660
  FB_RSSI_TEXTDOMAIN ) ?>
2661
+ <input class="widefat code"
2662
+ id="<?php echo $this->get_field_id( 'before_noitems' ); ?>"
2663
+ name="<?php echo $this->get_field_name( 'before_noitems' ); ?>"
2664
+ type="text"
2665
+ value="<?php echo $before_noitems; ?>" /></label>
2666
+ </p>
2667
+ <p>
2668
+ <label for="<?php echo $this->get_field_id( 'noitems' ); ?>"><?php _e( '<em>No</em> Items Message:',
2669
  FB_RSSI_TEXTDOMAIN ) ?>
2670
+ <input class="widefat"
2671
+ id="<?php echo $this->get_field_id( 'noitems' ); ?>"
2672
+ name="<?php echo $this->get_field_name( 'noitems' ); ?>"
2673
+ type="text"
2674
+ value="<?php echo esc_attr( $noitems ); ?>" /></label>
2675
+ </p>
2676
+ <p>
2677
+ <label for="<?php echo $this->get_field_id( 'after_noitems' ); ?>"><?php _e( 'After <em>No</em> Items Message (HTML):',
2678
  FB_RSSI_TEXTDOMAIN ) ?>
2679
+ <input class="widefat code"
2680
+ id="<?php echo $this->get_field_id( 'after_noitems' ); ?>"
2681
+ name="<?php echo $this->get_field_name( 'after_noitems' ); ?>"
2682
+ type="text"
2683
+ value="<?php echo $after_noitems; ?>" /></label>
2684
+ </p>
2685
+ <p>
2686
+ <label for="<?php echo $this->get_field_id( 'before_error' ); ?>"><?php _e( 'Before Error Message (HTML):',
2687
  FB_RSSI_TEXTDOMAIN ) ?>
2688
+ <input class="widefat code"
2689
+ id="<?php echo $this->get_field_id( 'before_error' ); ?>"
2690
+ name="<?php echo $this->get_field_name( 'before_error' ); ?>"
2691
+ type="text"
2692
+ value="<?php echo $before_error; ?>" /></label>
2693
+ </p>
2694
+ <p>
2695
+ <label for="<?php echo $this->get_field_id( 'error' ); ?>"><?php _e( 'Error Message:',
2696
  FB_RSSI_TEXTDOMAIN ) ?>
2697
+ <input class="widefat"
2698
+ id="<?php echo $this->get_field_id( 'error' ); ?>"
2699
+ name="<?php echo $this->get_field_name( 'error' ); ?>"
2700
+ type="text"
2701
+ value="<?php echo esc_attr( $error ); ?>" /></label>
2702
+ </p>
2703
+ <p>
2704
+ <label for="<?php echo $this->get_field_id( 'after_error' ); ?>"><?php _e( 'After Error Message (HTML):',
2705
  FB_RSSI_TEXTDOMAIN ) ?>
2706
+ <input class="widefat code"
2707
+ id="<?php echo $this->get_field_id( 'after_error' ); ?>"
2708
+ name="<?php echo $this->get_field_name( 'after_error' ); ?>"
2709
+ type="text"
2710
+ value="<?php echo $after_error; ?>" /></label>
2711
+ </p>
2712
+ <p>
2713
+ <label for="<?php echo $this->get_field_id( 'paging' ); ?>"><?php _e( 'Pagination:',
2714
  FB_RSSI_TEXTDOMAIN ) ?>
2715
+ <select id="<?php echo $this->get_field_id( 'paging' ); ?>"
2716
+ name="<?php echo $this->get_field_name( 'paging' ); ?>">
2717
+ <option value="0"<?php if ( ! $paging ) {
2718
  echo ' selected="selected"';
2719
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2720
+ <option value="1"<?php if ( $paging ) {
2721
  echo ' selected="selected"';
2722
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2723
+ </select>
2724
+ </label>
2725
+ </p>
2726
+ <p>
2727
+ <label for="<?php echo $this->get_field_id( 'prev_paging_link' ); ?>"><?php _e( 'Previous Pagination Link String:',
2728
  FB_RSSI_TEXTDOMAIN ) ?>
2729
+ <input class="widefat"
2730
+ id="<?php echo $this->get_field_id( 'prev_paging_link' ); ?>"
2731
+ name="<?php echo $this->get_field_name( 'prev_paging_link' ); ?>"
2732
+ type="text"
2733
+ value="<?php echo esc_attr( $prev_paging_link ); ?>" /></label>
2734
+ </p>
2735
+ <p>
2736
+ <label for="<?php echo $this->get_field_id( 'next_paging_link' ); ?>"><?php _e( 'Next Pagination Link String:',
2737
  FB_RSSI_TEXTDOMAIN ) ?>
2738
+ <input class="widefat"
2739
+ id="<?php echo $this->get_field_id( 'next_paging_link' ); ?>"
2740
+ name="<?php echo $this->get_field_name( 'next_paging_link' ); ?>"
2741
+ type="text"
2742
+ value="<?php echo esc_attr( $next_paging_link ); ?>" /></label>
2743
+ </p>
2744
+ <p>
2745
+ <label for="<?php echo $this->get_field_id( 'prev_paging_title' ); ?>"><?php _e( 'Previous Pagination Title String:',
2746
  FB_RSSI_TEXTDOMAIN ) ?>
2747
+ <input class="widefat"
2748
+ id="<?php echo $this->get_field_id( 'prev_paging_title' ); ?>"
2749
+ name="<?php echo $this->get_field_name( 'prev_paging_title' ); ?>"
2750
+ type="text"
2751
+ value="<?php echo esc_attr( $prev_paging_title ); ?>" /></label>
2752
+ </p>
2753
+ <p>
2754
+ <label for="<?php echo $this->get_field_id( 'next_paging_title' ); ?>"><?php _e( 'Next Pagination Title String:',
2755
  FB_RSSI_TEXTDOMAIN ) ?>
2756
+ <input class="widefat"
2757
+ id="<?php echo $this->get_field_id( 'next_paging_title' ); ?>"
2758
+ name="<?php echo $this->get_field_name( 'next_paging_title' ); ?>"
2759
+ type="text"
2760
+ value="<?php echo esc_attr( $next_paging_title ); ?>" /></label>
2761
+ </p>
2762
+ <p>
2763
+ <label for="<?php echo $this->get_field_id( 'use_simplepie' ); ?>"><?php _e( 'Use SimplePie class:',
2764
  FB_RSSI_TEXTDOMAIN ) ?>
2765
+ <select id="<?php echo $this->get_field_id( 'use_simplepie' ); ?>"
2766
+ name="<?php echo $this->get_field_name( 'use_simplepie' ); ?>">
2767
+ <option value="0"<?php if ( ! $use_simplepie ) {
2768
  echo ' selected="selected"';
2769
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2770
+ <option value="1"<?php if ( $use_simplepie ) {
2771
  echo ' selected="selected"';
2772
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2773
+ </select>
2774
+ </label>
2775
+ </p>
2776
+ <p>
2777
+ <label for="<?php echo $this->get_field_id( 'view' ); ?>"><?php _e( 'Echo/Return:',
2778
  FB_RSSI_TEXTDOMAIN ) ?>
2779
+ <select id="<?php echo $this->get_field_id( 'view' ); ?>"
2780
+ name="<?php echo $this->get_field_name( 'view' ); ?>">
2781
+ <option value="0"<?php if ( ! $view ) {
2782
  echo ' selected="selected"';
2783
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2784
+ <option value="1"<?php if ( $view ) {
2785
  echo ' selected="selected"';
2786
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2787
+ </select>
2788
+ </label>
2789
+ </p>
2790
+ <p>
2791
+ <label for="<?php echo $this->get_field_id( 'random_sort' ); ?>"><?php _e( 'Random Order:',
2792
  FB_RSSI_TEXTDOMAIN ) ?>
2793
+ <select id="<?php echo $this->get_field_id( 'random_sort' ); ?>"
2794
+ name="<?php echo $this->get_field_name( 'random_sort' ); ?>">
2795
+ <option value="0"<?php if ( ! $random_sort ) {
2796
  echo ' selected="selected"';
2797
  } ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
2798
+ <option value="1"<?php if ( $random_sort ) {
2799
  echo ' selected="selected"';
2800
  } ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
2801
+ </select>
2802
+ </label>
2803
+ </p>
2804
+ <p>
2805
+ <label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Order for Date, Title, Creator, Description:',
2806
+ FB_RSSI_TEXTDOMAIN ) ?>
2807
+ <input class="widefat code"
2808
+ id="<?php echo $this->get_field_id( 'order' ); ?>"
2809
+ name="<?php echo $this->get_field_name( 'order' ); ?>"
2810
+ type="text"
2811
+ value="<?php echo $order; ?>" /></label>
2812
+ <br />
2813
+ <small><?php _e( 'Use a comma separated string for your order. On default, it is',
2814
+ FB_RSSI_TEXTDOMAIN ); ?> <code>date,title,creator,description</code></small>
2815
+ </p>
2816
  <?php
 
2817
  }
2818
  }
2819
 
2820
+ add_action( 'widgets_init', function() { register_widget("RSSImport_Widget"); } );
 
2821
  } // end if class wp_widget exists