Page 1 of 1

Embedding with Serendipity

Posted: Wed Dec 23, 2009 4:50 am
by MCXSC
Hi there,

I've installed Serendipity on my webserver and wants an embedding "version". I've read the documenatation "Embedding with Serendipity":

Code: Select all

<?php
  chdir("<serendipity_dir>");
  require("index.php");
  chdir("<original_dir>");
?>
To "include" the index.php file - no problem. But how I could include f.e. one entry? The basiclink is f.e.: http://www.url.com/serendipity/archives/1-dsgdgs.html.

Any idea? :(

Thx,
MCXSC

Re: Embedding with Serendipity

Posted: Wed Dec 23, 2009 3:13 pm
by garvinhicking
Hi!

You might want to get yourself familiar with the serendipity API, i.e. all functions contained (and documented) inside the functions_entries.inc.php file.

And check this:
http://www.s9y.org/78.html#A7

Regards,
Garvin

Re: Embedding with Serendipity

Posted: Wed Dec 23, 2009 11:37 pm
by MCXSC
Ok, let me explain:

My website (php based) is on the root dir. "index.php" ist my indexpage. I've a file named "wrapper.php":
<?php
ob_start();
chdir("serendipity/");
require("index.php");
chdir("../");
$blog = ob_get_contents();
ob_end_clean();
?>
If I click on "Blog" (a image in my navigation), the link is "index.php?q=blog". It includes f.e. a file or anything. This file is:

Code: Select all

<?php
echo $blog;
?>
This "writes" the blogcontent completely in the html of "index.php?q=blog". Problem: The Links are f.e. not "index.php?q=blog&blabla", they are "serendipity/archieves/...", so they don't be included.

I now tried some of this post: I set "../index.php?q=blog" as Blog-Index in the adminpanel and did some changes in the .htacess: I replaced things like "index.php?q=blog?url=..." with "index.php?q=blog&url=...". And, lets see: The links in the wrapper-output are working.

But: The formaction for comments f.e. are still "index.php?q=blog?...", also the formaction of the searchbox... That's the only problem I (just) have... :(

Any idea? I think it could be just a global-variable?

Re: Embedding with Serendipity

Posted: Wed Dec 23, 2009 11:44 pm
by garvinhicking
Hi!

Ah! What you need to do is set the "Embed index file" from "index.php" to your "wrapper.php" (or a new file, that simply includes your main framework with the $_GET variables all set as if you call your usuall application workflow).

This will then route all s9y page calls through the wrapper.php file, which is the wrapper for your content page.

Regards,
Garvin

Re: Embedding with Serendipity

Posted: Wed Dec 23, 2009 11:53 pm
by MCXSC
Yes, I know. But my wrapper isn't really the wrapper.php, but "index.php?q=blog"... The included file for "?q=blog" "includes" the wrapper. To set the Indexpage to "wrapper.php" it didn't works...

Re: Embedding with Serendipity

Posted: Thu Dec 24, 2009 11:00 am
by garvinhicking
Hi!

Yes, I know. You must build a wrapper.php that includes your (not s9y's) index.php, sets q=blog, which then includes the s9y framework (which then includes s9y's index).

Regards,
Garvin

Re: Embedding with Serendipity

Posted: Fri Dec 25, 2009 10:19 am
by MCXSC
Oh, yes. Thank you!