Page 1 of 1

Content show up twice. um. yeah.

Posted: Tue Mar 01, 2005 5:47 pm
by techiem2
Ok. After having some odd permissions problem I couldn't figure out, I did a fresh install of s9y.
I'm using it in a semi-embedded mode. (you have to see the site to know what I mean).

Anyhow, my site index file that acts as a wrapper to get the blog content and such so it can be included looks like this:

Code: Select all

index.php

<?php

   $_REQUEST['page'] = 'blog';
   // Let serendipity generate our content:
   ob_start();
   require 'blog.php';
   $blog_data = ob_get_contents();
   ob_end_clean();


   // Now we include our normal content building file.
   // This one has to make use of your $blog_data variable to print
   // the content where appropriate!
   require 'content.php';

?>
blog.php is the s9y index file.
content.php is my site layout file.

Now, everything was working fine until I updated stuff on the server and got problems and had to reinstall s9y.

But after this fresh install, it's either not working, or doing oddness. :)

With the index as above, loading the site just gives a blank page.

When I comment out the ob_end_clean line, I get the blog, then my content (which includes the blog).


Well, take a look for yourself.

:)

http://techiem2.no-ip.com:444

So basically, I'm trying to figure out why the blog is showing up before it's actually called.
hehe.

Any ideas?
Thanks.

Mark II

Posted: Tue Mar 01, 2005 6:28 pm
by techiem2
So basically, it appears like the require directive is acting essentially the same as the include directive.

Posted: Tue Mar 01, 2005 6:37 pm
by techiem2
hmm.
From looking around more, it appears that everything is showing because I never run the ob_end_clean, and therefore blog.php and content.php are both in the buffer.

But that doesn't explain why it appears to stop processing there when I do run ob_end_clean.

Mark II

Posted: Tue Mar 01, 2005 7:18 pm
by techiem2
Well, I did some tweaking/hacking/etc. and seem to have it working how I want again.
hehe.

Although I still find it odd that the wrapper stopped working as intended.
Weird.

Mark iI

Posted: Tue Mar 01, 2005 10:35 pm
by Marinmo
Your extended pages is not working; I just tried one though. The URL as follows:

http://techiem2.no-ip.com:444/archives/ ... l#extended

Posted: Thu Mar 17, 2005 1:27 am
by techiem2
I have things sorta working now.
I am directly including the main blog page in my layout page instead of using the wrapper.
I'm not sure why, but apparently when I use a proper wrapper the processing stops at the ob_end_clean statement, thus resulting in a blank page.
I'm thinking I may try recompiling php to see if that fixes it.

Posted: Thu Mar 17, 2005 3:11 am
by techiem2
hmmmmm.
Playing some more..
If I put a php echo statement in the wrapper before the buffer setup, it will output, and the wrapper will work.
Except there will be some headers already sent errors and such.
Now I'm really confused.
I'm in the process of recompiling mod_php to see if that fixes it.