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