Topic: Putting forum in a div

I'd like to integrate PunBB into a 3 column blog, layout is all css.

The left & right div's have links, nav, and such with the middle div holding content.

I've tried using include() to get the forum, which lives in a sub dir of the root directory, to get it in but have experienced no joy as index.php seems to lose track of where the files it requires are.

Has anyone already accomplished what I'm looking to do? If so how.

Thanks

Blog: http://stageleft.crow.ws
IRC: UnderNet #stageleft
___________________________________
Don't ask for my Instant Messenger contact info - I have none. IRC is the original, and * only * IM the anyone in the world needs.

Re: Putting forum in a div

To include the forum code from an external directory you have to add the forum directory to the PHP include path (this will change in 1.1). Have a look at this code:

http://punbb.org/forums/viewtopic.php?id=2494

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Putting forum in a div

So, if I understand correctly, if I put

set_include_path(get_include_path().':path/to/forum');

at the head of the code in the index.php file at which point I can use include() to get the forum into the content div on a page one level up from /forum?

Just for greater certainty the main blog lives in a directory /pmachine and is displayed by /pmachine/weblog.php.

The weblog.php page has 3 div's.... left - content - right

The forum has been installed in /pmachine/forum and is displayed by /pmachine/forum/index.php

I want the forum to show up in a page called  forum.php (in /pmachine) by inserting something in the content div that will allow the forum (and all supporting files below /pmachine/forum/) to be found and operate properly.

Did that make any sense at all?

Thanks

Blog: http://stageleft.crow.ws
IRC: UnderNet #stageleft
___________________________________
Don't ask for my Instant Messenger contact info - I have none. IRC is the original, and * only * IM the anyone in the world needs.

Re: Putting forum in a div

Before I continue, are you going to split up the forum content into different divs or will everything related to the forum exist in one div?

Try this:

set_include_path(get_include_path().':./forum');

before including any files.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Putting forum in a div

The forum and everything related to it are going to live in one div.

I really appreciate this Kennel, thanks !!

M

Blog: http://stageleft.crow.ws
IRC: UnderNet #stageleft
___________________________________
Don't ask for my Instant Messenger contact info - I have none. IRC is the original, and * only * IM the anyone in the world needs.

Re: Putting forum in a div

Wouldn't an iframe be an option?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Putting forum in a div

It is an option - the one of last resort really :-)

I've used forums within frames and iframes that require that a cookie be set (such as the login cookie) that worked erratically in the past, read.... the cookie didn't always get set for right frame.

This is a new install so there is always the option of reinstalling in the /pmachine directory (will just have to check and make sure it wouldn't overwrite any files that happen to share a file name) and it would work fine.

I'll test the iframe option first though.

Thanks for looking into this.

M

Blog: http://stageleft.crow.ws
IRC: UnderNet #stageleft
___________________________________
Don't ask for my Instant Messenger contact info - I have none. IRC is the original, and * only * IM the anyone in the world needs.

Re: Putting forum in a div

Yeah, that is an issue with frames. Also, PunBB really needs cookies since it does not use sessions in any way.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Putting forum in a div

Oddly enough, although I'm not gonna complain, I dropped Punbb into an iframe and the cookie setting issue I experienced previously with other forums within a frameset has not reared it's ugly head.

IMO Layout using an iframe bytes but it's workable :-)

Thanks again

M

Blog: http://stageleft.crow.ws
IRC: UnderNet #stageleft
___________________________________
Don't ask for my Instant Messenger contact info - I have none. IRC is the original, and * only * IM the anyone in the world needs.

Re: Putting forum in a div

As long as it works, we can ignore the how :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."