help with using the blog embeded

Having trouble installing serendipity?
Post Reply
webMASTER_P
Posts: 4
Joined: Tue Jan 27, 2004 2:49 pm

help with using the blog embeded

Post by webMASTER_P »

i've been attempting to screw around with serendipity for a few days, and i still can't get something figured out
I am attempting to use the wrapper, just to have more control over the layout and i am stuck
so, here's what my wrapper.php looks like

Code: Select all

   <?php
   // Let serendipity generate our content:
   ob_start();
   require 'index.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';
   ?>
this is my content.php

Code: Select all

some stuff
<?php echo $blog_data ?>
and here's what i get when i try to access wrapper.php in my borwser

Code: Select all

some stuff 
Warning: Cannot modify header information - headers already sent by (output started at /home/pgutin/public_html/serendipity/wrapper.php:1) in /home/pgutin/public_html/serendipity/index.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /home/pgutin/public_html/serendipity/wrapper.php:1) in /home/pgutin/public_html/serendipity/index.php on line 136

BLOG TITLE
blog description

No entries to print.  
As you can tell, i am totally new to PHP, crossing over from the ASP world

Any help is greatly appreciated
tomsommer
Core Developer
Posts: 240
Joined: Tue Sep 02, 2003 6:43 pm
Location: Denmark
Contact:

Post by tomsommer »

HMm, i've never used this.. but check and make sure you don't have any linebreaks at the top of wrapper.php, the very first thing in the document MUST be <?php

no spaces before, nothing
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
webMASTER_P
Posts: 4
Joined: Tue Jan 27, 2004 2:49 pm

Post by webMASTER_P »

Right on the money!
i had three spaces before <?php

wow, thanks a lot!!! :D
tomsommer
Core Developer
Posts: 240
Joined: Tue Sep 02, 2003 6:43 pm
Location: Denmark
Contact:

Post by tomsommer »

Sure thing :)
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
webMASTER_P
Posts: 4
Joined: Tue Jan 27, 2004 2:49 pm

Post by webMASTER_P »

having gotten that to work, i am still stuck
i have serendipity installed in a separate directory, then my homepage, and that seems to be causing problems
here's what i have:
in my root, i have the index.php file (which i want to be using as a wrapper) and the serendipity folder
i have a wrapper.php file that is located in the serendipity directory and it works fine
here's what it looks like

Code: Select all

<?php
// Let serendipity generate our content:
ob_start();
require 'index.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';
?>
when i move that code into my home directory, it breaks
here's what that file looks like (all that is different is the first required statement)

Code: Select all

<?php
// Let serendipity generate our content:
ob_start();
require 'serendipity/index.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';
?>
i get an error saying that serendipy is not installed
anyone else encountered this?

thanks in advance
techiem2
Regular
Posts: 35
Joined: Sun Feb 15, 2004 6:59 am
Contact:

Post by techiem2 »

I had the same problem.

https://techiem2.no-ip.com

Here's what I finally did:
1. Backup web site.
2. Extract Serendipity to root of web space.
3. Get working standalone.

Once that worked, I started the embed stuff.

4. Renamed index.php to blog.php
5. Made a new index.php:

Code: Select all

<?php

   // 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';
?>
6. Made a new content.php that defines my page layout and sections and has

Code: Select all

echo $blog_data;
and

Code: Select all

serendipity_plugin_api::generate_plugins('left','div');
serendipity_plugin_api::generate_plugins('right','div');
in it in the appropriate sections.

7. Restore other parts of site and test everything until all integrated nicely.

It seems to be working well so far.
Comments are broken.
I haven't had time to figure out how to fix them yet.
That's the only thing I've noticed so far.
But I have an odd site setup.

*edit* I did have to edit the .htaccess file to change the DirectoryIndex directive to

Code: Select all

index.php
instead of

Code: Select all

/index.php
or else browsing to a directory on the server without specifying the index file would return to the main site page.
oops.
:)
TechieM2
webMASTER_P
Posts: 4
Joined: Tue Jan 27, 2004 2:49 pm

Post by webMASTER_P »

great, thank you very much, i will try that
techiem2
Regular
Posts: 35
Joined: Sun Feb 15, 2004 6:59 am
Contact:

Post by techiem2 »

:)
Have fun.
It takes quite a bit of work, but I think it was worth it.
Post Reply