Version Description
Download this release
Release Info
Developer | Bueltge |
Plugin | RSSImport |
Version | 4.4.17 |
Comparing to | |
See all releases |
Code changes from version 4.4.16 to 4.4.17
- readme.txt +246 -241
- rssimport.php +1419 -1182
- screenshot-1.png +0 -0
readme.txt
CHANGED
@@ -1,241 +1,246 @@
|
|
1 |
-
=== RSSImport ===
|
2 |
-
Contributors: Bueltge, inpsyde, took77
|
3 |
-
Plugin URI:
|
4 |
-
Author: Frank
|
5 |
-
Author URI:
|
6 |
-
Donate link:
|
7 |
-
Tags: rss, post, content, post, feed
|
8 |
-
Requires at least: 1.5
|
9 |
-
Tested up to: 4.
|
10 |
-
Stable tag: 4.4.
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
== Description ==
|
15 |
-
|
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 |
-
|
19 |
-
You can insert the following code into a PHP plugin or in a template, for example `sidebar.php` or `single.php`:
|
20 |
-
|
21 |
-
|
22 |
-
_Example:_
|
23 |
-
`<?php RSSImport(10, 'http://bueltge.de/feed/'); ?>`
|
24 |
-
|
25 |
-
This is the minimal code needed for using the plugin. The plugin accepts a number of parameters for customizing the feed content import. See below for the full list of available parameters. You can also use any of the parameters with Shortcode in posts and pages.
|
26 |
-
|
27 |
-
_Example Shortcode:_
|
28 |
-
`[RSSImport display="5" feedurl="http://bueltge.de/feed/"]`
|
29 |
-
|
30 |
-
For all (bool) parameters you can either use the strings `true` and `false` or the integer values `1` and `0`.
|
31 |
-
|
32 |
-
|
33 |
-
1. `display` - The number of items to display. Default is `5`.
|
34 |
-
1. `feedurl` - The feed address. Default is `http://bueltge.de/feed/`.
|
35 |
-
1. `before_desc` - The HTML or string to insert before the description. Default is `empty`. You can use some variables which will be replaced, see below.
|
36 |
-
1. `displaydescriptions` - (bool) When set to true, the description for each entry will be displayed. Default is `false`.
|
37 |
-
1. `after_desc` - The HTML or string to insert after the description. Default is `empty`. You can use some variables which will be replaced, see below.
|
38 |
-
1. `html` - (bool) When set to true, the description can include HTML tags. Default is `false`.
|
39 |
-
1. `truncatedescchar` - The maximum number of characters allowed in descriptions. If the description is longer than this length, it will be truncated to the given length. Default is `200`, set the value to empty quotes `''` to never truncate descriptions.
|
40 |
-
1. `truncatedescstring` - The HTML or string to insert at the end of a description after it has been truncated. Default is ` ... `
|
41 |
-
1. `truncatetitlechar` - The maximum number of characters allowed in titles. If the title is longer than this value, it will be truncated to the given length. Default is `''`, which means never truncate titles.
|
42 |
-
1. `truncatetitlestring` - The HTML or string to insert at the end of a title after it has been truncated. Default is `' ... '`.
|
43 |
-
1. `before_date` - The HTML or string to insert before the date. Default is ` <small>`.
|
44 |
-
1. `date` - (bool) If true, display the date of the item. Default is `false`.
|
45 |
-
1. `after_date` - The HTML or string to insert after the date. Default is `</small>`.
|
46 |
-
1. `date_format`- The date format string. Leave empty to use the format of your WordPress installation. If a different date format is desired, specify a PHP date string, for example: `F j, Y`. See also [the date and time formatting page in the WordPress Codex](http://codex.wordpress.org/Formatting_Date_and_Time).
|
47 |
-
1. `before_creator` - The HTML or string to insert before the creator of the item. Default is ` <small>`.
|
48 |
-
1. `creator` - (bool) If true, display the creator of the item. Default is `false`.
|
49 |
-
1. `after_creator` - The HTML or string to insert after creator of the item. Default is `</small>`.
|
50 |
-
1. `start_items` - The HTML or string to insert before the list of items. Default is `<ul>`.
|
51 |
-
1. `end_items` - The HTML or string to insert after the list of items. Default is `</ul>`.
|
52 |
-
1. `start_item` - The HTML or string to insert before each item. Default is `<li>`. You can use some variables which will be replaced, see below.
|
53 |
-
1. `end_item` - The HTML or string to insert after each item. Default is `</li>`. You can use some variables which will be replaced, see below.
|
54 |
-
1. `target` - The string to use for the `target` attribute on links. Default is `empty`. Valid options are `blank`, `self`, `parent`, `top`.
|
55 |
-
1. `rel` - The string to use for the `rel` attribute on links. Default is `empty`. Valid options are `nofollow` and `follow`.
|
56 |
-
1. `desc4title` - The description to use in the `title` attribute on item title links. Default is `false`.
|
57 |
-
1. `charsetscan` - (bool) If true, scan the feed content for the correct character set. This may cause the content to load more slowly. Use this option if you're having problems with feed content being displayed with stranged characters. Default is `false`.
|
58 |
-
1. `debug` - (bool) If true, activate debug-mode, which will echo the Magpie object as an array. Default is `false`. Only use this option for debugging.
|
59 |
-
1. `before_noitems` - The HTML or string to insert before the no items message. Default is `<p>`.
|
60 |
-
1. `noitems`- The message to display when the feed is empty. Default is `No items, feed is empty.`.
|
61 |
-
1. `after_noitems` - The HTML or string to insert before the no items message. Default is `</p>`.
|
62 |
-
1. `before_error` - The HTML or string to insert before the error message. Default is `<p>`.
|
63 |
-
1. `error` - Error message displayed when there is an error loading or displaying the feed. Default is `Error: Feed has an error or is not valid`.
|
64 |
-
1. `after_error` - The HTML or string to insert before the error message. Default is `</p>`.
|
65 |
-
1. `paging` - (bool) If true, enable pagination. Default is `false`.
|
66 |
-
1. `prev_paging_link` - The name of the previous page link. Default is `« Previous`.
|
67 |
-
1. `next_paging_link` - The name next page link. Default is `Next »`.
|
68 |
-
1. `prev_paging_title` - The title attribute of the previous page link. Default is `more items`.
|
69 |
-
1. `next_paging_title` - The title attribute of the next page link. Default is `more items`.
|
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 |
-
|
73 |
-
The parameters `before_desc`, `after_desc`, `start_item` and `end_item` accepts the following variables which will be replaced:
|
74 |
-
|
75 |
-
|
76 |
-
1. `%title%` for the title of the entry
|
77 |
-
1. `%href%` for the entry's URL
|
78 |
-
1. `%picture_url%` for the URL of a thumbnail image for the entry if available. To use this variable, SimplePie is required to be enabled (`use_simplepie="true"`)
|
79 |
-
|
80 |
-
|
81 |
-
If pagination is enabled, it adds a `div` with the class `rsspaging` to enable easier styling with CSS. You can also style the previous and next links, which have the classes: `rsspaging_prev` and `rsspaging_next`.
|
82 |
-
|
83 |
-
You can use any of the parameters in the php function `RSSImport()` in your templates or with the Shortcode `[RSSImport]` in posts and pages.
|
84 |
-
|
85 |
-
= Examples =
|
86 |
-
_Using the PHP function with many parameters:_
|
87 |
-
|
88 |
-
RSSImport(
|
89 |
-
$display = 5, $feedurl = 'http://bueltge.de/feed/',
|
90 |
-
$before_desc = '', $displaydescriptions = false, $after_desc = '', $html = false, $truncatedescchar = 200, $truncatedescstring = ' ... ',
|
91 |
-
$truncatetitlechar = '', $truncatetitlestring = ' ... ',
|
92 |
-
$before_date = ' <small>', $date = false, $after_date = '</small>',
|
93 |
-
$before_creator = ' <small>', $creator = false, $after_creator = '</small>',
|
94 |
-
$start_items = '<ul>', $end_items = '</ul>',
|
95 |
-
$start_item = '<li>', $end_item = '</li>'
|
96 |
-
);
|
97 |
-
|
98 |
-
Please note that for the PHP function the parameters are expected in the order in which they are defined in the above list. Thus if you skip one parameter, you will also have to skip all of the subsequent parameters.
|
99 |
-
|
100 |
-
_Using Shortcode with several parameters:_
|
101 |
-
|
102 |
-
[RSSImport display="10" feedurl="http://your_feed_url/"
|
103 |
-
displaydescriptions="true" html="true"
|
104 |
-
start_items="<ol>" end_items="</ol>" paging="true"]
|
105 |
-
|
106 |
-
_Add a "more" link to the output:_
|
107 |
-
|
108 |
-
RSSImport(
|
109 |
-
$display = 5,
|
110 |
-
$feedurl = 'http://bueltge.de/feed/',
|
111 |
-
$before_desc = '',
|
112 |
-
$displaydescriptions = true,
|
113 |
-
$after_desc = ' <a href="%href%" target="_blank">show more</a>'
|
114 |
-
);
|
115 |
-
|
116 |
-
or
|
117 |
-
|
118 |
-
[RSSImport feedurl="http://www.ichdruck3d.de/feed/" after_desc=" <a href='%href%' target='_blank'>show more</a>" displaydescriptions="true"]
|
119 |
-
|
120 |
-
_Enable Thumbnail Pictures:_
|
121 |
-
|
122 |
-
RSSImport(
|
123 |
-
$display = 5,
|
124 |
-
$feedurl = 'http://www.thestage.co.uk/opinion/shenton/feed/',
|
125 |
-
$before_desc = '<img src="%picture_url%" alt="">',
|
126 |
-
$displaydescriptions = true
|
127 |
-
);
|
128 |
-
|
129 |
-
or
|
130 |
-
|
131 |
-
[RSSImport feedurl="http://www.thestage.co.uk/opinion/shenton/feed/" displaydescriptions="true" before_desc="<div><img src='%picture_url%' width='50px' alt='' style='float:left;' />" after_desc="</div>" use_simplepie="true"]
|
132 |
-
|
133 |
-
== Installation ==
|
134 |
-
1. Unpack the download package.
|
135 |
-
1. Upload all files to the `/wp-content/plugins/` directory.
|
136 |
-
1. Activate the plugin through the 'Plugins' menu in WordPress.
|
137 |
-
1. Create a new site in WordPress or edit your template.
|
138 |
-
1. Copy the code into the site content or add it to your templates.
|
139 |
-
|
140 |
-
|
141 |
-
== Screenshots ==
|
142 |
-
1. Widget support
|
143 |
-
|
144 |
-
== Changelog ==
|
145 |
-
= v4.4.
|
146 |
-
* Fix
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
*
|
155 |
-
|
156 |
-
= v4.4.
|
157 |
-
*
|
158 |
-
* Fix
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
*
|
163 |
-
*
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
*
|
169 |
-
*
|
170 |
-
*
|
171 |
-
|
172 |
-
= v4.4.
|
173 |
-
* Bugfix:
|
174 |
-
*
|
175 |
-
* Maintenance:
|
176 |
-
|
177 |
-
= v4.4.
|
178 |
-
*
|
179 |
-
* Bugfix:
|
180 |
-
* Maintenance:
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
*
|
185 |
-
*
|
186 |
-
*
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
*
|
191 |
-
*
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
*
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
*
|
200 |
-
*
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
*
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
*
|
216 |
-
*
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
*
|
232 |
-
*
|
233 |
-
*
|
234 |
-
*
|
235 |
-
*
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
=== RSSImport ===
|
2 |
+
Contributors: Bueltge, inpsyde, took77
|
3 |
+
Plugin URI: https://bueltge.de/wp-rss-import-plugin/55/
|
4 |
+
Author: Frank Bültge
|
5 |
+
Author URI: https://bueltge.de/
|
6 |
+
Donate link: https://bueltge.de/wunschliste/
|
7 |
+
Tags: rss, post, content, post, feed
|
8 |
+
Requires at least: 1.5
|
9 |
+
Tested up to: 4.9
|
10 |
+
Stable tag: 4.4.17
|
11 |
+
|
12 |
+
Display feeds on your blog, using PHP in your templates or Shortcode in your posts and pages.
|
13 |
+
|
14 |
+
== Description ==
|
15 |
+
Display feeds in your blog, using PHP, a Widget or Shortcode. The plugin uses only standard WordPress functionality, so no external libraries are required. For older versions of Wordpress, the built-in [MagpieRSS library](http://magpierss.sourceforge.net/) is used. For WordPress 2.8 and newer, there is a setting available to enable the built-in [SimplePie library](http://simplepie.org/) for parsing feeds.
|
16 |
+
|
17 |
+
As with all other content you publish, make sure you are allowed to (re-)publish the content of the feeds you are about to import!
|
18 |
+
|
19 |
+
You can insert the following code into a PHP plugin or in a template, for example `sidebar.php` or `single.php`:
|
20 |
+
|
21 |
+
|
22 |
+
_Example:_
|
23 |
+
`<?php RSSImport(10, 'http://bueltge.de/feed/'); ?>`
|
24 |
+
|
25 |
+
This is the minimal code needed for using the plugin. The plugin accepts a number of parameters for customizing the feed content import. See below for the full list of available parameters. You can also use any of the parameters with Shortcode in posts and pages.
|
26 |
+
|
27 |
+
_Example Shortcode:_
|
28 |
+
`[RSSImport display="5" feedurl="http://bueltge.de/feed/" use_simplepie="true"]`
|
29 |
+
|
30 |
+
For all (bool) parameters you can either use the strings `true` and `false` or the integer values `1` and `0`.
|
31 |
+
|
32 |
+
|
33 |
+
1. `display` - The number of items to display. Default is `5`.
|
34 |
+
1. `feedurl` - The feed address. Default is `http://bueltge.de/feed/`.
|
35 |
+
1. `before_desc` - The HTML or string to insert before the description. Default is `empty`. You can use some variables which will be replaced, see below.
|
36 |
+
1. `displaydescriptions` - (bool) When set to true, the description for each entry will be displayed. Default is `false`.
|
37 |
+
1. `after_desc` - The HTML or string to insert after the description. Default is `empty`. You can use some variables which will be replaced, see below.
|
38 |
+
1. `html` - (bool) When set to true, the description can include HTML tags. Default is `false`.
|
39 |
+
1. `truncatedescchar` - The maximum number of characters allowed in descriptions. If the description is longer than this length, it will be truncated to the given length. Default is `200`, set the value to empty quotes `''` to never truncate descriptions.
|
40 |
+
1. `truncatedescstring` - The HTML or string to insert at the end of a description after it has been truncated. Default is ` ... `
|
41 |
+
1. `truncatetitlechar` - The maximum number of characters allowed in titles. If the title is longer than this value, it will be truncated to the given length. Default is `''`, which means never truncate titles.
|
42 |
+
1. `truncatetitlestring` - The HTML or string to insert at the end of a title after it has been truncated. Default is `' ... '`.
|
43 |
+
1. `before_date` - The HTML or string to insert before the date. Default is ` <small>`.
|
44 |
+
1. `date` - (bool) If true, display the date of the item. Default is `false`.
|
45 |
+
1. `after_date` - The HTML or string to insert after the date. Default is `</small>`.
|
46 |
+
1. `date_format`- The date format string. Leave empty to use the format of your WordPress installation. If a different date format is desired, specify a PHP date string, for example: `F j, Y`. See also [the date and time formatting page in the WordPress Codex](http://codex.wordpress.org/Formatting_Date_and_Time).
|
47 |
+
1. `before_creator` - The HTML or string to insert before the creator of the item. Default is ` <small>`.
|
48 |
+
1. `creator` - (bool) If true, display the creator of the item. Default is `false`.
|
49 |
+
1. `after_creator` - The HTML or string to insert after creator of the item. Default is `</small>`.
|
50 |
+
1. `start_items` - The HTML or string to insert before the list of items. Default is `<ul>`.
|
51 |
+
1. `end_items` - The HTML or string to insert after the list of items. Default is `</ul>`.
|
52 |
+
1. `start_item` - The HTML or string to insert before each item. Default is `<li>`. You can use some variables which will be replaced, see below.
|
53 |
+
1. `end_item` - The HTML or string to insert after each item. Default is `</li>`. You can use some variables which will be replaced, see below.
|
54 |
+
1. `target` - The string to use for the `target` attribute on links. Default is `empty`. Valid options are `blank`, `self`, `parent`, `top`.
|
55 |
+
1. `rel` - The string to use for the `rel` attribute on links. Default is `empty`. Valid options are `nofollow` and `follow`.
|
56 |
+
1. `desc4title` - The description to use in the `title` attribute on item title links. Default is `false`.
|
57 |
+
1. `charsetscan` - (bool) If true, scan the feed content for the correct character set. This may cause the content to load more slowly. Use this option if you're having problems with feed content being displayed with stranged characters. Default is `false`.
|
58 |
+
1. `debug` - (bool) If true, activate debug-mode, which will echo the Magpie object as an array. Default is `false`. Only use this option for debugging.
|
59 |
+
1. `before_noitems` - The HTML or string to insert before the no items message. Default is `<p>`.
|
60 |
+
1. `noitems`- The message to display when the feed is empty. Default is `No items, feed is empty.`.
|
61 |
+
1. `after_noitems` - The HTML or string to insert before the no items message. Default is `</p>`.
|
62 |
+
1. `before_error` - The HTML or string to insert before the error message. Default is `<p>`.
|
63 |
+
1. `error` - Error message displayed when there is an error loading or displaying the feed. Default is `Error: Feed has an error or is not valid`.
|
64 |
+
1. `after_error` - The HTML or string to insert before the error message. Default is `</p>`.
|
65 |
+
1. `paging` - (bool) If true, enable pagination. Default is `false`.
|
66 |
+
1. `prev_paging_link` - The name of the previous page link. Default is `« Previous`.
|
67 |
+
1. `next_paging_link` - The name next page link. Default is `Next »`.
|
68 |
+
1. `prev_paging_title` - The title attribute of the previous page link. Default is `more items`.
|
69 |
+
1. `next_paging_title` - The title attribute of the next page link. Default is `more items`.
|
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 |
+
|
73 |
+
The parameters `before_desc`, `after_desc`, `start_item` and `end_item` accepts the following variables which will be replaced:
|
74 |
+
|
75 |
+
|
76 |
+
1. `%title%` for the title of the entry
|
77 |
+
1. `%href%` for the entry's URL
|
78 |
+
1. `%picture_url%` for the URL of a thumbnail image for the entry if available. To use this variable, SimplePie is required to be enabled (`use_simplepie="true"`)
|
79 |
+
|
80 |
+
|
81 |
+
If pagination is enabled, it adds a `div` with the class `rsspaging` to enable easier styling with CSS. You can also style the previous and next links, which have the classes: `rsspaging_prev` and `rsspaging_next`.
|
82 |
+
|
83 |
+
You can use any of the parameters in the php function `RSSImport()` in your templates or with the Shortcode `[RSSImport]` in posts and pages.
|
84 |
+
|
85 |
+
= Examples =
|
86 |
+
_Using the PHP function with many parameters:_
|
87 |
+
|
88 |
+
RSSImport(
|
89 |
+
$display = 5, $feedurl = 'http://bueltge.de/feed/',
|
90 |
+
$before_desc = '', $displaydescriptions = false, $after_desc = '', $html = false, $truncatedescchar = 200, $truncatedescstring = ' ... ',
|
91 |
+
$truncatetitlechar = '', $truncatetitlestring = ' ... ',
|
92 |
+
$before_date = ' <small>', $date = false, $after_date = '</small>',
|
93 |
+
$before_creator = ' <small>', $creator = false, $after_creator = '</small>',
|
94 |
+
$start_items = '<ul>', $end_items = '</ul>',
|
95 |
+
$start_item = '<li>', $end_item = '</li>'
|
96 |
+
);
|
97 |
+
|
98 |
+
Please note that for the PHP function the parameters are expected in the order in which they are defined in the above list. Thus if you skip one parameter, you will also have to skip all of the subsequent parameters.
|
99 |
+
|
100 |
+
_Using Shortcode with several parameters:_
|
101 |
+
|
102 |
+
[RSSImport display="10" feedurl="http://your_feed_url/"
|
103 |
+
displaydescriptions="true" html="true"
|
104 |
+
start_items="<ol>" end_items="</ol>" paging="true" use_simplepie="true"]
|
105 |
+
|
106 |
+
_Add a "more" link to the output:_
|
107 |
+
|
108 |
+
RSSImport(
|
109 |
+
$display = 5,
|
110 |
+
$feedurl = 'http://bueltge.de/feed/',
|
111 |
+
$before_desc = '',
|
112 |
+
$displaydescriptions = true,
|
113 |
+
$after_desc = ' <a href="%href%" target="_blank">show more</a>'
|
114 |
+
);
|
115 |
+
|
116 |
+
or
|
117 |
+
|
118 |
+
[RSSImport feedurl="http://www.ichdruck3d.de/feed/" after_desc=" <a href='%href%' target='_blank'>show more</a>" displaydescriptions="true" use_simplepie="true"]
|
119 |
+
|
120 |
+
_Enable Thumbnail Pictures:_
|
121 |
+
|
122 |
+
RSSImport(
|
123 |
+
$display = 5,
|
124 |
+
$feedurl = 'http://www.thestage.co.uk/opinion/shenton/feed/',
|
125 |
+
$before_desc = '<img src="%picture_url%" alt="">',
|
126 |
+
$displaydescriptions = true
|
127 |
+
);
|
128 |
+
|
129 |
+
or
|
130 |
+
|
131 |
+
[RSSImport feedurl="http://www.thestage.co.uk/opinion/shenton/feed/" displaydescriptions="true" before_desc="<div><img src='%picture_url%' width='50px' alt='' style='float:left;' />" after_desc="</div>" use_simplepie="true"]
|
132 |
+
|
133 |
+
== Installation ==
|
134 |
+
1. Unpack the download package.
|
135 |
+
1. Upload all files to the `/wp-content/plugins/` directory.
|
136 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress.
|
137 |
+
1. Create a new site in WordPress or edit your template.
|
138 |
+
1. Copy the code into the site content or add it to your templates.
|
139 |
+
|
140 |
+
|
141 |
+
== Screenshots ==
|
142 |
+
1. Widget support
|
143 |
+
|
144 |
+
== Changelog ==
|
145 |
+
= v4.4.17 (2016-04-17) =
|
146 |
+
* Fix for usage under php 7*
|
147 |
+
* Code Formatting, WP Codex
|
148 |
+
* *You should always use SimplePie library as Feed Parser - check your parameter.*
|
149 |
+
|
150 |
+
= v4.4.16 (09/24/2015) =
|
151 |
+
* Fix the widget PHP4 style
|
152 |
+
|
153 |
+
= v4.4.15 (08/22/2014) =
|
154 |
+
* Added `%picture_url%` for `before_desc`, `after_desc`, `start_item` and `end_item`
|
155 |
+
|
156 |
+
= v4.4.14 (07/08/2014) =
|
157 |
+
* Fix typo in readme
|
158 |
+
* Fix a bug with `%href%` and `%title%` in after_desc
|
159 |
+
* Shortened some over-long lines in the code
|
160 |
+
|
161 |
+
= v4.4.13 (08/22/2013) =
|
162 |
+
* Set simplepie to default settings; is the default way of WP since lot of versions
|
163 |
+
* Fix for Quicktag on Post/Page Editor; use now the core functions, there we have since WP 3.3
|
164 |
+
|
165 |
+
= v4.4.12 (04/02/2012) =
|
166 |
+
* Bugfix: restored RSSImport QuickTag for Wordpress 3.3 and later
|
167 |
+
* Improvement: avoid PHP-notice when description is missing for an item
|
168 |
+
* TODO: add parameter to allow prefix of url (see http://wordpress.org/support/topic/plugin-rssimport-fix-for-headline-links-without-full-paths)
|
169 |
+
* TODO: check documentation of call to function (PHP), see http://wordpress.org/support/topic/plugin-rssimport-change-feed-display
|
170 |
+
* Documentation: corrected 'after_desc' (thanks to elricky for reporting)
|
171 |
+
|
172 |
+
= v4.4.11 (13/12/2011) =
|
173 |
+
* Bugfix: noitems string display is back
|
174 |
+
* Improvement: html_entity_decode feedurl when using shortcodes
|
175 |
+
* Maintenance: Add romanian language files
|
176 |
+
|
177 |
+
= v4.4.10 (01/12/2011) =
|
178 |
+
* Bugfix: add param desc4title on shortcodes
|
179 |
+
* Bugfix: Filter Feed-Url vor masked `&`; now works Yahoo Pipes feeds
|
180 |
+
* Maintenance: Translate strings from options
|
181 |
+
|
182 |
+
= v4.4.9 (09/16/2010) =
|
183 |
+
* Feature: add new param `desc4title` to add the description to title-attribut on title-links
|
184 |
+
* Bugfix: target parameter in widget
|
185 |
+
* Maintenance: rescan/rewrite de_DE language file
|
186 |
+
* Maintenance: rescan .pot
|
187 |
+
|
188 |
+
= v4.4.8 (06/04/2010) =
|
189 |
+
* small changes for better debugging
|
190 |
+
* change metadata for WordPress
|
191 |
+
* multilanguage plugin-description
|
192 |
+
* change error-handling on feeds; use WP-Error
|
193 |
+
|
194 |
+
= v4.4.7 (05/20/2010) =
|
195 |
+
* bugfix widget parameter for description
|
196 |
+
* small changes on source
|
197 |
+
|
198 |
+
= v4.4.6 (07/10/2009) =
|
199 |
+
* add function for WordPress lower version 2.8
|
200 |
+
* add option for format the date
|
201 |
+
|
202 |
+
= v4.4.5 (30/09/2009) =
|
203 |
+
* bugfix Widget-title
|
204 |
+
* include class SimpliePie for alternative parse
|
205 |
+
* new parameter `$use_simplepie` for active parse with class SimplePie
|
206 |
+
* change for boolean type, possible to use `true` or `false` and `1` or `0`
|
207 |
+
|
208 |
+
= v4.4.4 (15/09/2009) =
|
209 |
+
* change updatenotice to standard WP
|
210 |
+
|
211 |
+
= v4.4.3 (14/09/2009) =
|
212 |
+
* add strings %title% and %href% to replace in after-desc-option
|
213 |
+
|
214 |
+
= v4.4.2 (07/09/2009) =
|
215 |
+
* Bugfix for utl-value on shortcode
|
216 |
+
* change clean the title-attribut an links for multilanguage-support
|
217 |
+
|
218 |
+
= v4.4.1 (14/07/2009) =
|
219 |
+
|
220 |
+
* add rel attribut for links
|
221 |
+
* add widget support, WP 2.8 and higher
|
222 |
+
|
223 |
+
See on [the official website](http://bueltge.de/wp-rss-import-plugin/55/#historie "RSSImport Changelog") for older entries on changelog.
|
224 |
+
|
225 |
+
|
226 |
+
== Other Notes ==
|
227 |
+
= Acknowledgements =
|
228 |
+
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.
|
229 |
+
|
230 |
+
= Localizations =
|
231 |
+
* German language files by me [Frank Bültge](http://bueltge.de/) ;-)
|
232 |
+
* Russian translation by Fat Cow
|
233 |
+
* Ukrainian translation by [WordPress Ukraine](http://wpp.pp.ua/)
|
234 |
+
* French translation by [Martin Korolczuk](http://petitnuage.fr)
|
235 |
+
* Hungarian translation by [Feriman](http://feriman.com)
|
236 |
+
* Hindi translation by [Ashish Jha](http://outshinesolutions.com)
|
237 |
+
* Italian translation by [Gianni Diurno](http://gidibao.net/)
|
238 |
+
* Romanian language files, thanks to [Alexander Ovsov](http://webhostinggeeks.com/)
|
239 |
+
* Lithuanian translation files by [Vincent G](http://www.host1plus.com)
|
240 |
+
* Portuguese translation files by [Miguel Patricio Angelo](http://www.miguelpatricio.com/)
|
241 |
+
|
242 |
+
= License =
|
243 |
+
Good news, this plugin is free for everyone! Since it's released under the GPL, you can use it free of charge on your personal or commercial blog. But if you enjoy this plugin, you can thank me by leaving a [small donation](http://bueltge.de/wunschliste/ "Wish lists and donations") for the time I've spent writing and supporting this plugin. And I really don't want to know how many hours of my life this plugin has already eaten ;)
|
244 |
+
|
245 |
+
= Translations =
|
246 |
+
The plugin comes with various translations, please refer to the [WordPress Codex](http://codex.wordpress.org/Installing_WordPress_in_Your_Language "Installing WordPress in Your Language") for more information about activating the translation. If you want to help to translate the plugin to your language, please have a look at the sitemap.pot file which contains all defintions and may be used with a [gettext](http://www.gnu.org/software/gettext/) editor like [Poedit](http://www.poedit.net/) (Windows).
|
rssimport.php
CHANGED
@@ -1,20 +1,15 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* @package WP-RSSImport
|
4 |
-
* @author Frank Bültge
|
5 |
-
*/
|
6 |
-
|
7 |
/**
|
8 |
* Plugin Name: WP-RSSImport
|
9 |
-
* Plugin URI:
|
10 |
* Text Domain: rssimport
|
11 |
* Domain Path: /languages
|
12 |
-
* Description:
|
13 |
* Author: Frank Bültge, took77
|
14 |
-
* Version: 4.4.
|
15 |
-
* License:
|
16 |
-
* Last change:
|
17 |
-
*/
|
18 |
|
19 |
/*
|
20 |
------------------------------------------------------------
|
@@ -23,7 +18,6 @@
|
|
23 |
Original and Idea: Dave Wolf, http://www.davewolf.net
|
24 |
Thx to Thomas Fischer, http://www.securityfocus.de and
|
25 |
Gunnar Tillmann http://www.gunnart.de for a better code
|
26 |
-
|
27 |
Paging: Ilya Shindyapin, http://skookum.com
|
28 |
|
29 |
------------------------------------------------------------
|
@@ -33,29 +27,35 @@ Example: <?php RSSImport(10, "http://bueltge.de/feed/"); ?>
|
|
33 |
*/
|
34 |
|
35 |
//avoid direct calls to this file, because now WP core and framework has been used
|
36 |
-
if ( ! function_exists('add_action') ) {
|
37 |
-
header('Status: 403 Forbidden');
|
38 |
-
header('HTTP/1.1 403 Forbidden');
|
39 |
exit();
|
40 |
}
|
41 |
|
42 |
-
if ( function_exists('add_action') ) {
|
43 |
//WordPress definitions
|
44 |
-
if ( !defined('WP_CONTENT_URL') )
|
45 |
-
define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
if ( !defined('
|
51 |
-
define('
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
// plugin definitions
|
58 |
-
define( 'FB_RSSI_BASENAME', plugin_basename(__FILE__) );
|
59 |
define( 'FB_RSSI_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) );
|
60 |
define( 'FB_RSSI_TEXTDOMAIN', 'rssimport' );
|
61 |
define( 'FB_RSSI_QUICKTAG', TRUE );
|
@@ -63,561 +63,649 @@ if ( function_exists('add_action') ) {
|
|
63 |
|
64 |
function RSSImport_textdomain() {
|
65 |
|
66 |
-
if ( function_exists('load_plugin_textdomain') )
|
67 |
-
load_plugin_textdomain( FB_RSSI_TEXTDOMAIN, FALSE, dirname( FB_RSSI_BASENAME ) . '/languages');
|
68 |
-
}
|
69 |
-
|
70 |
-
if ( ! function_exists('esc_attr') ) {
|
71 |
-
function esc_attr( $text ) {
|
72 |
-
return attribute_escape( $text );
|
73 |
}
|
74 |
}
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
}
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
function RSSImport(
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
// replace for yahoo pipes urls
|
133 |
-
$feedurl = str_replace('&', '&', $feedurl);
|
134 |
-
|
135 |
-
$display
|
136 |
$displaydescriptions = (int) $displaydescriptions;
|
137 |
-
$html
|
138 |
-
$truncatedescchar
|
139 |
-
$truncatetitlechar
|
140 |
-
$date
|
141 |
-
if ( $date_format
|
142 |
-
$date_format = get_option('date_format');
|
143 |
-
|
144 |
-
$
|
145 |
-
$
|
146 |
-
$
|
|
|
147 |
$use_simplepie = (int) $use_simplepie;
|
148 |
-
$view
|
149 |
-
|
150 |
-
if ($use_simplepie) {
|
151 |
-
if ( ! class_exists('SimplePie') ) {
|
152 |
-
if ( file_exists(ABSPATH . WPINC . '/class-simplepie.php') ) {
|
153 |
-
@require_once
|
154 |
} else {
|
155 |
-
die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The WordPress file "class-simplepie.php" with class SimplePie could not be included.'));
|
156 |
}
|
157 |
}
|
158 |
} else {
|
159 |
// For function fetch_rss from wp-core
|
160 |
-
if ( file_exists(ABSPATH . WPINC . '/rss.php') ) {
|
161 |
-
|
162 |
// It's Wordpress 2.x. since it has been loaded successfully
|
163 |
-
} elseif (file_exists(ABSPATH . WPINC . '/rss-functions.php')) {
|
164 |
-
|
165 |
// In Wordpress < 2.1
|
166 |
} else {
|
167 |
-
die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The Wordpress file "rss-functions.php" or "rss.php" could not be included.'));
|
168 |
}
|
169 |
}
|
170 |
-
|
171 |
-
$display
|
172 |
-
$page
|
173 |
-
|
174 |
-
$
|
175 |
-
|
|
|
|
|
176 |
$echo = '<!--via SimplePie with RSSImport-->';
|
177 |
-
else
|
178 |
-
$echo = '<!--via MagpieRSS with RSSImport-->';
|
179 |
-
|
180 |
-
if ($charsetscan) {
|
181 |
-
// read in file for search charset
|
182 |
-
if ( function_exists('file_get_contents') ) {
|
183 |
-
ini_set('default_socket_timeout', 10);
|
184 |
-
$a = file_get_contents($feedurl);
|
185 |
-
// for better performance, if the server accepts the method
|
186 |
-
// $a = file_get_contents($feedurl, FALSE, NULL, 0, 50);
|
187 |
-
}
|
188 |
}
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
$
|
194 |
-
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
// the follow print_r list all items in array, for debug purpose
|
198 |
if ( $debug ) {
|
199 |
-
print
|
200 |
-
print
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
|
|
|
|
205 |
}
|
206 |
-
|
207 |
-
if ( isset($target) && $target
|
208 |
$target = ' target="_' . $target . '"';
|
209 |
-
|
210 |
-
|
|
|
211 |
$rel = ' rel="' . $rel . '"';
|
212 |
-
|
213 |
-
|
214 |
-
$
|
215 |
-
$
|
216 |
-
$
|
|
|
217 |
$previousitems = FALSE;
|
218 |
-
if ( $page > 1 )
|
219 |
$previousitems = TRUE;
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
|
|
|
|
224 |
$items = $rss->get_items();
|
225 |
-
elseif ($use_simplepie)
|
226 |
-
|
227 |
-
|
|
|
|
|
228 |
$items = $rss->items;
|
229 |
-
|
|
|
230 |
if ( array_key_exists( $display, $items ) ) {
|
231 |
-
|
232 |
-
if ($use_simplepie)
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
236 |
// import title
|
237 |
-
|
|
|
238 |
$title = esc_attr( strip_tags( $item->get_title() ) );
|
239 |
-
elseif ( isset($item['title']) )
|
240 |
-
$title = esc_attr( strip_tags( $item['title'] ) );
|
|
|
241 |
// import link
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
|
|
|
|
246 |
// import picture_url
|
247 |
-
$picture_url
|
248 |
-
if ($use_simplepie) {
|
249 |
-
|
250 |
-
$picture_url = wp_filter_kses( $enclosure->get_thumbnail() );
|
251 |
-
}
|
252 |
}
|
253 |
-
|
254 |
-
$start_item_temp = str_replace('%title%', $title, $start_item);
|
255 |
-
$start_item_temp = str_replace('%href%', $href, $start_item_temp);
|
256 |
-
$start_item_temp = str_replace('%picture_url%', $picture_url, $start_item_temp);
|
257 |
$echo .= $start_item_temp;
|
258 |
-
|
259 |
// import date
|
260 |
-
if ($use_simplepie && $date)
|
261 |
$pubDate = date_i18n( $date_format, strtotime( $item->get_date() ) );
|
262 |
-
elseif ($date && isset($item['pubdate']) )
|
263 |
-
$pubDate = date_i18n( $date_format, strtotime( $item['pubdate'] ) );
|
|
|
264 |
// import creator
|
265 |
-
if ($use_simplepie && $creator) {
|
266 |
$creator = $item->get_author();
|
267 |
-
if ( is_object($creator) ) {
|
268 |
$creator = $creator->get_name();
|
269 |
$creator = ' <cite>' . esc_html( strip_tags( $creator ) ) . '</cite>';
|
270 |
}
|
271 |
-
} elseif ($creator && isset($item['dc']['creator']) ) {
|
272 |
-
$creator =
|
273 |
-
} elseif ($creator && isset($item['creator']) ) {
|
274 |
-
$creator =
|
275 |
}
|
276 |
// import desc
|
277 |
-
if ( $use_simplepie && $displaydescriptions && $html )
|
278 |
-
$desc = @html_entity_decode( $item->get_content(), ENT_QUOTES, get_option('blog_charset') );
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
$echo .= 'ISO Feed' . "\n";
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
if ( isset($
|
300 |
-
isodec($
|
|
|
|
|
|
|
|
|
301 |
} else {
|
302 |
-
if ($debug)
|
303 |
$echo .= 'NonISO Feed' . "\n";
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
if ( isset($
|
309 |
-
utf8dec($
|
|
|
|
|
|
|
|
|
310 |
}
|
311 |
-
|
312 |
-
if ( isset($title) )
|
313 |
-
all_convert($title);
|
314 |
-
if ( isset($creator) )
|
315 |
-
all_convert($creator);
|
316 |
-
if ( isset($desc) )
|
317 |
-
all_convert($desc);
|
318 |
-
|
319 |
-
if ( isset($title) && $truncatetitlechar && (strlen($title) > $truncatetitlechar) ) {
|
320 |
-
$title = wp_html_excerpt($title, $truncatetitlechar) . $truncatetitlestring;
|
321 |
}
|
322 |
-
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
}
|
326 |
-
|
327 |
if ( $desc4title ) {
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
} else {
|
336 |
$atitle = $title;
|
337 |
}
|
338 |
-
|
339 |
-
$echo .= '<a' . $target . $rel . ' href="' . $href . '" title="'. $atitle . '">' . $title . '</a>';
|
340 |
-
if ( isset($pubDate) && $date && $pubDate
|
341 |
$echo .= $before_date . $pubDate . $after_date;
|
342 |
-
|
|
|
343 |
$echo .= $before_creator . $creator . $after_creator;
|
344 |
-
|
345 |
-
|
346 |
-
$after_desc_temp
|
347 |
-
$after_desc_temp
|
348 |
-
$after_desc_temp
|
349 |
-
$
|
350 |
-
$before_desc_temp = str_replace('%
|
351 |
-
$before_desc_temp = str_replace('%
|
|
|
352 |
$echo .= $before_desc_temp . $desc . $after_desc_temp;
|
353 |
}
|
354 |
-
$end_item_temp = str_replace('%title%', $title, $end_item);
|
355 |
-
$end_item_temp = str_replace('%href%', $href, $end_item_temp);
|
356 |
-
$end_item_temp = str_replace('%picture_url%', $picture_url, $end_item_temp);
|
357 |
$echo .= $end_item_temp;
|
358 |
} else {
|
359 |
$nextitems = FALSE;
|
360 |
}
|
361 |
-
|
362 |
-
$display++;
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
}
|
364 |
-
|
365 |
-
if (strip_tags($echo)) { // novaclic: needed to filter out false content madeof tags alone (html comments, html tags, ...)
|
366 |
-
$echo = wptexturize($start_items . $echo . $end_items);
|
367 |
-
} else
|
368 |
-
$echo = wptexturize($before_noitems . $noitems . $after_noitems);
|
369 |
-
|
370 |
} else {
|
371 |
-
if ( empty($rss->ERROR) )
|
372 |
$rss->ERROR = NULL;
|
373 |
-
|
|
|
374 |
}
|
375 |
-
|
376 |
-
if ($paging) {
|
377 |
$echo .= '<div class="rsspaging">';
|
378 |
-
if ($previousitems)
|
379 |
-
$echo .= '<a href="' . add_query_arg( 'rsspage',
|
380 |
-
|
381 |
-
|
|
|
|
|
|
|
|
|
382 |
$echo .= '<br style="clear: both" />';
|
383 |
$echo .= '</div>';
|
384 |
}
|
385 |
-
|
386 |
-
if ($view)
|
387 |
echo $echo;
|
388 |
-
else
|
389 |
return $echo;
|
|
|
390 |
}
|
391 |
|
392 |
-
function utf8dec($s_String) {
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
|
|
|
|
|
|
398 |
}
|
399 |
|
400 |
-
function isodec($s_String) {
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
|
|
|
|
|
|
406 |
}
|
407 |
|
408 |
-
function all_convert($s_String) {
|
409 |
|
410 |
// Array for entities
|
411 |
-
$umlaute = array('
|
412 |
-
|
413 |
-
'
|
414 |
-
|
415 |
-
'�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',
|
416 |
-
'�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�',utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
417 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
418 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
419 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
420 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
421 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
422 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
423 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
424 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
425 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
426 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
427 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
428 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
429 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
430 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),
|
431 |
-
utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),utf8_encode('�'),chr(128),chr(129),chr(130),
|
432 |
-
chr(131),chr(132),chr(133),chr(134),chr(135),chr(136),chr(137),chr(138),chr(139),chr(140),chr(141),chr(142),chr(143),chr(144),chr(145),
|
433 |
-
chr(146),chr(147),chr(148),chr(149),chr(150),chr(151),chr(152),chr(153),chr(154),chr(155),chr(156),chr(157),chr(158),chr(159),chr(160),
|
434 |
-
chr(161),chr(162),chr(163),chr(164),chr(165),chr(166),chr(167),chr(168),chr(169),chr(170),chr(171),chr(172),chr(173),chr(174),chr(175),
|
435 |
-
chr(176),chr(177),chr(178),chr(179),chr(180),chr(181),chr(182),chr(183),chr(184),chr(185),chr(186),chr(187),chr(188),chr(189),chr(190),
|
436 |
-
chr(191),chr(192),chr(193),chr(194),chr(195),chr(196),chr(197),chr(198),chr(199),chr(200),chr(201),chr(202),chr(203),chr(204),chr(205),
|
437 |
-
chr(206),chr(207),chr(208),chr(209),chr(210),chr(211),chr(212),chr(213),chr(214),chr(215),chr(216),chr(217),chr(218),chr(219),chr(220),
|
438 |
-
chr(221),chr(222),chr(223),chr(224),chr(225),chr(226),chr(227),chr(228),chr(229),chr(230),chr(231),chr(232),chr(233),chr(234),chr(235),
|
439 |
-
chr(236),chr(237),chr(238),chr(239),chr(240),chr(241),chr(242),chr(243),chr(244),chr(245),chr(246),chr(247),chr(248),chr(249),chr(250),
|
440 |
-
chr(251),chr(252),chr(253),chr(254),chr(255),chr(256));
|
441 |
-
$htmlcode = array('„','“','–',' "','–','—','‘','’','“','”','„','•' ,
|
442 |
-
'…','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ',
|
443 |
-
'Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ',
|
444 |
-
'ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬',
|
445 |
-
'®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»',
|
446 |
-
'¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È',
|
447 |
-
'É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ',
|
448 |
-
'Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â',
|
449 |
-
'ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï',
|
450 |
-
'ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü',
|
451 |
-
'ý','þ','ÿ','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š',
|
452 |
-
'‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š',
|
453 |
-
'›','œ','ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª',
|
454 |
-
'«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;',
|
455 |
-
'º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ',
|
456 |
-
'Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó',
|
457 |
-
'Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à',
|
458 |
-
'á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í',
|
459 |
-
'î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú',
|
460 |
-
'û','ü','ý','þ','ÿ','€','','‚','ƒ','„','…','†','‡','ˆ',
|
461 |
-
'‰','Š','‹','Œ','','Ž','','','‘','’','“','”','•','–','—',
|
462 |
-
'˜','™','š','›','œ','','ž','Ÿ',' ','¡','¡','¡','¡','¥',
|
463 |
-
'¦','§','¨','©','ª','«','¬','�­','®','¯','°','±','²','³',
|
464 |
-
'´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À',
|
465 |
-
'Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í',
|
466 |
-
'Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú',
|
467 |
-
'Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç',
|
468 |
-
'è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô',
|
469 |
-
'õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ');
|
470 |
//$s_String = str_replace($umlaute, $htmlcode, $s_String);
|
471 |
-
if ( version_compare(phpversion(), '5.0.0', '>=') )
|
472 |
-
$s_String = utf8_encode( html_entity_decode( str_replace($umlaute, $htmlcode, $s_String) ) );
|
473 |
-
else
|
474 |
-
$s_String = utf8_encode( RSSImport_html_entity_decode_php4( str_replace($umlaute, $htmlcode, $s_String) ) );
|
475 |
-
|
|
|
476 |
// … , …
|
477 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\xA6~', '…', $s_String);
|
478 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\xA6~', '…', $s_String);
|
479 |
-
$s_String = preg_replace('~\xD0\xB2\xD0\x82\xC2\xA6~', '…', $s_String);
|
480 |
-
|
481 |
// — , —
|
482 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9D~', '—', $s_String);
|
483 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '—',
|
484 |
-
|
485 |
-
|
|
|
486 |
// – , –
|
487 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9C~', '–', $s_String);
|
488 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC5\x93~', '–',
|
489 |
-
|
490 |
-
|
|
|
491 |
// ’ , ’
|
492 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xE2\x84\xA2~', '’', $s_String);
|
493 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '’',
|
494 |
-
|
495 |
-
$s_String = preg_replace('~\xD0\
|
496 |
-
|
|
|
497 |
// ‘ , ‘
|
498 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xCB\x9C~', '‘', $s_String);
|
499 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x8B\xC5\x93~', '‘', $s_String);
|
500 |
-
|
501 |
// ” , ”
|
502 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '”', $s_String);
|
503 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\x9D~', '”', $s_String);
|
504 |
-
$s_String = preg_replace('~\xD0\xB2\xD0\x82\xD1\x9C~', '”', $s_String);
|
505 |
-
|
506 |
// “ , “
|
507 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC5\x93~', '“', $s_String);
|
508 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x85\xE2\x80\x9C~', '“',
|
509 |
-
|
510 |
-
|
|
|
511 |
// ™ , ™
|
512 |
-
$s_String = preg_replace('~\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '™', $s_String);
|
513 |
-
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x82\xAC\xC5\xBE\xC3\x82\xC2\xA2~', '™', $s_String);
|
514 |
-
|
515 |
// th
|
516 |
-
$s_String = preg_replace('~t\xC3\x82\xC2\xADh~', 'th', $s_String);
|
517 |
-
|
518 |
// .
|
519 |
-
$s_String = preg_replace('~.\xD0\x92+~', '.', $s_String);
|
520 |
-
$s_String = preg_replace('~.\xD0\x92~', '.', $s_String);
|
521 |
-
|
522 |
// ,
|
523 |
-
$s_String = preg_replace('~\x2C\xD0\x92~', ',', $s_String);
|
524 |
|
525 |
return $s_String;
|
526 |
}
|
527 |
|
528 |
/**
|
529 |
* Entfernt unvollstaendige Worte am Ende eines Strings.
|
|
|
530 |
* @author Thomas Scholz <http://toscho.de>
|
531 |
-
*
|
|
|
|
|
532 |
* @return string
|
533 |
*/
|
534 |
-
function RSSImport_end_on_word($str) {
|
535 |
-
|
536 |
-
$arr = explode( ' ', trim($str) );
|
537 |
-
array_pop($arr);
|
538 |
-
|
539 |
-
return rtrim( implode(' ', $arr), ',;');
|
540 |
}
|
541 |
|
542 |
-
function RSSImport_Shortcode($atts) {
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
'
|
547 |
-
'
|
|
|
548 |
'displaydescriptions' => 0,
|
549 |
-
'after_desc'
|
550 |
-
'html'
|
551 |
-
'truncatedescchar'
|
552 |
-
'truncatedescstring'
|
553 |
-
'truncatetitlechar'
|
554 |
'truncatetitlestring' => ' ... ',
|
555 |
-
'before_date'
|
556 |
-
'date'
|
557 |
-
'after_date'
|
558 |
-
'date_format'
|
559 |
-
'before_creator'
|
560 |
-
'creator'
|
561 |
-
'after_creator'
|
562 |
-
'start_items'
|
563 |
-
'end_items'
|
564 |
-
'start_item'
|
565 |
-
'end_item'
|
566 |
-
'target'
|
567 |
-
'rel'
|
568 |
-
'desc4title'
|
569 |
-
'charsetscan'
|
570 |
-
'debug'
|
571 |
-
'before_noitems'
|
572 |
-
'noitems'
|
573 |
-
'after_noitems'
|
574 |
-
'before_error'
|
575 |
-
'error'
|
576 |
-
|
577 |
-
'
|
578 |
-
'
|
579 |
-
'
|
580 |
-
'
|
581 |
-
'
|
582 |
-
'
|
583 |
-
'
|
584 |
-
|
|
|
|
|
585 |
);
|
586 |
-
|
587 |
-
|
588 |
-
$
|
589 |
-
if ( strtolower($html)
|
590 |
-
$html = 1;
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
$
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
$
|
607 |
-
|
608 |
-
|
609 |
-
$
|
610 |
-
if ( strtolower($
|
611 |
-
$
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
$
|
616 |
-
if ( strtolower($
|
617 |
-
$
|
618 |
-
|
619 |
-
$
|
620 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
621 |
$return = RSSImport(
|
622 |
$display, $feedurl,
|
623 |
$before_desc, $displaydescriptions, $after_desc, $html,
|
@@ -637,460 +725,488 @@ function RSSImport_Shortcode($atts) {
|
|
637 |
$use_simplepie,
|
638 |
$view
|
639 |
);
|
640 |
-
|
641 |
return $return;
|
642 |
}
|
643 |
|
644 |
-
function RSSImport_shortcode_quot($pee) {
|
|
|
645 |
global $shortcode_tags;
|
646 |
-
|
647 |
-
if ( !empty($shortcode_tags) && is_array($shortcode_tags) ) {
|
648 |
-
$tagnames
|
649 |
-
$tagregexp =
|
650 |
-
$pee
|
|
|
|
|
|
|
|
|
651 |
}
|
652 |
|
653 |
return $pee;
|
654 |
}
|
655 |
|
656 |
-
|
657 |
/**
|
658 |
-
*
|
659 |
*/
|
660 |
-
|
661 |
function RSSImport_insert_button() {
|
|
|
662 |
global $pagenow;
|
663 |
-
|
664 |
-
$post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
|
665 |
-
if ( ! in_array( $pagenow, $post_page_pages ) )
|
666 |
return;
|
667 |
-
|
|
|
668 |
?>
|
669 |
<script type="text/javascript" charset="utf-8">
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
</script>
|
695 |
<?php
|
696 |
}
|
697 |
|
698 |
function RSSImport_insert_button_old() {
|
|
|
699 |
global $pagenow;
|
700 |
-
|
701 |
-
$post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
|
702 |
-
if ( ! in_array( $pagenow, $post_page_pages ) )
|
703 |
return;
|
704 |
-
|
|
|
705 |
echo '
|
706 |
<script type="text/javascript">
|
707 |
//<![CDATA[
|
708 |
if ( typeof edButtons != \'undefined\' ) {
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
721 |
}
|
722 |
-
jQuery(document).ready(function() {
|
723 |
-
content = \'<input id="RSSImport_\'+length
|
724 |
-
|
725 |
-
|
726 |
-
|
|
|
727 |
}
|
728 |
//]]>
|
729 |
</script>';
|
730 |
}
|
731 |
|
732 |
if ( is_admin() && FB_RSSI_QUICKTAG ) {
|
733 |
-
if ( version_compare( $GLOBALS['wp_version'], '3.3alpha', '>=' ) )
|
734 |
add_action( 'admin_print_footer_scripts', 'RSSImport_insert_button' );
|
735 |
-
else
|
736 |
add_action( 'admin_footer', 'RSSImport_insert_button_old' );
|
|
|
737 |
}
|
738 |
|
739 |
-
if ( function_exists('add_shortcode') )
|
740 |
-
add_shortcode('RSSImport', 'RSSImport_Shortcode');
|
|
|
741 |
|
742 |
add_action( 'init', 'RSSImport_textdomain' );
|
743 |
|
744 |
-
|
745 |
-
|
746 |
/**
|
747 |
* code to utf-8 in PHP 4
|
748 |
*
|
749 |
* @package WP-RSSImport
|
750 |
*/
|
751 |
-
function RSSImport_code_to_utf8($num) {
|
752 |
-
|
753 |
-
if ($num <= 0x7F) {
|
754 |
-
return chr($num);
|
755 |
-
} elseif ($num <= 0x7FF) {
|
756 |
-
return chr(($num >> 0x06) + 0xC0) . chr(($num & 0x3F) + 128);
|
757 |
-
} elseif ($num <= 0xFFFF) {
|
758 |
-
return chr(($num >> 0x0C) + 0xE0) . chr((($num >> 0x06) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);
|
759 |
-
} elseif ($num <= 0x1FFFFF) {
|
760 |
-
return chr(($num >> 0x12) + 0xF0) . chr((($num >> 0x0C) & 0x3F) + 0x80) . chr((($num >> 0x06) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);
|
761 |
}
|
762 |
|
763 |
return '';
|
764 |
}
|
765 |
|
766 |
-
|
767 |
/**
|
768 |
* html_entity_decode for PHP 4
|
769 |
*
|
770 |
* @package WP-RSSImport
|
771 |
*/
|
772 |
-
function RSSImport_html_entity_decode_php4($str) {
|
773 |
-
|
774 |
-
|
775 |
-
"&
|
776 |
-
"&
|
777 |
-
"&
|
778 |
-
"&
|
779 |
-
"&
|
780 |
-
"&
|
781 |
-
"&
|
782 |
-
"&
|
783 |
-
"&
|
784 |
-
"&
|
785 |
-
"&
|
786 |
-
"&
|
787 |
-
"&
|
788 |
-
"&
|
789 |
-
"&
|
790 |
-
"&
|
791 |
-
"&
|
792 |
-
"&
|
793 |
-
"&
|
794 |
-
"&
|
795 |
-
"&
|
796 |
-
"&
|
797 |
-
"&
|
798 |
-
"&
|
799 |
-
"&
|
800 |
-
"&
|
801 |
-
"&
|
802 |
-
"&
|
803 |
-
"&
|
804 |
-
"&
|
805 |
-
"&
|
806 |
-
"&
|
807 |
-
"&
|
808 |
-
"&
|
809 |
-
"&
|
810 |
-
"&
|
811 |
-
"&
|
812 |
-
"&
|
813 |
-
"&
|
814 |
-
"&
|
815 |
-
"&
|
816 |
-
"&
|
817 |
-
"&
|
818 |
-
"&
|
819 |
-
"&
|
820 |
-
"&
|
821 |
-
"&
|
822 |
-
"&
|
823 |
-
"&
|
824 |
-
"&
|
825 |
-
"&
|
826 |
-
"&
|
827 |
-
"&
|
828 |
-
"&
|
829 |
-
"&
|
830 |
-
"&
|
831 |
-
"&
|
832 |
-
"&
|
833 |
-
"&
|
834 |
-
"&
|
835 |
-
"&
|
836 |
-
"&
|
837 |
-
"&
|
838 |
-
"&
|
839 |
-
"&
|
840 |
-
"&
|
841 |
-
"&
|
842 |
-
"&
|
843 |
-
"&
|
844 |
-
"&
|
845 |
-
"&
|
846 |
-
"&
|
847 |
-
"&
|
848 |
-
"&
|
849 |
-
"&
|
850 |
-
"&
|
851 |
-
"&
|
852 |
-
"&
|
853 |
-
"&
|
854 |
-
"&
|
855 |
-
"&
|
856 |
-
"&
|
857 |
-
"&
|
858 |
-
"&
|
859 |
-
"&
|
860 |
-
"&
|
861 |
-
"&
|
862 |
-
"&
|
863 |
-
"&
|
864 |
-
"&
|
865 |
-
"&
|
866 |
-
"&
|
867 |
-
"&
|
868 |
-
"&
|
869 |
-
"&
|
870 |
-
"&
|
871 |
-
"&
|
872 |
-
"&
|
873 |
-
"&
|
874 |
-
"&
|
875 |
-
"&
|
876 |
-
"&
|
877 |
-
"&
|
878 |
-
"&
|
879 |
-
"&
|
880 |
-
"&
|
881 |
-
"&
|
882 |
-
"&
|
883 |
-
"&
|
884 |
-
"&
|
885 |
-
"&
|
886 |
-
"&
|
887 |
-
"&
|
888 |
-
"&
|
889 |
-
"&
|
890 |
-
"&
|
891 |
-
"&
|
892 |
-
"&
|
893 |
-
"&
|
894 |
-
"&
|
895 |
-
"&
|
896 |
-
"&
|
897 |
-
"&
|
898 |
-
"&
|
899 |
-
"&
|
900 |
-
"&
|
901 |
-
"&
|
902 |
-
"&
|
903 |
-
"&
|
904 |
-
"&
|
905 |
-
"&
|
906 |
-
"&
|
907 |
-
"&
|
908 |
-
"&
|
909 |
-
"&
|
910 |
-
"&
|
911 |
-
"&
|
912 |
-
"&
|
913 |
-
"&
|
914 |
-
"&
|
915 |
-
"&
|
916 |
-
"&
|
917 |
-
"&
|
918 |
-
"&
|
919 |
-
"&
|
920 |
-
"&
|
921 |
-
"&
|
922 |
-
"&
|
923 |
-
"&
|
924 |
-
"&
|
925 |
-
"&
|
926 |
-
"&
|
927 |
-
"&
|
928 |
-
"&
|
929 |
-
"&
|
930 |
-
"&
|
931 |
-
"&
|
932 |
-
"&
|
933 |
-
"&
|
934 |
-
"&
|
935 |
-
"&
|
936 |
-
"&
|
937 |
-
"&
|
938 |
-
"&
|
939 |
-
"&
|
940 |
-
"&
|
941 |
-
"&
|
942 |
-
"&
|
943 |
-
"&
|
944 |
-
"&
|
945 |
-
"&
|
946 |
-
"&
|
947 |
-
"&
|
948 |
-
"&
|
949 |
-
"&
|
950 |
-
"&
|
951 |
-
"&
|
952 |
-
"&
|
953 |
-
"&
|
954 |
-
"&
|
955 |
-
"&
|
956 |
-
"&
|
957 |
-
"&
|
958 |
-
"&
|
959 |
-
"&
|
960 |
-
"&
|
961 |
-
"&
|
962 |
-
"&
|
963 |
-
"&
|
964 |
-
"&
|
965 |
-
"&
|
966 |
-
"&
|
967 |
-
"&
|
968 |
-
"&
|
969 |
-
"&
|
970 |
-
"&
|
971 |
-
"&
|
972 |
-
"&
|
973 |
-
"&
|
974 |
-
"&
|
975 |
-
"&
|
976 |
-
"&
|
977 |
-
"&
|
978 |
-
"&
|
979 |
-
"&
|
980 |
-
"&
|
981 |
-
"&
|
982 |
-
"&
|
983 |
-
"&
|
984 |
-
"&
|
985 |
-
"&
|
986 |
-
"&
|
987 |
-
"&
|
988 |
-
"&
|
989 |
-
"&
|
990 |
-
"&
|
991 |
-
"&
|
992 |
-
"&
|
993 |
-
"&
|
994 |
-
"&
|
995 |
-
"&
|
996 |
-
"&
|
997 |
-
"&
|
998 |
-
"&
|
999 |
-
"&
|
1000 |
-
"&
|
1001 |
-
"&
|
1002 |
-
"&
|
1003 |
-
"&
|
1004 |
-
"&
|
1005 |
-
"&
|
1006 |
-
"&
|
1007 |
-
"&
|
1008 |
-
"&
|
1009 |
-
"&
|
1010 |
-
"&
|
1011 |
-
"&
|
1012 |
-
"&
|
1013 |
-
"&
|
1014 |
-
"&
|
1015 |
-
"&
|
1016 |
-
"&
|
1017 |
-
"&
|
1018 |
-
"&
|
1019 |
-
"&
|
1020 |
-
"&
|
1021 |
-
"&
|
1022 |
-
"&
|
1023 |
-
"&
|
1024 |
-
"&
|
|
|
1025 |
);
|
1026 |
|
1027 |
-
$return = strtr($str, $htmlentities);
|
1028 |
-
$return = preg_replace('~&#x([0-9a-f]+)
|
1029 |
-
$return = preg_replace('~&#([0-9]+)
|
1030 |
|
1031 |
return $return;
|
1032 |
}
|
1033 |
|
1034 |
-
|
1035 |
// check class wp_widget exists
|
1036 |
-
if ( class_exists('WP_Widget') ) {
|
1037 |
-
|
1038 |
class RSSImport_Widget extends WP_Widget {
|
1039 |
-
|
1040 |
-
function __construct() {
|
1041 |
-
|
1042 |
-
|
|
|
|
|
|
|
|
|
1043 |
}
|
1044 |
-
|
1045 |
-
function widget($args, $instance) {
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
$titlelink = empty($instance['titlelink']) ? '' : $instance['titlelink'];
|
1050 |
-
$display = empty($instance['display']) ? '5' : $instance['display'];
|
1051 |
-
$feedurl = empty($instance['feedurl']) ? 'http://bueltge.de/feed/' : $instance['feedurl'];
|
1052 |
-
$before_desc = empty($instance['before_desc']) ? '' : $instance['before_desc'];
|
1053 |
-
$displaydescriptions = empty($instance['displaydescriptions']) ? '0'
|
1054 |
-
|
1055 |
-
$
|
1056 |
-
$
|
1057 |
-
$
|
1058 |
-
$
|
1059 |
-
$
|
1060 |
-
$
|
1061 |
-
|
1062 |
-
$
|
1063 |
-
$
|
1064 |
-
$
|
1065 |
-
$
|
1066 |
-
$
|
1067 |
-
$
|
1068 |
-
$
|
1069 |
-
$
|
1070 |
-
$
|
1071 |
-
$
|
1072 |
-
$
|
1073 |
-
$
|
1074 |
-
$
|
1075 |
-
$
|
1076 |
-
$
|
1077 |
-
$
|
1078 |
-
$
|
1079 |
-
$
|
1080 |
-
|
1081 |
-
$
|
1082 |
-
$
|
1083 |
-
$
|
1084 |
-
|
1085 |
-
$
|
1086 |
-
$
|
1087 |
-
$
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1092 |
$title = '<a href="' . $titlelink . '">' . $title . '</a>';
|
1093 |
-
|
|
|
1094 |
RSSImport(
|
1095 |
$display, $feedurl,
|
1096 |
$before_desc, $displaydescriptions, $after_desc, $html, $truncatedescchar, $truncatedescstring,
|
@@ -1109,331 +1225,452 @@ if ( class_exists('WP_Widget') ) {
|
|
1109 |
$use_simplepie,
|
1110 |
$view
|
1111 |
);
|
1112 |
-
echo $after_widget;
|
1113 |
}
|
1114 |
-
|
1115 |
-
function update($new_instance, $old_instance) {
|
1116 |
-
|
1117 |
-
$instance['
|
1118 |
-
$instance['
|
1119 |
-
$instance['
|
1120 |
-
$instance['
|
1121 |
-
$instance['
|
1122 |
-
$instance['
|
1123 |
-
$instance['
|
1124 |
-
$instance['
|
1125 |
-
$instance['
|
1126 |
-
$instance['
|
1127 |
-
$instance['
|
1128 |
-
$instance['
|
1129 |
-
$instance['
|
1130 |
-
$instance['
|
1131 |
-
$instance['
|
1132 |
-
$instance['
|
1133 |
-
$instance['
|
1134 |
-
$instance['
|
1135 |
-
$instance['
|
1136 |
-
$instance['
|
1137 |
-
$instance['
|
1138 |
-
$instance['
|
1139 |
-
$instance['
|
1140 |
-
$instance['
|
1141 |
-
$instance['
|
1142 |
-
$instance['
|
1143 |
-
$instance['
|
1144 |
-
$instance['
|
1145 |
-
$instance['
|
1146 |
-
$instance['
|
1147 |
-
$instance['
|
1148 |
-
$instance['
|
1149 |
-
$instance['
|
1150 |
-
$instance['
|
1151 |
-
$instance['
|
1152 |
-
$instance['
|
1153 |
-
$instance['
|
1154 |
-
$instance['
|
1155 |
-
$instance['
|
1156 |
-
$instance['
|
1157 |
-
$instance['
|
1158 |
-
|
1159 |
-
|
|
|
1160 |
return $instance;
|
1161 |
-
else
|
1162 |
-
return stripslashes( strip_tags
|
|
|
1163 |
}
|
1164 |
-
|
1165 |
-
function form($instance) {
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
|
|
|
|
1210 |
);
|
1211 |
-
|
1212 |
-
$title
|
1213 |
-
$titlelink
|
1214 |
-
$display
|
1215 |
-
$feedurl
|
1216 |
-
$before_desc
|
1217 |
-
$displaydescriptions = (int) $instance['displaydescriptions'];
|
1218 |
-
$after_desc
|
1219 |
-
$html
|
1220 |
-
$truncatedescchar
|
1221 |
-
$truncatedescstring
|
1222 |
-
$truncatetitlechar
|
1223 |
-
$truncatetitlestring = $instance['truncatetitlestring'];
|
1224 |
-
$before_date
|
1225 |
-
$date
|
1226 |
-
$after_date
|
1227 |
-
$date_format
|
1228 |
-
$before_creator
|
1229 |
-
$creator
|
1230 |
-
$after_creator
|
1231 |
-
$start_items
|
1232 |
-
$end_items
|
1233 |
-
$start_item
|
1234 |
-
$end_item
|
1235 |
-
$target
|
1236 |
-
$rel
|
1237 |
-
$desc4title
|
1238 |
-
$charsetscan
|
1239 |
-
$debug
|
1240 |
-
$before_noitems
|
1241 |
-
$noitems
|
1242 |
-
$after_noitems
|
1243 |
-
$before_error
|
1244 |
-
$error
|
1245 |
-
$after_error
|
1246 |
-
$paging
|
1247 |
-
$prev_paging_link
|
1248 |
-
$next_paging_link
|
1249 |
-
$prev_paging_title
|
1250 |
-
$next_paging_title
|
1251 |
-
$use_simplepie
|
1252 |
-
$view
|
1253 |
?>
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
<
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
<
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
</
|
1289 |
-
</
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
<
|
1295 |
-
|
1296 |
-
<
|
1297 |
-
<
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
<
|
1303 |
-
<
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
<
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
<
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
<
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
</
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
<
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
<
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
<
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
<
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
<
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
<
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1432 |
<?php
|
1433 |
-
|
1434 |
}
|
1435 |
}
|
1436 |
-
|
1437 |
-
add_action( 'widgets_init', create_function('', 'return register_widget("RSSImport_Widget");') );
|
1438 |
|
1439 |
} // end if class wp_widget exists
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Plugin Name: WP-RSSImport
|
4 |
+
* Plugin URI: https://wordpress.org/support/plugin/
|
5 |
* Text Domain: rssimport
|
6 |
* Domain Path: /languages
|
7 |
+
* Description: Display Feeds in your blog. Use the function RSSImport(), a Widget or the Shortcode [RSSImport].
|
8 |
* Author: Frank Bültge, took77
|
9 |
+
* Version: 4.4.17
|
10 |
+
* License: GPLv3+
|
11 |
+
* Last change: 2016-04-17
|
12 |
+
*/
|
13 |
|
14 |
/*
|
15 |
------------------------------------------------------------
|
18 |
Original and Idea: Dave Wolf, http://www.davewolf.net
|
19 |
Thx to Thomas Fischer, http://www.securityfocus.de and
|
20 |
Gunnar Tillmann http://www.gunnart.de for a better code
|
|
|
21 |
Paging: Ilya Shindyapin, http://skookum.com
|
22 |
|
23 |
------------------------------------------------------------
|
27 |
*/
|
28 |
|
29 |
//avoid direct calls to this file, because now WP core and framework has been used
|
30 |
+
if ( ! function_exists( 'add_action' ) ) {
|
31 |
+
header( 'Status: 403 Forbidden' );
|
32 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
33 |
exit();
|
34 |
}
|
35 |
|
36 |
+
if ( function_exists( 'add_action' ) ) {
|
37 |
//WordPress definitions
|
38 |
+
if ( ! defined( 'WP_CONTENT_URL' ) ) {
|
39 |
+
define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
|
40 |
+
}
|
41 |
+
if ( ! defined( 'WP_CONTENT_DIR' ) ) {
|
42 |
+
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
|
43 |
+
}
|
44 |
+
if ( ! defined( 'WP_PLUGIN_URL' ) ) {
|
45 |
+
define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
|
46 |
+
}
|
47 |
+
if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
|
48 |
+
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
|
49 |
+
}
|
50 |
+
if ( ! defined( 'PLUGINDIR' ) ) {
|
51 |
+
define( 'PLUGINDIR', 'wp-content/plugins' );
|
52 |
+
} // Relative to ABSPATH. For back combat
|
53 |
+
if ( ! defined( 'WP_LANG_DIR' ) ) {
|
54 |
+
define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' );
|
55 |
+
}
|
56 |
|
57 |
// plugin definitions
|
58 |
+
define( 'FB_RSSI_BASENAME', plugin_basename( __FILE__ ) );
|
59 |
define( 'FB_RSSI_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) );
|
60 |
define( 'FB_RSSI_TEXTDOMAIN', 'rssimport' );
|
61 |
define( 'FB_RSSI_QUICKTAG', TRUE );
|
63 |
|
64 |
function RSSImport_textdomain() {
|
65 |
|
66 |
+
if ( function_exists( 'load_plugin_textdomain' ) ) {
|
67 |
+
load_plugin_textdomain( FB_RSSI_TEXTDOMAIN, FALSE, dirname( FB_RSSI_BASENAME ) . '/languages' );
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
}
|
70 |
|
71 |
+
// Cache reporting.
|
72 |
+
// define('MAGPIE_CACHE_ON', FALSE); // Cache off
|
73 |
+
if ( ! defined( 'MAGPIE_CACHE_AGE' ) ) {
|
74 |
+
define( 'MAGPIE_CACHE_AGE', '60*60' ); // in sec, one hour
|
75 |
}
|
76 |
|
77 |
+
/**
|
78 |
+
* @param int $display
|
79 |
+
* @param string $feedurl
|
80 |
+
* @param string $before_desc
|
81 |
+
* @param int $displaydescriptions
|
82 |
+
* @param string $after_desc
|
83 |
+
* @param int $html
|
84 |
+
* @param int $truncatedescchar
|
85 |
+
* @param string $truncatedescstring
|
86 |
+
* @param string $truncatetitlechar
|
87 |
+
* @param string $truncatetitlestring
|
88 |
+
* @param string $before_date
|
89 |
+
* @param int $date
|
90 |
+
* @param string $after_date
|
91 |
+
* @param string $date_format
|
92 |
+
* @param string $before_creator
|
93 |
+
* @param int $creator
|
94 |
+
* @param string $after_creator
|
95 |
+
* @param string $start_items
|
96 |
+
* @param string $end_items
|
97 |
+
* @param string $start_item
|
98 |
+
* @param string $end_item
|
99 |
+
* @param string $target
|
100 |
+
* @param string $rel
|
101 |
+
* @param int $desc4title
|
102 |
+
* @param int $charsetscan
|
103 |
+
* @param int $debug
|
104 |
+
* @param string $before_noitems
|
105 |
+
* @param string $noitems
|
106 |
+
* @param string $after_noitems
|
107 |
+
* @param string $before_error
|
108 |
+
* @param string $error
|
109 |
+
* @param string $after_error
|
110 |
+
* @param int $paging
|
111 |
+
* @param string $prev_paging_link
|
112 |
+
* @param string $next_paging_link
|
113 |
+
* @param string $prev_paging_title
|
114 |
+
* @param string $next_paging_title
|
115 |
+
* @param int $use_simplepie
|
116 |
+
* @param int $view
|
117 |
+
*
|
118 |
+
* @return string
|
119 |
+
*/
|
120 |
function RSSImport(
|
121 |
+
$display = 5,
|
122 |
+
$feedurl = 'http://bueltge.de/feed/',
|
123 |
+
$before_desc = '',
|
124 |
+
$displaydescriptions = 0,
|
125 |
+
$after_desc = '',
|
126 |
+
$html = 0,
|
127 |
+
$truncatedescchar = 200,
|
128 |
+
$truncatedescstring = ' ... ',
|
129 |
+
$truncatetitlechar = 0,
|
130 |
+
$truncatetitlestring = ' ... ',
|
131 |
+
$before_date = ' <small>',
|
132 |
+
$date = 0,
|
133 |
+
$after_date = '</small>',
|
134 |
+
$date_format = '',
|
135 |
+
$before_creator = ' <small>',
|
136 |
+
$creator = 0,
|
137 |
+
$after_creator = '</small>',
|
138 |
+
$start_items = '<ul>',
|
139 |
+
$end_items = '</ul>',
|
140 |
+
$start_item = '<li>',
|
141 |
+
$end_item = '</li>',
|
142 |
+
$target = '',
|
143 |
+
$rel = '',
|
144 |
+
$desc4title = 0,
|
145 |
+
$charsetscan = 0,
|
146 |
+
$debug = 0,
|
147 |
+
$before_noitems = '<p>',
|
148 |
+
$noitems = 'No items, feed is empty.',
|
149 |
+
$after_noitems = '</p>',
|
150 |
+
$before_error = '<p>',
|
151 |
+
$error = 'Error: Feed has an error or is not valid',
|
152 |
+
$after_error = '</p>',
|
153 |
+
$paging = 0,
|
154 |
+
$prev_paging_link = '« Previous',
|
155 |
+
$next_paging_link = 'Next »',
|
156 |
+
$prev_paging_title = 'more items',
|
157 |
+
$next_paging_title = 'more items',
|
158 |
+
$use_simplepie = 1,
|
159 |
+
$view = 1
|
160 |
+
) {
|
161 |
+
|
162 |
// replace for yahoo pipes urls
|
163 |
+
$feedurl = str_replace( '&', '&', $feedurl );
|
164 |
+
|
165 |
+
$display = (int) $display;
|
166 |
$displaydescriptions = (int) $displaydescriptions;
|
167 |
+
$html = (int) $html;
|
168 |
+
$truncatedescchar = (int) $truncatedescchar;
|
169 |
+
$truncatetitlechar = (int) $truncatetitlechar;
|
170 |
+
$date = (int) $date;
|
171 |
+
if ( '' === $date_format ) {
|
172 |
+
$date_format = get_option( 'date_format' );
|
173 |
+
}
|
174 |
+
$creator = (int) $creator;
|
175 |
+
$charsetscan = (int) $charsetscan;
|
176 |
+
$debug = (int) $debug;
|
177 |
+
$paging = (int) $paging;
|
178 |
$use_simplepie = (int) $use_simplepie;
|
179 |
+
$view = (int) $view;
|
180 |
+
|
181 |
+
if ( $use_simplepie ) {
|
182 |
+
if ( ! class_exists( 'SimplePie' ) ) {
|
183 |
+
if ( file_exists( ABSPATH . WPINC . '/class-simplepie.php' ) ) {
|
184 |
+
@require_once( ABSPATH . WPINC . '/class-simplepie.php' );
|
185 |
} else {
|
186 |
+
die ( __( 'Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The WordPress file "class-simplepie.php" with class SimplePie could not be included.' ) );
|
187 |
}
|
188 |
}
|
189 |
} else {
|
190 |
// For function fetch_rss from wp-core
|
191 |
+
if ( file_exists( ABSPATH . WPINC . '/rss.php' ) ) {
|
192 |
+
require_once( ABSPATH . WPINC . '/rss.php' );
|
193 |
// It's Wordpress 2.x. since it has been loaded successfully
|
194 |
+
} elseif ( file_exists( ABSPATH . WPINC . '/rss-functions.php' ) ) {
|
195 |
+
require_once( ABSPATH . WPINC . '/rss-functions.php' );
|
196 |
// In Wordpress < 2.1
|
197 |
} else {
|
198 |
+
die ( __( 'Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The Wordpress file "rss-functions.php" or "rss.php" could not be included.' ) );
|
199 |
}
|
200 |
}
|
201 |
+
|
202 |
+
$display = (int) $display;
|
203 |
+
$page = ( ( ! empty( $_GET[ 'rsspage' ] ) && (int) $_GET[ 'rsspage' ] > 0 )
|
204 |
+
? (int) $_GET[ 'rsspage' ] : 1 );
|
205 |
+
$truncatedescchar = (int) $truncatedescchar;
|
206 |
+
$truncatetitlechar = (int) $truncatetitlechar;
|
207 |
+
$echo = '<!--via MagpieRSS with RSSImport-->';
|
208 |
+
if ( $use_simplepie ) {
|
209 |
$echo = '<!--via SimplePie with RSSImport-->';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
}
|
211 |
+
|
212 |
+
// read in file for search charset
|
213 |
+
if ( $charsetscan && function_exists( 'file_get_contents' ) ) {
|
214 |
+
ini_set( 'default_socket_timeout', 10 );
|
215 |
+
$a = file_get_contents( $feedurl );
|
216 |
+
// for better performance, if the server accepts the method
|
217 |
+
// $a = file_get_contents( $feedurl, FALSE, NULL, 0, 50 );
|
218 |
+
}
|
219 |
+
|
220 |
+
if ( $use_simplepie ) {
|
221 |
+
$rss = fetch_feed( $feedurl );
|
222 |
+
} else {
|
223 |
+
$rss = fetch_rss( $feedurl );
|
224 |
+
}
|
225 |
+
|
226 |
+
if ( $rss && ! is_wp_error( $rss ) ) {
|
227 |
+
|
228 |
// the follow print_r list all items in array, for debug purpose
|
229 |
if ( $debug ) {
|
230 |
+
print '<pre>';
|
231 |
+
print 'FeedURL: ' . $feedurl . '<br>';
|
232 |
+
print 'The object after parsing Feed URL:<br>';
|
233 |
+
print_r( $rss );
|
234 |
+
print '</pre>';
|
235 |
+
if ( ! defined( 'MAGPIE_CACHE_ON' ) ) {
|
236 |
+
define( 'MAGPIE_CACHE_ON', FALSE );
|
237 |
+
}
|
238 |
}
|
239 |
+
|
240 |
+
if ( isset( $target ) && '' !== $target ) {
|
241 |
$target = ' target="_' . $target . '"';
|
242 |
+
}
|
243 |
+
|
244 |
+
if ( isset( $rel ) && '' !== $rel ) {
|
245 |
$rel = ' rel="' . $rel . '"';
|
246 |
+
}
|
247 |
+
|
248 |
+
$displayitems = $display;
|
249 |
+
$displaylimit = ( $page * $display );
|
250 |
+
$display = ( ( $page - 1 ) * $display );
|
251 |
+
$nextitems = TRUE;
|
252 |
$previousitems = FALSE;
|
253 |
+
if ( $page > 1 ) {
|
254 |
$previousitems = TRUE;
|
255 |
+
}
|
256 |
+
|
257 |
+
while ( $display < $displaylimit ) {
|
258 |
+
|
259 |
+
if ( $use_simplepie && ( 1 === $paging ) ) {
|
260 |
+
/** @var SimplePie $rss */
|
261 |
$items = $rss->get_items();
|
262 |
+
} elseif ( $use_simplepie ) {
|
263 |
+
/** @var SimplePie $rss */
|
264 |
+
$items = $rss->get_items( 0, $displayitems );
|
265 |
+
} else {
|
266 |
+
/** @var MagpieRSS $rss */
|
267 |
$items = $rss->items;
|
268 |
+
}
|
269 |
+
|
270 |
if ( array_key_exists( $display, $items ) ) {
|
271 |
+
|
272 |
+
if ( $use_simplepie ) {
|
273 |
+
/** @var SimplePie $rss */
|
274 |
+
$item = $rss->get_item( $display );
|
275 |
+
} else {
|
276 |
+
/** @var MagpieRSS $rss */
|
277 |
+
$item = $rss->items[ $display ];
|
278 |
+
}
|
279 |
// import title
|
280 |
+
$title = '';
|
281 |
+
if ( $use_simplepie ) {
|
282 |
$title = esc_attr( strip_tags( $item->get_title() ) );
|
283 |
+
} elseif ( isset( $item[ 'title' ] ) ) {
|
284 |
+
$title = esc_attr( strip_tags( $item[ 'title' ] ) );
|
285 |
+
}
|
286 |
// import link
|
287 |
+
$href = '';
|
288 |
+
if ( $use_simplepie ) {
|
289 |
+
$href = wp_filter_kses( $item->get_link() );
|
290 |
+
} elseif ( isset( $item[ 'link' ] ) ) {
|
291 |
+
$href = wp_filter_kses( $item[ 'link' ] );
|
292 |
+
}
|
293 |
// import picture_url
|
294 |
+
$picture_url = '';
|
295 |
+
if ( $use_simplepie && $enclosure = $item->get_enclosure() ) {
|
296 |
+
$picture_url = wp_filter_kses( $enclosure->get_thumbnail() );
|
|
|
|
|
297 |
}
|
298 |
+
|
299 |
+
$start_item_temp = str_replace( '%title%', $title, $start_item );
|
300 |
+
$start_item_temp = str_replace( '%href%', $href, $start_item_temp );
|
301 |
+
$start_item_temp = str_replace( '%picture_url%', $picture_url, $start_item_temp );
|
302 |
$echo .= $start_item_temp;
|
303 |
+
|
304 |
// import date
|
305 |
+
if ( $use_simplepie && $date ) {
|
306 |
$pubDate = date_i18n( $date_format, strtotime( $item->get_date() ) );
|
307 |
+
} elseif ( $date && isset( $item[ 'pubdate' ] ) ) {
|
308 |
+
$pubDate = date_i18n( $date_format, strtotime( $item[ 'pubdate' ] ) );
|
309 |
+
}
|
310 |
// import creator
|
311 |
+
if ( $use_simplepie && $creator ) {
|
312 |
$creator = $item->get_author();
|
313 |
+
if ( is_object( $creator ) ) {
|
314 |
$creator = $creator->get_name();
|
315 |
$creator = ' <cite>' . esc_html( strip_tags( $creator ) ) . '</cite>';
|
316 |
}
|
317 |
+
} elseif ( $creator && isset( $item[ 'dc' ][ 'creator' ] ) ) {
|
318 |
+
$creator = esc_html( $item[ 'dc' ][ 'creator' ] );
|
319 |
+
} elseif ( $creator && isset( $item[ 'creator' ] ) ) {
|
320 |
+
$creator = esc_html( $item[ 'creator' ] );
|
321 |
}
|
322 |
// import desc
|
323 |
+
if ( $use_simplepie && $displaydescriptions && $html ) {
|
324 |
+
$desc = @html_entity_decode( $item->get_content(), ENT_QUOTES, get_option( 'blog_charset' ) );
|
325 |
+
} // For import with HTML
|
326 |
+
elseif ( $use_simplepie && $displaydescriptions && ! $html ) {
|
327 |
+
$desc = str_replace(
|
328 |
+
array( "\n", "\r" ), ' ',
|
329 |
+
esc_attr( strip_tags(
|
330 |
+
@html_entity_decode(
|
331 |
+
$item->get_description(),
|
332 |
+
ENT_QUOTES,
|
333 |
+
get_option( 'blog_charset' ) ) )
|
334 |
+
)
|
335 |
+
);
|
336 |
+
} // For import without HTML
|
337 |
+
elseif ( $displaydescriptions && $html && isset( $item[ 'content' ][ 'encoded' ] ) && $item[ 'content' ][ 'encoded' ] != 'A' ) {
|
338 |
+
$desc = $item[ 'content' ][ 'encoded' ];
|
339 |
+
} // For import with HTML
|
340 |
+
elseif ( $displaydescriptions && $html && isset( $item[ 'content' ][ 'atom_content' ] ) && $item[ 'content' ][ 'atom_content' ] != 'A' ) {
|
341 |
+
$desc = $item[ 'content' ][ 'atom_content' ];
|
342 |
+
} // For import with HTML
|
343 |
+
elseif ( $displaydescriptions && $html && isset( $item[ 'content' ] ) && ! is_array( $item[ 'content' ] ) ) {
|
344 |
+
$desc = $item[ 'content' ];
|
345 |
+
} elseif ( $displaydescriptions && $html && isset( $item[ 'description' ] ) ) {
|
346 |
+
$desc = $item[ 'description' ];
|
347 |
+
} elseif ( $displaydescriptions && ! $html && isset( $item[ 'description' ] ) ) {
|
348 |
+
$desc = esc_html( strip_tags( $item[ 'description' ] ) );
|
349 |
+
} // For import without HTML
|
350 |
+
|
351 |
+
if ( isset( $a ) && FALSE !== stripos( $a, 'ISO' ) ) {
|
352 |
+
if ( $debug ) {
|
353 |
$echo .= 'ISO Feed' . "\n";
|
354 |
+
}
|
355 |
+
if ( isset( $title ) ) {
|
356 |
+
isodec( $title );
|
357 |
+
}
|
358 |
+
if ( isset( $creator ) ) {
|
359 |
+
isodec( $creator );
|
360 |
+
}
|
361 |
+
if ( isset( $desc ) ) {
|
362 |
+
isodec( $desc );
|
363 |
+
}
|
364 |
} else {
|
365 |
+
if ( $debug ) {
|
366 |
$echo .= 'NonISO Feed' . "\n";
|
367 |
+
}
|
368 |
+
if ( isset( $title ) ) {
|
369 |
+
utf8dec( $title );
|
370 |
+
}
|
371 |
+
if ( isset( $creator ) ) {
|
372 |
+
utf8dec( $creator );
|
373 |
+
}
|
374 |
+
if ( isset( $desc ) ) {
|
375 |
+
utf8dec( $desc );
|
376 |
+
}
|
377 |
}
|
378 |
+
|
379 |
+
if ( isset( $title ) ) {
|
380 |
+
all_convert( $title );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
}
|
382 |
+
if ( isset( $creator ) ) {
|
383 |
+
all_convert( $creator );
|
384 |
+
}
|
385 |
+
if ( isset( $desc ) ) {
|
386 |
+
all_convert( $desc );
|
387 |
+
}
|
388 |
+
|
389 |
+
if ( isset( $title ) && $truncatetitlechar && ( strlen( $title ) > $truncatetitlechar ) ) {
|
390 |
+
$title = wp_html_excerpt( $title, $truncatetitlechar ) . $truncatetitlestring;
|
391 |
+
}
|
392 |
+
|
393 |
+
if ( isset( $desc ) && $truncatedescchar && ( strlen( $desc ) > $truncatedescchar ) ) {
|
394 |
+
$desc = wp_html_excerpt( $desc, $truncatedescchar ) . $truncatedescstring;
|
395 |
}
|
396 |
+
|
397 |
if ( $desc4title ) {
|
398 |
+
$desc = '';
|
399 |
+
if ( $use_simplepie ) {
|
400 |
+
$desc = str_replace(
|
401 |
+
array( "\n", "\r" ),
|
402 |
+
' ',
|
403 |
+
esc_attr( strip_tags(
|
404 |
+
@html_entity_decode( $item->get_description(),
|
405 |
+
ENT_QUOTES,
|
406 |
+
get_option( 'blog_charset' )
|
407 |
+
)
|
408 |
+
)
|
409 |
+
)
|
410 |
+
);
|
411 |
+
} // For import without HTML
|
412 |
+
else if ( isset( $item[ 'description' ] ) ) {
|
413 |
+
$desc = esc_html( strip_tags( $item[ 'description' ] ) );
|
414 |
+
}
|
415 |
+
$atitle = wp_html_excerpt( $desc, $truncatedescchar ) . $truncatedescstring;
|
416 |
} else {
|
417 |
$atitle = $title;
|
418 |
}
|
419 |
+
|
420 |
+
$echo .= '<a' . $target . $rel . ' href="' . $href . '" title="' . $atitle . '">' . $title . '</a>';
|
421 |
+
if ( isset( $pubDate ) && $date && '' !== $pubDate ) {
|
422 |
$echo .= $before_date . $pubDate . $after_date;
|
423 |
+
}
|
424 |
+
if ( isset( $creator ) && $creator && '' !== $creator ) {
|
425 |
$echo .= $before_creator . $creator . $after_creator;
|
426 |
+
}
|
427 |
+
if ( isset( $desc ) && $displaydescriptions && '' !== $desc ) {
|
428 |
+
$after_desc_temp = stripslashes_deep( $after_desc );
|
429 |
+
$after_desc_temp = str_replace( '%title%', $title, $after_desc_temp );
|
430 |
+
$after_desc_temp = str_replace( '%href%', $href, $after_desc_temp );
|
431 |
+
$after_desc_temp = str_replace( '%picture_url%', $picture_url, $after_desc_temp );
|
432 |
+
$before_desc_temp = str_replace( '%title%', $title, $before_desc );
|
433 |
+
$before_desc_temp = str_replace( '%href%', $href, $before_desc_temp );
|
434 |
+
$before_desc_temp = str_replace( '%picture_url%', $picture_url, $before_desc_temp );
|
435 |
$echo .= $before_desc_temp . $desc . $after_desc_temp;
|
436 |
}
|
437 |
+
$end_item_temp = str_replace( '%title%', $title, $end_item );
|
438 |
+
$end_item_temp = str_replace( '%href%', $href, $end_item_temp );
|
439 |
+
$end_item_temp = str_replace( '%picture_url%', $picture_url, $end_item_temp );
|
440 |
$echo .= $end_item_temp;
|
441 |
} else {
|
442 |
$nextitems = FALSE;
|
443 |
}
|
444 |
+
|
445 |
+
$display ++;
|
446 |
+
}
|
447 |
+
|
448 |
+
if ( strip_tags( $echo ) ) { // novaclic: needed to filter out false content made of tags alone (html comments, html tags, ...)
|
449 |
+
$echo = wptexturize( $start_items . $echo . $end_items );
|
450 |
+
} else {
|
451 |
+
$echo = wptexturize( $before_noitems . $noitems . $after_noitems );
|
452 |
}
|
453 |
+
|
|
|
|
|
|
|
|
|
|
|
454 |
} else {
|
455 |
+
if ( empty( $rss->ERROR ) ) {
|
456 |
$rss->ERROR = NULL;
|
457 |
+
}
|
458 |
+
$echo = wptexturize( $before_error . $error . $rss->ERROR . $after_error );
|
459 |
}
|
460 |
+
|
461 |
+
if ( $paging ) {
|
462 |
$echo .= '<div class="rsspaging">';
|
463 |
+
if ( $previousitems ) {
|
464 |
+
$echo .= '<a href="' . add_query_arg( 'rsspage',
|
465 |
+
( $page - 1 ) ) . '" class="rsspaging_prev" title="' . $prev_paging_title . '">' . $prev_paging_link . '</a>';
|
466 |
+
}
|
467 |
+
if ( $nextitems ) {
|
468 |
+
$echo .= '<a href="' . add_query_arg( 'rsspage',
|
469 |
+
( $page + 1 ) ) . '" class="rsspaging_next" title="' . $next_paging_title . '">' . $next_paging_link . '</a>';
|
470 |
+
}
|
471 |
$echo .= '<br style="clear: both" />';
|
472 |
$echo .= '</div>';
|
473 |
}
|
474 |
+
|
475 |
+
if ( $view ) {
|
476 |
echo $echo;
|
477 |
+
} else {
|
478 |
return $echo;
|
479 |
+
}
|
480 |
}
|
481 |
|
482 |
+
function utf8dec( $s_String ) {
|
483 |
+
|
484 |
+
if ( version_compare( phpversion(), '5.0.0', '>=' ) ) {
|
485 |
+
$s_String = html_entity_decode( htmlentities( $s_String . " ", ENT_COMPAT, 'UTF-8' ) );
|
486 |
+
} else {
|
487 |
+
$s_String = RSSImport_html_entity_decode_php4( htmlentities( $s_String . " " ) );
|
488 |
+
}
|
489 |
+
|
490 |
+
return substr( $s_String, 0, - 1 );
|
491 |
}
|
492 |
|
493 |
+
function isodec( $s_String ) {
|
494 |
+
|
495 |
+
if ( version_compare( phpversion(), '5.0.0', '>=' ) ) {
|
496 |
+
$s_String = html_entity_decode( htmlentities( $s_String . ' ', ENT_COMPAT, 'ISO-8859-1' ) );
|
497 |
+
} else {
|
498 |
+
$s_String = RSSImport_html_entity_decode_php4( htmlentities( $s_String . ' ' ) );
|
499 |
+
}
|
500 |
+
|
501 |
+
return substr( $s_String, 0, - 1 );
|
502 |
}
|
503 |
|
504 |
+
function all_convert( $s_String ) {
|
505 |
|
506 |
// Array for entities
|
507 |
+
$umlaute = array('„','“','–',' \"','–','—','‘','’','“','”','„','•','…', '', '', '', '', '
', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '','','','','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','¹','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ',utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode('
'),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode('¡'),utf8_encode('¢'),utf8_encode('£'),utf8_encode('¤'),utf8_encode('¥'),utf8_encode('¦'),utf8_encode('§'),utf8_encode('¨'),utf8_encode('©'),utf8_encode('ª'),utf8_encode('«'),utf8_encode('¬'),utf8_encode('®'),utf8_encode('¯'),utf8_encode('°'),utf8_encode('±'),utf8_encode('²'),utf8_encode('³'),utf8_encode('´'),utf8_encode('µ'),utf8_encode('¶'),utf8_encode('·'),utf8_encode('¸'),utf8_encode('¹'),utf8_encode('º'),utf8_encode('»'),utf8_encode('¼'),utf8_encode('½'),utf8_encode('¾'),utf8_encode('¿'),utf8_encode('À'),utf8_encode('Á'),utf8_encode('Â'),utf8_encode('Ã'),utf8_encode('Ä'),utf8_encode('Å'),utf8_encode('Æ'),utf8_encode('Ç'),utf8_encode('È'),utf8_encode('É'),utf8_encode('Ê'),utf8_encode('Ë'),utf8_encode('Ì'),utf8_encode('Í'),utf8_encode('Î'),utf8_encode('Ï'),utf8_encode('Ð'),utf8_encode('Ñ'),utf8_encode('Ò'),utf8_encode('Ó'),utf8_encode('Ô'),utf8_encode('Õ'),utf8_encode('Ö'),utf8_encode('×'),utf8_encode('Ø'),utf8_encode('Ù'),utf8_encode('Ú'),utf8_encode('Û'),utf8_encode('Ü'),utf8_encode('Ý'),utf8_encode('Þ'),utf8_encode('ß'),utf8_encode('à'),utf8_encode('á'),utf8_encode('â'),utf8_encode('ã'),utf8_encode('ä'),utf8_encode('å'),utf8_encode('æ'),utf8_encode('ç'),utf8_encode('è'),utf8_encode('é'),utf8_encode('ê'),utf8_encode('ë'),utf8_encode('ì'),utf8_encode('í'),utf8_encode('î'),utf8_encode('ï'),utf8_encode('ð'),utf8_encode('ñ'),utf8_encode('ò'),utf8_encode('ó'),utf8_encode('ô'),utf8_encode('õ'),utf8_encode('ö'),utf8_encode('÷'),utf8_encode('ø'),utf8_encode('ù'),utf8_encode('ú'),utf8_encode('û'),utf8_encode('ü'),utf8_encode('ý'),utf8_encode('þ'),utf8_encode('ÿ'),chr(128),chr(129),chr(130),chr(131),chr(132),chr(133),chr(134),chr(135),chr(136),chr(137),chr(138),chr(139),chr(140),chr(141),chr(142),chr(143),chr(144),chr(145),chr(146),chr(147),chr(148),chr(149),chr(150),chr(151),chr(152),chr(153),chr(154),chr(155),chr(156),chr(157),chr(158),chr(159),chr(160),chr(161),chr(162),chr(163),chr(164),chr(165),chr(166),chr(167),chr(168),chr(169),chr(170),chr(171),chr(172),chr(173),chr(174),chr(175),chr(176),chr(177),chr(178),chr(179),chr(180),chr(181),chr(182),chr(183),chr(184),chr(185),chr(186),chr(187),chr(188),chr(189),chr(190),chr(191),chr(192),chr(193),chr(194),chr(195),chr(196),chr(197),chr(198),chr(199),chr(200),chr(201),chr(202),chr(203),chr(204),chr(205),chr(206),chr(207),chr(208),chr(209),chr(210),chr(211),chr(212),chr(213),chr(214),chr(215),chr(216),chr(217),chr(218),chr(219),chr(220),chr(221),chr(222),chr(223),chr(224),chr(225),chr(226),chr(227),chr(228),chr(229),chr(230),chr(231),chr(232),chr(233),chr(234),chr(235),chr(236),chr(237),chr(238),chr(239),chr(240),chr(241),chr(242),chr(243),chr(244),chr(245),chr(246),chr(247),chr(248),chr(249),chr(250),chr(251),chr(252),chr(253),chr(254),chr(255),chr(256));
|
508 |
+
|
509 |
+
$htmlcode = array( '„','“','–',' "','–','—','‘','’','“','”','„','•' ,'…','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','€','','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','','Ž','','','‘','’','“','”','•','–','—','˜','™','š','›','œ','','ž','Ÿ',' ','¡','¡','¡','¡','¥','¦','§','¨','©','ª','«','¬','­','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ' );
|
510 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
//$s_String = str_replace($umlaute, $htmlcode, $s_String);
|
512 |
+
if ( version_compare( phpversion(), '5.0.0', '>=' ) ) {
|
513 |
+
$s_String = utf8_encode( html_entity_decode( str_replace( $umlaute, $htmlcode, $s_String ) ) );
|
514 |
+
} else {
|
515 |
+
$s_String = utf8_encode( RSSImport_html_entity_decode_php4( str_replace( $umlaute, $htmlcode, $s_String ) ) );
|
516 |
+
}
|
517 |
+
|
518 |
// … , …
|
519 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xC2\xA6~', '…', $s_String );
|
520 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\xA6~', '…', $s_String );
|
521 |
+
$s_String = preg_replace( '~\xD0\xB2\xD0\x82\xC2\xA6~', '…', $s_String );
|
522 |
+
|
523 |
// — , —
|
524 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9D~', '—', $s_String );
|
525 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '—',
|
526 |
+
$s_String );
|
527 |
+
$s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x80\x9D~', '—', $s_String );
|
528 |
+
|
529 |
// – , –
|
530 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x80\x9C~', '–', $s_String );
|
531 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x82\xAC\xC5\x93~', '–',
|
532 |
+
$s_String );
|
533 |
+
$s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x80\x9C~', '–', $s_String );
|
534 |
+
|
535 |
// ’ , ’
|
536 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xE2\x84\xA2~', '’', $s_String );
|
537 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '’',
|
538 |
+
$s_String );
|
539 |
+
$s_String = preg_replace( '~\xD0\xB2\xD0\x82\xE2\x84\xA2~', '’', $s_String );
|
540 |
+
$s_String = preg_replace( '~\xD0\xBF\xD1\x97\xD0\x85~', '’', $s_String );
|
541 |
+
|
542 |
// ‘ , ‘
|
543 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xCB\x9C~', '‘', $s_String );
|
544 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x8B\xC5\x93~', '‘', $s_String );
|
545 |
+
|
546 |
// ” , ”
|
547 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xC2\x9D~', '”', $s_String );
|
548 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\x9D~', '”', $s_String );
|
549 |
+
$s_String = preg_replace( '~\xD0\xB2\xD0\x82\xD1\x9C~', '”', $s_String );
|
550 |
+
|
551 |
// “ , “
|
552 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x82\xAC\xC5\x93~', '“', $s_String );
|
553 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x85\xE2\x80\x9C~', '“',
|
554 |
+
$s_String );
|
555 |
+
$s_String = preg_replace( '~\xD0\xB2\xD0\x82\xD1\x9A~', '“', $s_String );
|
556 |
+
|
557 |
// ™ , ™
|
558 |
+
$s_String = preg_replace( '~\xC3\xA2\xE2\x80\x9E\xC2\xA2~', '™', $s_String );
|
559 |
+
$s_String = preg_replace( '~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x82\xAC\xC5\xBE\xC3\x82\xC2\xA2~', '™', $s_String );
|
560 |
+
|
561 |
// th
|
562 |
+
$s_String = preg_replace( '~t\xC3\x82\xC2\xADh~', 'th', $s_String );
|
563 |
+
|
564 |
// .
|
565 |
+
$s_String = preg_replace( '~.\xD0\x92+~', '.', $s_String );
|
566 |
+
$s_String = preg_replace( '~.\xD0\x92~', '.', $s_String );
|
567 |
+
|
568 |
// ,
|
569 |
+
$s_String = preg_replace( '~\x2C\xD0\x92~', ',', $s_String );
|
570 |
|
571 |
return $s_String;
|
572 |
}
|
573 |
|
574 |
/**
|
575 |
* Entfernt unvollstaendige Worte am Ende eines Strings.
|
576 |
+
*
|
577 |
* @author Thomas Scholz <http://toscho.de>
|
578 |
+
*
|
579 |
+
* @param $str
|
580 |
+
*
|
581 |
* @return string
|
582 |
*/
|
583 |
+
function RSSImport_end_on_word( $str ) {
|
584 |
+
|
585 |
+
$arr = explode( ' ', trim( $str ) );
|
586 |
+
array_pop( $arr );
|
587 |
+
|
588 |
+
return rtrim( implode( ' ', $arr ), ',;' );
|
589 |
}
|
590 |
|
591 |
+
function RSSImport_Shortcode( $atts ) {
|
592 |
+
|
593 |
+
$args = shortcode_atts(
|
594 |
+
array(
|
595 |
+
'display' => 5,
|
596 |
+
'feedurl' => 'http://bueltge.de/feed/',
|
597 |
+
'before_desc' => '<br />',
|
598 |
'displaydescriptions' => 0,
|
599 |
+
'after_desc' => '',
|
600 |
+
'html' => 0,
|
601 |
+
'truncatedescchar' => 200,
|
602 |
+
'truncatedescstring' => ' ... ',
|
603 |
+
'truncatetitlechar' => '',
|
604 |
'truncatetitlestring' => ' ... ',
|
605 |
+
'before_date' => ' <small>',
|
606 |
+
'date' => 0,
|
607 |
+
'after_date' => '</small>',
|
608 |
+
'date_format' => '',
|
609 |
+
'before_creator' => ' <small>',
|
610 |
+
'creator' => 0,
|
611 |
+
'after_creator' => '</small>',
|
612 |
+
'start_items' => '<ul>',
|
613 |
+
'end_items' => '</ul>',
|
614 |
+
'start_item' => '<li>',
|
615 |
+
'end_item' => '</li>',
|
616 |
+
'target' => '',
|
617 |
+
'rel' => '',
|
618 |
+
'desc4title' => 0,
|
619 |
+
'charsetscan' => 0,
|
620 |
+
'debug' => 0,
|
621 |
+
'before_noitems' => '<p>',
|
622 |
+
'noitems' => __( 'No items, feed is empty.', FB_RSSI_TEXTDOMAIN ),
|
623 |
+
'after_noitems' => '</p>',
|
624 |
+
'before_error' => '<p>',
|
625 |
+
'error' => __( 'Error: Feed has an error or is not valid',
|
626 |
+
FB_RSSI_TEXTDOMAIN ),
|
627 |
+
'after_error' => '</p>',
|
628 |
+
'paging' => 0,
|
629 |
+
'prev_paging_link' => __( '« Previous', FB_RSSI_TEXTDOMAIN ),
|
630 |
+
'next_paging_link' => __( 'Next »', FB_RSSI_TEXTDOMAIN ),
|
631 |
+
'prev_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
|
632 |
+
'next_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
|
633 |
+
'use_simplepie' => 1,
|
634 |
+
'view' => 0,
|
635 |
+
),
|
636 |
+
$atts
|
637 |
);
|
638 |
+
|
639 |
+
$display = (int) $args[ 'display' ];
|
640 |
+
$feedurl = html_entity_decode( $args[ 'feedurl' ] ); // novaclic: undo encoding due to wordpress WYSIWYG editor
|
641 |
+
if ( 'true' === strtolower( $args[ 'html' ] ) ) {
|
642 |
+
$args[ 'html' ] = 1;
|
643 |
+
}
|
644 |
+
$before_desc = $args[ 'before_desc' ];
|
645 |
+
$html = (int) $args[ 'html' ];
|
646 |
+
if ( 'true' === strtolower( $args[ 'displaydescriptions' ] ) ) {
|
647 |
+
$args[ 'displaydescriptions' ] = 1;
|
648 |
+
}
|
649 |
+
$after_desc = $args[ 'after_desc' ];
|
650 |
+
$displaydescriptions = (int) $args[ 'displaydescriptions' ];
|
651 |
+
if ( 'true' === strtolower( $args[ 'truncatedescchar' ] ) ) {
|
652 |
+
$args[ 'truncatedescchar' ] = 1;
|
653 |
+
}
|
654 |
+
$truncatedescchar = (int) $args[ 'truncatedescchar' ];
|
655 |
+
if ( 'true' === strtolower( $args[ 'truncatetitlechar' ] ) ) {
|
656 |
+
$args[ 'truncatetitlechar' ] = 1;
|
657 |
+
}
|
658 |
+
$truncatedescstring = $args[ 'truncatedescstring' ];
|
659 |
+
$truncatetitlestring = $args[ 'truncatetitlestring' ];
|
660 |
+
$truncatetitlechar = (int) $args[ 'truncatetitlechar' ];
|
661 |
+
$before_date = $args[ 'before_date' ];
|
662 |
+
if ( 'true' === strtolower( $args[ 'date' ] ) ) {
|
663 |
+
$args[ 'date' ] = 1;
|
664 |
+
}
|
665 |
+
$date = (int) $args[ 'date' ];
|
666 |
+
$after_date = $args[ 'after_date' ];
|
667 |
+
$date_format = $args[ 'date_format' ];
|
668 |
+
if ( 'true' === strtolower( $args[ 'creator' ] ) ) {
|
669 |
+
$args[ 'creator' ] = 1;
|
670 |
+
}
|
671 |
+
$before_creator = $args[ 'before_creator' ];
|
672 |
+
$creator = (int) $args[ 'creator' ];
|
673 |
+
$after_creator = $args[ 'after_creator' ];
|
674 |
+
$start_items = $args[ 'start_items' ];
|
675 |
+
$end_items = $args[ 'end_items' ];
|
676 |
+
$start_item = $args[ 'start_item' ];
|
677 |
+
$end_item = $args[ 'end_item' ];
|
678 |
+
$target = $args[ 'target' ];
|
679 |
+
$rel = $args[ 'rel' ];
|
680 |
+
$desc4title = $args[ 'desc4title' ];
|
681 |
+
if ( 'true' === strtolower( $args[ 'charsetscan' ] ) ) {
|
682 |
+
$args[ 'charsetscan' ] = 1;
|
683 |
+
}
|
684 |
+
$charsetscan = (int) $args[ 'charsetscan' ];
|
685 |
+
if ( 'true' === strtolower( $args[ 'debug' ] ) ) {
|
686 |
+
$args[ 'debug' ] = 1;
|
687 |
+
}
|
688 |
+
$debug = (int) $args[ 'debug' ];
|
689 |
+
$before_noitems = $args[ 'before_noitems' ];
|
690 |
+
$noitems = $args[ 'noitems' ];
|
691 |
+
$after_noitems = $args[ 'after_noitems' ];
|
692 |
+
$before_error = $args[ 'before_error' ];
|
693 |
+
$error = $args[ 'error' ];
|
694 |
+
$after_error = $args[ 'after_error' ];
|
695 |
+
if ( 'true' === strtolower( $args[ 'paging' ] ) ) {
|
696 |
+
$args[ 'paging' ] = 1;
|
697 |
+
}
|
698 |
+
$paging = (int) $args[ 'paging' ];
|
699 |
+
if ( 'true' === strtolower( $args[ 'use_simplepie' ] ) ) {
|
700 |
+
$args[ 'use_simplepie' ] = 1;
|
701 |
+
}
|
702 |
+
$prev_paging_link = $args[ 'prev_paging_link' ];
|
703 |
+
$next_paging_link = $args[ 'next_paging_link' ];
|
704 |
+
$prev_paging_title = $args[ 'prev_paging_title' ];
|
705 |
+
$next_paging_title = $args[ 'next_paging_title' ];
|
706 |
+
$use_simplepie = (int) $args[ 'use_simplepie' ];
|
707 |
+
$view = $args[ 'view' ];
|
708 |
+
|
709 |
$return = RSSImport(
|
710 |
$display, $feedurl,
|
711 |
$before_desc, $displaydescriptions, $after_desc, $html,
|
725 |
$use_simplepie,
|
726 |
$view
|
727 |
);
|
728 |
+
|
729 |
return $return;
|
730 |
}
|
731 |
|
732 |
+
function RSSImport_shortcode_quot( $pee ) {
|
733 |
+
|
734 |
global $shortcode_tags;
|
735 |
+
|
736 |
+
if ( ! empty( $shortcode_tags ) && is_array( $shortcode_tags ) ) {
|
737 |
+
$tagnames = array_keys( $shortcode_tags );
|
738 |
+
$tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) );
|
739 |
+
$pee = preg_replace(
|
740 |
+
'/\\s*?(\\[(' . $tagregexp . ')\\b.*?\\/?\\](?:.+?\\[\\/\\2\\])?)\\s*/s',
|
741 |
+
'$1',
|
742 |
+
$pee
|
743 |
+
);
|
744 |
}
|
745 |
|
746 |
return $pee;
|
747 |
}
|
748 |
|
|
|
749 |
/**
|
750 |
+
* Add Quicktag-button to editor.
|
751 |
*/
|
752 |
+
|
753 |
function RSSImport_insert_button() {
|
754 |
+
|
755 |
global $pagenow;
|
756 |
+
|
757 |
+
$post_page_pages = array( 'post-new.php', 'post.php', 'page-new.php', 'page.php' );
|
758 |
+
if ( ! in_array( $pagenow, $post_page_pages, TRUE ) ) {
|
759 |
return;
|
760 |
+
}
|
761 |
+
|
762 |
?>
|
763 |
<script type="text/javascript" charset="utf-8">
|
764 |
+
/* Adding Quicktag buttons to the editor WordPress ver. 3.3 and above
|
765 |
+
* - Button HTML ID (required)
|
766 |
+
* - Button display, value="" attribute (required)
|
767 |
+
* - Opening Tag (required)
|
768 |
+
* - Closing Tag (required)
|
769 |
+
* - Access key, accesskey="" attribute for the button (optional)
|
770 |
+
* - Title, title="" attribute (optional)
|
771 |
+
* - Priority/position on bar, 1-9 = first, 11-19 = second, 21-29 = third, etc. (optional)
|
772 |
+
*/
|
773 |
+
var id = 'rssimport',
|
774 |
+
text = '<?php _e( 'RSSImport', FB_RSSI_TEXTDOMAIN ); ?>',
|
775 |
+
start = '[RSSImport display="5" feedurl="http://feedurl.com/" before_desc="<br />" displaydescriptions="TRUE" after_desc=" " ' +
|
776 |
+
'html="FALSE" truncatedescchar="200" truncatedescstring=" ... " truncatetitlechar="" truncatetitlestring=" ... " ' +
|
777 |
+
'before_date=" <small>" date="FALSE" after_date="</small>" date_format="" before_creator=" <small>" creator="FALSE" ' +
|
778 |
+
'after_creator="</small>" start_items="<ul>" end_items="</ul>" start_item="<li>" end_item="</li>" target="" rel="" ' +
|
779 |
+
'desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>" noitems="No items, feed is empty." ' +
|
780 |
+
'after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid" after_error="</p>" ' +
|
781 |
+
'paging="FALSE" prev_paging_link="« Previous" next_paging_link="Next »" prev_paging_title="more items" ' +
|
782 |
+
'next_paging_title="more items" use_simplepie="FALSE"]',
|
783 |
+
end = '',
|
784 |
+
access = 'r',
|
785 |
+
title = '<?php _e( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ); ?>';
|
786 |
+
|
787 |
+
QTags.addButton( id, text, start, end, access );
|
788 |
</script>
|
789 |
<?php
|
790 |
}
|
791 |
|
792 |
function RSSImport_insert_button_old() {
|
793 |
+
|
794 |
global $pagenow;
|
795 |
+
|
796 |
+
$post_page_pages = array( 'post-new.php', 'post.php', 'page-new.php', 'page.php' );
|
797 |
+
if ( ! in_array( $pagenow, $post_page_pages, TRUE ) ) {
|
798 |
return;
|
799 |
+
}
|
800 |
+
|
801 |
echo '
|
802 |
<script type="text/javascript">
|
803 |
//<![CDATA[
|
804 |
if ( typeof edButtons != \'undefined\' ) {
|
805 |
+
|
806 |
+
var length = edButtons.length,
|
807 |
+
content;
|
808 |
+
|
809 |
+
edButtons[length] = new edButton(
|
810 |
+
\'RSSImport\', \'$context\', \'[RSSImport display="5" feedurl="http://feedurl.com/"' .
|
811 |
+
' before_desc="<br />" displaydescriptions="TRUE" after_desc=" " html="FALSE" truncatedescchar="200" truncatedescstring=" ... "' .
|
812 |
+
' truncatetitlechar=" " truncatetitlestring=" ... " before_date=" <small>" date="FALSE" after_date="</small>"' .
|
813 |
+
' date_format="" before_creator=" <small>" creator="FALSE" after_creator="</small>" start_items="<ul>" end_items="</ul>"' .
|
814 |
+
' start_item="<li>" end_item="</li>" target="" rel="" desc4title="" charsetscan="FALSE" debug="FALSE" before_noitems="<p>"' .
|
815 |
+
' noitems="No items, feed is empty." after_noitems="</p>" before_error="<p>" error="Error: Feed has an error or is not valid"' .
|
816 |
+
' after_error="</p>" paging="FALSE" prev_paging_link="« Previous" next_paging_link="Next »"' .
|
817 |
+
' prev_paging_title="more items" next_paging_title="more items" use_simplepie="FALSE"]\', \'\', \'\'
|
818 |
+
);
|
819 |
+
|
820 |
+
function RSSImport_tag( id ) {
|
821 |
+
id = id.replace( /RSSImport_/, \'\' );
|
822 |
+
edInsertTag( edCanvas, id );
|
823 |
}
|
824 |
+
jQuery( document ).ready( function() {
|
825 |
+
content = \'<input id="RSSImport_\' + length + \'" class="ed_button" type="button" value="'
|
826 |
+
. __( 'RSSImport', FB_RSSI_TEXTDOMAIN ) . '" title="'
|
827 |
+
. __( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ) . '" onclick="RSSImport_tag(this.id);" />\';
|
828 |
+
jQuery( "#ed_toolbar" ).append( content );
|
829 |
+
} );
|
830 |
}
|
831 |
//]]>
|
832 |
</script>';
|
833 |
}
|
834 |
|
835 |
if ( is_admin() && FB_RSSI_QUICKTAG ) {
|
836 |
+
if ( version_compare( $GLOBALS[ 'wp_version' ], '3.3alpha', '>=' ) ) {
|
837 |
add_action( 'admin_print_footer_scripts', 'RSSImport_insert_button' );
|
838 |
+
} else {
|
839 |
add_action( 'admin_footer', 'RSSImport_insert_button_old' );
|
840 |
+
}
|
841 |
}
|
842 |
|
843 |
+
if ( function_exists( 'add_shortcode' ) ) {
|
844 |
+
add_shortcode( 'RSSImport', 'RSSImport_Shortcode' );
|
845 |
+
}
|
846 |
|
847 |
add_action( 'init', 'RSSImport_textdomain' );
|
848 |
|
|
|
|
|
849 |
/**
|
850 |
* code to utf-8 in PHP 4
|
851 |
*
|
852 |
* @package WP-RSSImport
|
853 |
*/
|
854 |
+
function RSSImport_code_to_utf8( $num ) {
|
855 |
+
|
856 |
+
if ( $num <= 0x7F ) {
|
857 |
+
return chr( $num );
|
858 |
+
} elseif ( $num <= 0x7FF ) {
|
859 |
+
return chr( ( $num >> 0x06 ) + 0xC0 ) . chr( ( $num & 0x3F ) + 128 );
|
860 |
+
} elseif ( $num <= 0xFFFF ) {
|
861 |
+
return chr( ( $num >> 0x0C ) + 0xE0 ) . chr( ( ( $num >> 0x06 ) & 0x3F ) + 0x80 ) . chr( ( $num & 0x3F ) + 0x80 );
|
862 |
+
} elseif ( $num <= 0x1FFFFF ) {
|
863 |
+
return chr( ( $num >> 0x12 ) + 0xF0 ) . chr( ( ( $num >> 0x0C ) & 0x3F ) + 0x80 ) . chr( ( ( $num >> 0x06 ) & 0x3F ) + 0x80 ) . chr( ( $num & 0x3F ) + 0x80 );
|
864 |
}
|
865 |
|
866 |
return '';
|
867 |
}
|
868 |
|
|
|
869 |
/**
|
870 |
* html_entity_decode for PHP 4
|
871 |
*
|
872 |
* @package WP-RSSImport
|
873 |
*/
|
874 |
+
function RSSImport_html_entity_decode_php4( $str ) {
|
875 |
+
|
876 |
+
$htmlentities = array(
|
877 |
+
"Á" => chr( 195 ) . chr( 129 ),
|
878 |
+
"á" => chr( 195 ) . chr( 161 ),
|
879 |
+
"Â" => chr( 195 ) . chr( 130 ),
|
880 |
+
"â" => chr( 195 ) . chr( 162 ),
|
881 |
+
"´" => chr( 194 ) . chr( 180 ),
|
882 |
+
"Æ" => chr( 195 ) . chr( 134 ),
|
883 |
+
"æ" => chr( 195 ) . chr( 166 ),
|
884 |
+
"À" => chr( 195 ) . chr( 128 ),
|
885 |
+
"à" => chr( 195 ) . chr( 160 ),
|
886 |
+
"ℵ" => chr( 226 ) . chr( 132 ) . chr( 181 ),
|
887 |
+
"Α" => chr( 206 ) . chr( 145 ),
|
888 |
+
"α" => chr( 206 ) . chr( 177 ),
|
889 |
+
"&" => chr( 38 ),
|
890 |
+
"∧" => chr( 226 ) . chr( 136 ) . chr( 167 ),
|
891 |
+
"∠" => chr( 226 ) . chr( 136 ) . chr( 160 ),
|
892 |
+
"Å" => chr( 195 ) . chr( 133 ),
|
893 |
+
"å" => chr( 195 ) . chr( 165 ),
|
894 |
+
"≈" => chr( 226 ) . chr( 137 ) . chr( 136 ),
|
895 |
+
"Ã" => chr( 195 ) . chr( 131 ),
|
896 |
+
"ã" => chr( 195 ) . chr( 163 ),
|
897 |
+
"Ä" => chr( 195 ) . chr( 132 ),
|
898 |
+
"ä" => chr( 195 ) . chr( 164 ),
|
899 |
+
"„" => chr( 226 ) . chr( 128 ) . chr( 158 ),
|
900 |
+
"Β" => chr( 206 ) . chr( 146 ),
|
901 |
+
"β" => chr( 206 ) . chr( 178 ),
|
902 |
+
"¦" => chr( 194 ) . chr( 166 ),
|
903 |
+
"•" => chr( 226 ) . chr( 128 ) . chr( 162 ),
|
904 |
+
"∩" => chr( 226 ) . chr( 136 ) . chr( 169 ),
|
905 |
+
"Ç" => chr( 195 ) . chr( 135 ),
|
906 |
+
"ç" => chr( 195 ) . chr( 167 ),
|
907 |
+
"¸" => chr( 194 ) . chr( 184 ),
|
908 |
+
"¢" => chr( 194 ) . chr( 162 ),
|
909 |
+
"Χ" => chr( 206 ) . chr( 167 ),
|
910 |
+
"χ" => chr( 207 ) . chr( 135 ),
|
911 |
+
"ˆ" => chr( 203 ) . chr( 134 ),
|
912 |
+
"♣" => chr( 226 ) . chr( 153 ) . chr( 163 ),
|
913 |
+
"≅" => chr( 226 ) . chr( 137 ) . chr( 133 ),
|
914 |
+
"©" => chr( 194 ) . chr( 169 ),
|
915 |
+
"↵" => chr( 226 ) . chr( 134 ) . chr( 181 ),
|
916 |
+
"∪" => chr( 226 ) . chr( 136 ) . chr( 170 ),
|
917 |
+
"¤" => chr( 194 ) . chr( 164 ),
|
918 |
+
"†" => chr( 226 ) . chr( 128 ) . chr( 160 ),
|
919 |
+
"‡" => chr( 226 ) . chr( 128 ) . chr( 161 ),
|
920 |
+
"↓" => chr( 226 ) . chr( 134 ) . chr( 147 ),
|
921 |
+
"⇓" => chr( 226 ) . chr( 135 ) . chr( 147 ),
|
922 |
+
"°" => chr( 194 ) . chr( 176 ),
|
923 |
+
"Δ" => chr( 206 ) . chr( 148 ),
|
924 |
+
"δ" => chr( 206 ) . chr( 180 ),
|
925 |
+
"♦" => chr( 226 ) . chr( 153 ) . chr( 166 ),
|
926 |
+
"÷" => chr( 195 ) . chr( 183 ),
|
927 |
+
"É" => chr( 195 ) . chr( 137 ),
|
928 |
+
"é" => chr( 195 ) . chr( 169 ),
|
929 |
+
"Ê" => chr( 195 ) . chr( 138 ),
|
930 |
+
"ê" => chr( 195 ) . chr( 170 ),
|
931 |
+
"È" => chr( 195 ) . chr( 136 ),
|
932 |
+
"è" => chr( 195 ) . chr( 168 ),
|
933 |
+
"∅" => chr( 226 ) . chr( 136 ) . chr( 133 ),
|
934 |
+
" " => chr( 226 ) . chr( 128 ) . chr( 131 ),
|
935 |
+
" " => chr( 226 ) . chr( 128 ) . chr( 130 ),
|
936 |
+
"Ε" => chr( 206 ) . chr( 149 ),
|
937 |
+
"ε" => chr( 206 ) . chr( 181 ),
|
938 |
+
"≡" => chr( 226 ) . chr( 137 ) . chr( 161 ),
|
939 |
+
"Η" => chr( 206 ) . chr( 151 ),
|
940 |
+
"η" => chr( 206 ) . chr( 183 ),
|
941 |
+
"Ð" => chr( 195 ) . chr( 144 ),
|
942 |
+
"ð" => chr( 195 ) . chr( 176 ),
|
943 |
+
"Ë" => chr( 195 ) . chr( 139 ),
|
944 |
+
"ë" => chr( 195 ) . chr( 171 ),
|
945 |
+
"€" => chr( 226 ) . chr( 130 ) . chr( 172 ),
|
946 |
+
"∃" => chr( 226 ) . chr( 136 ) . chr( 131 ),
|
947 |
+
"ƒ" => chr( 198 ) . chr( 146 ),
|
948 |
+
"∀" => chr( 226 ) . chr( 136 ) . chr( 128 ),
|
949 |
+
"½" => chr( 194 ) . chr( 189 ),
|
950 |
+
"¼" => chr( 194 ) . chr( 188 ),
|
951 |
+
"¾" => chr( 194 ) . chr( 190 ),
|
952 |
+
"⁄" => chr( 226 ) . chr( 129 ) . chr( 132 ),
|
953 |
+
"Γ" => chr( 206 ) . chr( 147 ),
|
954 |
+
"γ" => chr( 206 ) . chr( 179 ),
|
955 |
+
"≥" => chr( 226 ) . chr( 137 ) . chr( 165 ),
|
956 |
+
"↔" => chr( 226 ) . chr( 134 ) . chr( 148 ),
|
957 |
+
"⇔" => chr( 226 ) . chr( 135 ) . chr( 148 ),
|
958 |
+
"♥" => chr( 226 ) . chr( 153 ) . chr( 165 ),
|
959 |
+
"…" => chr( 226 ) . chr( 128 ) . chr( 166 ),
|
960 |
+
"Í" => chr( 195 ) . chr( 141 ),
|
961 |
+
"í" => chr( 195 ) . chr( 173 ),
|
962 |
+
"Î" => chr( 195 ) . chr( 142 ),
|
963 |
+
"î" => chr( 195 ) . chr( 174 ),
|
964 |
+
"¡" => chr( 194 ) . chr( 161 ),
|
965 |
+
"Ì" => chr( 195 ) . chr( 140 ),
|
966 |
+
"ì" => chr( 195 ) . chr( 172 ),
|
967 |
+
"ℑ" => chr( 226 ) . chr( 132 ) . chr( 145 ),
|
968 |
+
"∞" => chr( 226 ) . chr( 136 ) . chr( 158 ),
|
969 |
+
"∫" => chr( 226 ) . chr( 136 ) . chr( 171 ),
|
970 |
+
"Ι" => chr( 206 ) . chr( 153 ),
|
971 |
+
"ι" => chr( 206 ) . chr( 185 ),
|
972 |
+
"¿" => chr( 194 ) . chr( 191 ),
|
973 |
+
"∈" => chr( 226 ) . chr( 136 ) . chr( 136 ),
|
974 |
+
"Ï" => chr( 195 ) . chr( 143 ),
|
975 |
+
"ï" => chr( 195 ) . chr( 175 ),
|
976 |
+
"Κ" => chr( 206 ) . chr( 154 ),
|
977 |
+
"κ" => chr( 206 ) . chr( 186 ),
|
978 |
+
"Λ" => chr( 206 ) . chr( 155 ),
|
979 |
+
"λ" => chr( 206 ) . chr( 187 ),
|
980 |
+
"⟨" => chr( 226 ) . chr( 140 ) . chr( 169 ),
|
981 |
+
"«" => chr( 194 ) . chr( 171 ),
|
982 |
+
"←" => chr( 226 ) . chr( 134 ) . chr( 144 ),
|
983 |
+
"⇐" => chr( 226 ) . chr( 135 ) . chr( 144 ),
|
984 |
+
"⌈" => chr( 226 ) . chr( 140 ) . chr( 136 ),
|
985 |
+
"“" => chr( 226 ) . chr( 128 ) . chr( 156 ),
|
986 |
+
"≤" => chr( 226 ) . chr( 137 ) . chr( 164 ),
|
987 |
+
"⌊" => chr( 226 ) . chr( 140 ) . chr( 138 ),
|
988 |
+
"∗" => chr( 226 ) . chr( 136 ) . chr( 151 ),
|
989 |
+
"◊" => chr( 226 ) . chr( 151 ) . chr( 138 ),
|
990 |
+
"‎" => chr( 226 ) . chr( 128 ) . chr( 142 ),
|
991 |
+
"‹" => chr( 226 ) . chr( 128 ) . chr( 185 ),
|
992 |
+
"‘" => chr( 226 ) . chr( 128 ) . chr( 152 ),
|
993 |
+
"¯" => chr( 194 ) . chr( 175 ),
|
994 |
+
"—" => chr( 226 ) . chr( 128 ) . chr( 148 ),
|
995 |
+
"µ" => chr( 194 ) . chr( 181 ),
|
996 |
+
"·" => chr( 194 ) . chr( 183 ),
|
997 |
+
"−" => chr( 226 ) . chr( 136 ) . chr( 146 ),
|
998 |
+
"Μ" => chr( 206 ) . chr( 156 ),
|
999 |
+
"μ" => chr( 206 ) . chr( 188 ),
|
1000 |
+
"∇" => chr( 226 ) . chr( 136 ) . chr( 135 ),
|
1001 |
+
" " => chr( 194 ) . chr( 160 ),
|
1002 |
+
"–" => chr( 226 ) . chr( 128 ) . chr( 147 ),
|
1003 |
+
"≠" => chr( 226 ) . chr( 137 ) . chr( 160 ),
|
1004 |
+
"∋" => chr( 226 ) . chr( 136 ) . chr( 139 ),
|
1005 |
+
"¬" => chr( 194 ) . chr( 172 ),
|
1006 |
+
"∉" => chr( 226 ) . chr( 136 ) . chr( 137 ),
|
1007 |
+
"⊄" => chr( 226 ) . chr( 138 ) . chr( 132 ),
|
1008 |
+
"Ñ" => chr( 195 ) . chr( 145 ),
|
1009 |
+
"ñ" => chr( 195 ) . chr( 177 ),
|
1010 |
+
"Ν" => chr( 206 ) . chr( 157 ),
|
1011 |
+
"ν" => chr( 206 ) . chr( 189 ),
|
1012 |
+
"Ó" => chr( 195 ) . chr( 147 ),
|
1013 |
+
"ó" => chr( 195 ) . chr( 179 ),
|
1014 |
+
"Ô" => chr( 195 ) . chr( 148 ),
|
1015 |
+
"ô" => chr( 195 ) . chr( 180 ),
|
1016 |
+
"Œ" => chr( 197 ) . chr( 146 ),
|
1017 |
+
"œ" => chr( 197 ) . chr( 147 ),
|
1018 |
+
"Ò" => chr( 195 ) . chr( 146 ),
|
1019 |
+
"ò" => chr( 195 ) . chr( 178 ),
|
1020 |
+
"‾" => chr( 226 ) . chr( 128 ) . chr( 190 ),
|
1021 |
+
"Ω" => chr( 206 ) . chr( 169 ),
|
1022 |
+
"ω" => chr( 207 ) . chr( 137 ),
|
1023 |
+
"Ο" => chr( 206 ) . chr( 159 ),
|
1024 |
+
"ο" => chr( 206 ) . chr( 191 ),
|
1025 |
+
"⊕" => chr( 226 ) . chr( 138 ) . chr( 149 ),
|
1026 |
+
"∨" => chr( 226 ) . chr( 136 ) . chr( 168 ),
|
1027 |
+
"ª" => chr( 194 ) . chr( 170 ),
|
1028 |
+
"º" => chr( 194 ) . chr( 186 ),
|
1029 |
+
"Ø" => chr( 195 ) . chr( 152 ),
|
1030 |
+
"ø" => chr( 195 ) . chr( 184 ),
|
1031 |
+
"Õ" => chr( 195 ) . chr( 149 ),
|
1032 |
+
"õ" => chr( 195 ) . chr( 181 ),
|
1033 |
+
"⊗" => chr( 226 ) . chr( 138 ) . chr( 151 ),
|
1034 |
+
"Ö" => chr( 195 ) . chr( 150 ),
|
1035 |
+
"ö" => chr( 195 ) . chr( 182 ),
|
1036 |
+
"¶" => chr( 194 ) . chr( 182 ),
|
1037 |
+
"∂" => chr( 226 ) . chr( 136 ) . chr( 130 ),
|
1038 |
+
"‰" => chr( 226 ) . chr( 128 ) . chr( 176 ),
|
1039 |
+
"⊥" => chr( 226 ) . chr( 138 ) . chr( 165 ),
|
1040 |
+
"Φ" => chr( 206 ) . chr( 166 ),
|
1041 |
+
"φ" => chr( 207 ) . chr( 134 ),
|
1042 |
+
"Π" => chr( 206 ) . chr( 160 ),
|
1043 |
+
"π" => chr( 207 ) . chr( 128 ),
|
1044 |
+
"ϖ" => chr( 207 ) . chr( 150 ),
|
1045 |
+
"±" => chr( 194 ) . chr( 177 ),
|
1046 |
+
"£" => chr( 194 ) . chr( 163 ),
|
1047 |
+
"′" => chr( 226 ) . chr( 128 ) . chr( 178 ),
|
1048 |
+
"″" => chr( 226 ) . chr( 128 ) . chr( 179 ),
|
1049 |
+
"∏" => chr( 226 ) . chr( 136 ) . chr( 143 ),
|
1050 |
+
"∝" => chr( 226 ) . chr( 136 ) . chr( 157 ),
|
1051 |
+
"Ψ" => chr( 206 ) . chr( 168 ),
|
1052 |
+
"ψ" => chr( 207 ) . chr( 136 ),
|
1053 |
+
"√" => chr( 226 ) . chr( 136 ) . chr( 154 ),
|
1054 |
+
"⟩" => chr( 226 ) . chr( 140 ) . chr( 170 ),
|
1055 |
+
"»" => chr( 194 ) . chr( 187 ),
|
1056 |
+
"→" => chr( 226 ) . chr( 134 ) . chr( 146 ),
|
1057 |
+
"⇒" => chr( 226 ) . chr( 135 ) . chr( 146 ),
|
1058 |
+
"⌉" => chr( 226 ) . chr( 140 ) . chr( 137 ),
|
1059 |
+
"”" => chr( 226 ) . chr( 128 ) . chr( 157 ),
|
1060 |
+
"ℜ" => chr( 226 ) . chr( 132 ) . chr( 156 ),
|
1061 |
+
"®" => chr( 194 ) . chr( 174 ),
|
1062 |
+
"⌋" => chr( 226 ) . chr( 140 ) . chr( 139 ),
|
1063 |
+
"Ρ" => chr( 206 ) . chr( 161 ),
|
1064 |
+
"ρ" => chr( 207 ) . chr( 129 ),
|
1065 |
+
"‏" => chr( 226 ) . chr( 128 ) . chr( 143 ),
|
1066 |
+
"›" => chr( 226 ) . chr( 128 ) . chr( 186 ),
|
1067 |
+
"’" => chr( 226 ) . chr( 128 ) . chr( 153 ),
|
1068 |
+
"‚" => chr( 226 ) . chr( 128 ) . chr( 154 ),
|
1069 |
+
"Š" => chr( 197 ) . chr( 160 ),
|
1070 |
+
"š" => chr( 197 ) . chr( 161 ),
|
1071 |
+
"⋅" => chr( 226 ) . chr( 139 ) . chr( 133 ),
|
1072 |
+
"§" => chr( 194 ) . chr( 167 ),
|
1073 |
+
"­" => chr( 194 ) . chr( 173 ),
|
1074 |
+
"Σ" => chr( 206 ) . chr( 163 ),
|
1075 |
+
"σ" => chr( 207 ) . chr( 131 ),
|
1076 |
+
"ς" => chr( 207 ) . chr( 130 ),
|
1077 |
+
"∼" => chr( 226 ) . chr( 136 ) . chr( 188 ),
|
1078 |
+
"♠" => chr( 226 ) . chr( 153 ) . chr( 160 ),
|
1079 |
+
"⊂" => chr( 226 ) . chr( 138 ) . chr( 130 ),
|
1080 |
+
"⊆" => chr( 226 ) . chr( 138 ) . chr( 134 ),
|
1081 |
+
"∑" => chr( 226 ) . chr( 136 ) . chr( 145 ),
|
1082 |
+
"¹" => chr( 194 ) . chr( 185 ),
|
1083 |
+
"²" => chr( 194 ) . chr( 178 ),
|
1084 |
+
"³" => chr( 194 ) . chr( 179 ),
|
1085 |
+
"⊃" => chr( 226 ) . chr( 138 ) . chr( 131 ),
|
1086 |
+
"⊇" => chr( 226 ) . chr( 138 ) . chr( 135 ),
|
1087 |
+
"ß" => chr( 195 ) . chr( 159 ),
|
1088 |
+
"Τ" => chr( 206 ) . chr( 164 ),
|
1089 |
+
"τ" => chr( 207 ) . chr( 132 ),
|
1090 |
+
"∴" => chr( 226 ) . chr( 136 ) . chr( 180 ),
|
1091 |
+
"Θ" => chr( 206 ) . chr( 152 ),
|
1092 |
+
"θ" => chr( 206 ) . chr( 184 ),
|
1093 |
+
"ϑ" => chr( 207 ) . chr( 145 ),
|
1094 |
+
" " => chr( 226 ) . chr( 128 ) . chr( 137 ),
|
1095 |
+
"Þ" => chr( 195 ) . chr( 158 ),
|
1096 |
+
"þ" => chr( 195 ) . chr( 190 ),
|
1097 |
+
"˜" => chr( 203 ) . chr( 156 ),
|
1098 |
+
"×" => chr( 195 ) . chr( 151 ),
|
1099 |
+
"™" => chr( 226 ) . chr( 132 ) . chr( 162 ),
|
1100 |
+
"Ú" => chr( 195 ) . chr( 154 ),
|
1101 |
+
"ú" => chr( 195 ) . chr( 186 ),
|
1102 |
+
"↑" => chr( 226 ) . chr( 134 ) . chr( 145 ),
|
1103 |
+
"⇑" => chr( 226 ) . chr( 135 ) . chr( 145 ),
|
1104 |
+
"Û" => chr( 195 ) . chr( 155 ),
|
1105 |
+
"û" => chr( 195 ) . chr( 187 ),
|
1106 |
+
"Ù" => chr( 195 ) . chr( 153 ),
|
1107 |
+
"ù" => chr( 195 ) . chr( 185 ),
|
1108 |
+
"¨" => chr( 194 ) . chr( 168 ),
|
1109 |
+
"ϒ" => chr( 207 ) . chr( 146 ),
|
1110 |
+
"Υ" => chr( 206 ) . chr( 165 ),
|
1111 |
+
"υ" => chr( 207 ) . chr( 133 ),
|
1112 |
+
"Ü" => chr( 195 ) . chr( 156 ),
|
1113 |
+
"ü" => chr( 195 ) . chr( 188 ),
|
1114 |
+
"℘" => chr( 226 ) . chr( 132 ) . chr( 152 ),
|
1115 |
+
"Ξ" => chr( 206 ) . chr( 158 ),
|
1116 |
+
"ξ" => chr( 206 ) . chr( 190 ),
|
1117 |
+
"Ý" => chr( 195 ) . chr( 157 ),
|
1118 |
+
"ý" => chr( 195 ) . chr( 189 ),
|
1119 |
+
"¥" => chr( 194 ) . chr( 165 ),
|
1120 |
+
"ÿ" => chr( 195 ) . chr( 191 ),
|
1121 |
+
"Ÿ" => chr( 197 ) . chr( 184 ),
|
1122 |
+
"Ζ" => chr( 206 ) . chr( 150 ),
|
1123 |
+
"ζ" => chr( 206 ) . chr( 182 ),
|
1124 |
+
"‍" => chr( 226 ) . chr( 128 ) . chr( 141 ),
|
1125 |
+
"‌" => chr( 226 ) . chr( 128 ) . chr( 140 ),
|
1126 |
+
">" => ">",
|
1127 |
+
"<" => "<",
|
1128 |
);
|
1129 |
|
1130 |
+
$return = strtr( $str, $htmlentities );
|
1131 |
+
$return = preg_replace( '~&#x([0-9a-f]+);i', 'RSSImport_code_to_utf8( hexdec( "\\1" ) )', $return );
|
1132 |
+
$return = preg_replace( '~&#([0-9]+);', 'RSSImport_code_to_utf8( \\1 )', $return );
|
1133 |
|
1134 |
return $return;
|
1135 |
}
|
1136 |
|
|
|
1137 |
// check class wp_widget exists
|
1138 |
+
if ( class_exists( 'WP_Widget' ) ) {
|
1139 |
+
|
1140 |
class RSSImport_Widget extends WP_Widget {
|
1141 |
+
|
1142 |
+
public function __construct() {
|
1143 |
+
|
1144 |
+
$widget_ops = array(
|
1145 |
+
'classname' => 'rssimport',
|
1146 |
+
'description' => __( 'Entries from any RSS or Atom feed', FB_RSSI_TEXTDOMAIN ),
|
1147 |
+
);
|
1148 |
+
parent::__construct( 'rssimport', __( 'RSSImport' ), $widget_ops );
|
1149 |
}
|
1150 |
+
|
1151 |
+
public function widget( $args, $instance ) {
|
1152 |
+
|
1153 |
+
$title = empty( $instance[ 'title' ] ) ? ' '
|
1154 |
+
: apply_filters( 'widget_title', $instance[ 'title' ] );
|
1155 |
+
$titlelink = empty( $instance[ 'titlelink' ] ) ? '' : $instance[ 'titlelink' ];
|
1156 |
+
$display = empty( $instance[ 'display' ] ) ? '5' : $instance[ 'display' ];
|
1157 |
+
$feedurl = empty( $instance[ 'feedurl' ] ) ? 'http://bueltge.de/feed/' : $instance[ 'feedurl' ];
|
1158 |
+
$before_desc = empty( $instance[ 'before_desc' ] ) ? '' : $instance[ 'before_desc' ];
|
1159 |
+
$displaydescriptions = empty( $instance[ 'displaydescriptions' ] ) ? '0'
|
1160 |
+
: $instance[ 'displaydescriptions' ];
|
1161 |
+
$after_desc = empty( $instance[ 'after_desc' ] ) ? '' : $instance[ 'after_desc' ];
|
1162 |
+
$html = empty( $instance[ 'html' ] ) ? '0' : $instance[ 'html' ];
|
1163 |
+
$truncatedescchar = empty( $instance[ 'truncatedescchar' ] ) ? '200' : $instance[ 'truncatedescchar' ];
|
1164 |
+
$truncatedescstring = empty( $instance[ 'truncatedescstring' ] ) ? '' : $instance[ 'truncatedescstring' ];
|
1165 |
+
$truncatetitlechar = empty( $instance[ 'truncatetitlechar' ] ) ? '' : $instance[ 'truncatetitlechar' ];
|
1166 |
+
$truncatetitlestring = empty( $instance[ 'truncatetitlestring' ] ) ? ' ... '
|
1167 |
+
: $instance[ 'truncatetitlestring' ];
|
1168 |
+
$before_date = empty( $instance[ 'before_date' ] ) ? ' <small>' : $instance[ 'before_date' ];
|
1169 |
+
$date = empty( $instance[ 'date' ] ) ? '0' : $instance[ 'date' ];
|
1170 |
+
$after_date = empty( $instance[ 'after_date' ] ) ? '</small>' : $instance[ 'after_date' ];
|
1171 |
+
$date_format = empty( $instance[ 'date_format' ] ) ? '' : $instance[ 'date_format' ];
|
1172 |
+
$before_creator = empty( $instance[ 'before_creator' ] ) ? ' <small>' : $instance[ 'before_creator' ];
|
1173 |
+
$creator = empty( $instance[ 'creator' ] ) ? '0' : $instance[ 'creator' ];
|
1174 |
+
$after_creator = empty( $instance[ 'after_creator' ] ) ? '</small>' : $instance[ 'after_creator' ];
|
1175 |
+
$start_items = empty( $instance[ 'start_items' ] ) ? '<ul>' : $instance[ 'start_items' ];
|
1176 |
+
$end_items = empty( $instance[ 'end_items' ] ) ? '</ul>' : $instance[ 'end_items' ];
|
1177 |
+
$start_item = empty( $instance[ 'start_item' ] ) ? '<li>' : $instance[ 'start_item' ];
|
1178 |
+
$end_item = empty( $instance[ 'end_item' ] ) ? '</li>' : $instance[ 'end_item' ];
|
1179 |
+
$target = empty( $instance[ 'target' ] ) ? '' : $instance[ 'target' ];
|
1180 |
+
$rel = empty( $instance[ 'rel' ] ) ? '' : $instance[ 'rel' ];
|
1181 |
+
$desc4title = empty( $instance[ 'desc4title' ] ) ? '0' : $instance[ 'desc4title' ];
|
1182 |
+
$charsetscan = empty( $instance[ 'charsetscan' ] ) ? '0' : $instance[ 'charsetscan' ];
|
1183 |
+
$debug = empty( $instance[ 'debug' ] ) ? '0' : $instance[ 'debug' ];
|
1184 |
+
$before_noitems = empty( $instance[ 'before_noitems' ] ) ? '<p>' : $instance[ 'before_noitems' ];
|
1185 |
+
$noitems = empty( $instance[ 'noitems' ] ) ? __( 'No items, feed is empty.',
|
1186 |
+
FB_RSSI_TEXTDOMAIN ) : $instance[ 'noitems' ];
|
1187 |
+
$after_noitems = empty( $instance[ 'after_noitems' ] ) ? '</p>' : $instance[ 'after_noitems' ];
|
1188 |
+
$before_error = empty( $instance[ 'before_error' ] ) ? '<p>' : $instance[ 'before_error' ];
|
1189 |
+
$error = empty( $instance[ 'error' ] ) ? __( 'Error: Feed has an error or is not valid',
|
1190 |
+
FB_RSSI_TEXTDOMAIN ) : $instance[ 'error' ];
|
1191 |
+
$after_error = empty( $instance[ 'after_error' ] ) ? '</p>' : $instance[ 'after_error' ];
|
1192 |
+
$paging = empty( $instance[ 'paging' ] ) ? '0' : $instance[ 'paging' ];
|
1193 |
+
$prev_paging_link = empty( $instance[ 'prev_paging_link' ] ) ? __( '« Previous',
|
1194 |
+
FB_RSSI_TEXTDOMAIN )
|
1195 |
+
: $instance[ 'prev_paging_link' ];
|
1196 |
+
$next_paging_link = empty( $instance[ 'next_paging_link' ] ) ? __( 'Next »', FB_RSSI_TEXTDOMAIN )
|
1197 |
+
: $instance[ 'next_paging_link' ];
|
1198 |
+
$prev_paging_title = empty( $instance[ 'prev_paging_title' ] ) ? __( 'more items', FB_RSSI_TEXTDOMAIN )
|
1199 |
+
: $instance[ 'prev_paging_title' ];
|
1200 |
+
$next_paging_title = empty( $instance[ 'next_paging_title' ] ) ? __( 'more items', FB_RSSI_TEXTDOMAIN )
|
1201 |
+
: $instance[ 'next_paging_title' ];
|
1202 |
+
$use_simplepie = $instance[ 'use_simplepie' ];
|
1203 |
+
$view = $instance[ 'view' ];
|
1204 |
+
|
1205 |
+
echo $args[ 'before_widget' ];
|
1206 |
+
if ( '' !== $titlelink ) {
|
1207 |
$title = '<a href="' . $titlelink . '">' . $title . '</a>';
|
1208 |
+
}
|
1209 |
+
echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
|
1210 |
RSSImport(
|
1211 |
$display, $feedurl,
|
1212 |
$before_desc, $displaydescriptions, $after_desc, $html, $truncatedescchar, $truncatedescstring,
|
1225 |
$use_simplepie,
|
1226 |
$view
|
1227 |
);
|
1228 |
+
echo $args[ 'after_widget' ];
|
1229 |
}
|
1230 |
+
|
1231 |
+
public function update( $new_instance, $old_instance ) {
|
1232 |
+
|
1233 |
+
$instance[ 'instance' ] = $old_instance;
|
1234 |
+
$instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
|
1235 |
+
$instance[ 'titlelink' ] = esc_url( $new_instance[ 'titlelink' ] );
|
1236 |
+
$instance[ 'display' ] = (int) $new_instance[ 'display' ];
|
1237 |
+
$instance[ 'feedurl' ] = $new_instance[ 'feedurl' ];
|
1238 |
+
$instance[ 'before_desc' ] = $new_instance[ 'before_desc' ];
|
1239 |
+
$instance[ 'displaydescriptions' ] = (int) $new_instance[ 'displaydescriptions' ];
|
1240 |
+
$instance[ 'after_desc' ] = stripslashes_deep( $new_instance[ 'after_desc' ] );
|
1241 |
+
$instance[ 'html' ] = (int) $new_instance[ 'html' ];
|
1242 |
+
$instance[ 'truncatedescchar' ] = (int) $new_instance[ 'truncatedescchar' ];
|
1243 |
+
$instance[ 'truncatedescstring' ] = $new_instance[ 'truncatedescstring' ];
|
1244 |
+
$instance[ 'truncatetitlechar' ] = (int) $new_instance[ 'truncatetitlechar' ];
|
1245 |
+
$instance[ 'truncatetitlestring' ] = $new_instance[ 'truncatetitlestring' ];
|
1246 |
+
$instance[ 'before_date' ] = $new_instance[ 'before_date' ];
|
1247 |
+
$instance[ 'date' ] = (int) $new_instance[ 'date' ];
|
1248 |
+
$instance[ 'after_date' ] = $new_instance[ 'after_date' ];
|
1249 |
+
$instance[ 'date_format' ] = $new_instance[ 'date_format' ];
|
1250 |
+
$instance[ 'before_creator' ] = $new_instance[ 'before_creator' ];
|
1251 |
+
$instance[ 'creator' ] = (int) $new_instance[ 'creator' ];
|
1252 |
+
$instance[ 'after_creator' ] = $new_instance[ 'after_creator' ];
|
1253 |
+
$instance[ 'start_items' ] = $new_instance[ 'start_items' ];
|
1254 |
+
$instance[ 'end_items' ] = $new_instance[ 'end_items' ];
|
1255 |
+
$instance[ 'start_item' ] = $new_instance[ 'start_item' ];
|
1256 |
+
$instance[ 'end_item' ] = $new_instance[ 'end_item' ];
|
1257 |
+
$instance[ 'target' ] = $new_instance[ 'target' ];
|
1258 |
+
$instance[ 'rel' ] = $new_instance[ 'rel' ];
|
1259 |
+
$instance[ 'desc4title' ] = (int) $new_instance[ 'desc4title' ];
|
1260 |
+
$instance[ 'charsetscan' ] = (int) $new_instance[ 'charsetscan' ];
|
1261 |
+
$instance[ 'debug' ] = (int) $new_instance[ 'debug' ];
|
1262 |
+
$instance[ 'view' ] = (int) $new_instance[ 'view' ];
|
1263 |
+
$instance[ 'before_noitems' ] = $new_instance[ 'before_noitems' ];
|
1264 |
+
$instance[ 'noitems' ] = $new_instance[ 'noitems' ];
|
1265 |
+
$instance[ 'after_noitems' ] = $new_instance[ 'after_noitems' ];
|
1266 |
+
$instance[ 'before_error' ] = $new_instance[ 'before_error' ];
|
1267 |
+
$instance[ 'error' ] = $new_instance[ 'error' ];
|
1268 |
+
$instance[ 'after_error' ] = $new_instance[ 'after_error' ];
|
1269 |
+
$instance[ 'paging' ] = (int) $new_instance[ 'paging' ];
|
1270 |
+
$instance[ 'prev_paging_link' ] = $new_instance[ 'prev_paging_link' ];
|
1271 |
+
$instance[ 'next_paging_link' ] = $new_instance[ 'next_paging_link' ];
|
1272 |
+
$instance[ 'prev_paging_title' ] = $new_instance[ 'prev_paging_title' ];
|
1273 |
+
$instance[ 'next_paging_title' ] = $new_instance[ 'next_paging_title' ];
|
1274 |
+
$instance[ 'use_simplepie' ] = (int) $new_instance[ 'use_simplepie' ];
|
1275 |
+
|
1276 |
+
if ( current_user_can( 'unfiltered_html' ) ) {
|
1277 |
return $instance;
|
1278 |
+
} else {
|
1279 |
+
return stripslashes( strip_tags( $instance ) );
|
1280 |
+
}
|
1281 |
}
|
1282 |
+
|
1283 |
+
public function form( $instance ) {
|
1284 |
+
|
1285 |
+
$instance = wp_parse_args(
|
1286 |
+
(array) $instance, array(
|
1287 |
+
'title' => '',
|
1288 |
+
'titlelink' => '',
|
1289 |
+
'display' => 5,
|
1290 |
+
'feedurl' => 'http://bueltge.de/feed/',
|
1291 |
+
'before_desc' => '',
|
1292 |
+
'displaydescriptions' => 0,
|
1293 |
+
'after_desc' => '',
|
1294 |
+
'html' => 0,
|
1295 |
+
'truncatedescchar' => 200,
|
1296 |
+
'truncatedescstring' => ' ... ',
|
1297 |
+
'truncatetitlechar' => '',
|
1298 |
+
'truncatetitlestring' => ' ... ',
|
1299 |
+
'before_date' => ' <small>',
|
1300 |
+
'date' => 0,
|
1301 |
+
'after_date' => '</small>',
|
1302 |
+
'date_format' => '',
|
1303 |
+
'before_creator' => ' <small>',
|
1304 |
+
'creator' => 0,
|
1305 |
+
'after_creator' => '</small>',
|
1306 |
+
'start_items' => '<ul>',
|
1307 |
+
'end_items' => '</ul>',
|
1308 |
+
'start_item' => '<li>',
|
1309 |
+
'end_item' => '</li>',
|
1310 |
+
'target' => '',
|
1311 |
+
'rel' => '',
|
1312 |
+
'desc4title' => 0,
|
1313 |
+
'charsetscan' => 0,
|
1314 |
+
'debug' => 0,
|
1315 |
+
'view' => 1,
|
1316 |
+
'before_noitems' => '<p>',
|
1317 |
+
'noitems' => __( 'No items, feed is empty.', FB_RSSI_TEXTDOMAIN ),
|
1318 |
+
'after_noitems' => '</p>',
|
1319 |
+
'before_error' => '<p>',
|
1320 |
+
'error' => __( 'Error: Feed has an error or is not valid',
|
1321 |
+
FB_RSSI_TEXTDOMAIN ),
|
1322 |
+
'after_error' => '</p>',
|
1323 |
+
'paging' => 0,
|
1324 |
+
'prev_paging_link' => __( '« Previous', FB_RSSI_TEXTDOMAIN ),
|
1325 |
+
'next_paging_link' => __( 'Next »', FB_RSSI_TEXTDOMAIN ),
|
1326 |
+
'prev_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
|
1327 |
+
'next_paging_title' => __( 'more items', FB_RSSI_TEXTDOMAIN ),
|
1328 |
+
'use_simplepie' => 1,
|
1329 |
+
)
|
1330 |
);
|
1331 |
+
|
1332 |
+
$title = strip_tags( $instance[ 'title' ] );
|
1333 |
+
$titlelink = esc_url( $instance[ 'titlelink' ] );
|
1334 |
+
$display = (int) $instance[ 'display' ];
|
1335 |
+
$feedurl = $instance[ 'feedurl' ];
|
1336 |
+
$before_desc = $instance[ 'before_desc' ];
|
1337 |
+
$displaydescriptions = (int) $instance[ 'displaydescriptions' ];
|
1338 |
+
$after_desc = format_to_edit( $instance[ 'after_desc' ] );
|
1339 |
+
$html = (int) $instance[ 'html' ];
|
1340 |
+
$truncatedescchar = (int) $instance[ 'truncatedescchar' ];
|
1341 |
+
$truncatedescstring = (int) $instance[ 'truncatedescstring' ];
|
1342 |
+
$truncatetitlechar = $instance[ 'truncatetitlechar' ];
|
1343 |
+
$truncatetitlestring = $instance[ 'truncatetitlestring' ];
|
1344 |
+
$before_date = $instance[ 'before_date' ];
|
1345 |
+
$date = (int) $instance[ 'date' ];
|
1346 |
+
$after_date = $instance[ 'after_date' ];
|
1347 |
+
$date_format = $instance[ 'date_format' ];
|
1348 |
+
$before_creator = $instance[ 'before_creator' ];
|
1349 |
+
$creator = (int) $instance[ 'creator' ];
|
1350 |
+
$after_creator = $instance[ 'after_creator' ];
|
1351 |
+
$start_items = $instance[ 'start_items' ];
|
1352 |
+
$end_items = $instance[ 'end_items' ];
|
1353 |
+
$start_item = $instance[ 'start_item' ];
|
1354 |
+
$end_item = $instance[ 'end_item' ];
|
1355 |
+
$target = $instance[ 'target' ];
|
1356 |
+
$rel = $instance[ 'rel' ];
|
1357 |
+
$desc4title = (int) $instance[ 'desc4title' ];
|
1358 |
+
$charsetscan = (int) $instance[ 'charsetscan' ];
|
1359 |
+
$debug = (int) $instance[ 'debug' ];
|
1360 |
+
$before_noitems = $instance[ 'before_noitems' ];
|
1361 |
+
$noitems = $instance[ 'noitems' ];
|
1362 |
+
$after_noitems = $instance[ 'after_noitems' ];
|
1363 |
+
$before_error = $instance[ 'before_error' ];
|
1364 |
+
$error = $instance[ 'error' ];
|
1365 |
+
$after_error = $instance[ 'after_error' ];
|
1366 |
+
$paging = (int) $instance[ 'paging' ];
|
1367 |
+
$prev_paging_link = $instance[ 'prev_paging_link' ];
|
1368 |
+
$next_paging_link = $instance[ 'next_paging_link' ];
|
1369 |
+
$prev_paging_title = $instance[ 'prev_paging_title' ];
|
1370 |
+
$next_paging_title = $instance[ 'next_paging_title' ];
|
1371 |
+
$use_simplepie = (int) $instance[ 'use_simplepie' ];
|
1372 |
+
$view = (int) $instance[ 'view' ];
|
1373 |
?>
|
1374 |
+
<p>
|
1375 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', FB_RSSI_TEXTDOMAIN ) ?>
|
1376 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></label>
|
1377 |
+
</p>
|
1378 |
+
<p>
|
1379 |
+
<label for="<?php echo $this->get_field_id( 'titlelink' ); ?>"><?php _e( 'URL for Title (incl. http://):',
|
1380 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1381 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'titlelink' ); ?>" name="<?php echo $this->get_field_name( 'titlelink' ); ?>" type="text" value="<?php echo esc_url( $titlelink ); ?>" /></label>
|
1382 |
+
</p>
|
1383 |
+
<p>
|
1384 |
+
<label for="<?php echo $this->get_field_id( 'display' ); ?>"><?php _e( 'Display:',
|
1385 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1386 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'display' ); ?>" name="<?php echo $this->get_field_name( 'display' ); ?>" type="text" value="<?php echo esc_attr( $display ); ?>" /></label>
|
1387 |
+
</p>
|
1388 |
+
<p>
|
1389 |
+
<label for="<?php echo $this->get_field_id( 'feedurl' ); ?>"><?php _e( 'FeedURL:',
|
1390 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1391 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'feedurl' ); ?>" name="<?php echo $this->get_field_name( 'feedurl' ); ?>" type="text" value="<?php echo $feedurl; ?>" /></label>
|
1392 |
+
</p>
|
1393 |
+
<p>
|
1394 |
+
<label for="<?php echo $this->get_field_id( 'before_desc' ); ?>"><?php _e( 'Before Description:',
|
1395 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1396 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'before_desc' ); ?>" name="<?php echo $this->get_field_name( 'before_desc' ); ?>" type="text" value="<?php echo $before_desc; ?>" /></label>
|
1397 |
+
</p>
|
1398 |
+
<p>
|
1399 |
+
<label for="<?php echo $this->get_field_id( 'displaydescriptions' ); ?>"><?php _e( 'Display Description:',
|
1400 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1401 |
+
<select id="<?php echo $this->get_field_id( 'displaydescriptions' ); ?>" name="<?php echo $this->get_field_name( 'displaydescriptions' ); ?>">
|
1402 |
+
<option value="0"<?php if ( $displaydescriptions == '0' ) {
|
1403 |
+
echo ' selected="selected"';
|
1404 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1405 |
+
<option value="1"<?php if ( $displaydescriptions == '1' ) {
|
1406 |
+
echo ' selected="selected"';
|
1407 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1408 |
+
</select>
|
1409 |
+
</label>
|
1410 |
+
</p>
|
1411 |
+
<p>
|
1412 |
+
<label for="<?php echo $this->get_field_id( 'after_desc' ); ?>"><?php _e( 'After Description:',
|
1413 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1414 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'after_desc' ); ?>" name="<?php echo $this->get_field_name( 'after_desc' ); ?>" type="text" value="<?php echo $after_desc; ?>" /></label>
|
1415 |
+
<br />
|
1416 |
+
<small><?php _e( 'You can use the following strings to create custom links:', FB_RSSI_TEXTDOMAIN ); ?>
|
1417 |
+
<code>%title%</code>, <code>%href%</code>
|
1418 |
+
<br /><?php _e( 'Example:', FB_RSSI_TEXTDOMAIN ); ?>
|
1419 |
+
<code><a href="%href%" target="self" rel="follow">%title%</a></code></small>
|
1420 |
+
</p>
|
1421 |
+
<p>
|
1422 |
+
<label for="<?php echo $this->get_field_id( 'html' ); ?>"><?php _e( 'HTML:', FB_RSSI_TEXTDOMAIN ) ?>
|
1423 |
+
<select id="<?php echo $this->get_field_id( 'html' ); ?>" name="<?php echo $this->get_field_name( 'html' ); ?>">
|
1424 |
+
<option value="0"<?php if ( ! $html ) {
|
1425 |
+
echo ' selected="selected"';
|
1426 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1427 |
+
<option value="1"<?php if ( $html ) {
|
1428 |
+
echo ' selected="selected"';
|
1429 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1430 |
+
</select>
|
1431 |
+
</label>
|
1432 |
+
</p>
|
1433 |
+
<p>
|
1434 |
+
<label for="<?php echo $this->get_field_id( 'truncatedescchar' ); ?>"><?php _e( 'Truncate Description Char:',
|
1435 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1436 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'truncatedescchar' ); ?>" name="<?php echo $this->get_field_name( 'truncatedescchar' ); ?>" type="text" value="<?php echo esc_attr( $truncatedescchar ); ?>" /></label>
|
1437 |
+
</p>
|
1438 |
+
<p>
|
1439 |
+
<label for="<?php echo $this->get_field_id( 'truncatedescstring' ); ?>"><?php _e( 'Truncate Description String (HTML):',
|
1440 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1441 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'truncatedescstring' ); ?>" name="<?php echo $this->get_field_name( 'truncatedescstring' ); ?>" type="text" value="<?php echo $truncatedescstring; ?>" /></label>
|
1442 |
+
</p>
|
1443 |
+
<p>
|
1444 |
+
<label for="<?php echo $this->get_field_id( 'truncatetitlechar' ); ?>"><?php _e( 'Truncate Title Char:',
|
1445 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1446 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'truncatetitlechar' ); ?>" name="<?php echo $this->get_field_name( 'truncatetitlechar' ); ?>" type="text" value="<?php echo esc_attr( $truncatetitlechar ); ?>" /></label>
|
1447 |
+
</p>
|
1448 |
+
<p>
|
1449 |
+
<label for="<?php echo $this->get_field_id( 'truncatetitlestring' ); ?>"><?php _e( 'Truncate Title String (HTML):',
|
1450 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1451 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'truncatetitlestring' ); ?>" name="<?php echo $this->get_field_name( 'truncatetitlestring' ); ?>" type="text" value="<?php echo $truncatetitlestring; ?>" /></label>
|
1452 |
+
</p>
|
1453 |
+
<p>
|
1454 |
+
<label for="<?php echo $this->get_field_id( 'before_date' ); ?>"><?php _e( 'Before Date (HTML):',
|
1455 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1456 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'before_date' ); ?>" name="<?php echo $this->get_field_name( 'before_date' ); ?>" type="text" value="<?php echo $before_date; ?>" /></label>
|
1457 |
+
</p>
|
1458 |
+
<p>
|
1459 |
+
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Date:', FB_RSSI_TEXTDOMAIN ) ?>
|
1460 |
+
<select id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>">
|
1461 |
+
<option value="0"<?php if ( ! $date ) {
|
1462 |
+
echo ' selected="selected"';
|
1463 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1464 |
+
<option value="1"<?php if ( $date ) {
|
1465 |
+
echo ' selected="selected"';
|
1466 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1467 |
+
</select>
|
1468 |
+
</label>
|
1469 |
+
</p>
|
1470 |
+
<p>
|
1471 |
+
<label for="<?php echo $this->get_field_id( 'after_date' ); ?>"><?php _e( 'After Date (HTML):',
|
1472 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1473 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'after_date' ); ?>" name="<?php echo $this->get_field_name( 'after_date' ); ?>" type="text" value="<?php echo $after_date; ?>" /></label>
|
1474 |
+
</p>
|
1475 |
+
<p>
|
1476 |
+
<label for="<?php echo $this->get_field_id( 'date_format' ); ?>"><?php _e( 'Date Formatting:',
|
1477 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1478 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'date_format' ); ?>" name="<?php echo $this->get_field_name( 'date_format' ); ?>" type="text" value="<?php echo $date_format; ?>" /></label>
|
1479 |
+
<br />
|
1480 |
+
<small><?php _e( 'Leave empty for use the date format of your WordPress settings.',
|
1481 |
+
FB_RSSI_TEXTDOMAIN ); ?>
|
1482 |
+
<a href="http://codex.wordpress.org/Formatting_Date_and_Time"><?php _e( 'Documentation on date formatting',
|
1483 |
+
FB_RSSI_TEXTDOMAIN ); ?></a>
|
1484 |
+
</small>
|
1485 |
+
</p>
|
1486 |
+
<p>
|
1487 |
+
<label for="<?php echo $this->get_field_id( 'before_creator' ); ?>"><?php _e( 'Before Creator (HTML):',
|
1488 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1489 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'before_creator' ); ?>" name="<?php echo $this->get_field_name( 'before_creator' ); ?>" type="text" value="<?php echo $before_creator; ?>" /></label>
|
1490 |
+
</p>
|
1491 |
+
<p>
|
1492 |
+
<label for="<?php echo $this->get_field_id( 'creator' ); ?>"><?php _e( 'Creator:',
|
1493 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1494 |
+
<select id="<?php echo $this->get_field_id( 'creator' ); ?>" name="<?php echo $this->get_field_name( 'creator' ); ?>">
|
1495 |
+
<option value="0"<?php if ( ! $creator ) {
|
1496 |
+
echo ' selected="selected"';
|
1497 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1498 |
+
<option value="1"<?php if ( $creator ) {
|
1499 |
+
echo ' selected="selected"';
|
1500 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1501 |
+
</select>
|
1502 |
+
</label>
|
1503 |
+
</p>
|
1504 |
+
<p>
|
1505 |
+
<label for="<?php echo $this->get_field_id( 'after_creator' ); ?>"><?php _e( 'After Creator (HTML):',
|
1506 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1507 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'after_creator' ); ?>" name="<?php echo $this->get_field_name( 'after_creator' ); ?>" type="text" value="<?php echo $after_creator; ?>" /></label>
|
1508 |
+
</p>
|
1509 |
+
<p>
|
1510 |
+
<label for="<?php echo $this->get_field_id( 'start_items' ); ?>"><?php _e( 'Before Items (HTML):',
|
1511 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1512 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'start_items' ); ?>" name="<?php echo $this->get_field_name( 'start_items' ); ?>" type="text" value="<?php echo $start_items; ?>" /></label>
|
1513 |
+
</p>
|
1514 |
+
<p>
|
1515 |
+
<label for="<?php echo $this->get_field_id( 'end_items' ); ?>"><?php _e( 'After Items (HTML):',
|
1516 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1517 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'end_items' ); ?>" name="<?php echo $this->get_field_name( 'end_items' ); ?>" type="text" value="<?php echo $end_items; ?>" /></label>
|
1518 |
+
</p>
|
1519 |
+
<p>
|
1520 |
+
<label for="<?php echo $this->get_field_id( 'start_item' ); ?>"><?php _e( 'Before Item (HTML):',
|
1521 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1522 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'start_item' ); ?>" name="<?php echo $this->get_field_name( 'start_item' ); ?>" type="text" value="<?php echo $start_item; ?>" /></label>
|
1523 |
+
</p>
|
1524 |
+
<p>
|
1525 |
+
<label for="<?php echo $this->get_field_id( 'end_item' ); ?>"><?php _e( 'After Item (HTML):',
|
1526 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1527 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'end_item' ); ?>" name="<?php echo $this->get_field_name( 'end_item' ); ?>" type="text" value="<?php echo $end_item; ?>" /></label>
|
1528 |
+
</p>
|
1529 |
+
<p>
|
1530 |
+
<label for="<?php echo $this->get_field_id( 'target' ); ?>"><?php _e( 'Target Attribut:',
|
1531 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1532 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'target' ); ?>" name="<?php echo $this->get_field_name( 'target' ); ?>" type="text" value="<?php echo esc_attr( $target ); ?>" /></label>
|
1533 |
+
</p>
|
1534 |
+
<p>
|
1535 |
+
<label for="<?php echo $this->get_field_id( 'rel' ); ?>"><?php _e( 'Rel Attribut:',
|
1536 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1537 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'rel' ); ?>" name="<?php echo $this->get_field_name( 'rel' ); ?>" type="text" value="<?php echo esc_attr( $rel ); ?>" /></label>
|
1538 |
+
</p>
|
1539 |
+
<p>
|
1540 |
+
<label for="<?php echo $this->get_field_id( 'desc4title' ); ?>"><?php _e( 'Desc4Title:',
|
1541 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1542 |
+
<select id="<?php echo $this->get_field_id( 'desc4title' ); ?>" name="<?php echo $this->get_field_name( 'desc4title' ); ?>">
|
1543 |
+
<option value="0"<?php if ( ! $desc4title ) {
|
1544 |
+
echo ' selected="selected"';
|
1545 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1546 |
+
<option value="1"<?php if ( $desc4title ) {
|
1547 |
+
echo ' selected="selected"';
|
1548 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1549 |
+
</select>
|
1550 |
+
</label>
|
1551 |
+
<br />
|
1552 |
+
<small><?php _e( 'Description for title-Attribut on Title-Link', FB_RSSI_TEXTDOMAIN ); ?></small>
|
1553 |
+
</p>
|
1554 |
+
<p>
|
1555 |
+
<label for="<?php echo $this->get_field_id( 'charsetscan' ); ?>"><?php _e( 'Charsetscan:',
|
1556 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1557 |
+
<select id="<?php echo $this->get_field_id( 'charsetscan' ); ?>" name="<?php echo $this->get_field_name( 'charsetscan' ); ?>">
|
1558 |
+
<option value="0"<?php if ( ! $charsetscan ) {
|
1559 |
+
echo ' selected="selected"';
|
1560 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1561 |
+
<option value="1"<?php if ( $charsetscan ) {
|
1562 |
+
echo ' selected="selected"';
|
1563 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1564 |
+
</select>
|
1565 |
+
</label>
|
1566 |
+
</p>
|
1567 |
+
<p>
|
1568 |
+
<label for="<?php echo $this->get_field_id( 'debug' ); ?>"><?php _e( 'Debug mode:',
|
1569 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1570 |
+
<select id="<?php echo $this->get_field_id( 'debug' ); ?>" name="<?php echo $this->get_field_name( 'debug' ); ?>">
|
1571 |
+
<option value="0"<?php if ( ! $debug ) {
|
1572 |
+
echo ' selected="selected"';
|
1573 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1574 |
+
<option value="1"<?php if ( $debug ) {
|
1575 |
+
echo ' selected="selected"';
|
1576 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1577 |
+
</select>
|
1578 |
+
</label>
|
1579 |
+
</p>
|
1580 |
+
<p>
|
1581 |
+
<label for="<?php echo $this->get_field_id( 'before_noitems' ); ?>"><?php _e( 'Before <em>No</em> Items Message (HTML):',
|
1582 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1583 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'before_noitems' ); ?>" name="<?php echo $this->get_field_name( 'before_noitems' ); ?>" type="text" value="<?php echo $before_noitems; ?>" /></label>
|
1584 |
+
</p>
|
1585 |
+
<p>
|
1586 |
+
<label for="<?php echo $this->get_field_id( 'noitems' ); ?>"><?php _e( '<em>No</em> Items Message:',
|
1587 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1588 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'noitems' ); ?>" name="<?php echo $this->get_field_name( 'noitems' ); ?>" type="text" value="<?php echo esc_attr( $noitems ); ?>" /></label>
|
1589 |
+
</p>
|
1590 |
+
<p>
|
1591 |
+
<label for="<?php echo $this->get_field_id( 'after_noitems' ); ?>"><?php _e( 'After <em>No</em> Items Message (HTML):',
|
1592 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1593 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'after_noitems' ); ?>" name="<?php echo $this->get_field_name( 'after_noitems' ); ?>" type="text" value="<?php echo $after_noitems; ?>" /></label>
|
1594 |
+
</p>
|
1595 |
+
<p>
|
1596 |
+
<label for="<?php echo $this->get_field_id( 'before_error' ); ?>"><?php _e( 'Before Error Message (HTML):',
|
1597 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1598 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'before_error' ); ?>" name="<?php echo $this->get_field_name( 'before_error' ); ?>" type="text" value="<?php echo $before_error; ?>" /></label>
|
1599 |
+
</p>
|
1600 |
+
<p>
|
1601 |
+
<label for="<?php echo $this->get_field_id( 'error' ); ?>"><?php _e( 'Error Message:',
|
1602 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1603 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'error' ); ?>" name="<?php echo $this->get_field_name( 'error' ); ?>" type="text" value="<?php echo esc_attr( $error ); ?>" /></label>
|
1604 |
+
</p>
|
1605 |
+
<p>
|
1606 |
+
<label for="<?php echo $this->get_field_id( 'after_error' ); ?>"><?php _e( 'After Error Message (HTML):',
|
1607 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1608 |
+
<input class="widefat code" id="<?php echo $this->get_field_id( 'after_error' ); ?>" name="<?php echo $this->get_field_name( 'after_error' ); ?>" type="text" value="<?php echo $after_error; ?>" /></label>
|
1609 |
+
</p>
|
1610 |
+
<p>
|
1611 |
+
<label for="<?php echo $this->get_field_id( 'paging' ); ?>"><?php _e( 'Pagination:',
|
1612 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1613 |
+
<select id="<?php echo $this->get_field_id( 'paging' ); ?>" name="<?php echo $this->get_field_name( 'paging' ); ?>">
|
1614 |
+
<option value="0"<?php if ( ! $paging ) {
|
1615 |
+
echo ' selected="selected"';
|
1616 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1617 |
+
<option value="1"<?php if ( $paging ) {
|
1618 |
+
echo ' selected="selected"';
|
1619 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1620 |
+
</select>
|
1621 |
+
</label>
|
1622 |
+
</p>
|
1623 |
+
<p>
|
1624 |
+
<label for="<?php echo $this->get_field_id( 'prev_paging_link' ); ?>"><?php _e( 'Previous Pagination Link String:',
|
1625 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1626 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'prev_paging_link' ); ?>" name="<?php echo $this->get_field_name( 'prev_paging_link' ); ?>" type="text" value="<?php echo esc_attr( $prev_paging_link ); ?>" /></label>
|
1627 |
+
</p>
|
1628 |
+
<p>
|
1629 |
+
<label for="<?php echo $this->get_field_id( 'next_paging_link' ); ?>"><?php _e( 'Next Pagination Link String:',
|
1630 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1631 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'next_paging_link' ); ?>" name="<?php echo $this->get_field_name( 'next_paging_link' ); ?>" type="text" value="<?php echo esc_attr( $next_paging_link ); ?>" /></label>
|
1632 |
+
</p>
|
1633 |
+
<p>
|
1634 |
+
<label for="<?php echo $this->get_field_id( 'prev_paging_title' ); ?>"><?php _e( 'Previous Pagination Title String:',
|
1635 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1636 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'prev_paging_title' ); ?>" name="<?php echo $this->get_field_name( 'prev_paging_title' ); ?>" type="text" value="<?php echo esc_attr( $prev_paging_title ); ?>" /></label>
|
1637 |
+
</p>
|
1638 |
+
<p>
|
1639 |
+
<label for="<?php echo $this->get_field_id( 'next_paging_title' ); ?>"><?php _e( 'Next Pagination Title String:',
|
1640 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1641 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'next_paging_title' ); ?>" name="<?php echo $this->get_field_name( 'next_paging_title' ); ?>" type="text" value="<?php echo esc_attr( $next_paging_title ); ?>" /></label>
|
1642 |
+
</p>
|
1643 |
+
<p>
|
1644 |
+
<label for="<?php echo $this->get_field_id( 'use_simplepie' ); ?>"><?php _e( 'Use SimplePie class:',
|
1645 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1646 |
+
<select id="<?php echo $this->get_field_id( 'use_simplepie' ); ?>" name="<?php echo $this->get_field_name( 'use_simplepie' ); ?>">
|
1647 |
+
<option value="0"<?php if ( ! $use_simplepie ) {
|
1648 |
+
echo ' selected="selected"';
|
1649 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1650 |
+
<option value="1"<?php if ( $use_simplepie ) {
|
1651 |
+
echo ' selected="selected"';
|
1652 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1653 |
+
</select>
|
1654 |
+
</label>
|
1655 |
+
</p>
|
1656 |
+
<p>
|
1657 |
+
<label for="<?php echo $this->get_field_id( 'view' ); ?>"><?php _e( 'Echo/Return:',
|
1658 |
+
FB_RSSI_TEXTDOMAIN ) ?>
|
1659 |
+
<select id="<?php echo $this->get_field_id( 'view' ); ?>" name="<?php echo $this->get_field_name( 'view' ); ?>">
|
1660 |
+
<option value="0"<?php if ( ! $view ) {
|
1661 |
+
echo ' selected="selected"';
|
1662 |
+
} ?>><?php _e( 'False', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1663 |
+
<option value="1"<?php if ( $view ) {
|
1664 |
+
echo ' selected="selected"';
|
1665 |
+
} ?>><?php _e( 'True', FB_RSSI_TEXTDOMAIN ); ?></option>
|
1666 |
+
</select>
|
1667 |
+
</label>
|
1668 |
+
</p>
|
1669 |
<?php
|
1670 |
+
|
1671 |
}
|
1672 |
}
|
1673 |
+
|
1674 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("RSSImport_Widget");' ) );
|
1675 |
|
1676 |
} // end if class wp_widget exists
|
screenshot-1.png
DELETED
Binary file
|