embedded s9y: RSS-Feed Problem - SOLVED

Having trouble installing serendipity?
Post Reply
seegers
Regular
Posts: 9
Joined: Mon Sep 26, 2005 6:43 am

embedded s9y: RSS-Feed Problem - SOLVED

Post by seegers »

Hi everyone,

i have been adjusting s9y's index.php in s9y's installation folder to embed it into my webpage.
http://www.e-neo.de/refreshed/serendipity

<?php ob_start(); ?> <!-- prevents "Warning: Cannot modify header information - headers already sent by..." -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- [removed other Framework of my homepage] -->

<?php # $Id: index.php,v 1.83 2005/08/19 10:50:36 garvinhicking Exp $
<!-- [code of sy9 index.php] -->
?>

<!-- [removed other Framework of my homepage] -->
</html>

<?php ob_end_flush(); ?> <!-- see first line -->


My problem now is that all RSS-Feeds start with the code of my homepage as well, which is of course causing parsing errors and thus rendering them useless.

I tried to find a solution myself, but still being new to php I am quite clueless at the moment. My guess the easiest way to solve it would be to open the XML-Output (which should be the rss.php output itself as far as i understand) itself in a new window.

I would appreciate any hints and helping hands on this issue.

Thanks ahead!
Last edited by seegers on Tue Sep 27, 2005 10:52 am, edited 1 time in total.
seegers
Regular
Posts: 9
Joined: Mon Sep 26, 2005 6:43 am

Post by seegers »

Ok, problem is solved for me now (why do the solutions always come to me after I made a problem public?).

I had tried earlier to manually discard the output buffer's contest, however for some reason this failed and my homepage headers still got printed. On php.net I luckily just found the solution:


while (@ob_end_clean()); <!-- insert this line -->
ob_start();
include_once(S9Y_INCLUDE_PATH . 'rss.php'); <!-- before this code -->
$data = ob_get_contents();
ob_end_clean();


This will erase all data in the output buffer and I get my desired XML Output.

Hope this will still help someone else.

Cheers :)
Post Reply