embedding serendipity in phpwcms
Posted: Fri 2. Sep 2005, 00:29
He I had contact with some people @ the serendipity forum. With a lot of help i managed to get a wrapper file to include serendipity into phpwcms. But to finish the whole stuff I have to place some code in tthe index.php file, buth where....??? I hope somebody can help me.
this is the wrapper.php code which is placed in the weblog/ dir:
http://www.shinebox.nl/weblog/wrapper.php
NOw I have to place the following code into index.php of phpwcms:
I hope somebody can help me with this.
this is the wrapper.php code which is placed in the weblog/ dir:
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!
if ($blog_startpage) {
return; // The framework has called us!
} else {
chdir('..');
include 'index.php'; // Include the phpwcms framework! It needs to put $blog_data somewhere!
}
?>
NOw I have to place the following code into index.php of phpwcms:
Code: Select all
if ($_SERVER['REQUEST_URI'] == 'index.php?weblog') {
chdir('weblog');
$blog_startpage = true;
include_once('wrapper.php');
chdir('..');
}
// Here is more of phpwcms code
echo "Blog: " . $blog_data;