Version Description
Download this release
Release Info
| Developer | Bueltge |
| Plugin | |
| Version | 4.3 |
| Comparing to | |
| See all releases | |
Code changes from version 4.2.3 to 4.3
- languages/rssimport-de_DE.mo +0 -0
- languages/rssimport-de_DE.po +40 -0
- languages/rssimport-xx_XX.pot +37 -0
- rssimport.php +276 -52
languages/rssimport-de_DE.mo
ADDED
|
Binary file
|
languages/rssimport-de_DE.po
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
msgid ""
|
| 2 |
+
msgstr ""
|
| 3 |
+
"Project-Id-Version: WP-RSSImport v4.2.4\n"
|
| 4 |
+
"Report-Msgid-Bugs-To: \n"
|
| 5 |
+
"POT-Creation-Date: 2009-06-08 13:26+0100\n"
|
| 6 |
+
"PO-Revision-Date: 2009-06-08 13:27+0100\n"
|
| 7 |
+
"Last-Translator: Frank Bueltge <frank@bueltge.de>\n"
|
| 8 |
+
"Language-Team: \n"
|
| 9 |
+
"MIME-Version: 1.0\n"
|
| 10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
| 13 |
+
"X-Poedit-Language: German\n"
|
| 14 |
+
"X-Poedit-Country: GERMANY\n"
|
| 15 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
| 16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;_c\n"
|
| 17 |
+
"X-Poedit-Basepath: ../\n"
|
| 18 |
+
"X-Poedit-SearchPath-0: .\n"
|
| 19 |
+
|
| 20 |
+
#: rssimport.php:63
|
| 21 |
+
msgid "Error in file: "
|
| 22 |
+
msgstr "Fehler in Datei:"
|
| 23 |
+
|
| 24 |
+
#: rssimport.php:373
|
| 25 |
+
msgid "RSSImport"
|
| 26 |
+
msgstr "RSSImport"
|
| 27 |
+
|
| 28 |
+
#: rssimport.php:373
|
| 29 |
+
msgid "Import a feed with RSSImport"
|
| 30 |
+
msgstr "Importiere einen Feed mit RSSImport"
|
| 31 |
+
|
| 32 |
+
#: rssimport.php:385
|
| 33 |
+
msgid "New version, however the plugin has been modified with many new parameters. Please see the new <a target=\"_blank\" href=\"http://wordpress.org/extend/plugins/rss-import/\">possibilities</a>."
|
| 34 |
+
msgstr "Neue Version: das Plugin wurde mit vielen Parametern aktualisiert. Bitte beachte die neuen <a target=\"_blank\" href=\"http://wordpress.org/extend/plugins/rss-import/\">Möglichkeiten</a>."
|
| 35 |
+
|
| 36 |
+
#~ msgid "Error: Feed has a error or is not valid"
|
| 37 |
+
#~ msgstr "Fehler: der Feed hat einen Fehler oder ist nicht valide."
|
| 38 |
+
#~ msgid "RSSImport einfügen"
|
| 39 |
+
#~ msgstr "RSSImport einfügen"
|
| 40 |
+
|
languages/rssimport-xx_XX.pot
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
msgid ""
|
| 2 |
+
msgstr ""
|
| 3 |
+
"Project-Id-Version: WP-RSSImport v4.2.4\n"
|
| 4 |
+
"Report-Msgid-Bugs-To: \n"
|
| 5 |
+
"POT-Creation-Date: 2009-06-08 13:26+0100\n"
|
| 6 |
+
"PO-Revision-Date: 2009-06-08 13:27+0100\n"
|
| 7 |
+
"Last-Translator: Frank Bueltge <frank@bueltge.de>\n"
|
| 8 |
+
"Language-Team: \n"
|
| 9 |
+
"MIME-Version: 1.0\n"
|
| 10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
| 13 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;_c\n"
|
| 14 |
+
"X-Poedit-Basepath: ../\n"
|
| 15 |
+
"X-Poedit-SearchPath-0: .\n"
|
| 16 |
+
|
| 17 |
+
#: rssimport.php:63
|
| 18 |
+
msgid "Error in file: "
|
| 19 |
+
msgstr "Fehler in Datei:"
|
| 20 |
+
|
| 21 |
+
#: rssimport.php:373
|
| 22 |
+
msgid "RSSImport"
|
| 23 |
+
msgstr "RSSImport"
|
| 24 |
+
|
| 25 |
+
#: rssimport.php:373
|
| 26 |
+
msgid "Import a feed with RSSImport"
|
| 27 |
+
msgstr "Importiere einen Feed mit RSSImport"
|
| 28 |
+
|
| 29 |
+
#: rssimport.php:385
|
| 30 |
+
msgid "New version, however the plugin has been modified with many new parameters. Please see the new <a target=\"_blank\" href=\"http://wordpress.org/extend/plugins/rss-import/\">possibilities</a>."
|
| 31 |
+
msgstr "Neue Version: das Plugin wurde mit vielen Parametern aktualisiert. Bitte beachte die neuen <a target=\"_blank\" href=\"http://wordpress.org/extend/plugins/rss-import/\">M�glichkeiten</a>."
|
| 32 |
+
|
| 33 |
+
#~ msgid "Error: Feed has a error or is not valid"
|
| 34 |
+
#~ msgstr "Fehler: der Feed hat einen Fehler oder ist nicht valide."
|
| 35 |
+
#~ msgid "RSSImport einfügen"
|
| 36 |
+
#~ msgstr "RSSImport einf�gen"
|
| 37 |
+
|
rssimport.php
CHANGED
|
@@ -1,27 +1,57 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
/*
|
| 4 |
Plugin Name: WP-RSSImport
|
| 5 |
Plugin URI: http://bueltge.de/wp-rss-import-plugin/55/
|
| 6 |
-
Description:
|
| 7 |
-
Author: Frank
|
| 8 |
-
Version: 4.
|
| 9 |
License: GPL
|
| 10 |
-
Author URI: http://bueltge.de
|
|
|
|
| 11 |
*/
|
| 12 |
|
| 13 |
/*
|
| 14 |
-
|
| 15 |
ACKNOWLEDGEMENTS
|
| 16 |
-
|
| 17 |
Original and Idea: Dave Wolf, http://www.davewolf.net
|
| 18 |
-
Thx to Thomas Fischer, http://www.securityfocus.de and
|
|
|
|
| 19 |
|
| 20 |
USAGE: Use following code with a PHP-Plugin for WordPress:
|
| 21 |
-
Example: <?php RSSImport(10, "http://bueltge.de/feed/"
|
| 22 |
-
|
| 23 |
*/
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
// For function fetch_rss from wp-core
|
| 26 |
if ( file_exists(ABSPATH . WPINC . '/rss.php') ) {
|
| 27 |
@require_once (ABSPATH . WPINC . '/rss.php');
|
|
@@ -33,73 +63,156 @@ if ( file_exists(ABSPATH . WPINC . '/rss.php') ) {
|
|
| 33 |
die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The Wordpress file "rss-functions.php" or "rss.php" could not be included.'));
|
| 34 |
}
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
// cache and error report
|
| 37 |
//define('MAGPIE_CACHE_ON', false); // Cache off
|
| 38 |
define('MAGPIE_CACHE_AGE', '60*60'); // in sec, one hour
|
| 39 |
// error reporting
|
| 40 |
-
//error_reporting(
|
| 41 |
|
| 42 |
-
function RSSImport(
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
// read in file for search charset
|
| 46 |
ini_set('default_socket_timeout', 120);
|
| 47 |
$a = file_get_contents($feedurl);
|
| 48 |
// for better performance, if the server accepts the method
|
| 49 |
-
|
| 50 |
}
|
| 51 |
|
| 52 |
$rss = fetch_rss($feedurl);
|
| 53 |
|
| 54 |
-
if ($rss
|
| 55 |
-
|
| 56 |
-
// print_r
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
foreach ($rss->items as $item) {
|
| 59 |
-
if ($display == 0)
|
| 60 |
break;
|
| 61 |
-
}
|
| 62 |
|
| 63 |
-
$
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
$title = utf8_encode( html_entity_decode( str_replace($umlaute, $htmlcode, $title) ) );
|
| 79 |
-
$desc = utf8_encode( html_entity_decode( str_replace($umlaute, $htmlcode, $desc) ) );
|
| 80 |
} else {
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
if ($
|
| 89 |
-
|
|
|
|
| 90 |
}
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
$display--;
|
| 97 |
-
echo wptexturize('</li>');
|
| 98 |
}
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
} else {
|
| 101 |
-
echo
|
| 102 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
}
|
| 104 |
|
| 105 |
function utf8dec($s_String) {
|
|
@@ -117,8 +230,9 @@ function all_convert($s_String) {
|
|
| 117 |
// Array for entities
|
| 118 |
$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));
|
| 119 |
$htmlcode = array('„','“','–',' "','–','—','‘','’','“','”','„','•' ,'…','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','€','','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','','Ž','','','‘','’','“','”','•','–','—','˜','™','š','›','œ','','ž','Ÿ',' ','¡','¡','¡','¡','¥','¦','§','¨','©','ª','«','¬','�­','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ');
|
| 120 |
-
|
| 121 |
-
|
|
|
|
| 122 |
// … , …
|
| 123 |
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\xA6~', '…', $s_String);
|
| 124 |
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\xA6~', '…', $s_String);
|
|
@@ -170,4 +284,114 @@ function all_convert($s_String) {
|
|
| 170 |
|
| 171 |
return $s_String;
|
| 172 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
?>
|
| 1 |
<?php
|
|
|
|
| 2 |
/*
|
| 3 |
Plugin Name: WP-RSSImport
|
| 4 |
Plugin URI: http://bueltge.de/wp-rss-import-plugin/55/
|
| 5 |
+
Description: Import and display Feeds in your blog, use the function RSSImport() or Shortcode [RSSImport]. Please see the new <a href="http://wordpress.org/extend/plugins/rss-import/">possibilities</a>.
|
| 6 |
+
Author: Frank Bültge
|
| 7 |
+
Version: 4.3
|
| 8 |
License: GPL
|
| 9 |
+
Author URI: http://bueltge.de/
|
| 10 |
+
Last change: 08.06.2009 13:05:32
|
| 11 |
*/
|
| 12 |
|
| 13 |
/*
|
| 14 |
+
------------------------------------------------------------
|
| 15 |
ACKNOWLEDGEMENTS
|
| 16 |
+
------------------------------------------------------------
|
| 17 |
Original and Idea: Dave Wolf, http://www.davewolf.net
|
| 18 |
+
Thx to Thomas Fischer, http://www.securityfocus.de and
|
| 19 |
+
Gunnar Tillmann http://www.gunnart.de for a better code
|
| 20 |
|
| 21 |
USAGE: Use following code with a PHP-Plugin for WordPress:
|
| 22 |
+
Example: <?php RSSImport(10, "http://bueltge.de/feed/"); ?>
|
| 23 |
+
------------------------------------------------------------
|
| 24 |
*/
|
| 25 |
|
| 26 |
+
//avoid direct calls to this file, because now WP core and framework has been used
|
| 27 |
+
if ( !function_exists('add_action') ) {
|
| 28 |
+
header('Status: 403 Forbidden');
|
| 29 |
+
header('HTTP/1.1 403 Forbidden');
|
| 30 |
+
exit();
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
if ( function_exists('add_action') ) {
|
| 34 |
+
//WordPress definitions
|
| 35 |
+
if ( !defined('WP_CONTENT_URL') )
|
| 36 |
+
define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
|
| 37 |
+
if ( !defined('WP_CONTENT_DIR') )
|
| 38 |
+
define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
|
| 39 |
+
if ( !defined('WP_PLUGIN_URL') )
|
| 40 |
+
define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
|
| 41 |
+
if ( !defined('WP_PLUGIN_DIR') )
|
| 42 |
+
define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
|
| 43 |
+
if ( !defined('PLUGINDIR') )
|
| 44 |
+
define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
|
| 45 |
+
if ( !defined('WP_LANG_DIR') )
|
| 46 |
+
define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages');
|
| 47 |
+
|
| 48 |
+
// plugin definitions
|
| 49 |
+
define( 'FB_RSSI_BASENAME', plugin_basename(__FILE__) );
|
| 50 |
+
define( 'FB_RSSI_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) );
|
| 51 |
+
define( 'FB_RSSI_TEXTDOMAIN', 'rssimport' );
|
| 52 |
+
define( 'FB_RSSI_QUICKTAG', true );
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
// For function fetch_rss from wp-core
|
| 56 |
if ( file_exists(ABSPATH . WPINC . '/rss.php') ) {
|
| 57 |
@require_once (ABSPATH . WPINC . '/rss.php');
|
| 63 |
die (__('Error in file: ' . __FILE__ . ' on line: ' . __LINE__ . '.<br />The Wordpress file "rss-functions.php" or "rss.php" could not be included.'));
|
| 64 |
}
|
| 65 |
|
| 66 |
+
|
| 67 |
+
function RSSImport_textdomain() {
|
| 68 |
+
|
| 69 |
+
if ( function_exists('load_plugin_textdomain') )
|
| 70 |
+
load_plugin_textdomain( FB_RSSI_TEXTDOMAIN, false, dirname( FB_RSSI_BASENAME ) . '/languages');
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
// cache and error report
|
| 75 |
//define('MAGPIE_CACHE_ON', false); // Cache off
|
| 76 |
define('MAGPIE_CACHE_AGE', '60*60'); // in sec, one hour
|
| 77 |
// error reporting
|
| 78 |
+
//error_reporting(E_ALL);
|
| 79 |
|
| 80 |
+
function RSSImport(
|
| 81 |
+
$display = 5, $feedurl = 'http://bueltge.de/feed/',
|
| 82 |
+
$before_desc = '', $displaydescriptions = false, $after_desc = '', $html = false, $truncatedescchar = 200, $truncatedescstring = ' ... ',
|
| 83 |
+
$truncatetitlechar = '', $truncatetitlestring = ' ... ',
|
| 84 |
+
$before_date = ' <small>', $date = false, $after_date = '</small>',
|
| 85 |
+
$before_creator = ' <small>', $creator = false, $after_creator = '</small>',
|
| 86 |
+
$start_items = '<ul>', $end_items = '</ul>',
|
| 87 |
+
$start_item = '<li>', $end_item = '</li>',
|
| 88 |
+
$target = '',
|
| 89 |
+
$charsetscan = false, $debug = false,
|
| 90 |
+
$view = true,
|
| 91 |
+
$before_noitems = '<p>', $noitems = 'No items, feed is empty.', $after_noitems = '</p>',
|
| 92 |
+
$before_error = '<p>', $error = 'Error: Feed has a error or is not valid', $after_error = '</p>'
|
| 93 |
+
) {
|
| 94 |
+
|
| 95 |
+
$display = intval($display);
|
| 96 |
+
$truncatedescchar = intval($truncatedescchar);
|
| 97 |
+
$truncatetitlechar = intval($truncatetitlechar);
|
| 98 |
+
$echo = '';
|
| 99 |
+
|
| 100 |
+
if ( $charsetscan && function_exists('file_get_contents') ) {
|
| 101 |
// read in file for search charset
|
| 102 |
ini_set('default_socket_timeout', 120);
|
| 103 |
$a = file_get_contents($feedurl);
|
| 104 |
// for better performance, if the server accepts the method
|
| 105 |
+
// $a = file_get_contents($feedurl, FALSE, NULL, 0, 50);
|
| 106 |
}
|
| 107 |
|
| 108 |
$rss = fetch_rss($feedurl);
|
| 109 |
|
| 110 |
+
if ($rss) {
|
| 111 |
+
|
| 112 |
+
// the follow print_r list all items in array, for debug purpose
|
| 113 |
+
if ($debug) {
|
| 114 |
+
print('<pre>');
|
| 115 |
+
print_r($rss);
|
| 116 |
+
print('</pre>');
|
| 117 |
+
define('MAGPIE_CACHE_ON', false);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
foreach ($rss->items as $item) {
|
| 121 |
+
if ($display == 0)
|
| 122 |
break;
|
|
|
|
| 123 |
|
| 124 |
+
$echo .= $start_item;
|
| 125 |
+
// import title
|
| 126 |
+
if ( isset($item['title']) )
|
| 127 |
+
$title = wp_specialchars( $item['title'] );
|
| 128 |
+
// import link
|
| 129 |
+
if ( isset($item['link']) )
|
| 130 |
+
$href = wp_filter_kses( $item['link'] );
|
| 131 |
+
// import date
|
| 132 |
+
if ($date && isset($item['pubdate']) )
|
| 133 |
+
$pubDate = date_i18n( get_option('date_format'), strtotime( $item['pubdate'] ) );
|
| 134 |
+
// import creator
|
| 135 |
+
if ($creator && isset($item['dc']['creator']) )
|
| 136 |
+
$creator = wp_specialchars( $item['dc']['creator'] );
|
| 137 |
+
elseif ($creator && isset($item['creator']) )
|
| 138 |
+
$creator = wp_specialchars( $item['creator'] );
|
| 139 |
+
// import desc
|
| 140 |
+
if ( $displaydescriptions && $html && isset($item['content']['encoded']) && $item['content']['encoded'] != 'A' )
|
| 141 |
+
$desc = $item['content']['encoded']; // For import with HTML
|
| 142 |
+
elseif ( $displaydescriptions && $html && isset($item['content']['atom_content']) && $item['content']['atom_content'] != 'A' )
|
| 143 |
+
$desc = $item['content']['atom_content']; // For import with HTML
|
| 144 |
+
elseif ( $displaydescriptions && $html && isset($item['content']) && !is_array($item['content']) )
|
| 145 |
+
$desc = $item['content'];
|
| 146 |
+
elseif ( $displaydescriptions && $html && isset($item['description']) )
|
| 147 |
+
$desc = $item['description'];
|
| 148 |
+
elseif ( $displaydescriptions && !$html && isset($item['description']) )
|
| 149 |
+
$desc = wp_specialchars($item['description']); // For import without HTML
|
| 150 |
|
| 151 |
+
if ( isset($a) && eregi('ISO', $a) ) {
|
| 152 |
+
if ($debug)
|
| 153 |
+
$echo .= 'ISO Feed' . "\n";
|
| 154 |
+
if ( isset($title) )
|
| 155 |
+
isodec($title);
|
| 156 |
+
if ( isset($creator) )
|
| 157 |
+
isodec($creator);
|
| 158 |
+
if ( isset($desc) )
|
| 159 |
+
isodec($desc);
|
|
|
|
|
|
|
| 160 |
} else {
|
| 161 |
+
if ($debug)
|
| 162 |
+
$echo .= 'NonISO Feed' . "\n";
|
| 163 |
+
if ( isset($title) )
|
| 164 |
+
utf8dec($title);
|
| 165 |
+
if ( isset($creator) )
|
| 166 |
+
utf8dec($creator);
|
| 167 |
+
if ( isset($desc) )
|
| 168 |
+
utf8dec($desc);
|
| 169 |
}
|
| 170 |
|
| 171 |
+
if ( isset($title) )
|
| 172 |
+
all_convert($title);
|
| 173 |
+
if ( isset($creator) )
|
| 174 |
+
all_convert($creator);
|
| 175 |
+
if ( isset($desc) )
|
| 176 |
+
all_convert($desc);
|
| 177 |
|
| 178 |
+
if ( isset($title) && $truncatetitlechar && (strlen($title) > $truncatetitlechar) ) {
|
| 179 |
+
$title = substr($title, 0, $truncatetitlechar);
|
| 180 |
+
$title = RSSImport_end_on_word($title) . $truncatetitlestring;
|
| 181 |
}
|
| 182 |
+
|
| 183 |
+
if ( isset($desc) && $truncatedescchar && (strlen($desc) > $truncatedescchar) ) {
|
| 184 |
+
$desc = substr($desc, 0, $truncatedescchar);
|
| 185 |
+
$desc = RSSImport_end_on_word($desc) . $truncatedescstring;
|
| 186 |
}
|
| 187 |
+
|
| 188 |
+
if ( isset($target) && $target != '' )
|
| 189 |
+
$target = ' target="_' . $target . '"';
|
| 190 |
+
|
| 191 |
+
$echo .= '<a' . $target . ' href="' . $href . '" title="'. ereg_replace("[^A-Za-z0-9 ]", "", $item['title']) . '">' . $title . '</a>';
|
| 192 |
+
if ( isset($pubDate) && $date && $pubDate != '' )
|
| 193 |
+
$echo .= $before_date . $pubDate . $after_date;
|
| 194 |
+
if ( isset($creator) && $creator && $creator != '' )
|
| 195 |
+
$echo .= $before_creator . $creator . $after_creator;
|
| 196 |
+
if ( isset($desc) && $displaydescriptions && $desc != '' )
|
| 197 |
+
$echo .= $before_desc . $desc . $after_desc;
|
| 198 |
+
$echo .= $end_item;
|
| 199 |
+
|
| 200 |
$display--;
|
|
|
|
| 201 |
}
|
| 202 |
+
|
| 203 |
+
if ($echo)
|
| 204 |
+
$echo = wptexturize($start_items . $echo . $end_items);
|
| 205 |
+
else
|
| 206 |
+
$echo = wptexturize($before_noitems . $noitems . $after_noitems);
|
| 207 |
+
|
| 208 |
} else {
|
| 209 |
+
$echo = wptexturize($before_error . $error . $rss->ERROR . $after_error);
|
| 210 |
}
|
| 211 |
+
|
| 212 |
+
if ($view)
|
| 213 |
+
echo $echo;
|
| 214 |
+
else
|
| 215 |
+
return $echo;
|
| 216 |
}
|
| 217 |
|
| 218 |
function utf8dec($s_String) {
|
| 230 |
// Array for entities
|
| 231 |
$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));
|
| 232 |
$htmlcode = array('„','“','–',' "','–','—','‘','’','“','”','„','•' ,'…','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ','¡','¢','£','¤','¥','¦','§','¨','©','ª','«','¬','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ','€','','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','','Ž','','','‘','’','“','”','•','–','—','˜','™','š','›','œ','','ž','Ÿ',' ','¡','¡','¡','¡','¥','¦','§','¨','©','ª','«','¬','�­','®','¯','°','±','²','³','´','µ','¶','·','¸','&supl;','º','»','¼','½','¾','¿','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','×','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','÷','ø','ù','ú','û','ü','ý','þ','ÿ');
|
| 233 |
+
//$s_String = str_replace($umlaute, $htmlcode, $s_String);
|
| 234 |
+
$s_String = utf8_encode( html_entity_decode( str_replace($umlaute, $htmlcode, $s_String) ) );
|
| 235 |
+
|
| 236 |
// … , …
|
| 237 |
$s_String = preg_replace('~\xC3\xA2\xE2\x82\xAC\xC2\xA6~', '…', $s_String);
|
| 238 |
$s_String = preg_replace('~\xC3\x83\xC2\xA2\xC3\xA2\xE2\x80\x9A\xC2\xAC\xC3\x82\xC2\xA6~', '…', $s_String);
|
| 284 |
|
| 285 |
return $s_String;
|
| 286 |
}
|
| 287 |
+
|
| 288 |
+
/**
|
| 289 |
+
* Entfernt unvollstaendige Worte am Ende eines Strings.
|
| 290 |
+
* @author Thomas Scholz <http://toscho.de>
|
| 291 |
+
* @param $str Zeichenkette
|
| 292 |
+
* @return string
|
| 293 |
+
*/
|
| 294 |
+
function RSSImport_end_on_word($str) {
|
| 295 |
+
|
| 296 |
+
$arr = explode( ' ', trim($str) );
|
| 297 |
+
array_pop($arr);
|
| 298 |
+
|
| 299 |
+
return rtrim( implode(' ', $arr), ',;');
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
function RSSImport_Shortcode($atts) {
|
| 303 |
+
extract( shortcode_atts( array(
|
| 304 |
+
'display' => '5',
|
| 305 |
+
'feedurl' => 'http://bueltge.de/feed/',
|
| 306 |
+
'before_desc' => '<br />',
|
| 307 |
+
'displaydescriptions' => false,
|
| 308 |
+
'after_desc' => '',
|
| 309 |
+
'html' => false,
|
| 310 |
+
'truncatedescchar' => 200,
|
| 311 |
+
'truncatedescstring' => ' ... ',
|
| 312 |
+
'truncatetitlechar' => '',
|
| 313 |
+
'truncatetitlestring' => ' ... ',
|
| 314 |
+
'before_date' => ' <small>',
|
| 315 |
+
'date' => false,
|
| 316 |
+
'after_date' => '</small>',
|
| 317 |
+
'before_creator' => ' <small>',
|
| 318 |
+
'creator' => false,
|
| 319 |
+
'after_creator' => '</small>',
|
| 320 |
+
'start_items' => '<ul>',
|
| 321 |
+
'end_items' => '</ul>',
|
| 322 |
+
'start_item' => '<li>',
|
| 323 |
+
'end_item' => '</li>',
|
| 324 |
+
'target' => '',
|
| 325 |
+
'charsetscan' => false,
|
| 326 |
+
'debug' => false,
|
| 327 |
+
'before_noitems' => '<p>',
|
| 328 |
+
'noitems' => 'No items, feed is empty.',
|
| 329 |
+
'after_noitems' => '</p>',
|
| 330 |
+
'before_error' => '<p>',
|
| 331 |
+
'error' => 'Error: Feed has a error or is not valid',
|
| 332 |
+
'after_error' => '</p>'
|
| 333 |
+
), $atts) );
|
| 334 |
+
|
| 335 |
+
$return = RSSImport(
|
| 336 |
+
$display, $feedurl,
|
| 337 |
+
$before_desc, $displaydescriptions, $after_desc, $html, $truncatedescchar, $truncatedescstring,
|
| 338 |
+
$truncatetitlechar, $truncatetitlestring,
|
| 339 |
+
$before_date, $date, $after_date,
|
| 340 |
+
$before_creator, $creator, $after_creator,
|
| 341 |
+
$start_items, $end_items,
|
| 342 |
+
$start_item, $end_item,
|
| 343 |
+
$target,
|
| 344 |
+
$charsetscan, $debug,
|
| 345 |
+
$view = false,
|
| 346 |
+
$before_noitems, $noitems, $after_noitems,
|
| 347 |
+
$before_error, $error, $after_error
|
| 348 |
+
);
|
| 349 |
+
|
| 350 |
+
return $return;
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
/**
|
| 354 |
+
* add quicktag-button to editor
|
| 355 |
+
*/
|
| 356 |
+
function RSSImport_insert_button() {
|
| 357 |
+
global $pagenow;
|
| 358 |
+
|
| 359 |
+
$post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
|
| 360 |
+
if ( !in_array( $pagenow, $post_page_pages ) )
|
| 361 |
+
return;
|
| 362 |
+
|
| 363 |
+
echo '
|
| 364 |
+
<script type="text/javascript">
|
| 365 |
+
//<![CDATA[
|
| 366 |
+
var length = edButtons.length;
|
| 367 |
+
edButtons[length] = new edButton(\'RSSImport\', \'$context\', \'[RSSImport display="5" feedurl="http://feedurl.com/" before_desc="<br />" displaydescriptions="true" after_desc=" " html="false" truncatedescchar="200" truncatedescstring=" ... " truncatetitlechar=" " truncatetitlestring=" ... " before_date=" <small>" date="false" after_date=" </small>" before_creator=" <small>" creator="false" after_creator=" </small>" start_items=" <ul>" end_items=" </ul>" start_item=" <li>" end_item=" </li>" target="" charsetscan="false" debug="false" before_noitems="<p>" noitems="No items, feed is empty." after_noitems="</p>" before_error="<p>" error="Error: Feed has a error or is not valid" after_error="</p>"]\', \'\', \'\');
|
| 368 |
+
function RSSImport_tag(id) {
|
| 369 |
+
id = id.replace(/RSSImport_/, \'\');
|
| 370 |
+
edInsertTag(edCanvas, id);
|
| 371 |
+
}
|
| 372 |
+
jQuery(document).ready(function() {
|
| 373 |
+
content = \'<input id="RSSImport_\'+length+\'" class="ed_button" type="button" value="' . __( 'RSSImport', FB_RSSI_TEXTDOMAIN ) . '" title="' . __( 'Import a feed with RSSImport', FB_RSSI_TEXTDOMAIN ) . '" onclick="RSSImport_tag(this.id);" />\';
|
| 374 |
+
jQuery("#ed_toolbar").append(content);
|
| 375 |
+
});
|
| 376 |
+
//]]>
|
| 377 |
+
</script>';
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
function RSSImport_update_notice() {
|
| 381 |
+
$plugin_data = get_plugin_data( __FILE__ );
|
| 382 |
+
if ($plugin_data['Version'] > '4.2.4')
|
| 383 |
+
return;
|
| 384 |
+
else
|
| 385 |
+
echo '<tr><td class="plugin-update" colspan="5">' . __('New version, however the plugin has been modified with many new parameters. Please see the new <a target="_blank" href="http://wordpress.org/extend/plugins/rss-import/">possibilities</a>.', FB_RSSI_TEXTDOMAIN) . '</td></tr>';
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
if ( function_exists('add_shortcode') )
|
| 389 |
+
add_shortcode('RSSImport', 'RSSImport_Shortcode');
|
| 390 |
+
|
| 391 |
+
add_action( 'init', 'RSSImport_textdomain' );
|
| 392 |
+
if ( is_admin() ) {
|
| 393 |
+
add_action( 'after_plugin_row_'.FB_RSSI_BASENAME, 'RSSImport_update_notice' );
|
| 394 |
+
if (FB_RSSI_QUICKTAG)
|
| 395 |
+
add_filter( 'admin_footer', 'RSSImport_insert_button' );
|
| 396 |
+
}
|
| 397 |
?>
|
