mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Fix for CDATA in XML feeds. e107 blog feed now working with SSL enabled.
This commit is contained in:
@@ -20,6 +20,10 @@ if (!defined('e107_INIT'))
|
||||
|
||||
header('Content-type: text/html; charset=utf-8', TRUE);
|
||||
|
||||
define('ADMINFEED', 'http://e107.org/adminfeed');
|
||||
|
||||
|
||||
|
||||
if(!empty($_GET['iframe'])) // global iframe support.
|
||||
{
|
||||
define('e_IFRAME', true);
|
||||
@@ -33,6 +37,41 @@ if(ADMIN && defset('e_ADMIN_UI') && varset($_POST['mode']) == 'sef' && !empty($_
|
||||
exit;
|
||||
}
|
||||
|
||||
if(ADMIN && e_AJAX_REQUEST && varset($_GET['mode']) == 'core' && ($_GET['type'] == 'feed'))
|
||||
{
|
||||
|
||||
$limit = 3;
|
||||
|
||||
if($data = e107::getXml()->getRemoteFile(ADMINFEED,3))
|
||||
{
|
||||
// print_a($data);
|
||||
$rows = e107::getXml()->parseXml($data, 'advanced');
|
||||
$defaultImg = $rows['channel']['image']['url'];
|
||||
|
||||
$text = '<div style="margin-left:10px;margin-top:10px">';
|
||||
$count = 1;
|
||||
foreach($rows['channel']['item'] as $row)
|
||||
{
|
||||
if($count > $limit){ break; }
|
||||
|
||||
$description = $tp->toText($row['description']);
|
||||
$text .= '
|
||||
<div class="media">
|
||||
<div class="media-body">
|
||||
<h4 class="media-heading"><a href="'.$row['link'].'">'.$row['title'].'</a> <small>— '.$row['pubDate'].'</small></h4>
|
||||
'.$tp->text_truncate($description,150).'
|
||||
</div></div>';
|
||||
$count++;
|
||||
}
|
||||
$text .= '</div>';
|
||||
echo $text;
|
||||
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(ADMIN && e_AJAX_REQUEST && varset($_GET['mode']) == 'addons' )
|
||||
{
|
||||
$type = ($_GET['type'] == 'plugin') ? 'plugin' : 'theme';
|
||||
|
@@ -17,7 +17,7 @@ if (!defined('e107_INIT'))
|
||||
exit;
|
||||
}
|
||||
|
||||
define('ADMINFEED', 'http://e107.org/adminfeed');
|
||||
|
||||
define('ADMINFEEDMORE', 'http://e107.org/blog');
|
||||
|
||||
|
||||
@@ -31,17 +31,14 @@ class adminstyle_infopanel
|
||||
|
||||
function __construct()
|
||||
{
|
||||
e107::js('core','zrssfeed/jquery.zrssfeed.min.js'); // http://www.zazar.net/developers/jquery/zrssfeed/
|
||||
// e107::js('core','zrssfeed/jquery.zrssfeed.min.js'); // http://www.zazar.net/developers/jquery/zrssfeed/
|
||||
|
||||
$code = "
|
||||
|
||||
|
||||
jQuery(function($){
|
||||
$('#e-adminfeed').rssfeed('".ADMINFEED."', {
|
||||
limit: 3,
|
||||
header: false,
|
||||
linktarget: '_blank'
|
||||
});
|
||||
|
||||
$('#e-adminfeed').load('".e_ADMIN."admin.php?mode=core&type=feed');
|
||||
|
||||
$('#e-adminfeed-plugin').load('".e_ADMIN."admin.php?mode=addons&type=plugin');
|
||||
|
||||
|
@@ -589,7 +589,7 @@ class xmlClass
|
||||
|
||||
$xmlData = str_replace(array_keys($extendedTypes), array_values($extendedTypes), $xmlData);
|
||||
|
||||
if(!$xml = simplexml_load_string($xmlData))
|
||||
if(!$xml = simplexml_load_string($xmlData, 'SimpleXMLElement', LIBXML_NOCDATA))
|
||||
{
|
||||
$this->errors = $this->getErrors($xmlData);
|
||||
return FALSE;
|
||||
|
Reference in New Issue
Block a user