Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: magpierss

  1. #1
    Join Date
    Sep 2006
    Posts
    204
    Thanks
    11
    Thanked 3 Times in 3 Posts

    Default magpierss

    Anybody here using magpie RSS on their site

    I have created a dir called magpierss as described in their install doc but I'm getting feed errors, could somebody please point me in the correct direction please

    cliftonfc.co.uk is the link

    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Somehow you have un-parsed PHP code appearing on the page, which suggests that it has been incorrectly embedded. Check each bit of php is preceeded by <?php and terminated with ?>.

    N

  3. #3
    Join Date
    Sep 2006
    Posts
    204
    Thanks
    11
    Thanked 3 Times in 3 Posts

    Default

    Thanks for the reply Nick, here is the code which looks fine but please correct me if I'm wrong

    Code:
    <?php $num_items =5; 
    $rss = @fetch_rss('http://www.cisco.com/cdc_content_elements/rss/products/products.xml');
    
    if ($rss) 
    { 
        $items = array_slice($rss->items, 0, $num_items); 
    
        echo '<ul>'; 
        foreach ($items as $item) 
        { 
            $href = $item['link']; 
            $title = $item['title']; 
            echo '<li><a href="' . htmlspecialchars($href) . '" target="_blank">'. htmlspecialchars($title) . '</a></li>'; 
        } 
        echo '</ul>'; 
    } 
    else 
    { 
        echo '<p>We were unable to contact or RSS feed for the latest security alerts. Sorry for any inconvenience.</p>'; 
    } 
    unset($rss); ?>
    Cheers Nick

  4. #4
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    You need to show the source that surrounds that really because on its own that doesn't, at first glance, seem wrong.

  5. #5
    Join Date
    Sep 2006
    Posts
    204
    Thanks
    11
    Thanked 3 Times in 3 Posts

    Default

    Sorry can you explain please

    Thanks

  6. #6
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    I've just worked it out. You have not got PHP enabled on your domain.
    To enable it in Helm, navigate to your domain, click the 'website settings' button, select 'Version 5' from the drop down menu 'PHP' (It will currently say 'None'), and click save.

  7. #7
    Join Date
    Sep 2006
    Posts
    204
    Thanks
    11
    Thanked 3 Times in 3 Posts

    Default

    <?php $num_items =5;
    $rss = @fetch_rss('http://www.cisco.com/cdc_content_elements/rss/products/products.xml');

    if ($rss)
    {
    $items = array_slice($rss->items, 0, $num_items);

    echo '<ul>';
    foreach ($items as $item)
    {
    $href = $item['link'];
    $title = $item['title'];
    echo '<li><a href="' . htmlspecialchars($href) . '" target="_blank">'. htmlspecialchars($title) . '</a></li>';
    }
    echo '</ul>';
    }
    else
    {
    echo '<p>We were unable to contact or RSS feed for the latest security alerts. Sorry for any inconvenience.</p>';
    }
    unset($rss);?>

  8. #8
    Join Date
    Sep 2006
    Posts
    204
    Thanks
    11
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by nick View Post
    I've just worked it out. You have not got PHP enabled on your domain.
    To enable it in Helm, navigate to your domain, click the 'website settings' button, select 'Version 5' from the drop down menu 'PHP' (It will currently say 'None'), and click save.
    is already set to Version 5

  9. #9
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    Is there PHP being used for any other parts of the page, are these static pages you have created manually, or are you using a content management system to generate it?

    All I know is, if you don't parse the snippet you gave as PHP, and instead render it as HTML, it will output exactly what you are seeing.
    There are no PHP error messages displayed here, it is simply rendering the PHP code as HTML.

  10. #10
    Join Date
    Sep 2006
    Posts
    204
    Thanks
    11
    Thanked 3 Times in 3 Posts

    Default

    OK what I did was create the page with dreamweaver which saved the file as an html file, I then changed the extension to php, guess this is where is has screwed up, it is has can it be sorted?

    Thanks for staying with me

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •