Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

RSS not showing anything.

Hello,
I have a problem with RSS Syndication: I have various posts in my "Ofertas." Categories forum: http://www.dealia.org/forum/categories/Ofertas
but my RSS feed is not showing anything... http://www.dealia.org/forum/categories/Ofertas/feed.rss , the same happens with the rest of the of the Categories and the Discussions feed:
http://www.dealia.org/forum/discussions/feed.rss

Answers

  • hgtonighthgtonight ∞ · New Moderator

    Welcome to the community!

    What is the contents of your /applications/vanilla/views/discussions/index_rss.php file?

    Once you paste it in the editor box, select it and click on the code button to make sure it shows up properly.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • <?php if (!defined('APPLICATION')) exit(); ?>
       <description><?php echo Gdn_Format::Text($this->Head->Title()); ?></description>
       <language><?php echo Gdn::Config('Garden.Locale', 'en-US'); ?></language>
       <atom:link href="<?php echo htmlspecialchars(Url($this->SelfUrl, TRUE)); ?>" rel="self" type="application/rss+xml" />
    <?php
    foreach ($this->DiscussionData->Result() as $Discussion) {
    ?>
       <item>
          <title><?php echo Gdn_Format::Text($Discussion->Name); ?></title>
          <link><?php echo $Discussion->Url; ?></link>
          <pubDate><?php echo date('r', Gdn_Format::ToTimeStamp($Discussion->DateInserted)); ?></pubDate>
          <dc:creator><?php echo Gdn_Format::Text($Discussion->FirstName); ?></dc:creator>
          <guid isPermaLink="false"><?php echo $Discussion->DiscussionID . '@' . Url('/discussions'); ?></guid>
          <description><![CDATA[<?php echo Gdn_Format::RssHtml($Discussion->Body, $Discussion->Format); ?>]]></description>
       </item>
    <?php
    }
    

    Thanks for your help!

  • hgtonighthgtonight ∞ · New Moderator

    Please place the following before line 6 in that file: var_dump($this->DiscussionData->Result());. and check the feed again.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Thanks for your help, I've placed that before line 6 but it keeps showing the same :-(

  • hgtonighthgtonight ∞ · New Moderator

    What plugins are you running?

    The member $DiscussionData is returning an empty array.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited August 2014

    Thanks for your help, I've placed that before line 6 but it keeps showing the same :-(

    perhaps it is rss error rather than discussion data (it might be - but your answer doesn't jive.

    it should show a value - even if its null - so it wouldn't be showing the same.

    you may have an rss error due to a plugin or as a result of your category names.

    what are your category names?

    disable all your plugins, use the default theme and see if rss is working.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I've disabled all plugins and I've set the default theme, but it keeps showing the same.
    The category names are:
    Ofertas
    Concursos y Sorteos
    Cupones
    Regalos
    Resenas
    Off Topic
    Soporte Tecnico
    Dealia y ForoDeals

  • peregrineperegrine MVP
    edited August 2014

    I'm not sure -

    but this was an issue with & (perhaps accents or something might have an impact if you have accents in there.

    http://vanillaforums.org/discussion/comment/191556/#Comment_191556

    it might be a red herring.

    do all categories not show feeds or just one category.

    also you have lots of strange redirects or embeds.

    and your page looks nothing like this

    http://vanillaforums.org/categories

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Yes, I thought it was accents or something and I changed them, so I don't know what could be the problem.
    All categories do not show feeds.

  • hgtonighthgtonight ∞ · New Moderator

    If you look at the source of the http://www.dealia.org/forum/discussions/feeds.rss you can see the debug code spitting out an empty array.

    Try changing the previously added line to: var_dump($this->Data('Discussions');.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Now the feed shows this: XML Parsing Error: no element found
    Location: http://www.dealia.org/forum/categories/Ofertas/feed.rss
    Line Number 1, Column 1:
    ^

  • peregrineperegrine MVP
    edited August 2014

    if hgtonight's solution doesn't work ...
    you probably have white space added by something. which caused the error.

    this often happens in plugins and code that have a closing ?> at the bottom of the code.

    people mistakenly add this to plugins and other code and it almost always is the culprit.
    if you modified any code or added a ?> at the bottom of your code (the last line in a program, remove it).

    x00 taught me this two years ago when I though it was good practice to end all php programs with ?>

    not so for vanilla at least, because it ruins rss feeds.

    rss feeds cannot have any white space coming first.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    Sounds like you have a syntax error in your modified index_rss.php file.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Having the original index_rss.php file I don't know where could be any syntax errors :s Anyway, the plugin CommentsRSS did the trick and works well, although the original rss keeps nonworking. Thanks for your help!

Sign In or Register to comment.