mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Correction to news-summary generation.
This commit is contained in:
@@ -386,13 +386,14 @@ class news_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$text = $tp->toHtml($this->news_item['news_body'],true);
|
$text = $tp->toHtml($this->news_item['news_body'],true);
|
||||||
$text = str_replace("<br />"," ",$text);
|
$text = str_replace("<br />","\n",$text);
|
||||||
$text = strip_tags($text);
|
$text = strip_tags($text);
|
||||||
$tmp = preg_split('/\.\s/i', trim($text));
|
$tmp = preg_split('/(\.\s|!|\r|\n|\?)/i', trim($text));
|
||||||
|
$tmp = array_filter($tmp);
|
||||||
|
|
||||||
if($tmp[0] && $tmp[1])
|
if($tmp[0])
|
||||||
{
|
{
|
||||||
return trim($tmp[0]).". ".trim($tmp[1]).'.<br />';
|
return trim($tmp[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -606,7 +607,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
$class .= ' news-image-'.$tmp['count'];
|
$class .= ' news-image-'.$tmp['count'];
|
||||||
|
|
||||||
|
|
||||||
if($tp->isVideo($this->news_item['news_thumbnail']))
|
if($tp->isVideo($srcPath))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -635,10 +636,17 @@ class news_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vartrue($parm['nolegacy']) && strpos($src,'newspost_images')!==false)
|
|
||||||
|
|
||||||
|
if(vartrue($parm['nolegacy'])) // Remove legacy thumbnails.
|
||||||
|
{
|
||||||
|
$legSrc = urldecode($src);
|
||||||
|
|
||||||
|
if(strpos($legSrc,'newspost_images/thumb_')!==false)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user