mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Issue #2426 - Possibly fix. (untested)
This commit is contained in:
@@ -38,6 +38,8 @@ class rss_import extends base_import_class
|
|||||||
|
|
||||||
var $feedUrl = null;
|
var $feedUrl = null;
|
||||||
var $defaultClass = false;
|
var $defaultClass = false;
|
||||||
|
|
||||||
|
private $foundImages = array();
|
||||||
|
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
@@ -137,6 +139,7 @@ class rss_import extends base_import_class
|
|||||||
*/
|
*/
|
||||||
function copyNewsData(&$target, &$source)
|
function copyNewsData(&$target, &$source)
|
||||||
{
|
{
|
||||||
|
$this->foundImages = array();
|
||||||
|
|
||||||
if(!$content = $this->process('content_encoded',$source))
|
if(!$content = $this->process('content_encoded',$source))
|
||||||
{
|
{
|
||||||
@@ -181,7 +184,7 @@ class rss_import extends base_import_class
|
|||||||
// $target['news_render_type'] = '';
|
// $target['news_render_type'] = '';
|
||||||
// $target['news_comment_total'] = $source['comment_count'];
|
// $target['news_comment_total'] = $source['comment_count'];
|
||||||
// $target['news_summary'] = $source['post_excerpt'];
|
// $target['news_summary'] = $source['post_excerpt'];
|
||||||
// $target['news_thumbnail'] = '';
|
$target['news_thumbnail'] = !empty($this->foundImages[0]) ? $this->foundImages[0] : '';
|
||||||
// $target['news_sticky'] = '';
|
// $target['news_sticky'] = '';
|
||||||
|
|
||||||
|
|
||||||
@@ -331,7 +334,9 @@ class rss_import extends base_import_class
|
|||||||
if(filesize(e_MEDIA.$relPath."/".$filename) > 0)
|
if(filesize(e_MEDIA.$relPath."/".$filename) > 0)
|
||||||
{
|
{
|
||||||
$search[] = $att['src'];
|
$search[] = $att['src'];
|
||||||
$replace[] = $tp->createConstants(e_MEDIA.$relPath."/".$filename,1);
|
$src = $tp->createConstants(e_MEDIA.$relPath."/".$filename,1);
|
||||||
|
$this->foundImages[] = $src;
|
||||||
|
$replace[] = $src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,7 +356,7 @@ class rss_import extends base_import_class
|
|||||||
return str_replace($search,$replace,$body);
|
return str_replace($search,$replace,$body);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
// echo htmlentities($body);
|
// echo htmlentities($body);
|
||||||
preg_match_all("/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)\.(jpg|jpeg|gif|png|svg)/im",$body,$matches);
|
preg_match_all("/(((http:\/\/www)|(http:\/\/)|(www))[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)\.(jpg|jpeg|gif|png|svg)/im",$body,$matches);
|
||||||
@@ -387,7 +392,7 @@ class rss_import extends base_import_class
|
|||||||
$med->import($cat,e_MEDIA.$relPath);
|
$med->import($cat,e_MEDIA.$relPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
return str_replace($search,$replace,$body);
|
return str_replace($search,$replace,$body);*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user