Including the blog into a site

Having trouble installing serendipity?
Post Reply
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Including the blog into a site

Post by StarF »

Hi

I am trying to set up this blog on my own site now ( www.evilsun.dk )
now i know the easiest way is to include the index.php onto my site, or make a wrapper my problem how ever is a bit diffrent..

i got my site layout prette strick, and i would like to keep it that way if possible.

i installed my blog in /blog
i then make my wrapper, to include /blog/index.php
but that results in, index.php starts to look for all its other files, in / and not /blog

is there a easy way to do this? so i could keep my blog in /blog and not on the root of the server ?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Including the blog into a site

Post by garvinhicking »

You should look at your s9y configuration and see which paths are configured there; if you put your blog into a subdirectory you need to specify that path, not the root path.

Regards,
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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

my path looks like this:

Full path : /home/www/evilsun.dk/blog/
Upload path : uploads/
Relative path : /blog/
Relative template path : templates/
Relative upload path : uploads/
URL to blog : http://www.evilsun.dk/blog/

as far i can see that is corrent, how ever i do still get those problems..
http://www.evilsun.dk/wrapper.php it just redirects to the admin page?

my wrapper looks like this:

Code: Select all

<?php
$_REQUEST['page'] = 'blog';

ob_start();
require 'blog/index.php';
$blog_data = ob_get_contents();
ob_end_clean();

require 'index.php';
?>
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You cannot require the files in the subdir, you need to change your code to this:

Code: Select all

<?php
$_REQUEST['page'] = 'blog';

ob_start();
chdir('blog');
require 'blog/index.php';
$blog_data = ob_get_contents();
chdir('..');
ob_end_clean();

require 'index.php';
?>
Regards,
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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

garvinhicking wrote:You cannot require the files in the subdir, you need to change your code to this:

Code: Select all

<?php
$_REQUEST['page'] = 'blog';

ob_start();
chdir('blog');
require 'blog/index.php';
$blog_data = ob_get_contents();
chdir('..');
ob_end_clean();

require 'index.php';
?>
Regards,
Garvin
tnx that seems to work, and in order to show my blog, i just put this on the page i want to show my blog?

Code: Select all

<?php 
echo $blog_data; 
?>
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Yes. Just try it out :)

Regards,
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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

tnx it works :)

now back to finish up those themes for ya :)
Post Reply