XF 1.5 Double title on RSS feed

valdet

Active member
Hello,

We send a daily digest of new threads from Feedburner.

However, there are few items that I'd like to remove from the RSS output. The title and URL in bottom, as well as the time next to the title on top.

double-headline-rss.webp


How can this be done ?
Thanks
 
Last edited:
I'm not clear what that screenshot is of. If it's outside of XF, then you would likely need to contact them with your question.
 
Hi @Mike The screenshot is from Google Feedburner, which just pulls the contents from Xenforo RSS Feed at .../community/forums/-/index.rss

From the example in screenshot, here's the resulting RSS item

Code:
<item>
<title>Condo Association Help</title>
<pubDate>Fri, 15 Dec 2017 18:36:57 +0000</pubDate>
<link>https://mywebsite12345.com/community/threads/condo-association-help.92074/</link>
<guid>https://mywebsite12345.com/community/threads/condo-association-help.92074/</guid>
<author>invalid@example.com (Dave)</author>
<dc:creator>Dave</dc:creator>
<content:encoded>
<![CDATA[
I have a Condo Association that has formed. They&#039;re looking for property coverage for 30 buildings with 154 units. Problem is 25% of the roofs need to be replaced due a wind damage. Anyone know of...<br /> <br /> <a href="https://mywebsite12345.com/community/threads/condo-association-help.92074/" class="internalLink">Condo Association Help</a>
]]>
</content:encoded>
<slash:comments>8</slash:comments>
</item>

What I am specifically asking is, if it possible, how to remove/disable the <pubDate>...</pubDate> entry, as well as remove the link that is added at the end of <content:encoded>...</content:encoded> block.

By checking the XF files, in /library/Zend/Feed/Rss.php on line 424, there's this block, but I don't see a reference of how to remove only the URL in bottom of the screenshot.
Code:
if (isset($dataentry->content)) {
                $content = $this->_element->createElement('content:encoded');
                $content->appendChild($this->_element->createCDATASection($dataentry->content));
                $item->appendChild($content);
            }
 
Last edited:
For the most part, there isn't a way to change these elements specifically without code modifications.

The link at the bottom is only included if the content is cut off. This is controlled by the "discussionRssContentLength" option (can be found using the control panel search).
 
Yes I have that setting to cut off to 200 characters, as I don't want the whole first post to end up there.

I which file should I look into removing the URL insertion on end, despite the setting ?
Thanks.
 
It can happen in various places, though primarily 2 of the view classes in XenForo/ViewPublic/Forum (GlobalRss and View).
 
At the ViewPublic/Forum/View.php this block seems like it

Code:
if (!empty($thread['canViewContent']) && !empty($thread['message']) && XenForo_Application::getOptions()->discussionRssContentLength)
            {
                $snippet = $bbCodeSnippetParser->render(XenForo_Helper_String::wholeWordTrim($thread['message'], XenForo_Application::getOptions()->discussionRssContentLength), $rendererStates);
                if ($snippet != $thread['message'])
                {
                    $snippet .= "\n\n[url='" . XenForo_Link::buildPublicLink('canonical:threads', $thread) . "']" . $thread['title'] . '[/url]';
                }
                $content = trim($bbCodeParser->render($snippet, $rendererStates));
                if (strlen($content))
                {
                    $entry->setContent($content);
                }
            }

while on ViewPublic/Forum/GlobalRss.php it's this one

Code:
if (!empty($thread['canViewContent']) && !empty($thread['message']) && XenForo_Application::getOptions()->discussionRssContentLength)
            {
                $snippet = $bbCodeSnippetParser->render(
                    XenForo_Helper_String::wholeWordTrim($thread['message'], XenForo_Application::getOptions()->discussionRssContentLength), $rendererStates);
                if ($snippet != $thread['message'])
                {
                    $snippet .= "\n\n[url='" . XenForo_Link::buildPublicLink('canonical:threads', $thread) . "']" . $thread['title'] . '[/url]';
                }
                $content = trim($bbCodeParser->render($snippet, $rendererStates));
                if (strlen($content))
                {
                    $entry->setContent($content);
                }
            }

Can this be achieved by simply leaving an empty like $snippet .= "\n";
 
Back
Top Bottom