1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Fix for CDATA in XML feeds. e107 blog feed now working with SSL enabled.

This commit is contained in:
Cameron
2016-02-16 13:08:15 -08:00
parent 39bae789f8
commit 53b6519f55
3 changed files with 44 additions and 8 deletions

View File

@@ -20,6 +20,10 @@ if (!defined('e107_INIT'))
header('Content-type: text/html; charset=utf-8', TRUE); header('Content-type: text/html; charset=utf-8', TRUE);
define('ADMINFEED', 'http://e107.org/adminfeed');
if(!empty($_GET['iframe'])) // global iframe support. if(!empty($_GET['iframe'])) // global iframe support.
{ {
define('e_IFRAME', true); define('e_IFRAME', true);
@@ -33,6 +37,41 @@ if(ADMIN && defset('e_ADMIN_UI') && varset($_POST['mode']) == 'sef' && !empty($_
exit; 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' ) if(ADMIN && e_AJAX_REQUEST && varset($_GET['mode']) == 'addons' )
{ {
$type = ($_GET['type'] == 'plugin') ? 'plugin' : 'theme'; $type = ($_GET['type'] == 'plugin') ? 'plugin' : 'theme';

View File

@@ -17,7 +17,7 @@ if (!defined('e107_INIT'))
exit; exit;
} }
define('ADMINFEED', 'http://e107.org/adminfeed');
define('ADMINFEEDMORE', 'http://e107.org/blog'); define('ADMINFEEDMORE', 'http://e107.org/blog');
@@ -31,17 +31,14 @@ class adminstyle_infopanel
function __construct() 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 = " $code = "
jQuery(function($){ jQuery(function($){
$('#e-adminfeed').rssfeed('".ADMINFEED."', {
limit: 3, $('#e-adminfeed').load('".e_ADMIN."admin.php?mode=core&type=feed');
header: false,
linktarget: '_blank'
});
$('#e-adminfeed-plugin').load('".e_ADMIN."admin.php?mode=addons&type=plugin'); $('#e-adminfeed-plugin').load('".e_ADMIN."admin.php?mode=addons&type=plugin');

View File

@@ -589,7 +589,7 @@ class xmlClass
$xmlData = str_replace(array_keys($extendedTypes), array_values($extendedTypes), $xmlData); $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); $this->errors = $this->getErrors($xmlData);
return FALSE; return FALSE;