Page 1 of 1

How to initialize s9y outside of s9y itself

Posted: Tue Jul 05, 2005 5:14 pm
by veggie2u
I was working on a portal type page that would display a couple of posts from my s9y blog, and wrote the following code that worked with 8.1

Code: Select all

$serendipity_directory = '/var/www/localhost/htdocs/serendipity/';
define('S9Y_INCLUDE_PATH', $serendipity_directory);
include_once(S9Y_INCLUDE_PATH . 'serendipity_config.inc.php');
include_once(S9Y_INCLUDE_PATH . 'include/functions.inc.php');
serendipity_smarty_init();
$entries = serendipity_fetchEntries( null, true, 5 );
Now that I have updated to 8.2, the first include of serendipity_config.inc.php now tries to redirect to the admin page.

Anyone have any other ideas how I can do this now?

Re: How to initialize s9y outside of s9y itself

Posted: Wed Jul 06, 2005 12:34 pm
by garvinhicking
It seems that your script is not in the same directory as Serendipity. So you should do a "chdir($serendipity_directory)" first, because Serendipity tries to load its configuration file and seems to fail.

If that does not work, try to:

Code: Select all

define('IS_installed', true);
first.

HTH,
Garvin

Posted: Wed Jul 06, 2005 9:12 pm
by veggie2u
The IS_installed worked. Thanks.