Skip to content

Commit

Permalink
RSS: Add value "None" to Characters Per Item (#6064)
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Gasiorowski authored and 810 committed Jul 28, 2018
1 parent c207d4b commit 92b5d56
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/administrator/components/com_kunena/models/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public function getConfiglists()

$rss_word_count = array();
$rss_word_count [] = HTMLHelper::_('select.option', '0', Text::_('COM_KUNENA_A_RSS_WORD_COUNT_ALL'));
$rss_word_count [] = HTMLHelper::_('select.option', '-1', JText::_('JNONE'));
$rss_word_count [] = HTMLHelper::_('select.option', '50', '50');
$rss_word_count [] = HTMLHelper::_('select.option', '100', '100');
$rss_word_count [] = HTMLHelper::_('select.option', '250', '250');
Expand Down
23 changes: 15 additions & 8 deletions src/components/com_kunena/views/category/view.feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,25 @@ public function createItem($title, $url, $description, $category, $date, $userid
$title .= ' - ' . Text::_('COM_KUNENA_BY') . ': ' . $username;
}

$description = preg_replace('/\[confidential\](.*?)\[\/confidential\]/s', '', $description);
$description = preg_replace('/\[hide\](.*?)\[\/hide\]/s', '', $description);
$description = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/s', '', $description);
$description = preg_replace('/\[code\](.*?)\[\/code]/s', '', $description);

if ((bool) $this->config->rss_allow_html)
if ((int) $this->config->rss_word_count === -1)
{
$description = KunenaHtmlParser::parseBBCode($description, null, (int) $this->config->rss_word_count);
$description = '';
}
else
{
$description = KunenaHtmlParser::parseText($description, (int) $this->config->rss_word_count);
$description = preg_replace('/\[confidential\](.*?)\[\/confidential\]/s', '', $description);
$description = preg_replace('/\[hide\](.*?)\[\/hide\]/s', '', $description);
$description = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/s', '', $description);
$description = preg_replace('/\[code\](.*?)\[\/code]/s', '', $description);

if ((bool) $this->config->rss_allow_html)
{
$description = KunenaHtmlParser::parseBBCode($description, null, (int) $this->config->rss_word_count);
}
else
{
$description = KunenaHtmlParser::parseText($description, (int) $this->config->rss_word_count);
}
}

// Assign values to feed item
Expand Down
23 changes: 15 additions & 8 deletions src/components/com_kunena/views/topics/view.feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,18 +287,25 @@ public function createItem($title, $url, $description, $category, $date, $userid
$title .= ' - ' . Text::_('COM_KUNENA_BY') . ': ' . $username;
}

$description = preg_replace('/\[confidential\](.*?)\[\/confidential\]/s', '', $description);
$description = preg_replace('/\[hide\](.*?)\[\/hide\]/s', '', $description);
$description = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/s', '', $description);
$description = preg_replace('/\[code\](.*?)\[\/code]/s', '', $description);

if ((bool) $this->config->rss_allow_html)
if ((int) $this->config->rss_word_count === -1)
{
$description = KunenaHtmlParser::parseBBCode($description, null, (int) $this->config->rss_word_count);
$description = '';
}
else
{
$description = KunenaHtmlParser::parseText($description, (int) $this->config->rss_word_count);
$description = preg_replace('/\[confidential\](.*?)\[\/confidential\]/s', '', $description);
$description = preg_replace('/\[hide\](.*?)\[\/hide\]/s', '', $description);
$description = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/s', '', $description);
$description = preg_replace('/\[code\](.*?)\[\/code]/s', '', $description);

if ((bool) $this->config->rss_allow_html)
{
$description = KunenaHtmlParser::parseBBCode($description, null, (int) $this->config->rss_word_count);
}
else
{
$description = KunenaHtmlParser::parseText($description, (int) $this->config->rss_word_count);
}
}

// Assign values to feed item
Expand Down

0 comments on commit 92b5d56

Please sign in to comment.