Page 1 of 1

Change install dir/ simple embed setup

Posted: Fri Jan 13, 2006 11:42 pm
by webnick
What's the best way to change the install dir of Serendipity? First at the blog admin page then move the directories or move the package then log in to admin and update paths?

I'd like to use the embed option after this but the documentation is rough. What are the bare minimums required? Set embed to true and create a webpage like this -

Code: Select all

<?php
$_REQUEST['page'] = 'blog';
ob_start();
require ("$_SERVER[DOCUMENT_ROOT]/pathto/serendipity/index.php");
$blog_data = ob_get_contents();
ob_end_clean();

require ("$_SERVER[DOCUMENT_ROOT]/pathto/serendipity/content.php");
?>
Thanks for any help!

Re: Change install dir/ simple embed setup

Posted: Sun Jan 15, 2006 7:12 pm
by garvinhicking
Hi!

Moving s9y to a different server/directory is outlined in our FAQ, please have a look at that. First you need to move dirs, then login to admin and change dirs.

About embedding: Your code is nearly doing it. But you should first chdir() to the s9y directory, and then include the files via "." instead of a full path. This is because s9y uses quite a few relative links.

But actually, the embed mode is a tad outdated and you should be able to do everything via Smarty templating...

HTH,
Garvin

Posted: Mon Jan 16, 2006 10:04 pm
by webnick
In the most basic set up, my /blog/ directory runs Serendipity fine. Why shouldn't this text.php file run in the same directory also?

Code: Select all

<?
$_REQUEST['page'] = 'blog';
ob_start();
require("index.php");
$blog_data = ob_get_contents();
ob_end_clean();
?>

At some point I'd like to run this out of our cgi-bin and have different directories/templates for different categories. Thanks again for the help.

Posted: Tue Jan 17, 2006 9:22 am
by garvinhicking
Webnick: Yes, actually what's needed is just that the file you are running either resides in the same directory as Serendipity, or your script must perform a chdir() to the serendipity directory. The reason is because s9y includes files relatively from its own directory, so you would face errors if not residing in that directory.

Running out of cgi-bin should be possible with this wrapping way. Having different templates for categories though can already be solved with the serendipity plugin "Extended Properties for Categories". (serendipity_event_categorytemplates) :-)

Best regards,
Garvin