Hi,
I’m new to RapidWeaver and this forum and was wondering if anyone here would be able to help with a probem I have. I’m a bit of a novice, however RW is just so easy that I had to have it! However, the problem…
I’m making our band site and wanted some static content on the home page and some dynamic stuff, such as latest news, blog entries, so when I saw “Show Recent Posts” snippet I was chuffed to bits!
Now I downloaded the “Show Recent Posts 2” snippet and followed the instructions. Downloaded and added SimplePie 1.1.1 as an asset to the page, created the cache inline (777), etc (I also ran the compatibility test, which returned that everything was okay with my host, PHP, cURL, etc).
However when I uploaded my site the recent posts was blank, just white space. I then uploaded the Simple Pie demo and I could read feeds from other sites (rss, atom, xml, etc) however it wouldn’t return my site feeds from my feed url, returning a “cURL Error 7: timeout”
I spoke with my host, “Heart Internet”, who said:
“We don’t allow scripts to make HTTP requests to the same server they’re running on. This measure is in place to prevent script errors/misconfigured scripts from causing a “loopback” effect, which would severely detriment the performance of our shared servers - affecting other customers.
Unfortunately this block can’t be raised for specific sites. I’d suggest seeing if there’s anyway to implement what you’re trying to do without HTTP callbacks. I apologise for the inconvenience.”
Okay, I thought, I’ll just burn the feed through feedburner and point to that instead as that isn’t on the server site (that may be a stupid thing to do, forgive me, is it?). However all I got returned was:
A feed could not be found at http://feeds.feedburner.com/fifthcircle
But I can point my browser at that URL and see them? I’m exhausted! (I owe my family 4 days of my life back!!!)
I tore all the site down and have now just got some simple code (below) that pulls my feedburner and the BBC’s feedburner. Mine returns the ‘no feeds’ error and the BBC’s displays correctly. <boggle>
<?php
error_reporting(E_ALL);
// Make sure SimplePie is included. You may need to change this to match the location of simplepie.inc.
require_once('assets/simplepie.inc');
// We'll process this feed with all of the default options.
$feed = new SimplePie('http://feeds.feedburner.com/bbc', $_SERVER['DOCUMENT_ROOT'] . 'cache');
$feed->set_timeout(60);
// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).
$feed->handle_content_type();
echo $feed->error();
// Let's begin our XHTML webpage code. The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag.
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Sample SimplePie Page</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<div class="header">
<h1><a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a></h1>
<p><?php echo $feed->get_description(); ?></p>
</div>
<?php
/*
Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
*/
foreach ($feed->get_items() as $item):
?>
<div class="item">
<h2><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h2>
<p><?php echo $item->get_description(); ?></p>
<p><small>Posted on <?php echo $item->get_date('j F Y | g:i a'); ?></small></p>
</div>
<?php endforeach; ?>
</body>
</html>
RapidWeaver is set to publish php files, no XML declaration, code Tidied, the test pages are HTML pages, custom feed disabled, site URL as below , the assets are added and the cache is CHMOD 777.
I don’t have a .htaccess file on my host (should I? What would I put in it?!), it’s obviously a shared server and as far as I can tell PHP is delivered as cgi (as opposed to module).
Site: http://www.fifthcirclemusic.com/
RSS: http://www.fifthcirclemusic.com/blog/files/blog.xml
Feedburner: http://feeds.feedburner.com/fifthcircle
RW is great, you just can’t help loving the styling, ease of use, plug-ins etc, however I’m really getting hung up on this problem. I’d really like a static home page (that isn’t a Blog) but can be added to with dynamic content from the blog page!
Any help you could offer would be greatly appreciated and would save both my sanity and my marriage!
Thank You and apologies for the long post,
David