I've read the embedding documentation and I understand what I have to do to get it to work. I'm almost there, but I'm running into a weird issue.
First, I created a simple blog.php which does nothing more than include('index.php'). I changed the indexFile directive and turned on embed mode. So far so good. Browsing serendipity/index.php or serendipity/blog.php gives me a nice plain html, embeddable html snippet.
Now I need to wrap this in output buffering, because I need to include the rest of my site first, then output the s9y output somewhere in between. So I changed my code to this:
Code: Select all
ob_start();
include("index.php");
$s9y_output = ob_get_contents();
ob_end_clean();
echo $s9y_output;
The funny thing is, if I remove the ob_end_clean, it works. (although I get the output double of course). So it seems the include is alright, it's just that I get a blank page as soon as ob_end_clean() is being called.
To check if this is caused by s9y, I removed the include, and just put an 'echo "Hello World"' in its place. If I do that, everything works. The ob_end_clean works fine, and the echo of $s9y_output displays "Hello World".
So there's something inside the serendipity include that, together with ob_end_clean, wreaks havoc. Maybe some mismatched internal ob_start/ob_end_clean inside s9y? Maybe some bug in output buffering in PHP? (can't really imagine what that would be).
It's only about 6 lines of code and I haven't even inserted my own cms stuff yet; but I've tried everything I can, and nothing seems to get it working. If I can't use ob_end_clean, I can't save the output for later display in the page.
Any ideas?