mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
news-summary auto-gen correction.
This commit is contained in:
@@ -291,7 +291,9 @@ class news_shortcodes extends e_shortcode
|
|||||||
if($this->news_item['news_body']) // Auto-generate from first 2 sentences of news-body. //TODO Add Pref?
|
if($this->news_item['news_body']) // Auto-generate from first 2 sentences of news-body. //TODO Add Pref?
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$text = strip_tags($tp->toHtml($this->news_item['news_body'],true));
|
$text = $tp->toHtml($this->news_item['news_body'],true);
|
||||||
|
$text = str_replace("<br />"," ",$text);
|
||||||
|
$text = strip_tags($text);
|
||||||
$tmp = preg_split('/\.\s/i', trim($text));
|
$tmp = preg_split('/\.\s/i', trim($text));
|
||||||
|
|
||||||
if($tmp[0] && $tmp[1])
|
if($tmp[0] && $tmp[1])
|
||||||
|
Reference in New Issue
Block a user