How to initialize s9y outside of s9y itself

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
veggie2u
Regular
Posts: 12
Joined: Fri Jan 07, 2005 7:44 pm
Location: Minneapolis
Contact:

How to initialize s9y outside of s9y itself

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How to initialize s9y outside of s9y itself

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
veggie2u
Regular
Posts: 12
Joined: Fri Jan 07, 2005 7:44 pm
Location: Minneapolis
Contact:

Post by veggie2u »

The IS_installed worked. Thanks.
Post Reply