RSSImport - Version 4.4.16

Version Description

Download this release

Release Info

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

Code changes from version 4.4.15 to 4.4.16

Files changed (2) hide show
  1. readme.txt +5 -2
  2. rssimport.php +1438 -1440
readme.txt CHANGED
@@ -6,8 +6,8 @@ Author URI: http://bueltge.de/
6
  Donate link: http://bueltge.de/wunschliste/
7
  Tags: rss, post, content, post, feed
8
  Requires at least: 1.5
9
- Tested up to: 4.3
10
- Stable tag: 4.4.15
11
 
12
  Import and display feeds on your blog, using PHP in your templates or Shortcode in your posts and pages.
13
 
@@ -142,6 +142,9 @@ or
142
  1. Widget support
143
 
144
  == Changelog ==
 
 
 
145
  = v4.4.15 (08/22/2014) =
146
  * Added `%picture_url%` for `before_desc`, `after_desc`, `start_item` and `end_item`
147
 
6
  Donate link: http://bueltge.de/wunschliste/
7
  Tags: rss, post, content, post, feed
8
  Requires at least: 1.5
9
+ Tested up to: 4.4
10
+ Stable tag: 4.4.16
11
 
12
  Import and display feeds on your blog, using PHP in your templates or Shortcode in your posts and pages.
13
 
142
  1. Widget support
143
 
144
  == Changelog ==
145
+ = v4.4.16 (09/24/2015) =
146
+ * Fix the widget PHP4 style
147
+
148
  = v4.4.15 (08/22/2014) =
149
  * Added `%picture_url%` for `before_desc`, `after_desc`, `start_item` and `end_item`
150
 
