Page 1 of 1

embedding serendipity in phpwcms

Posted: Fri 2. Sep 2005, 00:29
by Zym0tiC
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:

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!
}
?>
http://www.shinebox.nl/weblog/wrapper.php

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;
I hope somebody can help me with this.

Posted: Sun 4. Sep 2005, 16:52
by Zym0tiC
I found something more I can do but it isn't 100% working.

I created an article called weblog: in the summary I put the following:

{PHP:phpwcms_template/inc_script/frontend_render/weblog.php}

In phpwcms_template/inc_script/frontend_render I placed weblog.php with the following content:

Code: Select all

<?php
global $serendipity;

chdir('weblog');
$blog_startpage = true;
include_once('wrapper.php');
chdir('..');

echo $blog_data;
?>
The wrapper.php file is still the same see my first post in this topic.

When I open http://www.shinebox.nl/index.php?weblog the serendipity page gets included as it should be, but when i click a link the content of serendipity gets placed above the phpwcms code so that my page doesn't looks ok.