The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End RSS stopped working

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #27606

    I copied some RSS simplepie PHP code and have used it to display PHP RSS feeds on my site for a long time. In the last month or so the feeds have not worked correctly, it displays the code and not the feed. You can view my site here ……….Look in the lower right under "Todays Health News"

    Below is the code I’m using. Please take a look below or go to my site and view the source code and tell me what is wrong. All that I have changed is some cache settings. From $feed->enable_cache(true); to $feed->enable_cache(false); and I changed the mode setting in my cache directory to "000" because the cache files were getting to big.

    My host is
    Simplepie v 1.2


    Nothing too exciting here. Just a sample page that demos integrated
    Multifeeds support as well as cached favicons and perhaps a few other

    Lots of this code is commented to help explain some of the new stuff.
    Code was tested in PHP 5.2.2, but *should* also work with earlier
    versions of PHP, as supported by SimplePie (PHP 4.1).


    // Include the SimplePie library, and the one that handles internationalized domain names.

    // Initialize some feeds for use.
    $feed = new SimplePie();

    // When we set these, we need to make sure that the handler_image.php file is also trying to read from the same cache directory that we are.

    // Initialize the feed.

    // Make sure the page is being served with the UTF-8 headers.

    // Begin the (X)HTML page.
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="; xml:lang="en" lang="en">
    <title>Health and Beauty Information</title>
    <link rel="stylesheet" href="../demo/for_the_demo/simplepie.css" type="text/css" media="screen" title="SimplePie Styles" charset="utf-8" />

    <style type="text/css">
    div#site {
    span.footnote {
    h1 {
    h4 {
    background-position:0 1px;
    .clearBoth {
    <div id="site">

    <?php if ($feed->error): ?>
    <?php endif ?>

    <div class="chunk">
    <h1>Todays Health News</a></h1>


    // Let’s loop through each item in the feed.
    foreach($feed->get_items() as $item):

    // Let’s give ourselves a reference to the parent $feed object for this particular item.
    $feed = $item->get_feed();

    <div class="chunk">
    <h4 style="background-image:url(<?php echo $feed->get_favicon(); ?>);"><a href="<?php echo $item->get_permalink(); ?>"><?php echo html_entity_decode($item->get_title(), ENT_QUOTES, ‘UTF-8’); ?></a></h4>

    <!– get_content() prefers full content over summaries –>
    <?php echo $item->get_content(); ?>

    <?php if ($enclosure = $item->get_enclosure()): ?>
    <?php echo $enclosure->native_embed(array(
    // New ‘mediaplayer’ attribute shows off Flash-based MP3 and FLV playback.
    ‘mediaplayer’ => ‘../demo/for_the_demo/mediaplayer.swf’
    )); ?>

    <?php endif; ?>

    <p class="footnote">Source: <a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a> | <?php echo $item->get_date(‘j M Y | g:i a’); ?></p>

    <?php endforeach ?>

    <p class="footnote">&hellip;</p>

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.