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',
|