rssimport.php CHANGED
@@ -1,1441 +1,1439 @@
1
- <?php
2
- /**
3
- * @package WP-RSSImport
4
- * @author Frank B&uuml;ltge &amp; Novaclic
5
- * @version 4.4.14
6
- */
7
-
8
- /**
9
- * Plugin Name: WP-RSSImport
10
- * Plugin URI: http://bueltge.de/wp-rss-import-plugin/55/
11
- * Text Domain: rssimport
12
- * Domain Path: /languages
13
- * Description: Import and display Feeds in your blog, use the function RSSImport(), a Widget or Shortcode [RSSImport]. Please see the new <a href="http://wordpress.org/extend/plugins/rss-import/">possibilities</a>.
14
- * Author: Frank B&uuml;ltge, novaclic, took77
15
- * Version: 4.4.15
16
- * License: GPLv3
17
- * Last change: 08/22/2014
18
- */
19
-
20
- /*
21
- ------------------------------------------------------------
22
- ACKNOWLEDGEMENTS
23
- ------------------------------------------------------------
24
- Original and Idea: Dave Wolf, http://www.davewolf.net
25
- Thx to Thomas Fischer, http://www.securityfocus.de and
26
- Gunnar Tillmann http://www.gunnart.de for a better code
27
-
28
- Paging: Ilya Shindyapin, http://skookum.com
29
-
30
- ------------------------------------------------------------
31
- USAGE: Use following code with a PHP-Plugin for WordPress:
32
- Example: <?php RSSImport(10, "http://bueltge.de/feed/"); ?>
33
- ------------------------------------------------------------
34
- */
35
-
36
- //avoid direct calls to this file, because now WP core and framework has been used
37
- if ( ! function_exists('add_action') ) {
38
- header('Status: 403 Forbidden');
39
- header('HTTP/1.1 403 Forbidden');
40
- exit();
41
- }
42
-
43
- if ( function_exists('add_action') ) {
44
- //WordPress definitions
45
- if ( !defined('WP_CONTENT_URL') )
46
- define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
47
- if ( !defined('WP_CONTENT_DIR') )
48
- define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
49
- if ( !defined('WP_PLUGIN_URL') )
50
- define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
51
- if ( !defined('WP_PLUGIN_DIR') )
52
- define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
53
- if ( !defined('PLUGINDIR') )
54
- define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
55
- if ( !defined('WP_LANG_DIR') )
56
- define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages');
57
-
58
- // plugin definitions
59
- define( 'FB_RSSI_BASENAME', plugin_basename(__FILE__) );
60
- define( 'FB_RSSI_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) );
61
- define( 'FB_RSSI_TEXTDOMAIN', 'rssimport' );
62
- define( 'FB_RSSI_QUICKTAG', TRUE );
63
- }
64
-
65
- function RSSImport_textdomain() {
66
-
67
- if ( function_exists('load_plugin_textdomain') )
68
- load_plugin_textdomain( FB_RSSI_TEXTDOMAIN, FALSE, dirname( FB_RSSI_BASENAME ) . '/languages');
69
- }
70
-
71
- if ( ! function_exists('esc_attr') ) {
72
- function esc_attr( $text ) {
73
- return attribute_escape( $text );
74
- }
75
- }
76
-
77
- if ( ! function_exists('esc_url') ) {
78
- function esc_url($text ) {
79
- return clean_url($text);
80
- }
81
- }
82
-
83
-
84
- // cache and error report
85
- //define('MAGPIE_CACHE_ON', FALSE); // Cache off
86
- if ( ! defined('MAGPIE_CACHE_AGE') )
87
- define('MAGPIE_CACHE_AGE', '60*60'); // in sec, one hour
88
- // error reporting
89
- //error_reporting(E_ALL);
90
-
91
- function RSSImport(
92
- $display = 5,
93
- $feedurl = 'http://bueltge.de/feed/',
94
- $before_desc = '',
95
- $displaydescriptions = 0,
96
- $after_desc = '',
97
- $html = 0,
98
- $truncatedescchar = 200,
99
- $truncatedescstring = ' ... ',
100
- $truncatetitlechar = '',
101
- $truncatetitlestring = ' ... ',
102
- $before_date = ' <small>',
103
- $date = 0,
104
- $after_date = '</small>',
105
- $date_format = '',
106
- $before_creator = ' <small>',
107
- $creator = 0,
108
- $after_creator = '</small>',
109
- $start_items = '<ul>',
110
- $end_items = '</ul>',
111
- $start_item = '<li>',
112
- $end_item = '</li>',
113
- $target = '',
114
- $rel = '',
115
- $desc4title = 0,
116
- $charsetscan = 0,
117
- $debug = 0,
118
- $before_noitems = '<p>',
119
- $noitems = 'No items, feed is empty.',
120
- $after_noitems = '</p>',
121
- $before_error = '<p>',
122
- $error = 'Error: Feed has an error or is not valid',
123
- $after_error = '</p>',
124
- $paging = 0,
125
- $prev_paging_link = '&laquo; Previous',
126
- $next_paging_link = 'Next &raquo;',
127
- $prev_paging_title = 'more items',
128
- $next_paging_title = 'more items',
129
- $use_simplepie = 1,
130
- $view = 1
131
- ) {
132
-
133
- // replace for yahoo pipes urls
134
- $feedurl = str_replace('&#038;', '&', $feedurl);
135
-
136
- $display = (int) $display;
137
- $displaydescriptions = (int) $displaydescriptions;
138
- $html = (int) $html;
139
- $truncatedescchar = (int) $truncatedescchar;
140
- $truncatetitlechar = (int) $truncatetitlechar;
141
- $date = (int) $date;
142
- if ( $date_format == '' )
143
- $date_format = get_option('date_format');
144
- $creator = (int) $creator;
145
- $charsetscan = (int) $charsetscan;
146
- $debug = (int) $debug;
147
- $paging = (int) $paging;
148
- $use_simplepie = (int) $use_simplepie;
149
- $view = (int) $view;
150
-
151
- if ($use_simplepie) {
152
- if ( ! class_exists('SimplePie') ) {
153
- if ( file_exists(ABSPATH . WPINC . '/class-simplepie.php') ) {
154
- @require_once (ABSPATH . WPINC . '/class-simplepie.php');
155
- } else {
156
- die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The WordPress file "class-simplepie.php" with class SimplePie could not be included.'));
157
- }
158
- }
159
- } else {
160
- // For function fetch_rss from wp-core
161
- if ( file_exists(ABSPATH . WPINC . '/rss.php') ) {
162
- @require_once (ABSPATH . WPINC . '/rss.php');
163
- // It's Wordpress 2.x. since it has been loaded successfully
164
- } elseif (file_exists(ABSPATH . WPINC . '/rss-functions.php')) {
165
- @require_once (ABSPATH . WPINC . '/rss-functions.php');
166
- // In Wordpress < 2.1
167
- } else {
168
- die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The Wordpress file "rss-functions.php" or "rss.php" could not be included.'));
169
- }
170
- }
171
-
172
- $display = intval($display);
173
- $page = ( ( !empty( $_GET['rsspage'] ) && intval($_GET['rsspage']) > 0 ) ? intval($_GET['rsspage']) : 1 );
174
- $truncatedescchar = intval($truncatedescchar);
175
- $truncatetitlechar = intval($truncatetitlechar);
176
- if ($use_simplepie)
177
- $echo = '<!--via SimplePie with RSSImport-->';
178
- else
179
- $echo = '<!--via MagpieRSS with RSSImport-->';
180
-
181
- if ($charsetscan) {
182
- // read in file for search charset
183
- if ( function_exists('file_get_contents') ) {
184
- ini_set('default_socket_timeout', 10);
185
- $a = file_get_contents($feedurl);
186
- // for better performance, if the server accepts the method
187
- // $a = file_get_contents($feedurl, FALSE, NULL, 0, 50);
188
- }
189
- }
190
-
191
- if ($use_simplepie)
192
- $rss = fetch_feed($feedurl);
193
- else
194
- $rss = fetch_rss($feedurl);
195
-
196
- if ( $rss && ! is_wp_error($rss) ) {
197
-
198
- // the follow print_r list all items in array, for debug purpose
199
- if ( $debug ) {
200
- print('FeedURL: ' . $feedurl);
201
- print('<pre>');
202
- print_r($rss);
203
- print('</pre>');
204
- if ( ! defined('MAGPIE_CACHE_ON') )
205
- define('MAGPIE_CACHE_ON', FALSE);
206
- }
207
-
208
- if ( isset($target) && $target != '' )
209
- $target = ' target="_' . $target . '"';
210
-
211
- if ( isset($rel) && $rel != '' )
212
- $rel = ' rel="' . $rel . '"';
213
-
214
- $displayitems = $display;
215
- $displaylimit = ($page * $display);
216
- $display = (($page-1) * $display);
217
- $nextitems = TRUE;
218
- $previousitems = FALSE;
219
- if ( $page > 1 )
220
- $previousitems = TRUE;
221
-
222
- while($display < $displaylimit) {
223
-
224
- if ( $use_simplepie && (1 ==$paging) )
225
- $items = $rss->get_items();
226
- elseif ($use_simplepie)
227
- $items = $rss->get_items(0, $displayitems);
228
- else
229
- $items = $rss->items;
230
-
231
- if ( array_key_exists( $display, $items ) ) {
232
-
233
- if ($use_simplepie)
234
- $item = $rss->get_item($display);
235
- else
236
- $item = $rss->items[$display];
237
- // import title
238
- if ($use_simplepie)
239
- $title = esc_attr( strip_tags( $item->get_title() ) );
240
- elseif ( isset($item['title']) )
241
- $title = esc_attr( strip_tags( $item['title'] ) );
242
- // import link
243
- if ($use_simplepie)
244
- $href = wp_filter_kses( $item->get_link() );
245
- elseif ( isset($item['link']) )
246
- $href = wp_filter_kses( $item['link'] );
247
- // import picture_url
248
- $picture_url = '';
249
- if ($use_simplepie) {
250
- if ( $enclosure = $item->get_enclosure() ) {
251
- $picture_url = wp_filter_kses( $enclosure->get_thumbnail() );
252
- }
253
- }
254
-
255
- $start_item_temp = str_replace('%title%', $title, $start_item);
256
- $start_item_temp = str_replace('%href%', $href, $start_item_temp);
257
- $start_item_temp = str_replace('%picture_url%', $picture_url, $start_item_temp);
258
- $echo .= $start_item_temp;
259
-
260
- // import date
261
- if ($use_simplepie && $date)
262
- $pubDate = date_i18n( $date_format, strtotime( $item->get_date() ) );
263
- elseif ($date && isset($item['pubdate']) )
264
- $pubDate = date_i18n( $date_format, strtotime( $item['pubdate'] ) );
265
- // import creator
266
- if ($use_simplepie && $creator) {
267
- $creator = $item->get_author();
268
- if ( is_object($creator) ) {
269
- $creator = $creator->get_name();
270
- $creator = ' <cite>' . esc_html( strip_tags( $creator ) ) . '</cite>';
271
- }
272
- } elseif ($creator && isset($item['dc']['creator']) ) {
273
- $creator = wp_specialchars( $item['dc']['creator'] );
274
- } elseif ($creator && isset($item['creator']) ) {
275
- $creator = wp_specialchars( $item['creator'] );
276
- }
277
- // import desc
278
- if ( $use_simplepie && $displaydescriptions && $html )
279
- $desc = @html_entity_decode( $item->get_content(), ENT_QUOTES, get_option('blog_charset') ); // For import with HTML
280
- elseif ( $use_simplepie && $displaydescriptions && !$html )
281
- $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); // For import without HTML
282
- elseif ( $displaydescriptions && $html && isset($item['content']['encoded']) && $item['content']['encoded'] != 'A' )
283
- $desc = $item['content']['encoded']; // For import with HTML
284
- elseif ( $displaydescriptions && $html && isset($item['content']['atom_content']) && $item['content']['atom_content'] != 'A' )
285
- $desc = $item['content']['atom_content']; // For import with HTML
286
- elseif ( $displaydescriptions && $html && isset($item['content']) && !is_array($item['content']) )
287
- $desc = $item['content'];
288
- elseif ( $displaydescriptions && $html && isset($item['description']) )
289
- $desc = $item['description'];
290
- elseif ( $displaydescriptions && !$html && isset($item['description']) )
291
- $desc = wp_specialchars(strip_tags($item['description'])); // For import without HTML
292
-
293
- if ( isset($a) && eregi('ISO', $a) ) {
294
- if ($debug)
295
- $echo .= 'ISO Feed' . "\n";
296
- if ( isset($title) )
297
- isodec($title);
298
- if ( isset($creator) )
299
- isodec($creator);
300
- if ( isset($desc) )
301
- isodec($desc);
302
- } else {
303
- if ($debug)
304
- $echo .= 'NonISO Feed' . "\n";
305
- if ( isset($title) )
306
- utf8dec($title);
307
- if ( isset($creator) )
308
- utf8dec($creator);
309
- if ( isset($desc) )
310
- utf8dec($desc);
311
- }
312
-
313
- if ( isset($title) )
314
- all_convert($title);
315
- if ( isset($creator) )
316
- all_convert($creator);
317
- if ( isset($desc) )
318
- all_convert($desc);
319
-
320
- if ( isset($title) && $truncatetitlechar && (strlen($title) > $truncatetitlechar) ) {
321
- $title = wp_html_excerpt($title, $truncatetitlechar) . $truncatetitlestring;
322
- }
323
-
324
- if ( isset($desc) && $truncatedescchar && (strlen($desc) > $truncatedescchar) ) {
325
- $desc = wp_html_excerpt($desc, $truncatedescchar) . $truncatedescstring;
326
- }
327
-
328
- if ( $desc4title ) {
329
- if ($use_simplepie)
330
- $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); // For import without HTML
331
- else if (isset($item['description']))
332
- $desc = wp_specialchars(strip_tags($item['description']));
333
- else
334
- $desc ='';
335
- $atitle = wp_html_excerpt($desc, $truncatedescchar) . $truncatedescstring;
336
- } else {
337
- $atitle = $title;
338
- }
339
-
340
- $echo .= '<a' . $target . $rel . ' href="' . $href . '" title="'. $atitle . '">' . $title . '</a>';
341
- if ( isset($pubDate) && $date && $pubDate != '' )
342
- $echo .= $before_date . $pubDate . $after_date;
343
- if ( isset($creator) && $creator && $creator != '' )
344
- $echo .= $before_creator . $creator . $after_creator;
345
- if ( isset($desc) && $displaydescriptions && $desc != '' ) {
346
- $after_desc_temp = stripslashes_deep( $after_desc );
347
- $after_desc_temp = str_replace('%title%', $title, $after_desc_temp);
348
- $after_desc_temp = str_replace('%href%', $href, $after_desc_temp);
349
- $after_desc_temp = str_replace('%picture_url%', $picture_url, $after_desc_temp);
350
- $before_desc_temp = str_replace('%title%', $title, $before_desc);
351
- $before_desc_temp = str_replace('%href%', $href, $before_desc_temp);
352
- $before_desc_temp = str_replace('%picture_url%', $picture_url, $before_desc_temp);
353
- $echo .= $before_desc_temp . $desc . $after_desc_temp;
354
- }
355
- $end_item_temp = str_replace('%title%', $title, $end_item);
356
- $end_item_temp = str_replace('%href%', $href, $end_item_temp);
357
- $end_item_temp = str_replace('%picture_url%', $picture_url, $end_item_temp);
358
- $echo .= $end_item_temp;
359
- } else {
360
- $nextitems = FALSE;
361
- }
362
-
363
- $display++;
364
- }
365
-
366
- if (strip_tags($echo)) { // novaclic: needed to filter out false content madeof tags alone (html comments, html tags, ...)
367
- $echo = wptexturize($start_items . $echo . $end_items);
368
- } else
369
- $echo = wptexturize($before_noitems . $noitems . $after_noitems);
370
-
371
- } else {
372
- if ( empty($rss->ERROR) )
373
- $rss->ERROR = NULL;
374
- $echo = wptexturize($before_error . $error . $rss->ERROR . $after_error);
375
- }
376
-
377
- if ($paging) {
378
- $echo .= '<div class="rsspaging">';
379
- if ($previousitems)
380
- $echo .= '<a href="' . add_query_arg( 'rsspage', ($page-1) ) . '" class="rsspaging_prev" title="' . $prev_paging_title . '">' . $prev_paging_link . '</a>';
381
- if ($nextitems)
382
- $echo .= '<a href="' . add_query_arg( 'rsspage', ($page+1) ) . '" class="rsspaging_next" title="' . $next_paging_title . '">' . $next_paging_link .'</a>';
383
- $echo .= '<br style="clear: both" />';
384
- $echo .= '</div>';
385
- }
386
-
387
- if ($view)
388
- echo $echo;
389
- else
390
- return $echo;
391
- }
392
-
393
- function utf8dec($s_String) {
394
- if ( version_compare(phpversion(), '5.0.0', '>=') )
395
- $s_String = html_entity_decode(htmlentities( $s_String." ", ENT_COMPAT, 'UTF-8') );
396
- else
397
- $s_String = RSSImport_html_entity_decode_php4( htmlentities($s_String." ") );
398
- return substr($s_String, 0, strlen($s_String)-1);
399
- }
400
-
401
- function isodec($s_String) {
402
- if ( version_compare(phpversion(), '5.0.0', '>=') )
403
- $s_String = html_entity_decode(htmlentities($s_String." ", ENT_COMPAT, 'ISO-8859-1'));
404
- else
405
- $s_String = RSSImport_html_entity_decode_php4( htmlentities($s_String." ") );
406
- return substr($s_String, 0, strlen($s_String)-1);
407
- }
408
-
409
- function all_convert($s_String) {
410
-
411
- // Array for entities
412
- $umlaute = array('„','“','–',' \&#34;','&#8211;','&#8212;','&#8216;','&#8217;','&#8220;','&#8221;','&#8222;','&#8226;','&#8230;' ,
413
- '�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,
414
- '�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�','�','�','�','�','�','�','�','�',
415
- '�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',
416
- '�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',
417
- '�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
418
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
419
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
420
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
421
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
422
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
423
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
424
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
425
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
426
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
427
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
428
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
429
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
430
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
431
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
432
- utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),chr(128),chr(129),chr(130),
433
- chr(131),chr(132),chr(133),chr(134),chr(135),chr(136),chr(137),chr(138),chr(139),chr(140),chr(141),chr(142),chr(143),chr(144),chr(145),
434
- chr(146),chr(147),chr(148),chr(149),chr(150),chr(151),chr(152),chr(153),chr(154),chr(155),chr(156),chr(157),chr(158),chr(159),chr(160),
435
- chr(161),chr(162),chr(163),chr(164),chr(165),chr(166),chr(167),chr(168),chr(169),chr(170),chr(171),chr(172),chr(173),chr(174),chr(175),
436
- chr(176),chr(177),chr(178),chr(179),chr(180),chr(181),chr(182),chr(183),chr(184),chr(185),chr(186),chr(187),chr(188),chr(189),chr(190),
437
- chr(191),chr(192),chr(193),chr(194),chr(195),chr(196),chr(197),chr(198),chr(199),chr(200),chr(201),chr(202),chr(203),chr(204),chr(205),
438
- chr(206),chr(207),chr(208),chr(209),chr(210),chr(211),chr(212),chr(213),chr(214),chr(215),chr(216),chr(217),chr(218),chr(219),chr(220),
439
- chr(221),chr(222),chr(223),chr(224),chr(225),chr(226),chr(227),chr(228),chr(229),chr(230),chr(231),chr(232),chr(233),chr(234),chr(235),
440
- chr(236),chr(237),chr(238),chr(239),chr(240),chr(241),chr(242),chr(243),chr(244),chr(245),chr(246),chr(247),chr(248),chr(249),chr(250),
441
- chr(251),chr(252),chr(253),chr(254),chr(255),chr(256));
442
- $htmlcode = array('&bdquo;','&ldquo;','&ndash;',' &#34;','&ndash;','&mdash;','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bdquo;','&bull;' ,
443
- '&hellip;','&euro;','&sbquo;','&fnof;','&bdquo;','&hellip;','&dagger;','&Dagger;','&circ;','&permil;','&Scaron;','&lsaquo;','&OElig;',
444
- '&#x017D;','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bull;','&ndash;','&mdash;','&tilde;','&trade;','&scaron;','&rsaquo;','&oelig;',
445
- '&#x017E;','&Yuml;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;',
446
- '&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&supl;','&ordm;','&raquo;',
447
- '&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;',
448
- '&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;',
449
- '&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;',
450
- '&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;',
451
- '&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;',
452
- '&yacute;','&thorn;','&yuml;','&euro;','&sbquo;','&fnof;','&bdquo;','&hellip;','&dagger;','&Dagger;','&circ;','&permil;','&Scaron;',
453
- '&lsaquo;','&OElig;','&#x017D;','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bull;','&ndash;','&mdash;','&tilde;','&trade;','&scaron;',
454
- '&rsaquo;','&oelig;','&#x017E;','&Yuml;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;',
455
- '&laquo;','&not;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&supl;',
456
- '&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;',
457
- '&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;',
458
- '&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;',
459
- '&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;',
460
- '&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;',
461
- '&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;','&euro;','','&sbquo;','&fnof;','&bdquo;','&hellip;','&dagger;','&Dagger;','&circ;',
462
- '&permil;','&Scaron;','&lsaquo;','&OElig;','','&#x017D;','','','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bull;','&ndash;','&mdash;',
463
- '&tilde;','&trade;','&scaron;','&rsaquo;','&oelig;','','&#x017E;','&Yuml;','&nbsp;','&iexcl;','&iexcl;','&iexcl;','&iexcl;','&yen;',
464
- '&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','�&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;',
465
- '&acute;','&micro;','&para;','&middot;','&cedil;','&supl;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;',
466
- '&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;',
467
- '&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;',
468
- '&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;',
469
- '&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;',
470
- '&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;');
471
- //$s_String = str_replace($umlaute, $htmlcode, $s_String);
472
- if ( version_compare(phpversion(), '5.0.0', '>=') )
473
- $s_String = utf8_encode( html_entity_decode( str_replace($umlaute, $htmlcode, $s_String) ) );
474
- else
475
- $s_String = utf8_encode( RSSImport_html_entity_decode_php4( str_replace($umlaute, $htmlcode, $s_String) ) );
476
-
477
- // &hellip; , &#8230;
478
- $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\xA6~', '&hellip;', $s_String);
479
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\xA6~', '&hellip;', $s_String);
480
- $s_String = preg_replace('~\xD0\xB2\xD0\x82\xC2\xA6~', '&hellip;', $s_String);
481
-
482
- // &mdash; , &#8212;
483
- $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9D~', '&mdash;', $s_String);
484
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '&mdash;', $s_String);
485
- $s_String = preg_replace('~\xD0\xB2\xD0\x82\xE2\x80\x9D~', '&mdash;', $s_String);
486
-
487
- // &ndash; , &#8211;
488
- $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9C~', '&ndash;', $s_String);
489
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC5\x93~', '&ndash;', $s_String);
490
- $s_String = preg_replace('~\xD0\xB2\xD0\x82\xE2\x80\x9C~', '&ndash;', $s_String);
491
-
492
- // &rsquo; , &#8217;
493
- $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x84\xA2~', '&rsquo;', $s_String);
494
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '&rsquo;', $s_String);
495
- $s_String = preg_replace('~\xD0\xB2\xD0\x82\xE2\x84\xA2~', '&rsquo;', $s_String);
496
- $s_String = preg_replace('~\xD0\xBF\xD1\x97\xD0\x85~', '&rsquo;', $s_String);
497
-
498
- // &lsquo; , &#8216;
499
- $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xCB\x9C~', '&lsquo;', $s_String);
500
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x8B\xC5\x93~', '&lsquo;', $s_String);
501
-
502
- // &rdquo; , &#8221;
503
- $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '&rdquo;', $s_String);
504
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\x9D~', '&rdquo;', $s_String);
505
- $s_String = preg_replace('~\xD0\xB2\xD0\x82\xD1\x9C~', '&rdquo;', $s_String);
506
-
507
- // &ldquo; , &#8220;
508
- $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC5\x93~', '&ldquo;', $s_String);
509
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x85\xE2\x80\x9C~', '&ldquo;', $s_String);
510
- $s_String = preg_replace('~\xD0\xB2\xD0\x82\xD1\x9A~', '&ldquo;', $s_String);
511
-
512
- // &trade; , &#8482;
513
- $s_String = preg_replace('~\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '&trade;', $s_String);
514
- $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x82\xAC\xC5\xBE\xC3\x82\xC2\xA2~', '&trade;', $s_String);
515
-
516
- // th
517
- $s_String = preg_replace('~t\xC3\x82\xC2\xADh~', 'th', $s_String);
518
-
519
- // .
520
- $s_String = preg_replace('~.\xD0\x92+~', '.', $s_String);
521
- $s_String = preg_replace('~.\xD0\x92~', '.', $s_String);
522
-
523
- // ,
524
- $s_String = preg_replace('~\x2C\xD0\x92~', ',', $s_String);
525
-
526
- return $s_String;
527
- }
528
-
529
- /**
530
- * Entfernt unvollstaendige Worte am Ende eines Strings.
531
- * @author Thomas Scholz <http://toscho.de>
532
- * @param $str Zeichenkette
533
- * @return string
534
- */
535
- function RSSImport_end_on_word($str) {
536
-
537
- $arr = explode( ' ', trim($str) );
538
- array_pop($arr);
539
-
540
- return rtrim( implode(' ', $arr), ',;');
541
- }
542
-
543
- function RSSImport_Shortcode($atts) {
544
- extract(
545
- shortcode_atts( array(
546
- 'display' => 5,
547
- 'feedurl' => 'http://bueltge.de/feed/',
548
- 'before_desc' => '<br />',
549
- 'displaydescriptions' => 0,
550
- 'after_desc' => '',
551
- 'html' => 0,
552
- 'truncatedescchar' => 200,
553
- 'truncatedescstring' => ' ... ',
554
- 'truncatetitlechar' => '',
555
- 'truncatetitlestring' => ' ... ',
556
- 'before_date' => ' <small>',
557
- 'date' => 0,
558
- 'after_date' => '</small>',
559
- 'date_format' => '',
560
- 'before_creator' => ' <small>',
561
- 'creator' => 0,
562
- 'after_creator' => '</small>',
563
- 'start_items' => '<ul>',
564
- 'end_items' => '</ul>',
565
- 'start_item' => '<li>',
566
- 'end_item' => '</li>',
567
- 'target' => '',
568
- 'rel' => '',
569
- 'desc4title' => 0,
570
- 'charsetscan' => 0,
571
- 'debug' => 0,
572
- 'before_noitems' => '<p>',
573
- 'noitems' => __('No items, feed is empty.', FB_RSSI_TEXTDOMAIN ),
574
- 'after_noitems' => '</p>',
575
- 'before_error' => '<p>',
576
- 'error' => __('Error: Feed has an error or is not valid', FB_RSSI_TEXTDOMAIN ),
577
- 'after_error' => '</p>',
578
- 'paging' => 0,
579
- 'prev_paging_link' => __( '&laquo; Previous', FB_RSSI_TEXTDOMAIN ),
580
- 'next_paging_link' => __( 'Next &raquo;', FB_RSSI_TEXTDOMAIN ),
581
- 'prev_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
582
- 'next_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
583
- 'use_simplepie' => 1,
584
- 'view' => 0
585
- ), $atts)
586
- );
587
- //var_dump($atts);
588
-
589
- $display = intval($display);
590
- if ( strtolower($html) == 'true')
591
- $html = 1;
592
- $html = intval($html);
593
- if ( strtolower($displaydescriptions) == 'true')
594
- $displaydescriptions = 1;
595
- $displaydescriptions = intval($displaydescriptions);
596
- if ( strtolower($truncatedescchar) == 'true')
597
- $truncatedescchar = 1;
598
- $truncatedescchar = intval($truncatedescchar);
599
- if ( strtolower($truncatetitlechar) == 'true')
600
- $truncatetitlechar = 1;
601
- $truncatetitlechar = intval($truncatetitlechar);
602
- if ( strtolower($date) == 'true')
603
- $date = 1;
604
- $date = intval($date);
605
- if ( strtolower($creator) == 'true')
606
- $creator = 1;
607
- $creator = intval($creator);
608
- if ( strtolower($charsetscan) == 'true')
609
- $charsetscan = 1;
610
- $charsetscan = intval($charsetscan);
611
- if ( strtolower($debug) == 'true')
612
- $debug = 1;
613
- $debug = intval($debug);
614
- if ( strtolower($paging) == 'true')
615
- $paging = 1;
616
- $paging = intval($paging);
617
- if ( strtolower($use_simplepie) == 'true')
618
- $use_simplepie = 1;
619
- $use_simplepie = intval($use_simplepie);
620
- $feedurl = html_entity_decode( $feedurl ); // novaclic: undo encoding due to wordpress WYSIWYG editor
621
-
622
- $return = RSSImport(
623
- $display, $feedurl,
624
- $before_desc, $displaydescriptions, $after_desc, $html,
625
- $truncatedescchar, $truncatedescstring,
626
- $truncatetitlechar, $truncatetitlestring,
627
- $before_date, $date, $after_date, $date_format,
628
- $before_creator, $creator, $after_creator,
629
- $start_items, $end_items,
630
- $start_item, $end_item,
631
- $target,
632
- $rel,
633
- $desc4title,
634
- $charsetscan, $debug,
635
- $before_noitems, $noitems, $after_noitems,
636
- $before_error, $error, $after_error,
637
- $paging, $prev_paging_link, $next_paging_link, $prev_paging_title, $next_paging_title,
638
- $use_simplepie,
639
- $view
640
- );
641
-
642
- return $return;
643
- }
644
-
645
- function RSSImport_shortcode_quot($pee) {
646
- global $shortcode_tags;
647
-
648
- if ( !empty($shortcode_tags) && is_array($shortcode_tags) ) {
649
- $tagnames = array_keys($shortcode_tags);
650
- $tagregexp = join( '|', array_map('preg_quote', $tagnames) );
651
- $pee = preg_replace('/\\s*?(\\[(' . $tagregexp . ')\\b.*?\\/?\\](?:.+?\\[\\/\\2\\])?)\\s*/s', '$1', $pee);
652
- }
653
-
654
- return $pee;
655
- }
656
-
657
-
658
- /**
659
- * add quicktag-button to editor
660
- */
661
-
662
- function RSSImport_insert_button() {
663
- global $pagenow;
664
-
665
- $post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
666
- if ( ! in_array( $pagenow, $post_page_pages ) )
667
- return;
668
-
669
- ?>
670
- <script type="text/javascript" charset="utf-8">
671
- /* Adding Quicktag buttons to the editor WordPress ver. 3.3 and above
672
- * - Button HTML ID (required)
673
- * - Button display, value="" attribute (required)
674
- * - Opening Tag (required)
675
- * - Closing Tag (required)
676
- * - Access key, accesskey="" attribute for the button (optional)
677
- * - Title, title="" attribute (optional)
678
- * - Priority/position on bar, 1-9 = first, 11-19 = second, 21-29 = third, etc. (optional)
679
- */
680
- var id = 'rssimport',
681
- text = '<?php _e( 'RSSImport', FB_RSSI_TEXTDOMAIN ); ?>',
682
- start = '[RSSImport display="5" feedurl="http://feedurl.com/" before_desc="<br />" displaydescriptions="TRUE" after_desc=" " ' +
683
- 'html="FALSE" truncatedescchar="200" truncatedescstring=" ... " truncatetitlechar="" truncatetitlestring=" ... " ' +
684
- 'before_date=" <small>" date="FALSE" after_date="</small>" date_format="" before_creator=" <small>" creator="FALSE" ' +
685
- 'after_creator="</small>" start_items="<ul>" end_items="</ul>" start_item="<li>" end_item="</li>" target="" rel="" ' +
686
- 'desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>" noitems="No items, feed is empty." ' +
687
- 'after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid" after_error="</p>" ' +
688
- 'paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;" prev_paging_title="more items" ' +
689
- 'next_paging_title="more items" use_simplepie="FALSE"]',
690
- end = '',
691
- access = 'r',
692
- title = '<?php _e( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ); ?>';
693
-
694
- QTags.addButton( id, text, start, end, access );
695
- </script>
696
- <?php
697
- }
698
-
699
- function RSSImport_insert_button_old() {
700
- global $pagenow;
701
-
702
- $post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
703
- if ( ! in_array( $pagenow, $post_page_pages ) )
704
- return;
705
-
706
- echo '
707
- <script type="text/javascript">
708
- //<![CDATA[
709
- if ( typeof edButtons != \'undefined\' ) {
710
- var length = edButtons.length;
711
- edButtons[length] = new edButton(\'RSSImport\', \'$context\', \'[RSSImport display="5" feedurl="http://feedurl.com/"'.
712
- ' before_desc="<br />" displaydescriptions="TRUE" after_desc=" " html="FALSE" truncatedescchar="200" truncatedescstring=" ... "'.
713
- ' truncatetitlechar=" " truncatetitlestring=" ... " before_date=" <small>" date="FALSE" after_date="</small>"'.
714
- ' date_format="" before_creator=" <small>" creator="FALSE" after_creator="</small>" start_items="<ul>" end_items="</ul>"'.
715
- ' start_item="<li>" end_item="</li>" target="" rel="" desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>"'.
716
- ' noitems="No items, feed is empty." after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid"'.
717
- ' after_error="</p>" paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;"'.
718
- ' prev_paging_title="more items" next_paging_title="more items" use_simplepie="FALSE"]\', \'\', \'\');
719
- function RSSImport_tag(id) {
720
- id = id.replace(/RSSImport_/, \'\');
721
- edInsertTag(edCanvas, id);
722
- }
723
- jQuery(document).ready(function() {
724
- content = \'<input id="RSSImport_\'+length+\'" class="ed_button" type="button" value="' . __( 'RSSImport', FB_RSSI_TEXTDOMAIN ) .
725
- '" title="' . __( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ) . '" onclick="RSSImport_tag(this.id);" />\';
726
- jQuery("#ed_toolbar").append(content);
727
- });
728
- }
729
- //]]>
730
- </script>';
731
- }
732
-
733
- if ( is_admin() && FB_RSSI_QUICKTAG ) {
734
- if ( version_compare( $GLOBALS['wp_version'], '3.3alpha', '>=' ) )
735
- add_action( 'admin_print_footer_scripts', 'RSSImport_insert_button' );
736
  else
737
- add_action( 'admin_footer', 'RSSImport_insert_button_old' );
738
- }
739
-
740
- if ( function_exists('add_shortcode') )
741
- add_shortcode('RSSImport', 'RSSImport_Shortcode');
742
-
743
- add_action( 'init', 'RSSImport_textdomain' );
744
-
745
-
746
-
747
- /**
748
- * code to utf-8 in PHP 4
749
- *
750
- * @package WP-RSSImport
751
- */
752
- function RSSImport_code_to_utf8($num) {
753
-
754
- if ($num <= 0x7F) {
755
- return chr($num);
756
- } elseif ($num <= 0x7FF) {
757
- return chr(($num >> 0x06) + 0xC0) . chr(($num & 0x3F) + 128);
758
- } elseif ($num <= 0xFFFF) {
759
- return chr(($num >> 0x0C) + 0xE0) . chr((($num >> 0x06) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);
760
- } elseif ($num <= 0x1FFFFF) {
761
- return chr(($num >> 0x12) + 0xF0) . chr((($num >> 0x0C) & 0x3F) + 0x80) . chr((($num >> 0x06) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);
762
- }
763
-
764
- return '';
765
- }
766
-
767
-
768
- /**
769
- * html_entity_decode for PHP 4
770
- *
771
- * @package WP-RSSImport
772
- */
773
- function RSSImport_html_entity_decode_php4($str) {
774
- $htmlentities = array (
775
- "&Aacute;" => chr(195).chr(129),
776
- "&aacute;" => chr(195).chr(161),
777
- "&Acirc;" => chr(195).chr(130),
778
- "&acirc;" => chr(195).chr(162),
779
- "&acute;" => chr(194).chr(180),
780
- "&AElig;" => chr(195).chr(134),
781
- "&aelig;" => chr(195).chr(166),
782
- "&Agrave;" => chr(195).chr(128),
783
- "&agrave;" => chr(195).chr(160),
784
- "&alefsym;" => chr(226).chr(132).chr(181),
785
- "&Alpha;" => chr(206).chr(145),
786
- "&alpha;" => chr(206).chr(177),
787
- "&amp;" => chr(38),
788
- "&and;" => chr(226).chr(136).chr(167),
789
- "&ang;" => chr(226).chr(136).chr(160),
790
- "&Aring;" => chr(195).chr(133),
791
- "&aring;" => chr(195).chr(165),
792
- "&asymp;" => chr(226).chr(137).chr(136),
793
- "&Atilde;" => chr(195).chr(131),
794
- "&atilde;" => chr(195).chr(163),
795
- "&Auml;" => chr(195).chr(132),
796
- "&auml;" => chr(195).chr(164),
797
- "&bdquo;" => chr(226).chr(128).chr(158),
798
- "&Beta;" => chr(206).chr(146),
799
- "&beta;" => chr(206).chr(178),
800
- "&brvbar;" => chr(194).chr(166),
801
- "&bull;" => chr(226).chr(128).chr(162),
802
- "&cap;" => chr(226).chr(136).chr(169),
803
- "&Ccedil;" => chr(195).chr(135),
804
- "&ccedil;" => chr(195).chr(167),
805
- "&cedil;" => chr(194).chr(184),
806
- "&cent;" => chr(194).chr(162),
807
- "&Chi;" => chr(206).chr(167),
808
- "&chi;" => chr(207).chr(135),
809
- "&circ;" => chr(203).chr(134),
810
- "&clubs;" => chr(226).chr(153).chr(163),
811
- "&cong;" => chr(226).chr(137).chr(133),
812
- "&copy;" => chr(194).chr(169),
813
- "&crarr;" => chr(226).chr(134).chr(181),
814
- "&cup;" => chr(226).chr(136).chr(170),
815
- "&curren;" => chr(194).chr(164),
816
- "&dagger;" => chr(226).chr(128).chr(160),
817
- "&Dagger;" => chr(226).chr(128).chr(161),
818
- "&darr;" => chr(226).chr(134).chr(147),
819
- "&dArr;" => chr(226).chr(135).chr(147),
820
- "&deg;" => chr(194).chr(176),
821
- "&Delta;" => chr(206).chr(148),
822
- "&delta;" => chr(206).chr(180),
823
- "&diams;" => chr(226).chr(153).chr(166),
824
- "&divide;" => chr(195).chr(183),
825
- "&Eacute;" => chr(195).chr(137),
826
- "&eacute;" => chr(195).chr(169),
827
- "&Ecirc;" => chr(195).chr(138),
828
- "&ecirc;" => chr(195).chr(170),
829
- "&Egrave;" => chr(195).chr(136),
830
- "&egrave;" => chr(195).chr(168),
831
- "&empty;" => chr(226).chr(136).chr(133),
832
- "&emsp;" => chr(226).chr(128).chr(131),
833
- "&ensp;" => chr(226).chr(128).chr(130),
834
- "&Epsilon;" => chr(206).chr(149),
835
- "&epsilon;" => chr(206).chr(181),
836
- "&equiv;" => chr(226).chr(137).chr(161),
837
- "&Eta;" => chr(206).chr(151),
838
- "&eta;" => chr(206).chr(183),
839
- "&ETH;" => chr(195).chr(144),
840
- "&eth;" => chr(195).chr(176),
841
- "&Euml;" => chr(195).chr(139),
842
- "&euml;" => chr(195).chr(171),
843
- "&euro;" => chr(226).chr(130).chr(172),
844
- "&exist;" => chr(226).chr(136).chr(131),
845
- "&fnof;" => chr(198).chr(146),
846
- "&forall;" => chr(226).chr(136).chr(128),
847
- "&frac12;" => chr(194).chr(189),
848
- "&frac14;" => chr(194).chr(188),
849
- "&frac34;" => chr(194).chr(190),
850
- "&frasl;" => chr(226).chr(129).chr(132),
851
- "&Gamma;" => chr(206).chr(147),
852
- "&gamma;" => chr(206).chr(179),
853
- "&ge;" => chr(226).chr(137).chr(165),
854
- "&harr;" => chr(226).chr(134).chr(148),
855
- "&hArr;" => chr(226).chr(135).chr(148),
856
- "&hearts;" => chr(226).chr(153).chr(165),
857
- "&hellip;" => chr(226).chr(128).chr(166),
858
- "&Iacute;" => chr(195).chr(141),
859
- "&iacute;" => chr(195).chr(173),
860
- "&Icirc;" => chr(195).chr(142),
861
- "&icirc;" => chr(195).chr(174),
862
- "&iexcl;" => chr(194).chr(161),
863
- "&Igrave;" => chr(195).chr(140),
864
- "&igrave;" => chr(195).chr(172),
865
- "&image;" => chr(226).chr(132).chr(145),
866
- "&infin;" => chr(226).chr(136).chr(158),
867
- "&int;" => chr(226).chr(136).chr(171),
868
- "&Iota;" => chr(206).chr(153),
869
- "&iota;" => chr(206).chr(185),
870
- "&iquest;" => chr(194).chr(191),
871
- "&isin;" => chr(226).chr(136).chr(136),
872
- "&Iuml;" => chr(195).chr(143),
873
- "&iuml;" => chr(195).chr(175),
874
- "&Kappa;" => chr(206).chr(154),
875
- "&kappa;" => chr(206).chr(186),
876
- "&Lambda;" => chr(206).chr(155),
877
- "&lambda;" => chr(206).chr(187),
878
- "&lang;" => chr(226).chr(140).chr(169),
879
- "&laquo;" => chr(194).chr(171),
880
- "&larr;" => chr(226).chr(134).chr(144),
881
- "&lArr;" => chr(226).chr(135).chr(144),
882
- "&lceil;" => chr(226).chr(140).chr(136),
883
- "&ldquo;" => chr(226).chr(128).chr(156),
884
- "&le;" => chr(226).chr(137).chr(164),
885
- "&lfloor;" => chr(226).chr(140).chr(138),
886
- "&lowast;" => chr(226).chr(136).chr(151),
887
- "&loz;" => chr(226).chr(151).chr(138),
888
- "&lrm;" => chr(226).chr(128).chr(142),
889
- "&lsaquo;" => chr(226).chr(128).chr(185),
890
- "&lsquo;" => chr(226).chr(128).chr(152),
891
- "&macr;" => chr(194).chr(175),
892
- "&mdash;" => chr(226).chr(128).chr(148),
893
- "&micro;" => chr(194).chr(181),
894
- "&middot;" => chr(194).chr(183),
895
- "&minus;" => chr(226).chr(136).chr(146),
896
- "&Mu;" => chr(206).chr(156),
897
- "&mu;" => chr(206).chr(188),
898
- "&nabla;" => chr(226).chr(136).chr(135),
899
- "&nbsp;" => chr(194).chr(160),
900
- "&ndash;" => chr(226).chr(128).chr(147),
901
- "&ne;" => chr(226).chr(137).chr(160),
902
- "&ni;" => chr(226).chr(136).chr(139),
903
- "&not;" => chr(194).chr(172),
904
- "&notin;" => chr(226).chr(136).chr(137),
905
- "&nsub;" => chr(226).chr(138).chr(132),
906
- "&Ntilde;" => chr(195).chr(145),
907
- "&ntilde;" => chr(195).chr(177),
908
- "&Nu;" => chr(206).chr(157),
909
- "&nu;" => chr(206).chr(189),
910
- "&Oacute;" => chr(195).chr(147),
911
- "&oacute;" => chr(195).chr(179),
912
- "&Ocirc;" => chr(195).chr(148),
913
- "&ocirc;" => chr(195).chr(180),
914
- "&OElig;" => chr(197).chr(146),
915
- "&oelig;" => chr(197).chr(147),
916
- "&Ograve;" => chr(195).chr(146),
917
- "&ograve;" => chr(195).chr(178),
918
- "&oline;" => chr(226).chr(128).chr(190),
919
- "&Omega;" => chr(206).chr(169),
920
- "&omega;" => chr(207).chr(137),
921
- "&Omicron;" => chr(206).chr(159),
922
- "&omicron;" => chr(206).chr(191),
923
- "&oplus;" => chr(226).chr(138).chr(149),
924
- "&or;" => chr(226).chr(136).chr(168),
925
- "&ordf;" => chr(194).chr(170),
926
- "&ordm;" => chr(194).chr(186),
927
- "&Oslash;" => chr(195).chr(152),
928
- "&oslash;" => chr(195).chr(184),
929
- "&Otilde;" => chr(195).chr(149),
930
- "&otilde;" => chr(195).chr(181),
931
- "&otimes;" => chr(226).chr(138).chr(151),
932
- "&Ouml;" => chr(195).chr(150),
933
- "&ouml;" => chr(195).chr(182),
934
- "&para;" => chr(194).chr(182),
935
- "&part;" => chr(226).chr(136).chr(130),
936
- "&permil;" => chr(226).chr(128).chr(176),
937
- "&perp;" => chr(226).chr(138).chr(165),
938
- "&Phi;" => chr(206).chr(166),
939
- "&phi;" => chr(207).chr(134),
940
- "&Pi;" => chr(206).chr(160),
941
- "&pi;" => chr(207).chr(128),
942
- "&piv;" => chr(207).chr(150),
943
- "&plusmn;" => chr(194).chr(177),
944
- "&pound;" => chr(194).chr(163),
945
- "&prime;" => chr(226).chr(128).chr(178),
946
- "&Prime;" => chr(226).chr(128).chr(179),
947
- "&prod;" => chr(226).chr(136).chr(143),
948
- "&prop;" => chr(226).chr(136).chr(157),
949
- "&Psi;" => chr(206).chr(168),
950
- "&psi;" => chr(207).chr(136),
951
- "&radic;" => chr(226).chr(136).chr(154),
952
- "&rang;" => chr(226).chr(140).chr(170),
953
- "&raquo;" => chr(194).chr(187),
954
- "&rarr;" => chr(226).chr(134).chr(146),
955
- "&rArr;" => chr(226).chr(135).chr(146),
956
- "&rceil;" => chr(226).chr(140).chr(137),
957
- "&rdquo;" => chr(226).chr(128).chr(157),
958
- "&real;" => chr(226).chr(132).chr(156),
959
- "&reg;" => chr(194).chr(174),
960
- "&rfloor;" => chr(226).chr(140).chr(139),
961
- "&Rho;" => chr(206).chr(161),
962
- "&rho;" => chr(207).chr(129),
963
- "&rlm;" => chr(226).chr(128).chr(143),
964
- "&rsaquo;" => chr(226).chr(128).chr(186),
965
- "&rsquo;" => chr(226).chr(128).chr(153),
966
- "&sbquo;" => chr(226).chr(128).chr(154),
967
- "&Scaron;" => chr(197).chr(160),
968
- "&scaron;" => chr(197).chr(161),
969
- "&sdot;" => chr(226).chr(139).chr(133),
970
- "&sect;" => chr(194).chr(167),
971
- "&shy;" => chr(194).chr(173),
972
- "&Sigma;" => chr(206).chr(163),
973
- "&sigma;" => chr(207).chr(131),
974
- "&sigmaf;" => chr(207).chr(130),
975
- "&sim;" => chr(226).chr(136).chr(188),
976
- "&spades;" => chr(226).chr(153).chr(160),
977
- "&sub;" => chr(226).chr(138).chr(130),
978
- "&sube;" => chr(226).chr(138).chr(134),
979
- "&sum;" => chr(226).chr(136).chr(145),
980
- "&sup1;" => chr(194).chr(185),
981
- "&sup2;" => chr(194).chr(178),
982
- "&sup3;" => chr(194).chr(179),
983
- "&sup;" => chr(226).chr(138).chr(131),
984
- "&supe;" => chr(226).chr(138).chr(135),
985
- "&szlig;" => chr(195).chr(159),
986
- "&Tau;" => chr(206).chr(164),
987
- "&tau;" => chr(207).chr(132),
988
- "&there4;" => chr(226).chr(136).chr(180),
989
- "&Theta;" => chr(206).chr(152),
990
- "&theta;" => chr(206).chr(184),
991
- "&thetasym;" => chr(207).chr(145),
992
- "&thinsp;" => chr(226).chr(128).chr(137),
993
- "&THORN;" => chr(195).chr(158),
994
- "&thorn;" => chr(195).chr(190),
995
- "&tilde;" => chr(203).chr(156),
996
- "&times;" => chr(195).chr(151),
997
- "&trade;" => chr(226).chr(132).chr(162),
998
- "&Uacute;" => chr(195).chr(154),
999
- "&uacute;" => chr(195).chr(186),
1000
- "&uarr;" => chr(226).chr(134).chr(145),
1001
- "&uArr;" => chr(226).chr(135).chr(145),
1002
- "&Ucirc;" => chr(195).chr(155),
1003
- "&ucirc;" => chr(195).chr(187),
1004
- "&Ugrave;" => chr(195).chr(153),
1005
- "&ugrave;" => chr(195).chr(185),
1006
- "&uml;" => chr(194).chr(168),
1007
- "&upsih;" => chr(207).chr(146),
1008
- "&Upsilon;" => chr(206).chr(165),
1009
- "&upsilon;" => chr(207).chr(133),
1010
- "&Uuml;" => chr(195).chr(156),
1011
- "&uuml;" => chr(195).chr(188),
1012
- "&weierp;" => chr(226).chr(132).chr(152),
1013
- "&Xi;" => chr(206).chr(158),
1014
- "&xi;" => chr(206).chr(190),
1015
- "&Yacute;" => chr(195).chr(157),
1016
- "&yacute;" => chr(195).chr(189),
1017
- "&yen;" => chr(194).chr(165),
1018
- "&yuml;" => chr(195).chr(191),
1019
- "&Yuml;" => chr(197).chr(184),
1020
- "&Zeta;" => chr(206).chr(150),
1021
- "&zeta;" => chr(206).chr(182),
1022
- "&zwj;" => chr(226).chr(128).chr(141),
1023
- "&zwnj;" => chr(226).chr(128).chr(140),
1024
- "&gt;" => ">",
1025
- "&lt;" => "<"
1026
- );
1027
-
1028
- $return = strtr($str, $htmlentities);
1029
- $return = preg_replace('~&#x([0-9a-f]+);~ei', 'RSSImport_code_to_utf8(hexdec("\\1"))', $return);
1030
- $return = preg_replace('~&#([0-9]+);~e', 'RSSImport_code_to_utf8(\\1)', $return);
1031
-
1032
- return $return;
1033
- }
1034
-
1035
-
1036
- // check class wp_widget exists
1037
- if ( class_exists('WP_Widget') ) {
1038
-
1039
- class RSSImport_Widget extends WP_Widget {
1040
-
1041
- function RSSImport_Widget() {
1042
- $widget_ops = array('classname' => 'rssimport', 'description' => __( 'Entries from any RSS or Atom feed', FB_RSSI_TEXTDOMAIN ) );
1043
- $this->WP_Widget('rssimport', __( 'RSSImport' ), $widget_ops);
1044
- }
1045
-
1046
- function widget($args, $instance) {
1047
- extract($args, EXTR_SKIP);
1048
-
1049
- $title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
1050
- $titlelink = empty($instance['titlelink']) ? '' : $instance['titlelink'];
1051
- $display = empty($instance['display']) ? '5' : $instance['display'];
1052
- $feedurl = empty($instance['feedurl']) ? 'http://bueltge.de/feed/' : $instance['feedurl'];
1053
- $before_desc = empty($instance['before_desc']) ? '' : $instance['before_desc'];
1054
- $displaydescriptions = empty($instance['displaydescriptions']) ? '0' : $instance['displaydescriptions'];
1055
- $after_desc = empty($instance['after_desc']) ? '' : $instance['after_desc'];
1056
- $html = empty($instance['html']) ? '0' : $instance['html'];
1057
- $truncatedescchar = empty($instance['truncatedescchar']) ? '200' : $instance['truncatedescchar'];
1058
- $truncatedescstring = empty($instance['truncatedescstring']) ? '' : $instance['truncatedescstring'];
1059
- $truncatetitlechar = empty($instance['truncatetitlechar']) ? '' : $instance['truncatetitlechar'];
1060
- $truncatetitlestring = empty($instance['truncatetitlestring']) ? ' ... ' : $instance['truncatetitlestring'];
1061
- $before_date = empty($instance['before_date']) ? ' <small>' : $instance['before_date'];
1062
- $date = empty($instance['date']) ? '0' : $instance['date'];
1063
- $after_date = empty($instance['after_date']) ? '</small>' : $instance['after_date'];
1064
- $date_format = empty($instance['date_format']) ? '' : $instance['date_format'];
1065
- $before_creator = empty($instance['before_creator']) ? ' <small>' : $instance['before_creator'];
1066
- $creator = empty($instance['creator']) ? '0' : $instance['creator'];
1067
- $after_creator = empty($instance['after_creator']) ? '</small>' : $instance['after_creator'];
1068
- $start_items = empty($instance['start_items']) ? '<ul>' : $instance['start_items'];
1069
- $end_items = empty($instance['end_items']) ? '</ul>' : $instance['end_items'];
1070
- $start_item = empty($instance['start_item']) ? '<li>' : $instance['start_item'];
1071
- $end_item = empty($instance['end_item']) ? '</li>' : $instance['end_item'];
1072
- $target = empty($instance['target']) ? '' : $instance['target'];
1073
- $rel = empty($instance['rel']) ? '' : $instance['rel'];
1074
- $desc4title = empty($instance['desc4title']) ? '0' : $instance['desc4title'];
1075
- $charsetscan = empty($instance['charsetscan']) ? '0' : $instance['charsetscan'];
1076
- $debug = empty($instance['debug']) ? '0' : $instance['debug'];
1077
- $before_noitems = empty($instance['before_noitems']) ? '<p>' : $instance['before_noitems'];
1078
- $noitems = empty($instance['noitems']) ? __('No items, feed is empty.', FB_RSSI_TEXTDOMAIN) : $instance['noitems'];
1079
- $after_noitems = empty($instance['after_noitems']) ? '</p>' : $instance['after_noitems'];
1080
- $before_error = empty($instance['before_error']) ? '<p>' : $instance['before_error'];
1081
- $error = empty($instance['error']) ? __('Error: Feed has an error or is not valid', FB_RSSI_TEXTDOMAIN) : $instance['error'];
1082
- $after_error = empty($instance['after_error']) ? '</p>' : $instance['after_error'];
1083
- $paging = empty($instance['paging']) ? '0' : $instance['paging'];
1084
- $prev_paging_link = empty($instance['prev_paging_link']) ? __('&laquo; Previous', FB_RSSI_TEXTDOMAIN) : $instance['prev_paging_link'];
1085
- $next_paging_link = empty($instance['next_paging_link']) ? __('Next &raquo;', FB_RSSI_TEXTDOMAIN) : $instance['next_paging_link'];
1086
- $prev_paging_title = empty($instance['prev_paging_title']) ? __('more items', FB_RSSI_TEXTDOMAIN) : $instance['prev_paging_title'];
1087
- $next_paging_title = empty($instance['next_paging_title']) ? __('more items', FB_RSSI_TEXTDOMAIN) : $instance['next_paging_title'];
1088
- $use_simplepie = empty($instance['use_simplepie']) ? '1' : $instance['use_simplepie'];
1089
- $view = empty($instance['view']) ? '1' : $instance['view'];
1090
-
1091
- echo $before_widget;
1092
- if ( $titlelink != '' )
1093
- $title = '<a href="' . $titlelink . '">' . $title . '</a>';
1094
- echo $before_title . $title . $after_title;
1095
- RSSImport(
1096
- $display, $feedurl,
1097
- $before_desc, $displaydescriptions, $after_desc, $html, $truncatedescchar, $truncatedescstring,
1098
- $truncatetitlechar, $truncatetitlestring,
1099
- $before_date, $date, $after_date, $date_format,
1100
- $before_creator, $creator, $after_creator,
1101
- $start_items, $end_items,
1102
- $start_item, $end_item,
1103
- $target,
1104
- $rel,
1105
- $desc4title,
1106
- $charsetscan, $debug,
1107
- $before_noitems, $noitems, $after_noitems,
1108
- $before_error, $error, $after_error,
1109
- $paging, $prev_paging_link, $next_paging_link, $prev_paging_title, $next_paging_title,
1110
- $use_simplepie,
1111
- $view
1112
- );
1113
- echo $after_widget;
1114
- }
1115
-
1116
- function update($new_instance, $old_instance) {
1117
- $instance['instance'] = $old_instance;
1118
- $instance['title'] = strip_tags( $new_instance['title'] );
1119
- $instance['titlelink'] = esc_url($new_instance['titlelink']);
1120
- $instance['display'] = (int) $new_instance['display'];
1121
- $instance['feedurl'] = $new_instance['feedurl'];
1122
- $instance['before_desc'] = $new_instance['before_desc'];
1123
- $instance['displaydescriptions'] = (int) $new_instance['displaydescriptions'];
1124
- $instance['after_desc'] = stripslashes_deep( $new_instance['after_desc'] );
1125
- $instance['html'] = (int) $new_instance['html'];
1126
- $instance['truncatedescchar'] = (int) $new_instance['truncatedescchar'];
1127
- $instance['truncatedescstring'] = $new_instance['truncatedescstring'];
1128
- $instance['truncatetitlechar'] = (int) $new_instance['truncatetitlechar'];
1129
- $instance['truncatetitlestring'] = $new_instance['truncatetitlestring'];
1130
- $instance['before_date'] = $new_instance['before_date'];
1131
- $instance['date'] = (int) $new_instance['date'];
1132
- $instance['after_date'] = $new_instance['after_date'];
1133
- $instance['date_format'] = $new_instance['date_format'];
1134
- $instance['before_creator'] = $new_instance['before_creator'];
1135
- $instance['creator'] = (int) $new_instance['creator'];
1136
- $instance['after_creator'] = $new_instance['after_creator'];
1137
- $instance['start_items'] = $new_instance['start_items'];
1138
- $instance['end_items'] = $new_instance['end_items'];
1139
- $instance['start_item'] = $new_instance['start_item'];
1140
- $instance['end_item'] = $new_instance['end_item'];
1141
- $instance['target'] = $new_instance['target'];
1142
- $instance['rel'] = $new_instance['rel'];
1143
- $instance['desc4title'] = (int) $new_instance['desc4title'];
1144
- $instance['charsetscan'] = (int) $new_instance['charsetscan'];
1145
- $instance['debug'] = (int) $new_instance['debug'];
1146
- $instance['view'] = (int) $new_instance['view'];
1147
- $instance['before_noitems'] = $new_instance['before_noitems'];
1148
- $instance['noitems'] = $new_instance['noitems'];
1149
- $instance['after_noitems'] = $new_instance['after_noitems'];
1150
- $instance['before_error'] = $new_instance['before_error'];
1151
- $instance['error'] = $new_instance['error'];
1152
- $instance['after_error'] = $new_instance['after_error'];
1153
- $instance['paging'] = (int) $new_instance['paging'];
1154
- $instance['prev_paging_link'] = $new_instance['prev_paging_link'];
1155
- $instance['next_paging_link'] = $new_instance['next_paging_link'];
1156
- $instance['prev_paging_title'] = $new_instance['prev_paging_title'];
1157
- $instance['next_paging_title'] = $new_instance['next_paging_title'];
1158
- $instance['use_simplepie'] = (int) $new_instance['use_simplepie'];
1159
-
1160
- if ( current_user_can('unfiltered_html') )
1161
- return $instance;
1162
- else
1163
- return stripslashes( strip_tags ( $instance ) );
1164
- }
1165
-
1166
- function form($instance) {
1167
- $instance = wp_parse_args(
1168
- (array) $instance, array(
1169
- 'title' => '',
1170
- 'titlelink' => '',
1171
- 'display' => 5,
1172
- 'feedurl' => 'http://bueltge.de/feed/',
1173
- 'before_desc' => '',
1174
- 'displaydescriptions' => 0,
1175
- 'after_desc' => '',
1176
- 'html' => 0,
1177
- 'truncatedescchar' => 200,
1178
- 'truncatedescstring' => ' ... ',
1179
- 'truncatetitlechar' => '',
1180
- 'truncatetitlestring' => ' ... ',
1181
- 'before_date' => ' <small>',
1182
- 'date' => 0,
1183
- 'after_date' => '</small>',
1184
- 'date_format' => '',
1185
- 'before_creator' => ' <small>',
1186
- 'creator' => 0,
1187
- 'after_creator' => '</small>',
1188
- 'start_items' => '<ul>',
1189
- 'end_items' => '</ul>',
1190
- 'start_item' => '<li>',
1191
- 'end_item' => '</li>',
1192
- 'target' => '',
1193
- 'rel' => '',
1194
- 'desc4title' => 0,
1195
- 'charsetscan' => 0,
1196
- 'debug' => 0,
1197
- 'view' => 1,
1198
- 'before_noitems' => '<p>',
1199
- 'noitems' => __('No items, feed is empty.', FB_RSSI_TEXTDOMAIN),
1200
- 'after_noitems' => '</p>',
1201
- 'before_error' => '<p>',
1202
- 'error' => __('Error: Feed has an error or is not valid', FB_RSSI_TEXTDOMAIN),
1203
- 'after_error' => '</p>',
1204
- 'paging' => 0,
1205
- 'prev_paging_link' => __('&laquo; Previous', FB_RSSI_TEXTDOMAIN),
1206
- 'next_paging_link' => __('Next &raquo;', FB_RSSI_TEXTDOMAIN),
1207
- 'prev_paging_title' => __('more items', FB_RSSI_TEXTDOMAIN),
1208
- 'next_paging_title' => __('more items', FB_RSSI_TEXTDOMAIN),
1209
- 'use_simplepie' => 1
1210
- )
1211
- );
1212
-
1213
- $title = strip_tags($instance['title']);
1214
- $titlelink = esc_url($instance['titlelink']);
1215
- $display = (int) $instance['display'];
1216
- $feedurl = $instance['feedurl'];
1217
- $before_desc = $instance['before_desc'];
1218
- $displaydescriptions = (int) $instance['displaydescriptions'];
1219
- $after_desc = format_to_edit( $instance['after_desc'] );
1220
- $html = (int) $instance['html'];
1221
- $truncatedescchar = (int) $instance['truncatedescchar'];
1222
- $truncatedescstring = (int) $instance['truncatedescstring'];
1223
- $truncatetitlechar = $instance['truncatetitlechar'];
1224
- $truncatetitlestring = $instance['truncatetitlestring'];
1225
- $before_date = $instance['before_date'];
1226
- $date = (int) $instance['date'];
1227
- $after_date = $instance['after_date'];
1228
- $date_format = $instance['date_format'];
1229
- $before_creator = $instance['before_creator'];
1230
- $creator = (int) $instance['creator'];
1231
- $after_creator = $instance['after_creator'];
1232
- $start_items = $instance['start_items'];
1233
- $end_items = $instance['end_items'];
1234
- $start_item = $instance['start_item'];
1235
- $end_item = $instance['end_item'];
1236
- $target = $instance['target'];
1237
- $rel = $instance['rel'];
1238
- $desc4title = (int) $instance['desc4title'];
1239
- $charsetscan = (int) $instance['charsetscan'];
1240
- $debug = (int) $instance['debug'];
1241
- $before_noitems = $instance['before_noitems'];
1242
- $noitems = $instance['noitems'];
1243
- $after_noitems = $instance['after_noitems'];
1244
- $before_error = $instance['before_error'];
1245
- $error = $instance['error'];
1246
- $after_error = $instance['after_error'];
1247
- $paging = (int) $instance['paging'];
1248
- $prev_paging_link = $instance['prev_paging_link'];
1249
- $next_paging_link = $instance['next_paging_link'];
1250
- $prev_paging_title = $instance['prev_paging_title'];
1251
- $next_paging_title = $instance['next_paging_title'];
1252
- $use_simplepie = (int) $instance['use_simplepie'];
1253
- $view = (int) $instance['view'];
1254
- ?>
1255
- <p>
1256
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1257
- </p>
1258
- <p>
1259
- <label for="<?php echo $this->get_field_id('titlelink'); ?>"><?php _e( 'URL for Title (incl. http://):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1260
- </p>
1261
- <p>
1262
- <label for="<?php echo $this->get_field_id('display'); ?>"><?php _e( 'Display:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1263
- </p>
1264
- <p>
1265
- <label for="<?php echo $this->get_field_id('feedurl'); ?>"><?php _e( 'FeedURL:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1266
- </p>
1267
- <p>
1268
- <label for="<?php echo $this->get_field_id('before_desc'); ?>"><?php _e( 'Before Description:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1269
- </p>
1270
- <p>
1271
- <label for="<?php echo $this->get_field_id('displaydescriptions'); ?>"><?php _e( 'Display Description:', FB_RSSI_TEXTDOMAIN ) ?>
1272
- <select id="<?php echo $this->get_field_id('displaydescriptions'); ?>" name="<?php echo $this->get_field_name('displaydescriptions'); ?>">
1273
- <option value="0"<?php if ($displaydescriptions == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1274
- <option value="1"<?php if ($displaydescriptions == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1275
- </select>
1276
- </label>
1277
- </p>
1278
- <p>
1279
- <label for="<?php echo $this->get_field_id('after_desc'); ?>"><?php _e( 'After Description:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1280
- <br /><small><?php _e( 'You can use the following strings to create custom links:', FB_RSSI_TEXTDOMAIN ); ?> <code>%title%</code>, <code>%href%</code>
1281
- <br /><?php _e( 'Example:', FB_RSSI_TEXTDOMAIN ); ?> <code>&lt;a href="%href%" target="self" rel="follow"&gt;%title%&lt;/a&gt;</code></small>
1282
- </p>
1283
- <p>
1284
- <label for="<?php echo $this->get_field_id('html'); ?>"><?php _e( 'HTML:', FB_RSSI_TEXTDOMAIN ) ?>
1285
- <select id="<?php echo $this->get_field_id('html'); ?>" name="<?php echo $this->get_field_name('html'); ?>">
1286
- <option value="0"<?php if ($html == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1287
- <option value="1"<?php if ($html == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1288
- </select>
1289
- </label>
1290
- </p>
1291
- <p>
1292
- <label for="<?php echo $this->get_field_id('truncatedescchar'); ?>"><?php _e( 'Truncate Description Char:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1293
- </p>
1294
- <p>
1295
- <label for="<?php echo $this->get_field_id('truncatedescstring'); ?>"><?php _e( 'Truncate Description String (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1296
- </p>
1297
- <p>
1298
- <label for="<?php echo $this->get_field_id('truncatetitlechar'); ?>"><?php _e( 'Truncate Title Char:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1299
- </p>
1300
- <p>
1301
- <label for="<?php echo $this->get_field_id('truncatetitlestring'); ?>"><?php _e( 'Truncate Title String (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1302
- </p>
1303
- <p>
1304
- <label for="<?php echo $this->get_field_id('before_date'); ?>"><?php _e( 'Before Date (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1305
- </p>
1306
- <p>
1307
- <label for="<?php echo $this->get_field_id('date'); ?>"><?php _e( 'Date:', FB_RSSI_TEXTDOMAIN ) ?>
1308
- <select id="<?php echo $this->get_field_id('date'); ?>" name="<?php echo $this->get_field_name('date'); ?>">
1309
- <option value="0"<?php if ($date == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1310
- <option value="1"<?php if ($date == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1311
- </select>
1312
- </label>
1313
- </p>
1314
- <p>
1315
- <label for="<?php echo $this->get_field_id('after_date'); ?>"><?php _e( 'After Date (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1316
- </p>
1317
- <p>
1318
- <label for="<?php echo $this->get_field_id('date_format'); ?>"><?php _e( 'Date Formatting:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1319
- <br /><small><?php _e( 'Leave empty for use the date format of your WordPress settings.', FB_RSSI_TEXTDOMAIN ); ?> <a href="http://codex.wordpress.org/Formatting_Date_and_Time"><?php _e( 'Documentation on date formatting', FB_RSSI_TEXTDOMAIN ); ?></a></small>
1320
- </p>
1321
- <p>
1322
- <label for="<?php echo $this->get_field_id('before_creator'); ?>"><?php _e( 'Before Creator (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1323
- </p>
1324
- <p>
1325
- <label for="<?php echo $this->get_field_id('creator'); ?>"><?php _e( 'Creator:', FB_RSSI_TEXTDOMAIN ) ?>
1326
- <select id="<?php echo $this->get_field_id('creator'); ?>" name="<?php echo $this->get_field_name('creator'); ?>">
1327
- <option value="0"<?php if ($creator == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1328
- <option value="1"<?php if ($creator == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1329
- </select>
1330
- </label>
1331
- </p>
1332
- <p>
1333
- <label for="<?php echo $this->get_field_id('after_creator'); ?>"><?php _e( 'After Creator (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1334
- </p>
1335
- <p>
1336
- <label for="<?php echo $this->get_field_id('start_items'); ?>"><?php _e( 'Before Items (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1337
- </p>
1338
- <p>
1339
- <label for="<?php echo $this->get_field_id('end_items'); ?>"><?php _e( 'After Items (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1340
- </p>
1341
- <p>
1342
- <label for="<?php echo $this->get_field_id('start_item'); ?>"><?php _e( 'Before Item (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1343
- </p>
1344
- <p>
1345
- <label for="<?php echo $this->get_field_id('end_item'); ?>"><?php _e( 'After Item (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1346
- </p>
1347
- <p>
1348
- <label for="<?php echo $this->get_field_id('target'); ?>"><?php _e( 'Target Attribut:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1349
- </p>
1350
- <p>
1351
- <label for="<?php echo $this->get_field_id('rel'); ?>"><?php _e( 'Rel Attribut:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1352
- </p>
1353
- <p>
1354
- <label for="<?php echo $this->get_field_id('desc4title'); ?>"><?php _e( 'Desc4Title:', FB_RSSI_TEXTDOMAIN ) ?>
1355
- <select id="<?php echo $this->get_field_id('desc4title'); ?>" name="<?php echo $this->get_field_name('desc4title'); ?>">
1356
- <option value="0"<?php if ($desc4title == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1357
- <option value="1"<?php if ($desc4title == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1358
- </select>
1359
- </label>
1360
- <br />
1361
- <small><?php _e( 'Description for title-Attribut on Title-Link', FB_RSSI_TEXTDOMAIN ); ?></small>
1362
- </p>
1363
- <p>
1364
- <label for="<?php echo $this->get_field_id('charsetscan'); ?>"><?php _e( 'Charsetscan:', FB_RSSI_TEXTDOMAIN ) ?>
1365
- <select id="<?php echo $this->get_field_id('charsetscan'); ?>" name="<?php echo $this->get_field_name('charsetscan'); ?>">
1366
- <option value="0"<?php if ($charsetscan == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1367
- <option value="1"<?php if ($charsetscan == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1368
- </select>
1369
- </label>
1370
- </p>
1371
- <p>
1372
- <label for="<?php echo $this->get_field_id('debug'); ?>"><?php _e( 'Debug mode:', FB_RSSI_TEXTDOMAIN ) ?>
1373
- <select id="<?php echo $this->get_field_id('debug'); ?>" name="<?php echo $this->get_field_name('debug'); ?>">
1374
- <option value="0"<?php if ($debug == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1375
- <option value="1"<?php if ($debug == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1376
- </select>
1377
- </label>
1378
- </p>
1379
- <p>
1380
- <label for="<?php echo $this->get_field_id('before_noitems'); ?>"><?php _e( 'Before <em>No</em> Items Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1381
- </p>
1382
- <p>
1383
- <label for="<?php echo $this->get_field_id('noitems'); ?>"><?php _e( '<em>No</em> Items Message:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1384
- </p>
1385
- <p>
1386
- <label for="<?php echo $this->get_field_id('after_noitems'); ?>"><?php _e( 'After <em>No</em> Items Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1387
- </p>
1388
- <p>
1389
- <label for="<?php echo $this->get_field_id('before_error'); ?>"><?php _e( 'Before Error Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1390
- </p>
1391
- <p>
1392
- <label for="<?php echo $this->get_field_id('error'); ?>"><?php _e( 'Error Message:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1393
- </p>
1394
- <p>
1395
- <label for="<?php echo $this->get_field_id('after_error'); ?>"><?php _e( 'After Error Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1396
- </p>
1397
- <p>
1398
- <label for="<?php echo $this->get_field_id('paging'); ?>"><?php _e( 'Pagination:', FB_RSSI_TEXTDOMAIN ) ?>
1399
- <select id="<?php echo $this->get_field_id('paging'); ?>" name="<?php echo $this->get_field_name('paging'); ?>">
1400
- <option value="0"<?php if ($paging == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1401
- <option value="1"<?php if ($paging == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1402
- </select>
1403
- </label>
1404
- </p>
1405
- <p>
1406
- <label for="<?php echo $this->get_field_id('prev_paging_link'); ?>"><?php _e( 'Previous Pagination Link String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1407
- </p>
1408
- <p>
1409
- <label for="<?php echo $this->get_field_id('next_paging_link'); ?>"><?php _e( 'Next Pagination Link String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1410
- </p>
1411
- <p>
1412
- <label for="<?php echo $this->get_field_id('prev_paging_title'); ?>"><?php _e( 'Previous Pagination Title String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1413
- </p>
1414
- <p>
1415
- <label for="<?php echo $this->get_field_id('next_paging_title'); ?>"><?php _e( 'Next Pagination Title String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1416
- </p>
1417
- <p>
1418
- <label for="<?php echo $this->get_field_id('use_simplepie'); ?>"><?php _e( 'Use SimplePie class:', FB_RSSI_TEXTDOMAIN ) ?>
1419
- <select id="<?php echo $this->get_field_id('use_simplepie'); ?>" name="<?php echo $this->get_field_name('use_simplepie'); ?>">
1420
- <option value="0"<?php if ($use_simplepie == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1421
- <option value="1"<?php if ($use_simplepie == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1422
- </select>
1423
- </label>
1424
- </p>
1425
- <p>
1426
- <label for="<?php echo $this->get_field_id('view'); ?>"><?php _e( 'Echo/Return:', FB_RSSI_TEXTDOMAIN ) ?>
1427
- <select id="<?php echo $this->get_field_id('view'); ?>" name="<?php echo $this->get_field_name('view'); ?>">
1428
- <option value="0"<?php if ($view == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1429
- <option value="1"<?php if ($view == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1430
- </select>
1431
- </label>
1432
- </p>
1433
- <?php
1434
-
1435
- }
1436
- }
1437
-
1438
- add_action( 'widgets_init', create_function('', 'return register_widget("RSSImport_Widget");') );
1439
-
1440
- } // end if class wp_widget exists
1441
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package WP-RSSImport
4
+ * @author Frank Bültge
5
+ */
6
+
7
+ /**
8
+ * Plugin Name: WP-RSSImport
9
+ * Plugin URI: http://bueltge.de/wp-rss-import-plugin/55/
10
+ * Text Domain: rssimport
11
+ * Domain Path: /languages
12
+ * Description: Import and display Feeds in your blog, use the function RSSImport(), a Widget or Shortcode [RSSImport].
13
+ * Author: Frank Bültge, took77
14
+ * Version: 4.4.16
15
+ * License: GPLv2+
16
+ * Last change: 09/24/2015
17
+ */
18
+
19
+ /*
20
+ ------------------------------------------------------------
21
+ ACKNOWLEDGEMENTS
22
+ ------------------------------------------------------------
23
+ Original and Idea: Dave Wolf, http://www.davewolf.net
24
+ Thx to Thomas Fischer, http://www.securityfocus.de and
25
+ Gunnar Tillmann http://www.gunnart.de for a better code
26
+
27
+ Paging: Ilya Shindyapin, http://skookum.com
28
+
29
+ ------------------------------------------------------------
30
+ USAGE: Use following code with a PHP-Plugin for WordPress:
31
+ Example: <?php RSSImport(10, "http://bueltge.de/feed/"); ?>
32
+ ------------------------------------------------------------
33
+ */
34
+
35
+ //avoid direct calls to this file, because now WP core and framework has been used
36
+ if ( ! function_exists('add_action') ) {
37
+ header('Status: 403 Forbidden');
38
+ header('HTTP/1.1 403 Forbidden');
39
+ exit();
40
+ }
41
+
42
+ if ( function_exists('add_action') ) {
43
+ //WordPress definitions
44
+ if ( !defined('WP_CONTENT_URL') )
45
+ define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
46
+ if ( !defined('WP_CONTENT_DIR') )
47
+ define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
48
+ if ( !defined('WP_PLUGIN_URL') )
49
+ define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
50
+ if ( !defined('WP_PLUGIN_DIR') )
51
+ define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
52
+ if ( !defined('PLUGINDIR') )
53
+ define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
54
+ if ( !defined('WP_LANG_DIR') )
55
+ define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages');
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
+ }
69
+
70
+ if ( ! function_exists('esc_attr') ) {
71
+ function esc_attr( $text ) {
72
+ return attribute_escape( $text );
73
+ }
74
+ }
75
+
76
+ if ( ! function_exists('esc_url') ) {
77
+ function esc_url($text ) {
78
+ return clean_url($text);
79
+ }
80
+ }
81
+
82
+
83
+ // cache and error report
84
+ //define('MAGPIE_CACHE_ON', FALSE); // Cache off
85
+ if ( ! defined('MAGPIE_CACHE_AGE') )
86
+ define('MAGPIE_CACHE_AGE', '60*60'); // in sec, one hour
87
+ // error reporting
88
+ //error_reporting(E_ALL);
89
+
90
+ function RSSImport(
91
+ $display = 5,
92
+ $feedurl = 'http://bueltge.de/feed/',
93
+ $before_desc = '',
94
+ $displaydescriptions = 0,
95
+ $after_desc = '',
96
+ $html = 0,
97
+ $truncatedescchar = 200,
98
+ $truncatedescstring = ' ... ',
99
+ $truncatetitlechar = '',
100
+ $truncatetitlestring = ' ... ',
101
+ $before_date = ' <small>',
102
+ $date = 0,
103
+ $after_date = '</small>',
104
+ $date_format = '',
105
+ $before_creator = ' <small>',
106
+ $creator = 0,
107
+ $after_creator = '</small>',
108
+ $start_items = '<ul>',
109
+ $end_items = '</ul>',
110
+ $start_item = '<li>',
111
+ $end_item = '</li>',
112
+ $target = '',
113
+ $rel = '',
114
+ $desc4title = 0,
115
+ $charsetscan = 0,
116
+ $debug = 0,
117
+ $before_noitems = '<p>',
118
+ $noitems = 'No items, feed is empty.',
119
+ $after_noitems = '</p>',
120
+ $before_error = '<p>',
121
+ $error = 'Error: Feed has an error or is not valid',
122
+ $after_error = '</p>',
123
+ $paging = 0,
124
+ $prev_paging_link = '&laquo; Previous',
125
+ $next_paging_link = 'Next &raquo;',
126
+ $prev_paging_title = 'more items',
127
+ $next_paging_title = 'more items',
128
+ $use_simplepie = 1,
129
+ $view = 1
130
+ ) {
131
+
132
+ // replace for yahoo pipes urls
133
+ $feedurl = str_replace('&#038;', '&', $feedurl);
134
+
135
+ $display = (int) $display;
136
+ $displaydescriptions = (int) $displaydescriptions;
137
+ $html = (int) $html;
138
+ $truncatedescchar = (int) $truncatedescchar;
139
+ $truncatetitlechar = (int) $truncatetitlechar;
140
+ $date = (int) $date;
141
+ if ( $date_format == '' )
142
+ $date_format = get_option('date_format');
143
+ $creator = (int) $creator;
144
+ $charsetscan = (int) $charsetscan;
145
+ $debug = (int) $debug;
146
+ $paging = (int) $paging;
147
+ $use_simplepie = (int) $use_simplepie;
148
+ $view = (int) $view;
149
+
150
+ if ($use_simplepie) {
151
+ if ( ! class_exists('SimplePie') ) {
152
+ if ( file_exists(ABSPATH . WPINC . '/class-simplepie.php') ) {
153
+ @require_once (ABSPATH . WPINC . '/class-simplepie.php');
154
+ } else {
155
+ die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The WordPress file "class-simplepie.php" with class SimplePie could not be included.'));
156
+ }
157
+ }
158
+ } else {
159
+ // For function fetch_rss from wp-core
160
+ if ( file_exists(ABSPATH . WPINC . '/rss.php') ) {
161
+ @require_once (ABSPATH . WPINC . '/rss.php');
162
+ // It's Wordpress 2.x. since it has been loaded successfully
163
+ } elseif (file_exists(ABSPATH . WPINC . '/rss-functions.php')) {
164
+ @require_once (ABSPATH . WPINC . '/rss-functions.php');
165
+ // In Wordpress < 2.1
166
+ } else {
167
+ die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The Wordpress file "rss-functions.php" or "rss.php" could not be included.'));
168
+ }
169
+ }
170
+
171
+ $display = intval($display);
172
+ $page = ( ( !empty( $_GET['rsspage'] ) && intval($_GET['rsspage']) > 0 ) ? intval($_GET['rsspage']) : 1 );
173
+ $truncatedescchar = intval($truncatedescchar);
174
+ $truncatetitlechar = intval($truncatetitlechar);
175
+ if ($use_simplepie)
176
+ $echo = '<!--via SimplePie with RSSImport-->';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  else
178
+ $echo = '<!--via MagpieRSS with RSSImport-->';
179
+
180
+ if ($charsetscan) {
181
+ // read in file for search charset
182
+ if ( function_exists('file_get_contents') ) {
183
+ ini_set('default_socket_timeout', 10);
184
+ $a = file_get_contents($feedurl);
185
+ // for better performance, if the server accepts the method
186
+ // $a = file_get_contents($feedurl, FALSE, NULL, 0, 50);
187
+ }
188
+ }
189
+
190
+ if ($use_simplepie)
191
+ $rss = fetch_feed($feedurl);
192
+ else
193
+ $rss = fetch_rss($feedurl);
194
+
195
+ if ( $rss && ! is_wp_error($rss) ) {
196
+
197
+ // the follow print_r list all items in array, for debug purpose
198
+ if ( $debug ) {
199
+ print('FeedURL: ' . $feedurl);
200
+ print('<pre>');
201
+ print_r($rss);
202
+ print('</pre>');
203
+ if ( ! defined('MAGPIE_CACHE_ON') )
204
+ define('MAGPIE_CACHE_ON', FALSE);
205
+ }
206
+
207
+ if ( isset($target) && $target != '' )
208
+ $target = ' target="_' . $target . '"';
209
+
210
+ if ( isset($rel) && $rel != '' )
211
+ $rel = ' rel="' . $rel . '"';
212
+
213
+ $displayitems = $display;
214
+ $displaylimit = ($page * $display);
215
+ $display = (($page-1) * $display);
216
+ $nextitems = TRUE;
217
+ $previousitems = FALSE;
218
+ if ( $page > 1 )
219
+ $previousitems = TRUE;
220
+
221
+ while($display < $displaylimit) {
222
+
223
+ if ( $use_simplepie && (1 ==$paging) )
224
+ $items = $rss->get_items();
225
+ elseif ($use_simplepie)
226
+ $items = $rss->get_items(0, $displayitems);
227
+ else
228
+ $items = $rss->items;
229
+
230
+ if ( array_key_exists( $display, $items ) ) {
231
+
232
+ if ($use_simplepie)
233
+ $item = $rss->get_item($display);
234
+ else
235
+ $item = $rss->items[$display];
236
+ // import title
237
+ if ($use_simplepie)
238
+ $title = esc_attr( strip_tags( $item->get_title() ) );
239
+ elseif ( isset($item['title']) )
240
+ $title = esc_attr( strip_tags( $item['title'] ) );
241
+ // import link
242
+ if ($use_simplepie)
243
+ $href = wp_filter_kses( $item->get_link() );
244
+ elseif ( isset($item['link']) )
245
+ $href = wp_filter_kses( $item['link'] );
246
+ // import picture_url
247
+ $picture_url = '';
248
+ if ($use_simplepie) {
249
+ if ( $enclosure = $item->get_enclosure() ) {
250
+ $picture_url = wp_filter_kses( $enclosure->get_thumbnail() );
251
+ }
252
+ }
253
+
254
+ $start_item_temp = str_replace('%title%', $title, $start_item);
255
+ $start_item_temp = str_replace('%href%', $href, $start_item_temp);
256
+ $start_item_temp = str_replace('%picture_url%', $picture_url, $start_item_temp);
257
+ $echo .= $start_item_temp;
258
+
259
+ // import date
260
+ if ($use_simplepie && $date)
261
+ $pubDate = date_i18n( $date_format, strtotime( $item->get_date() ) );
262
+ elseif ($date && isset($item['pubdate']) )
263
+ $pubDate = date_i18n( $date_format, strtotime( $item['pubdate'] ) );
264
+ // import creator
265
+ if ($use_simplepie && $creator) {
266
+ $creator = $item->get_author();
267
+ if ( is_object($creator) ) {
268
+ $creator = $creator->get_name();
269
+ $creator = ' <cite>' . esc_html( strip_tags( $creator ) ) . '</cite>';
270
+ }
271
+ } elseif ($creator && isset($item['dc']['creator']) ) {
272
+ $creator = wp_specialchars( $item['dc']['creator'] );
273
+ } elseif ($creator && isset($item['creator']) ) {
274
+ $creator = wp_specialchars( $item['creator'] );
275
+ }
276
+ // import desc
277
+ if ( $use_simplepie && $displaydescriptions && $html )
278
+ $desc = @html_entity_decode( $item->get_content(), ENT_QUOTES, get_option('blog_charset') ); // For import with HTML
279
+ elseif ( $use_simplepie && $displaydescriptions && !$html )
280
+ $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); // For import without HTML
281
+ elseif ( $displaydescriptions && $html && isset($item['content']['encoded']) && $item['content']['encoded'] != 'A' )
282
+ $desc = $item['content']['encoded']; // For import with HTML
283
+ elseif ( $displaydescriptions && $html && isset($item['content']['atom_content']) && $item['content']['atom_content'] != 'A' )
284
+ $desc = $item['content']['atom_content']; // For import with HTML
285
+ elseif ( $displaydescriptions && $html && isset($item['content']) && !is_array($item['content']) )
286
+ $desc = $item['content'];
287
+ elseif ( $displaydescriptions && $html && isset($item['description']) )
288
+ $desc = $item['description'];
289
+ elseif ( $displaydescriptions && !$html && isset($item['description']) )
290
+ $desc = wp_specialchars(strip_tags($item['description'])); // For import without HTML
291
+
292
+ if ( isset($a) && eregi('ISO', $a) ) {
293
+ if ($debug)
294
+ $echo .= 'ISO Feed' . "\n";
295
+ if ( isset($title) )
296
+ isodec($title);
297
+ if ( isset($creator) )
298
+ isodec($creator);
299
+ if ( isset($desc) )
300
+ isodec($desc);
301
+ } else {
302
+ if ($debug)
303
+ $echo .= 'NonISO Feed' . "\n";
304
+ if ( isset($title) )
305
+ utf8dec($title);
306
+ if ( isset($creator) )
307
+ utf8dec($creator);
308
+ if ( isset($desc) )
309
+ utf8dec($desc);
310
+ }
311
+
312
+ if ( isset($title) )
313
+ all_convert($title);
314
+ if ( isset($creator) )
315
+ all_convert($creator);
316
+ if ( isset($desc) )
317
+ all_convert($desc);
318
+
319
+ if ( isset($title) && $truncatetitlechar && (strlen($title) > $truncatetitlechar) ) {
320
+ $title = wp_html_excerpt($title, $truncatetitlechar) . $truncatetitlestring;
321
+ }
322
+
323
+ if ( isset($desc) && $truncatedescchar && (strlen($desc) > $truncatedescchar) ) {
324
+ $desc = wp_html_excerpt($desc, $truncatedescchar) . $truncatedescstring;
325
+ }
326
+
327
+ if ( $desc4title ) {
328
+ if ($use_simplepie)
329
+ $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); // For import without HTML
330
+ else if (isset($item['description']))
331
+ $desc = wp_specialchars(strip_tags($item['description']));
332
+ else
333
+ $desc ='';
334
+ $atitle = wp_html_excerpt($desc, $truncatedescchar) . $truncatedescstring;
335
+ } else {
336
+ $atitle = $title;
337
+ }
338
+
339
+ $echo .= '<a' . $target . $rel . ' href="' . $href . '" title="'. $atitle . '">' . $title . '</a>';
340
+ if ( isset($pubDate) && $date && $pubDate != '' )
341
+ $echo .= $before_date . $pubDate . $after_date;
342
+ if ( isset($creator) && $creator && $creator != '' )
343
+ $echo .= $before_creator . $creator . $after_creator;
344
+ if ( isset($desc) && $displaydescriptions && $desc != '' ) {
345
+ $after_desc_temp = stripslashes_deep( $after_desc );
346
+ $after_desc_temp = str_replace('%title%', $title, $after_desc_temp);
347
+ $after_desc_temp = str_replace('%href%', $href, $after_desc_temp);
348
+ $after_desc_temp = str_replace('%picture_url%', $picture_url, $after_desc_temp);
349
+ $before_desc_temp = str_replace('%title%', $title, $before_desc);
350
+ $before_desc_temp = str_replace('%href%', $href, $before_desc_temp);
351
+ $before_desc_temp = str_replace('%picture_url%', $picture_url, $before_desc_temp);
352
+ $echo .= $before_desc_temp . $desc . $after_desc_temp;
353
+ }
354
+ $end_item_temp = str_replace('%title%', $title, $end_item);
355
+ $end_item_temp = str_replace('%href%', $href, $end_item_temp);
356
+ $end_item_temp = str_replace('%picture_url%', $picture_url, $end_item_temp);
357
+ $echo .= $end_item_temp;
358
+ } else {
359
+ $nextitems = FALSE;
360
+ }
361
+
362
+ $display++;
363
+ }
364
+
365
+ if (strip_tags($echo)) { // novaclic: needed to filter out false content madeof tags alone (html comments, html tags, ...)
366
+ $echo = wptexturize($start_items . $echo . $end_items);
367
+ } else
368
+ $echo = wptexturize($before_noitems . $noitems . $after_noitems);
369
+
370
+ } else {
371
+ if ( empty($rss->ERROR) )
372
+ $rss->ERROR = NULL;
373
+ $echo = wptexturize($before_error . $error . $rss->ERROR . $after_error);
374
+ }
375
+
376
+ if ($paging) {
377
+ $echo .= '<div class="rsspaging">';
378
+ if ($previousitems)
379
+ $echo .= '<a href="' . add_query_arg( 'rsspage', ($page-1) ) . '" class="rsspaging_prev" title="' . $prev_paging_title . '">' . $prev_paging_link . '</a>';
380
+ if ($nextitems)
381
+ $echo .= '<a href="' . add_query_arg( 'rsspage', ($page+1) ) . '" class="rsspaging_next" title="' . $next_paging_title . '">' . $next_paging_link .'</a>';
382
+ $echo .= '<br style="clear: both" />';
383
+ $echo .= '</div>';
384
+ }
385
+
386
+ if ($view)
387
+ echo $echo;
388
+ else
389
+ return $echo;
390
+ }
391
+
392
+ function utf8dec($s_String) {
393
+ if ( version_compare(phpversion(), '5.0.0', '>=') )
394
+ $s_String = html_entity_decode(htmlentities( $s_String." ", ENT_COMPAT, 'UTF-8') );
395
+ else
396
+ $s_String = RSSImport_html_entity_decode_php4( htmlentities($s_String." ") );
397
+ return substr($s_String, 0, strlen($s_String)-1);
398
+ }
399
+
400
+ function isodec($s_String) {
401
+ if ( version_compare(phpversion(), '5.0.0', '>=') )
402
+ $s_String = html_entity_decode(htmlentities($s_String." ", ENT_COMPAT, 'ISO-8859-1'));
403
+ else
404
+ $s_String = RSSImport_html_entity_decode_php4( htmlentities($s_String." ") );
405
+ return substr($s_String, 0, strlen($s_String)-1);
406
+ }
407
+
408
+ function all_convert($s_String) {
409
+
410
+ // Array for entities
411
+ $umlaute = array('„','“','–',' \&#34;','&#8211;','&#8212;','&#8216;','&#8217;','&#8220;','&#8221;','&#8222;','&#8226;','&#8230;' ,
412
+ '�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,
413
+ '�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�' ,'�','�','�','�','�','�','�','�','�',
414
+ '�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',
415
+ '�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',
416
+ '�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
417
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
418
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
419
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
420
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
421
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
422
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
423
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
424
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
425
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
426
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
427
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
428
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
429
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
430
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
431
+ utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),chr(128),chr(129),chr(130),
432
+ chr(131),chr(132),chr(133),chr(134),chr(135),chr(136),chr(137),chr(138),chr(139),chr(140),chr(141),chr(142),chr(143),chr(144),chr(145),
433
+ chr(146),chr(147),chr(148),chr(149),chr(150),chr(151),chr(152),chr(153),chr(154),chr(155),chr(156),chr(157),chr(158),chr(159),chr(160),
434
+ chr(161),chr(162),chr(163),chr(164),chr(165),chr(166),chr(167),chr(168),chr(169),chr(170),chr(171),chr(172),chr(173),chr(174),chr(175),
435
+ chr(176),chr(177),chr(178),chr(179),chr(180),chr(181),chr(182),chr(183),chr(184),chr(185),chr(186),chr(187),chr(188),chr(189),chr(190),
436
+ chr(191),chr(192),chr(193),chr(194),chr(195),chr(196),chr(197),chr(198),chr(199),chr(200),chr(201),chr(202),chr(203),chr(204),chr(205),
437
+ chr(206),chr(207),chr(208),chr(209),chr(210),chr(211),chr(212),chr(213),chr(214),chr(215),chr(216),chr(217),chr(218),chr(219),chr(220),
438
+ chr(221),chr(222),chr(223),chr(224),chr(225),chr(226),chr(227),chr(228),chr(229),chr(230),chr(231),chr(232),chr(233),chr(234),chr(235),
439
+ chr(236),chr(237),chr(238),chr(239),chr(240),chr(241),chr(242),chr(243),chr(244),chr(245),chr(246),chr(247),chr(248),chr(249),chr(250),
440
+ chr(251),chr(252),chr(253),chr(254),chr(255),chr(256));
441
+ $htmlcode = array('&bdquo;','&ldquo;','&ndash;',' &#34;','&ndash;','&mdash;','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bdquo;','&bull;' ,
442
+ '&hellip;','&euro;','&sbquo;','&fnof;','&bdquo;','&hellip;','&dagger;','&Dagger;','&circ;','&permil;','&Scaron;','&lsaquo;','&OElig;',
443
+ '&#x017D;','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bull;','&ndash;','&mdash;','&tilde;','&trade;','&scaron;','&rsaquo;','&oelig;',
444
+ '&#x017E;','&Yuml;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;',
445
+ '&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&supl;','&ordm;','&raquo;',
446
+ '&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;',
447
+ '&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;',
448
+ '&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;',
449
+ '&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;',
450
+ '&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;',
451
+ '&yacute;','&thorn;','&yuml;','&euro;','&sbquo;','&fnof;','&bdquo;','&hellip;','&dagger;','&Dagger;','&circ;','&permil;','&Scaron;',
452
+ '&lsaquo;','&OElig;','&#x017D;','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bull;','&ndash;','&mdash;','&tilde;','&trade;','&scaron;',
453
+ '&rsaquo;','&oelig;','&#x017E;','&Yuml;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;',
454
+ '&laquo;','&not;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&supl;',
455
+ '&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;',
456
+ '&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;',
457
+ '&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;',
458
+ '&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;',
459
+ '&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;',
460
+ '&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;','&euro;','','&sbquo;','&fnof;','&bdquo;','&hellip;','&dagger;','&Dagger;','&circ;',
461
+ '&permil;','&Scaron;','&lsaquo;','&OElig;','','&#x017D;','','','&lsquo;','&rsquo;','&ldquo;','&rdquo;','&bull;','&ndash;','&mdash;',
462
+ '&tilde;','&trade;','&scaron;','&rsaquo;','&oelig;','','&#x017E;','&Yuml;','&nbsp;','&iexcl;','&iexcl;','&iexcl;','&iexcl;','&yen;',
463
+ '&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','�&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;',
464
+ '&acute;','&micro;','&para;','&middot;','&cedil;','&supl;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;',
465
+ '&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;',
466
+ '&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;',
467
+ '&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;',
468
+ '&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;',
469
+ '&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;');
470
+ //$s_String = str_replace($umlaute, $htmlcode, $s_String);
471
+ if ( version_compare(phpversion(), '5.0.0', '>=') )
472
+ $s_String = utf8_encode( html_entity_decode( str_replace($umlaute, $htmlcode, $s_String) ) );
473
+ else
474
+ $s_String = utf8_encode( RSSImport_html_entity_decode_php4( str_replace($umlaute, $htmlcode, $s_String) ) );
475
+
476
+ // &hellip; , &#8230;
477
+ $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\xA6~', '&hellip;', $s_String);
478
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\xA6~', '&hellip;', $s_String);
479
+ $s_String = preg_replace('~\xD0\xB2\xD0\x82\xC2\xA6~', '&hellip;', $s_String);
480
+
481
+ // &mdash; , &#8212;
482
+ $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9D~', '&mdash;', $s_String);
483
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '&mdash;', $s_String);
484
+ $s_String = preg_replace('~\xD0\xB2\xD0\x82\xE2\x80\x9D~', '&mdash;', $s_String);
485
+
486
+ // &ndash; , &#8211;
487
+ $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9C~', '&ndash;', $s_String);
488
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC5\x93~', '&ndash;', $s_String);
489
+ $s_String = preg_replace('~\xD0\xB2\xD0\x82\xE2\x80\x9C~', '&ndash;', $s_String);
490
+
491
+ // &rsquo; , &#8217;
492
+ $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x84\xA2~', '&rsquo;', $s_String);
493
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '&rsquo;', $s_String);
494
+ $s_String = preg_replace('~\xD0\xB2\xD0\x82\xE2\x84\xA2~', '&rsquo;', $s_String);
495
+ $s_String = preg_replace('~\xD0\xBF\xD1\x97\xD0\x85~', '&rsquo;', $s_String);
496
+
497
+ // &lsquo; , &#8216;
498
+ $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xCB\x9C~', '&lsquo;', $s_String);
499
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x8B\xC5\x93~', '&lsquo;', $s_String);
500
+
501
+ // &rdquo; , &#8221;
502
+ $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '&rdquo;', $s_String);
503
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\x9D~', '&rdquo;', $s_String);
504
+ $s_String = preg_replace('~\xD0\xB2\xD0\x82\xD1\x9C~', '&rdquo;', $s_String);
505
+
506
+ // &ldquo; , &#8220;
507
+ $s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC5\x93~', '&ldquo;', $s_String);
508
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x85\xE2\x80\x9C~', '&ldquo;', $s_String);
509
+ $s_String = preg_replace('~\xD0\xB2\xD0\x82\xD1\x9A~', '&ldquo;', $s_String);
510
+
511
+ // &trade; , &#8482;
512
+ $s_String = preg_replace('~\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '&trade;', $s_String);
513
+ $s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x82\xAC\xC5\xBE\xC3\x82\xC2\xA2~', '&trade;', $s_String);
514
+
515
+ // th
516
+ $s_String = preg_replace('~t\xC3\x82\xC2\xADh~', 'th', $s_String);
517
+
518
+ // .
519
+ $s_String = preg_replace('~.\xD0\x92+~', '.', $s_String);
520
+ $s_String = preg_replace('~.\xD0\x92~', '.', $s_String);
521
+
522
+ // ,
523
+ $s_String = preg_replace('~\x2C\xD0\x92~', ',', $s_String);
524
+
525
+ return $s_String;
526
+ }
527
+
528
+ /**
529
+ * Entfernt unvollstaendige Worte am Ende eines Strings.
530
+ * @author Thomas Scholz <http://toscho.de>
531
+ * @param $str Zeichenkette
532
+ * @return string
533
+ */
534
+ function RSSImport_end_on_word($str) {
535
+
536
+ $arr = explode( ' ', trim($str) );
537
+ array_pop($arr);
538
+
539
+ return rtrim( implode(' ', $arr), ',;');
540
+ }
541
+
542
+ function RSSImport_Shortcode($atts) {
543
+ extract(
544
+ shortcode_atts( array(
545
+ 'display' => 5,
546
+ 'feedurl' => 'http://bueltge.de/feed/',
547
+ 'before_desc' => '<br />',
548
+ 'displaydescriptions' => 0,
549
+ 'after_desc' => '',
550
+ 'html' => 0,
551
+ 'truncatedescchar' => 200,
552
+ 'truncatedescstring' => ' ... ',
553
+ 'truncatetitlechar' => '',
554
+ 'truncatetitlestring' => ' ... ',
555
+ 'before_date' => ' <small>',
556
+ 'date' => 0,
557
+ 'after_date' => '</small>',
558
+ 'date_format' => '',
559
+ 'before_creator' => ' <small>',
560
+ 'creator' => 0,
561
+ 'after_creator' => '</small>',
562
+ 'start_items' => '<ul>',
563
+ 'end_items' => '</ul>',
564
+ 'start_item' => '<li>',
565
+ 'end_item' => '</li>',
566
+ 'target' => '',
567
+ 'rel' => '',
568
+ 'desc4title' => 0,
569
+ 'charsetscan' => 0,
570
+ 'debug' => 0,
571
+ 'before_noitems' => '<p>',
572
+ 'noitems' => __('No items, feed is empty.', FB_RSSI_TEXTDOMAIN ),
573
+ 'after_noitems' => '</p>',
574
+ 'before_error' => '<p>',
575
+ 'error' => __('Error: Feed has an error or is not valid', FB_RSSI_TEXTDOMAIN ),
576
+ 'after_error' => '</p>',
577
+ 'paging' => 0,
578
+ 'prev_paging_link' => __( '&laquo; Previous', FB_RSSI_TEXTDOMAIN ),
579
+ 'next_paging_link' => __( 'Next &raquo;', FB_RSSI_TEXTDOMAIN ),
580
+ 'prev_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
581
+ 'next_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
582
+ 'use_simplepie' => 1,
583
+ 'view' => 0
584
+ ), $atts)
585
+ );
586
+ //var_dump($atts);
587
+
588
+ $display = intval($display);
589
+ if ( strtolower($html) == 'true')
590
+ $html = 1;
591
+ $html = intval($html);
592
+ if ( strtolower($displaydescriptions) == 'true')
593
+ $displaydescriptions = 1;
594
+ $displaydescriptions = intval($displaydescriptions);
595
+ if ( strtolower($truncatedescchar) == 'true')
596
+ $truncatedescchar = 1;
597
+ $truncatedescchar = intval($truncatedescchar);
598
+ if ( strtolower($truncatetitlechar) == 'true')
599
+ $truncatetitlechar = 1;
600
+ $truncatetitlechar = intval($truncatetitlechar);
601
+ if ( strtolower($date) == 'true')
602
+ $date = 1;
603
+ $date = intval($date);
604
+ if ( strtolower($creator) == 'true')
605
+ $creator = 1;
606
+ $creator = intval($creator);
607
+ if ( strtolower($charsetscan) == 'true')
608
+ $charsetscan = 1;
609
+ $charsetscan = intval($charsetscan);
610
+ if ( strtolower($debug) == 'true')
611
+ $debug = 1;
612
+ $debug = intval($debug);
613
+ if ( strtolower($paging) == 'true')
614
+ $paging = 1;
615
+ $paging = intval($paging);
616
+ if ( strtolower($use_simplepie) == 'true')
617
+ $use_simplepie = 1;
618
+ $use_simplepie = intval($use_simplepie);
619
+ $feedurl = html_entity_decode( $feedurl ); // novaclic: undo encoding due to wordpress WYSIWYG editor
620
+
621
+ $return = RSSImport(
622
+ $display, $feedurl,
623
+ $before_desc, $displaydescriptions, $after_desc, $html,
624
+ $truncatedescchar, $truncatedescstring,
625
+ $truncatetitlechar, $truncatetitlestring,
626
+ $before_date, $date, $after_date, $date_format,
627
+ $before_creator, $creator, $after_creator,
628
+ $start_items, $end_items,
629
+ $start_item, $end_item,
630
+ $target,
631
+ $rel,
632
+ $desc4title,
633
+ $charsetscan, $debug,
634
+ $before_noitems, $noitems, $after_noitems,
635
+ $before_error, $error, $after_error,
636
+ $paging, $prev_paging_link, $next_paging_link, $prev_paging_title, $next_paging_title,
637
+ $use_simplepie,
638
+ $view
639
+ );
640
+
641
+ return $return;
642
+ }
643
+
644
+ function RSSImport_shortcode_quot($pee) {
645
+ global $shortcode_tags;
646
+
647
+ if ( !empty($shortcode_tags) && is_array($shortcode_tags) ) {
648
+ $tagnames = array_keys($shortcode_tags);
649
+ $tagregexp = join( '|', array_map('preg_quote', $tagnames) );
650
+ $pee = preg_replace('/\\s*?(\\[(' . $tagregexp . ')\\b.*?\\/?\\](?:.+?\\[\\/\\2\\])?)\\s*/s', '$1', $pee);
651
+ }
652
+
653
+ return $pee;
654
+ }
655
+
656
+
657
+ /**
658
+ * add quicktag-button to editor
659
+ */
660
+
661
+ function RSSImport_insert_button() {
662
+ global $pagenow;
663
+
664
+ $post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
665
+ if ( ! in_array( $pagenow, $post_page_pages ) )
666
+ return;
667
+
668
+ ?>
669
+ <script type="text/javascript" charset="utf-8">
670
+ /* Adding Quicktag buttons to the editor WordPress ver. 3.3 and above
671
+ * - Button HTML ID (required)
672
+ * - Button display, value="" attribute (required)
673
+ * - Opening Tag (required)
674
+ * - Closing Tag (required)
675
+ * - Access key, accesskey="" attribute for the button (optional)
676
+ * - Title, title="" attribute (optional)
677
+ * - Priority/position on bar, 1-9 = first, 11-19 = second, 21-29 = third, etc. (optional)
678
+ */
679
+ var id = 'rssimport',
680
+ text = '<?php _e( 'RSSImport', FB_RSSI_TEXTDOMAIN ); ?>',
681
+ start = '[RSSImport display="5" feedurl="http://feedurl.com/" before_desc="<br />" displaydescriptions="TRUE" after_desc=" " ' +
682
+ 'html="FALSE" truncatedescchar="200" truncatedescstring=" ... " truncatetitlechar="" truncatetitlestring=" ... " ' +
683
+ 'before_date=" <small>" date="FALSE" after_date="</small>" date_format="" before_creator=" <small>" creator="FALSE" ' +
684
+ 'after_creator="</small>" start_items="<ul>" end_items="</ul>" start_item="<li>" end_item="</li>" target="" rel="" ' +
685
+ 'desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>" noitems="No items, feed is empty." ' +
686
+ 'after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid" after_error="</p>" ' +
687
+ 'paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;" prev_paging_title="more items" ' +
688
+ 'next_paging_title="more items" use_simplepie="FALSE"]',
689
+ end = '',
690
+ access = 'r',
691
+ title = '<?php _e( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ); ?>';
692
+
693
+ QTags.addButton( id, text, start, end, access );
694
+ </script>
695
+ <?php
696
+ }
697
+
698
+ function RSSImport_insert_button_old() {
699
+ global $pagenow;
700
+
701
+ $post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
702
+ if ( ! in_array( $pagenow, $post_page_pages ) )
703
+ return;
704
+
705
+ echo '
706
+ <script type="text/javascript">
707
+ //<![CDATA[
708
+ if ( typeof edButtons != \'undefined\' ) {
709
+ var length = edButtons.length;
710
+ edButtons[length] = new edButton(\'RSSImport\', \'$context\', \'[RSSImport display="5" feedurl="http://feedurl.com/"'.
711
+ ' before_desc="<br />" displaydescriptions="TRUE" after_desc=" " html="FALSE" truncatedescchar="200" truncatedescstring=" ... "'.
712
+ ' truncatetitlechar=" " truncatetitlestring=" ... " before_date=" <small>" date="FALSE" after_date="</small>"'.
713
+ ' date_format="" before_creator=" <small>" creator="FALSE" after_creator="</small>" start_items="<ul>" end_items="</ul>"'.
714
+ ' start_item="<li>" end_item="</li>" target="" rel="" desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>"'.
715
+ ' noitems="No items, feed is empty." after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid"'.
716
+ ' after_error="</p>" paging="FALSE" prev_paging_link="&laquo; Previous" next_paging_link="Next &raquo;"'.
717
+ ' prev_paging_title="more items" next_paging_title="more items" use_simplepie="FALSE"]\', \'\', \'\');
718
+ function RSSImport_tag(id) {
719
+ id = id.replace(/RSSImport_/, \'\');
720
+ edInsertTag(edCanvas, id);
721
+ }
722
+ jQuery(document).ready(function() {
723
+ content = \'<input id="RSSImport_\'+length+\'" class="ed_button" type="button" value="' . __( 'RSSImport', FB_RSSI_TEXTDOMAIN ) .
724
+ '" title="' . __( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ) . '" onclick="RSSImport_tag(this.id);" />\';
725
+ jQuery("#ed_toolbar").append(content);
726
+ });
727
+ }
728
+ //]]>
729
+ </script>';
730
+ }
731
+
732
+ if ( is_admin() && FB_RSSI_QUICKTAG ) {
733
+ if ( version_compare( $GLOBALS['wp_version'], '3.3alpha', '>=' ) )
734
+ add_action( 'admin_print_footer_scripts', 'RSSImport_insert_button' );
735
+ else
736
+ add_action( 'admin_footer', 'RSSImport_insert_button_old' );
737
+ }
738
+
739
+ if ( function_exists('add_shortcode') )
740
+ add_shortcode('RSSImport', 'RSSImport_Shortcode');
741
+
742
+ add_action( 'init', 'RSSImport_textdomain' );
743
+
744
+
745
+
746
+ /**
747
+ * code to utf-8 in PHP 4
748
+ *
749
+ * @package WP-RSSImport
750
+ */
751
+ function RSSImport_code_to_utf8($num) {
752
+
753
+ if ($num <= 0x7F) {
754
+ return chr($num);
755
+ } elseif ($num <= 0x7FF) {
756
+ return chr(($num >> 0x06) + 0xC0) . chr(($num & 0x3F) + 128);
757
+ } elseif ($num <= 0xFFFF) {
758
+ return chr(($num >> 0x0C) + 0xE0) . chr((($num >> 0x06) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);
759
+ } elseif ($num <= 0x1FFFFF) {
760
+ return chr(($num >> 0x12) + 0xF0) . chr((($num >> 0x0C) & 0x3F) + 0x80) . chr((($num >> 0x06) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);
761
+ }
762
+
763
+ return '';
764
+ }
765
+
766
+
767
+ /**
768
+ * html_entity_decode for PHP 4
769
+ *
770
+ * @package WP-RSSImport
771
+ */
772
+ function RSSImport_html_entity_decode_php4($str) {
773
+ $htmlentities = array (
774
+ "&Aacute;" => chr(195).chr(129),
775
+ "&aacute;" => chr(195).chr(161),
776
+ "&Acirc;" => chr(195).chr(130),
777
+ "&acirc;" => chr(195).chr(162),
778
+ "&acute;" => chr(194).chr(180),
779
+ "&AElig;" => chr(195).chr(134),
780
+ "&aelig;" => chr(195).chr(166),
781
+ "&Agrave;" => chr(195).chr(128),
782
+ "&agrave;" => chr(195).chr(160),
783
+ "&alefsym;" => chr(226).chr(132).chr(181),
784
+ "&Alpha;" => chr(206).chr(145),
785
+ "&alpha;" => chr(206).chr(177),
786
+ "&amp;" => chr(38),
787
+ "&and;" => chr(226).chr(136).chr(167),
788
+ "&ang;" => chr(226).chr(136).chr(160),
789
+ "&Aring;" => chr(195).chr(133),
790
+ "&aring;" => chr(195).chr(165),
791
+ "&asymp;" => chr(226).chr(137).chr(136),
792
+ "&Atilde;" => chr(195).chr(131),
793
+ "&atilde;" => chr(195).chr(163),
794
+ "&Auml;" => chr(195).chr(132),
795
+ "&auml;" => chr(195).chr(164),
796
+ "&bdquo;" => chr(226).chr(128).chr(158),
797
+ "&Beta;" => chr(206).chr(146),
798
+ "&beta;" => chr(206).chr(178),
799
+ "&brvbar;" => chr(194).chr(166),
800
+ "&bull;" => chr(226).chr(128).chr(162),
801
+ "&cap;" => chr(226).chr(136).chr(169),
802
+ "&Ccedil;" => chr(195).chr(135),
803
+ "&ccedil;" => chr(195).chr(167),
804
+ "&cedil;" => chr(194).chr(184),
805
+ "&cent;" => chr(194).chr(162),
806
+ "&Chi;" => chr(206).chr(167),
807
+ "&chi;" => chr(207).chr(135),
808
+ "&circ;" => chr(203).chr(134),
809
+ "&clubs;" => chr(226).chr(153).chr(163),
810
+ "&cong;" => chr(226).chr(137).chr(133),
811
+ "&copy;" => chr(194).chr(169),
812
+ "&crarr;" => chr(226).chr(134).chr(181),
813
+ "&cup;" => chr(226).chr(136).chr(170),
814
+ "&curren;" => chr(194).chr(164),
815
+ "&dagger;" => chr(226).chr(128).chr(160),
816
+ "&Dagger;" => chr(226).chr(128).chr(161),
817
+ "&darr;" => chr(226).chr(134).chr(147),
818
+ "&dArr;" => chr(226).chr(135).chr(147),
819
+ "&deg;" => chr(194).chr(176),
820
+ "&Delta;" => chr(206).chr(148),
821
+ "&delta;" => chr(206).chr(180),
822
+ "&diams;" => chr(226).chr(153).chr(166),
823
+ "&divide;" => chr(195).chr(183),
824
+ "&Eacute;" => chr(195).chr(137),
825
+ "&eacute;" => chr(195).chr(169),
826
+ "&Ecirc;" => chr(195).chr(138),
827
+ "&ecirc;" => chr(195).chr(170),
828
+ "&Egrave;" => chr(195).chr(136),
829
+ "&egrave;" => chr(195).chr(168),
830
+ "&empty;" => chr(226).chr(136).chr(133),
831
+ "&emsp;" => chr(226).chr(128).chr(131),
832
+ "&ensp;" => chr(226).chr(128).chr(130),
833
+ "&Epsilon;" => chr(206).chr(149),
834
+ "&epsilon;" => chr(206).chr(181),
835
+ "&equiv;" => chr(226).chr(137).chr(161),
836
+ "&Eta;" => chr(206).chr(151),
837
+ "&eta;" => chr(206).chr(183),
838
+ "&ETH;" => chr(195).chr(144),
839
+ "&eth;" => chr(195).chr(176),
840
+ "&Euml;" => chr(195).chr(139),
841
+ "&euml;" => chr(195).chr(171),
842
+ "&euro;" => chr(226).chr(130).chr(172),
843
+ "&exist;" => chr(226).chr(136).chr(131),
844
+ "&fnof;" => chr(198).chr(146),
845
+ "&forall;" => chr(226).chr(136).chr(128),
846
+ "&frac12;" => chr(194).chr(189),
847
+ "&frac14;" => chr(194).chr(188),
848
+ "&frac34;" => chr(194).chr(190),
849
+ "&frasl;" => chr(226).chr(129).chr(132),
850
+ "&Gamma;" => chr(206).chr(147),
851
+ "&gamma;" => chr(206).chr(179),
852
+ "&ge;" => chr(226).chr(137).chr(165),
853
+ "&harr;" => chr(226).chr(134).chr(148),
854
+ "&hArr;" => chr(226).chr(135).chr(148),
855
+ "&hearts;" => chr(226).chr(153).chr(165),
856
+ "&hellip;" => chr(226).chr(128).chr(166),
857
+ "&Iacute;" => chr(195).chr(141),
858
+ "&iacute;" => chr(195).chr(173),
859
+ "&Icirc;" => chr(195).chr(142),
860
+ "&icirc;" => chr(195).chr(174),
861
+ "&iexcl;" => chr(194).chr(161),
862
+ "&Igrave;" => chr(195).chr(140),
863
+ "&igrave;" => chr(195).chr(172),
864
+ "&image;" => chr(226).chr(132).chr(145),
865
+ "&infin;" => chr(226).chr(136).chr(158),
866
+ "&int;" => chr(226).chr(136).chr(171),
867
+ "&Iota;" => chr(206).chr(153),
868
+ "&iota;" => chr(206).chr(185),
869
+ "&iquest;" => chr(194).chr(191),
870
+ "&isin;" => chr(226).chr(136).chr(136),
871
+ "&Iuml;" => chr(195).chr(143),
872
+ "&iuml;" => chr(195).chr(175),
873
+ "&Kappa;" => chr(206).chr(154),
874
+ "&kappa;" => chr(206).chr(186),
875
+ "&Lambda;" => chr(206).chr(155),
876
+ "&lambda;" => chr(206).chr(187),
877
+ "&lang;" => chr(226).chr(140).chr(169),
878
+ "&laquo;" => chr(194).chr(171),
879
+ "&larr;" => chr(226).chr(134).chr(144),
880
+ "&lArr;" => chr(226).chr(135).chr(144),
881
+ "&lceil;" => chr(226).chr(140).chr(136),
882
+ "&ldquo;" => chr(226).chr(128).chr(156),
883
+ "&le;" => chr(226).chr(137).chr(164),
884
+ "&lfloor;" => chr(226).chr(140).chr(138),
885
+ "&lowast;" => chr(226).chr(136).chr(151),
886
+ "&loz;" => chr(226).chr(151).chr(138),
887
+ "&lrm;" => chr(226).chr(128).chr(142),
888
+ "&lsaquo;" => chr(226).chr(128).chr(185),
889
+ "&lsquo;" => chr(226).chr(128).chr(152),
890
+ "&macr;" => chr(194).chr(175),
891
+ "&mdash;" => chr(226).chr(128).chr(148),
892
+ "&micro;" => chr(194).chr(181),
893
+ "&middot;" => chr(194).chr(183),
894
+ "&minus;" => chr(226).chr(136).chr(146),
895
+ "&Mu;" => chr(206).chr(156),
896
+ "&mu;" => chr(206).chr(188),
897
+ "&nabla;" => chr(226).chr(136).chr(135),
898
+ "&nbsp;" => chr(194).chr(160),
899
+ "&ndash;" => chr(226).chr(128).chr(147),
900
+ "&ne;" => chr(226).chr(137).chr(160),
901
+ "&ni;" => chr(226).chr(136).chr(139),
902
+ "&not;" => chr(194).chr(172),
903
+ "&notin;" => chr(226).chr(136).chr(137),
904
+ "&nsub;" => chr(226).chr(138).chr(132),
905
+ "&Ntilde;" => chr(195).chr(145),
906
+ "&ntilde;" => chr(195).chr(177),
907
+ "&Nu;" => chr(206).chr(157),
908
+ "&nu;" => chr(206).chr(189),
909
+ "&Oacute;" => chr(195).chr(147),
910
+ "&oacute;" => chr(195).chr(179),
911
+ "&Ocirc;" => chr(195).chr(148),
912
+ "&ocirc;" => chr(195).chr(180),
913
+ "&OElig;" => chr(197).chr(146),
914
+ "&oelig;" => chr(197).chr(147),
915
+ "&Ograve;" => chr(195).chr(146),
916
+ "&ograve;" => chr(195).chr(178),
917
+ "&oline;" => chr(226).chr(128).chr(190),
918
+ "&Omega;" => chr(206).chr(169),
919
+ "&omega;" => chr(207).chr(137),
920
+ "&Omicron;" => chr(206).chr(159),
921
+ "&omicron;" => chr(206).chr(191),
922
+ "&oplus;" => chr(226).chr(138).chr(149),
923
+ "&or;" => chr(226).chr(136).chr(168),
924
+ "&ordf;" => chr(194).chr(170),
925
+ "&ordm;" => chr(194).chr(186),
926
+ "&Oslash;" => chr(195).chr(152),
927
+ "&oslash;" => chr(195).chr(184),
928
+ "&Otilde;" => chr(195).chr(149),
929
+ "&otilde;" => chr(195).chr(181),
930
+ "&otimes;" => chr(226).chr(138).chr(151),
931
+ "&Ouml;" => chr(195).chr(150),
932
+ "&ouml;" => chr(195).chr(182),
933
+ "&para;" => chr(194).chr(182),
934
+ "&part;" => chr(226).chr(136).chr(130),
935
+ "&permil;" => chr(226).chr(128).chr(176),
936
+ "&perp;" => chr(226).chr(138).chr(165),
937
+ "&Phi;" => chr(206).chr(166),
938
+ "&phi;" => chr(207).chr(134),
939
+ "&Pi;" => chr(206).chr(160),
940
+ "&pi;" => chr(207).chr(128),
941
+ "&piv;" => chr(207).chr(150),
942
+ "&plusmn;" => chr(194).chr(177),
943
+ "&pound;" => chr(194).chr(163),
944
+ "&prime;" => chr(226).chr(128).chr(178),
945
+ "&Prime;" => chr(226).chr(128).chr(179),
946
+ "&prod;" => chr(226).chr(136).chr(143),
947
+ "&prop;" => chr(226).chr(136).chr(157),
948
+ "&Psi;" => chr(206).chr(168),
949
+ "&psi;" => chr(207).chr(136),
950
+ "&radic;" => chr(226).chr(136).chr(154),
951
+ "&rang;" => chr(226).chr(140).chr(170),
952
+ "&raquo;" => chr(194).chr(187),
953
+ "&rarr;" => chr(226).chr(134).chr(146),
954
+ "&rArr;" => chr(226).chr(135).chr(146),
955
+ "&rceil;" => chr(226).chr(140).chr(137),
956
+ "&rdquo;" => chr(226).chr(128).chr(157),
957
+ "&real;" => chr(226).chr(132).chr(156),
958
+ "&reg;" => chr(194).chr(174),
959
+ "&rfloor;" => chr(226).chr(140).chr(139),
960
+ "&Rho;" => chr(206).chr(161),
961
+ "&rho;" => chr(207).chr(129),
962
+ "&rlm;" => chr(226).chr(128).chr(143),
963
+ "&rsaquo;" => chr(226).chr(128).chr(186),
964
+ "&rsquo;" => chr(226).chr(128).chr(153),
965
+ "&sbquo;" => chr(226).chr(128).chr(154),
966
+ "&Scaron;" => chr(197).chr(160),
967
+ "&scaron;" => chr(197).chr(161),
968
+ "&sdot;" => chr(226).chr(139).chr(133),
969
+ "&sect;" => chr(194).chr(167),
970
+ "&shy;" => chr(194).chr(173),
971
+ "&Sigma;" => chr(206).chr(163),
972
+ "&sigma;" => chr(207).chr(131),
973
+ "&sigmaf;" => chr(207).chr(130),
974
+ "&sim;" => chr(226).chr(136).chr(188),
975
+ "&spades;" => chr(226).chr(153).chr(160),
976
+ "&sub;" => chr(226).chr(138).chr(130),
977
+ "&sube;" => chr(226).chr(138).chr(134),
978
+ "&sum;" => chr(226).chr(136).chr(145),
979
+ "&sup1;" => chr(194).chr(185),
980
+ "&sup2;" => chr(194).chr(178),
981
+ "&sup3;" => chr(194).chr(179),
982
+ "&sup;" => chr(226).chr(138).chr(131),
983
+ "&supe;" => chr(226).chr(138).chr(135),
984
+ "&szlig;" => chr(195).chr(159),
985
+ "&Tau;" => chr(206).chr(164),
986
+ "&tau;" => chr(207).chr(132),
987
+ "&there4;" => chr(226).chr(136).chr(180),
988
+ "&Theta;" => chr(206).chr(152),
989
+ "&theta;" => chr(206).chr(184),
990
+ "&thetasym;" => chr(207).chr(145),
991
+ "&thinsp;" => chr(226).chr(128).chr(137),
992
+ "&THORN;" => chr(195).chr(158),
993
+ "&thorn;" => chr(195).chr(190),
994
+ "&tilde;" => chr(203).chr(156),
995
+ "&times;" => chr(195).chr(151),
996
+ "&trade;" => chr(226).chr(132).chr(162),
997
+ "&Uacute;" => chr(195).chr(154),
998
+ "&uacute;" => chr(195).chr(186),
999
+ "&uarr;" => chr(226).chr(134).chr(145),
1000
+ "&uArr;" => chr(226).chr(135).chr(145),
1001
+ "&Ucirc;" => chr(195).chr(155),
1002
+ "&ucirc;" => chr(195).chr(187),
1003
+ "&Ugrave;" => chr(195).chr(153),
1004
+ "&ugrave;" => chr(195).chr(185),
1005
+ "&uml;" => chr(194).chr(168),
1006
+ "&upsih;" => chr(207).chr(146),
1007
+ "&Upsilon;" => chr(206).chr(165),
1008
+ "&upsilon;" => chr(207).chr(133),
1009
+ "&Uuml;" => chr(195).chr(156),
1010
+ "&uuml;" => chr(195).chr(188),
1011
+ "&weierp;" => chr(226).chr(132).chr(152),
1012
+ "&Xi;" => chr(206).chr(158),
1013
+ "&xi;" => chr(206).chr(190),
1014
+ "&Yacute;" => chr(195).chr(157),
1015
+ "&yacute;" => chr(195).chr(189),
1016
+ "&yen;" => chr(194).chr(165),
1017
+ "&yuml;" => chr(195).chr(191),
1018
+ "&Yuml;" => chr(197).chr(184),
1019
+ "&Zeta;" => chr(206).chr(150),
1020
+ "&zeta;" => chr(206).chr(182),
1021
+ "&zwj;" => chr(226).chr(128).chr(141),
1022
+ "&zwnj;" => chr(226).chr(128).chr(140),
1023
+ "&gt;" => ">",
1024
+ "&lt;" => "<"
1025
+ );
1026
+
1027
+ $return = strtr($str, $htmlentities);
1028
+ $return = preg_replace('~&#x([0-9a-f]+);~ei', 'RSSImport_code_to_utf8(hexdec("\\1"))', $return);
1029
+ $return = preg_replace('~&#([0-9]+);~e', 'RSSImport_code_to_utf8(\\1)', $return);
1030
+
1031
+ return $return;
1032
+ }
1033
+
1034
+
1035
+ // check class wp_widget exists
1036
+ if ( class_exists('WP_Widget') ) {
1037
+
1038
+ class RSSImport_Widget extends WP_Widget {
1039
+
1040
+ function __construct() {
1041
+ $widget_ops = array('classname' => 'rssimport', 'description' => __( 'Entries from any RSS or Atom feed', FB_RSSI_TEXTDOMAIN ) );
1042
+ parent::__construct('rssimport', __( 'RSSImport' ), $widget_ops);
1043
+ }
1044
+
1045
+ function widget($args, $instance) {
1046
+ extract($args, EXTR_SKIP);
1047
+
1048
+ $title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
1049
+ $titlelink = empty($instance['titlelink']) ? '' : $instance['titlelink'];
1050
+ $display = empty($instance['display']) ? '5' : $instance['display'];
1051
+ $feedurl = empty($instance['feedurl']) ? 'http://bueltge.de/feed/' : $instance['feedurl'];
1052
+ $before_desc = empty($instance['before_desc']) ? '' : $instance['before_desc'];
1053
+ $displaydescriptions = empty($instance['displaydescriptions']) ? '0' : $instance['displaydescriptions'];
1054
+ $after_desc = empty($instance['after_desc']) ? '' : $instance['after_desc'];
1055
+ $html = empty($instance['html']) ? '0' : $instance['html'];
1056
+ $truncatedescchar = empty($instance['truncatedescchar']) ? '200' : $instance['truncatedescchar'];
1057
+ $truncatedescstring = empty($instance['truncatedescstring']) ? '' : $instance['truncatedescstring'];
1058
+ $truncatetitlechar = empty($instance['truncatetitlechar']) ? '' : $instance['truncatetitlechar'];
1059
+ $truncatetitlestring = empty($instance['truncatetitlestring']) ? ' ... ' : $instance['truncatetitlestring'];
1060
+ $before_date = empty($instance['before_date']) ? ' <small>' : $instance['before_date'];
1061
+ $date = empty($instance['date']) ? '0' : $instance['date'];
1062
+ $after_date = empty($instance['after_date']) ? '</small>' : $instance['after_date'];
1063
+ $date_format = empty($instance['date_format']) ? '' : $instance['date_format'];
1064
+ $before_creator = empty($instance['before_creator']) ? ' <small>' : $instance['before_creator'];
1065
+ $creator = empty($instance['creator']) ? '0' : $instance['creator'];
1066
+ $after_creator = empty($instance['after_creator']) ? '</small>' : $instance['after_creator'];
1067
+ $start_items = empty($instance['start_items']) ? '<ul>' : $instance['start_items'];
1068
+ $end_items = empty($instance['end_items']) ? '</ul>' : $instance['end_items'];
1069
+ $start_item = empty($instance['start_item']) ? '<li>' : $instance['start_item'];
1070
+ $end_item = empty($instance['end_item']) ? '</li>' : $instance['end_item'];
1071
+ $target = empty($instance['target']) ? '' : $instance['target'];
1072
+ $rel = empty($instance['rel']) ? '' : $instance['rel'];
1073
+ $desc4title = empty($instance['desc4title']) ? '0' : $instance['desc4title'];
1074
+ $charsetscan = empty($instance['charsetscan']) ? '0' : $instance['charsetscan'];
1075
+ $debug = empty($instance['debug']) ? '0' : $instance['debug'];
1076
+ $before_noitems = empty($instance['before_noitems']) ? '<p>' : $instance['before_noitems'];
1077
+ $noitems = empty($instance['noitems']) ? __('No items, feed is empty.', FB_RSSI_TEXTDOMAIN) : $instance['noitems'];
1078
+ $after_noitems = empty($instance['after_noitems']) ? '</p>' : $instance['after_noitems'];
1079
+ $before_error = empty($instance['before_error']) ? '<p>' : $instance['before_error'];
1080
+ $error = empty($instance['error']) ? __('Error: Feed has an error or is not valid', FB_RSSI_TEXTDOMAIN) : $instance['error'];
1081
+ $after_error = empty($instance['after_error']) ? '</p>' : $instance['after_error'];
1082
+ $paging = empty($instance['paging']) ? '0' : $instance['paging'];
1083
+ $prev_paging_link = empty($instance['prev_paging_link']) ? __('&laquo; Previous', FB_RSSI_TEXTDOMAIN) : $instance['prev_paging_link'];
1084
+ $next_paging_link = empty($instance['next_paging_link']) ? __('Next &raquo;', FB_RSSI_TEXTDOMAIN) : $instance['next_paging_link'];
1085
+ $prev_paging_title = empty($instance['prev_paging_title']) ? __('more items', FB_RSSI_TEXTDOMAIN) : $instance['prev_paging_title'];
1086
+ $next_paging_title = empty($instance['next_paging_title']) ? __('more items', FB_RSSI_TEXTDOMAIN) : $instance['next_paging_title'];
1087
+ $use_simplepie = empty($instance['use_simplepie']) ? '1' : $instance['use_simplepie'];
1088
+ $view = empty($instance['view']) ? '1' : $instance['view'];
1089
+
1090
+ echo $before_widget;
1091
+ if ( $titlelink != '' )
1092
+ $title = '<a href="' . $titlelink . '">' . $title . '</a>';
1093
+ echo $before_title . $title . $after_title;
1094
+ RSSImport(
1095
+ $display, $feedurl,
1096
+ $before_desc, $displaydescriptions, $after_desc, $html, $truncatedescchar, $truncatedescstring,
1097
+ $truncatetitlechar, $truncatetitlestring,
1098
+ $before_date, $date, $after_date, $date_format,
1099
+ $before_creator, $creator, $after_creator,
1100
+ $start_items, $end_items,
1101
+ $start_item, $end_item,
1102
+ $target,
1103
+ $rel,
1104
+ $desc4title,
1105
+ $charsetscan, $debug,
1106
+ $before_noitems, $noitems, $after_noitems,
1107
+ $before_error, $error, $after_error,
1108
+ $paging, $prev_paging_link, $next_paging_link, $prev_paging_title, $next_paging_title,
1109
+ $use_simplepie,
1110
+ $view
1111
+ );
1112
+ echo $after_widget;
1113
+ }
1114
+
1115
+ function update($new_instance, $old_instance) {
1116
+ $instance['instance'] = $old_instance;
1117
+ $instance['title'] = strip_tags( $new_instance['title'] );
1118
+ $instance['titlelink'] = esc_url($new_instance['titlelink']);
1119
+ $instance['display'] = (int) $new_instance['display'];
1120
+ $instance['feedurl'] = $new_instance['feedurl'];
1121
+ $instance['before_desc'] = $new_instance['before_desc'];
1122
+ $instance['displaydescriptions'] = (int) $new_instance['displaydescriptions'];
1123
+ $instance['after_desc'] = stripslashes_deep( $new_instance['after_desc'] );
1124
+ $instance['html'] = (int) $new_instance['html'];
1125
+ $instance['truncatedescchar'] = (int) $new_instance['truncatedescchar'];
1126
+ $instance['truncatedescstring'] = $new_instance['truncatedescstring'];
1127
+ $instance['truncatetitlechar'] = (int) $new_instance['truncatetitlechar'];
1128
+ $instance['truncatetitlestring'] = $new_instance['truncatetitlestring'];
1129
+ $instance['before_date'] = $new_instance['before_date'];
1130
+ $instance['date'] = (int) $new_instance['date'];
1131
+ $instance['after_date'] = $new_instance['after_date'];
1132
+ $instance['date_format'] = $new_instance['date_format'];
1133
+ $instance['before_creator'] = $new_instance['before_creator'];
1134
+ $instance['creator'] = (int) $new_instance['creator'];
1135
+ $instance['after_creator'] = $new_instance['after_creator'];
1136
+ $instance['start_items'] = $new_instance['start_items'];
1137
+ $instance['end_items'] = $new_instance['end_items'];
1138
+ $instance['start_item'] = $new_instance['start_item'];
1139
+ $instance['end_item'] = $new_instance['end_item'];
1140
+ $instance['target'] = $new_instance['target'];
1141
+ $instance['rel'] = $new_instance['rel'];
1142
+ $instance['desc4title'] = (int) $new_instance['desc4title'];
1143
+ $instance['charsetscan'] = (int) $new_instance['charsetscan'];
1144
+ $instance['debug'] = (int) $new_instance['debug'];
1145
+ $instance['view'] = (int) $new_instance['view'];
1146
+ $instance['before_noitems'] = $new_instance['before_noitems'];
1147
+ $instance['noitems'] = $new_instance['noitems'];
1148
+ $instance['after_noitems'] = $new_instance['after_noitems'];
1149
+ $instance['before_error'] = $new_instance['before_error'];
1150
+ $instance['error'] = $new_instance['error'];
1151
+ $instance['after_error'] = $new_instance['after_error'];
1152
+ $instance['paging'] = (int) $new_instance['paging'];
1153
+ $instance['prev_paging_link'] = $new_instance['prev_paging_link'];
1154
+ $instance['next_paging_link'] = $new_instance['next_paging_link'];
1155
+ $instance['prev_paging_title'] = $new_instance['prev_paging_title'];
1156
+ $instance['next_paging_title'] = $new_instance['next_paging_title'];
1157
+ $instance['use_simplepie'] = (int) $new_instance['use_simplepie'];
1158
+
1159
+ if ( current_user_can('unfiltered_html') )
1160
+ return $instance;
1161
+ else
1162
+ return stripslashes( strip_tags ( $instance ) );
1163
+ }
1164
+
1165
+ function form($instance) {
1166
+ $instance = wp_parse_args(
1167
+ (array) $instance, array(
1168
+ 'title' => '',
1169
+ 'titlelink' => '',
1170
+ 'display' => 5,
1171
+ 'feedurl' => 'http://bueltge.de/feed/',
1172
+ 'before_desc' => '',
1173
+ 'displaydescriptions' => 0,
1174
+ 'after_desc' => '',
1175
+ 'html' => 0,
1176
+ 'truncatedescchar' => 200,
1177
+ 'truncatedescstring' => ' ... ',
1178
+ 'truncatetitlechar' => '',
1179
+ 'truncatetitlestring' => ' ... ',
1180
+ 'before_date' => ' <small>',
1181
+ 'date' => 0,
1182
+ 'after_date' => '</small>',
1183
+ 'date_format' => '',
1184
+ 'before_creator' => ' <small>',
1185
+ 'creator' => 0,
1186
+ 'after_creator' => '</small>',
1187
+ 'start_items' => '<ul>',
1188
+ 'end_items' => '</ul>',
1189
+ 'start_item' => '<li>',
1190
+ 'end_item' => '</li>',
1191
+ 'target' => '',
1192
+ 'rel' => '',
1193
+ 'desc4title' => 0,
1194
+ 'charsetscan' => 0,
1195
+ 'debug' => 0,
1196
+ 'view' => 1,
1197
+ 'before_noitems' => '<p>',
1198
+ 'noitems' => __('No items, feed is empty.', FB_RSSI_TEXTDOMAIN),
1199
+ 'after_noitems' => '</p>',
1200
+ 'before_error' => '<p>',
1201
+ 'error' => __('Error: Feed has an error or is not valid', FB_RSSI_TEXTDOMAIN),
1202
+ 'after_error' => '</p>',
1203
+ 'paging' => 0,
1204
+ 'prev_paging_link' => __('&laquo; Previous', FB_RSSI_TEXTDOMAIN),
1205
+ 'next_paging_link' => __('Next &raquo;', FB_RSSI_TEXTDOMAIN),
1206
+ 'prev_paging_title' => __('more items', FB_RSSI_TEXTDOMAIN),
1207
+ 'next_paging_title' => __('more items', FB_RSSI_TEXTDOMAIN),
1208
+ 'use_simplepie' => 1
1209
+ )
1210
+ );
1211
+
1212
+ $title = strip_tags($instance['title']);
1213
+ $titlelink = esc_url($instance['titlelink']);
1214
+ $display = (int) $instance['display'];
1215
+ $feedurl = $instance['feedurl'];
1216
+ $before_desc = $instance['before_desc'];
1217
+ $displaydescriptions = (int) $instance['displaydescriptions'];
1218
+ $after_desc = format_to_edit( $instance['after_desc'] );
1219
+ $html = (int) $instance['html'];
1220
+ $truncatedescchar = (int) $instance['truncatedescchar'];
1221
+ $truncatedescstring = (int) $instance['truncatedescstring'];
1222
+ $truncatetitlechar = $instance['truncatetitlechar'];
1223
+ $truncatetitlestring = $instance['truncatetitlestring'];
1224
+ $before_date = $instance['before_date'];
1225
+ $date = (int) $instance['date'];
1226
+ $after_date = $instance['after_date'];
1227
+ $date_format = $instance['date_format'];
1228
+ $before_creator = $instance['before_creator'];
1229
+ $creator = (int) $instance['creator'];
1230
+ $after_creator = $instance['after_creator'];
1231
+ $start_items = $instance['start_items'];
1232
+ $end_items = $instance['end_items'];
1233
+ $start_item = $instance['start_item'];
1234
+ $end_item = $instance['end_item'];
1235
+ $target = $instance['target'];
1236
+ $rel = $instance['rel'];
1237
+ $desc4title = (int) $instance['desc4title'];
1238
+ $charsetscan = (int) $instance['charsetscan'];
1239
+ $debug = (int) $instance['debug'];
1240
+ $before_noitems = $instance['before_noitems'];
1241
+ $noitems = $instance['noitems'];
1242
+ $after_noitems = $instance['after_noitems'];
1243
+ $before_error = $instance['before_error'];
1244
+ $error = $instance['error'];
1245
+ $after_error = $instance['after_error'];
1246
+ $paging = (int) $instance['paging'];
1247
+ $prev_paging_link = $instance['prev_paging_link'];
1248
+ $next_paging_link = $instance['next_paging_link'];
1249
+ $prev_paging_title = $instance['prev_paging_title'];
1250
+ $next_paging_title = $instance['next_paging_title'];
1251
+ $use_simplepie = (int) $instance['use_simplepie'];
1252
+ $view = (int) $instance['view'];
1253
+ ?>
1254
+ <p>
1255
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1256
+ </p>
1257
+ <p>
1258
+ <label for="<?php echo $this->get_field_id('titlelink'); ?>"><?php _e( 'URL for Title (incl. http://):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1259
+ </p>
1260
+ <p>
1261
+ <label for="<?php echo $this->get_field_id('display'); ?>"><?php _e( 'Display:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1262
+ </p>
1263
+ <p>
1264
+ <label for="<?php echo $this->get_field_id('feedurl'); ?>"><?php _e( 'FeedURL:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1265
+ </p>
1266
+ <p>
1267
+ <label for="<?php echo $this->get_field_id('before_desc'); ?>"><?php _e( 'Before Description:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1268
+ </p>
1269
+ <p>
1270
+ <label for="<?php echo $this->get_field_id('displaydescriptions'); ?>"><?php _e( 'Display Description:', FB_RSSI_TEXTDOMAIN ) ?>
1271
+ <select id="<?php echo $this->get_field_id('displaydescriptions'); ?>" name="<?php echo $this->get_field_name('displaydescriptions'); ?>">
1272
+ <option value="0"<?php if ($displaydescriptions == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1273
+ <option value="1"<?php if ($displaydescriptions == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1274
+ </select>
1275
+ </label>
1276
+ </p>
1277
+ <p>
1278
+ <label for="<?php echo $this->get_field_id('after_desc'); ?>"><?php _e( 'After Description:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1279
+ <br /><small><?php _e( 'You can use the following strings to create custom links:', FB_RSSI_TEXTDOMAIN ); ?> <code>%title%</code>, <code>%href%</code>
1280
+ <br /><?php _e( 'Example:', FB_RSSI_TEXTDOMAIN ); ?> <code>&lt;a href="%href%" target="self" rel="follow"&gt;%title%&lt;/a&gt;</code></small>
1281
+ </p>
1282
+ <p>
1283
+ <label for="<?php echo $this->get_field_id('html'); ?>"><?php _e( 'HTML:', FB_RSSI_TEXTDOMAIN ) ?>
1284
+ <select id="<?php echo $this->get_field_id('html'); ?>" name="<?php echo $this->get_field_name('html'); ?>">
1285
+ <option value="0"<?php if ($html == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1286
+ <option value="1"<?php if ($html == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1287
+ </select>
1288
+ </label>
1289
+ </p>
1290
+ <p>
1291
+ <label for="<?php echo $this->get_field_id('truncatedescchar'); ?>"><?php _e( 'Truncate Description Char:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1292
+ </p>
1293
+ <p>
1294
+ <label for="<?php echo $this->get_field_id('truncatedescstring'); ?>"><?php _e( 'Truncate Description String (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1295
+ </p>
1296
+ <p>
1297
+ <label for="<?php echo $this->get_field_id('truncatetitlechar'); ?>"><?php _e( 'Truncate Title Char:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1298
+ </p>
1299
+ <p>
1300
+ <label for="<?php echo $this->get_field_id('truncatetitlestring'); ?>"><?php _e( 'Truncate Title String (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1301
+ </p>
1302
+ <p>
1303
+ <label for="<?php echo $this->get_field_id('before_date'); ?>"><?php _e( 'Before Date (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1304
+ </p>
1305
+ <p>
1306
+ <label for="<?php echo $this->get_field_id('date'); ?>"><?php _e( 'Date:', FB_RSSI_TEXTDOMAIN ) ?>
1307
+ <select id="<?php echo $this->get_field_id('date'); ?>" name="<?php echo $this->get_field_name('date'); ?>">
1308
+ <option value="0"<?php if ($date == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1309
+ <option value="1"<?php if ($date == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1310
+ </select>
1311
+ </label>
1312
+ </p>
1313
+ <p>
1314
+ <label for="<?php echo $this->get_field_id('after_date'); ?>"><?php _e( 'After Date (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1315
+ </p>
1316
+ <p>
1317
+ <label for="<?php echo $this->get_field_id('date_format'); ?>"><?php _e( 'Date Formatting:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1318
+ <br /><small><?php _e( 'Leave empty for use the date format of your WordPress settings.', FB_RSSI_TEXTDOMAIN ); ?> <a href="http://codex.wordpress.org/Formatting_Date_and_Time"><?php _e( 'Documentation on date formatting', FB_RSSI_TEXTDOMAIN ); ?></a></small>
1319
+ </p>
1320
+ <p>
1321
+ <label for="<?php echo $this->get_field_id('before_creator'); ?>"><?php _e( 'Before Creator (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1322
+ </p>
1323
+ <p>
1324
+ <label for="<?php echo $this->get_field_id('creator'); ?>"><?php _e( 'Creator:', FB_RSSI_TEXTDOMAIN ) ?>
1325
+ <select id="<?php echo $this->get_field_id('creator'); ?>" name="<?php echo $this->get_field_name('creator'); ?>">
1326
+ <option value="0"<?php if ($creator == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1327
+ <option value="1"<?php if ($creator == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1328
+ </select>
1329
+ </label>
1330
+ </p>
1331
+ <p>
1332
+ <label for="<?php echo $this->get_field_id('after_creator'); ?>"><?php _e( 'After Creator (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1333
+ </p>
1334
+ <p>
1335
+ <label for="<?php echo $this->get_field_id('start_items'); ?>"><?php _e( 'Before Items (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1336
+ </p>
1337
+ <p>
1338
+ <label for="<?php echo $this->get_field_id('end_items'); ?>"><?php _e( 'After Items (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1339
+ </p>
1340
+ <p>
1341
+ <label for="<?php echo $this->get_field_id('start_item'); ?>"><?php _e( 'Before Item (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1342
+ </p>
1343
+ <p>
1344
+ <label for="<?php echo $this->get_field_id('end_item'); ?>"><?php _e( 'After Item (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1345
+ </p>
1346
+ <p>
1347
+ <label for="<?php echo $this->get_field_id('target'); ?>"><?php _e( 'Target Attribut:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1348
+ </p>
1349
+ <p>
1350
+ <label for="<?php echo $this->get_field_id('rel'); ?>"><?php _e( 'Rel Attribut:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1351
+ </p>
1352
+ <p>
1353
+ <label for="<?php echo $this->get_field_id('desc4title'); ?>"><?php _e( 'Desc4Title:', FB_RSSI_TEXTDOMAIN ) ?>
1354
+ <select id="<?php echo $this->get_field_id('desc4title'); ?>" name="<?php echo $this->get_field_name('desc4title'); ?>">
1355
+ <option value="0"<?php if ($desc4title == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1356
+ <option value="1"<?php if ($desc4title == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1357
+ </select>
1358
+ </label>
1359
+ <br />
1360
+ <small><?php _e( 'Description for title-Attribut on Title-Link', FB_RSSI_TEXTDOMAIN ); ?></small>
1361
+ </p>
1362
+ <p>
1363
+ <label for="<?php echo $this->get_field_id('charsetscan'); ?>"><?php _e( 'Charsetscan:', FB_RSSI_TEXTDOMAIN ) ?>
1364
+ <select id="<?php echo $this->get_field_id('charsetscan'); ?>" name="<?php echo $this->get_field_name('charsetscan'); ?>">
1365
+ <option value="0"<?php if ($charsetscan == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1366
+ <option value="1"<?php if ($charsetscan == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1367
+ </select>
1368
+ </label>
1369
+ </p>
1370
+ <p>
1371
+ <label for="<?php echo $this->get_field_id('debug'); ?>"><?php _e( 'Debug mode:', FB_RSSI_TEXTDOMAIN ) ?>
1372
+ <select id="<?php echo $this->get_field_id('debug'); ?>" name="<?php echo $this->get_field_name('debug'); ?>">
1373
+ <option value="0"<?php if ($debug == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1374
+ <option value="1"<?php if ($debug == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1375
+ </select>
1376
+ </label>
1377
+ </p>
1378
+ <p>
1379
+ <label for="<?php echo $this->get_field_id('before_noitems'); ?>"><?php _e( 'Before <em>No</em> Items Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1380
+ </p>
1381
+ <p>
1382
+ <label for="<?php echo $this->get_field_id('noitems'); ?>"><?php _e( '<em>No</em> Items Message:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1383
+ </p>
1384
+ <p>
1385
+ <label for="<?php echo $this->get_field_id('after_noitems'); ?>"><?php _e( 'After <em>No</em> Items Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1386
+ </p>
1387
+ <p>
1388
+ <label for="<?php echo $this->get_field_id('before_error'); ?>"><?php _e( 'Before Error Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1389
+ </p>
1390
+ <p>
1391
+ <label for="<?php echo $this->get_field_id('error'); ?>"><?php _e( 'Error Message:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1392
+ </p>
1393
+ <p>
1394
+ <label for="<?php echo $this->get_field_id('after_error'); ?>"><?php _e( 'After Error Message (HTML):', FB_RSSI_TEXTDOMAIN ) ?> <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>
1395
+ </p>
1396
+ <p>
1397
+ <label for="<?php echo $this->get_field_id('paging'); ?>"><?php _e( 'Pagination:', FB_RSSI_TEXTDOMAIN ) ?>
1398
+ <select id="<?php echo $this->get_field_id('paging'); ?>" name="<?php echo $this->get_field_name('paging'); ?>">
1399
+ <option value="0"<?php if ($paging == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1400
+ <option value="1"<?php if ($paging == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1401
+ </select>
1402
+ </label>
1403
+ </p>
1404
+ <p>
1405
+ <label for="<?php echo $this->get_field_id('prev_paging_link'); ?>"><?php _e( 'Previous Pagination Link String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1406
+ </p>
1407
+ <p>
1408
+ <label for="<?php echo $this->get_field_id('next_paging_link'); ?>"><?php _e( 'Next Pagination Link String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1409
+ </p>
1410
+ <p>
1411
+ <label for="<?php echo $this->get_field_id('prev_paging_title'); ?>"><?php _e( 'Previous Pagination Title String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1412
+ </p>
1413
+ <p>
1414
+ <label for="<?php echo $this->get_field_id('next_paging_title'); ?>"><?php _e( 'Next Pagination Title String:', FB_RSSI_TEXTDOMAIN ) ?> <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>
1415
+ </p>
1416
+ <p>
1417
+ <label for="<?php echo $this->get_field_id('use_simplepie'); ?>"><?php _e( 'Use SimplePie class:', FB_RSSI_TEXTDOMAIN ) ?>
1418
+ <select id="<?php echo $this->get_field_id('use_simplepie'); ?>" name="<?php echo $this->get_field_name('use_simplepie'); ?>">
1419
+ <option value="0"<?php if ($use_simplepie == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1420
+ <option value="1"<?php if ($use_simplepie == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1421
+ </select>
1422
+ </label>
1423
+ </p>
1424
+ <p>
1425
+ <label for="<?php echo $this->get_field_id('view'); ?>"><?php _e( 'Echo/Return:', FB_RSSI_TEXTDOMAIN ) ?>
1426
+ <select id="<?php echo $this->get_field_id('view'); ?>" name="<?php echo $this->get_field_name('view'); ?>">
1427
+ <option value="0"<?php if ($view == '0') { echo ' selected="selected"'; } ?>><?php _e('False', FB_RSSI_TEXTDOMAIN ); ?></option>
1428
+ <option value="1"<?php if ($view == '1') { echo ' selected="selected"'; } ?>><?php _e('True', FB_RSSI_TEXTDOMAIN ); ?></option>
1429
+ </select>
1430
+ </label>
1431
+ </p>
1432
+ <?php
1433
+
1434
+ }
1435
+ }
1436
+
1437
+ add_action( 'widgets_init', create_function('', 'return register_widget("RSSImport_Widget");') );
1438
+
1439
+ } // end if class wp_widget exists