1 (edited by Staline 2005-07-02 14:46)

Topic: How to include top of punBB forum ?

Hi all (sorry for my english I'm french) !

I have a server and I have my punBB forum in the folder "forum".
But my site is in the parent folder, and I don't know how to include the top of the forum in the top of my website's pages.
I also want include the CSS of the forum to create pages with the punBB design !

If you can understand my message, can you help me ?

Thanks !

--Staline

Re: How to include top of punBB forum ?

To access the forums folder from the parent folder, use forums/

To access the parent folder from the forums folder, use ../

Re: How to include top of punBB forum ?

you could move your forum into the folder your site is in?

or you could include punbbs common.php by defining PUN_ROOT as ./forums/ then use $pun_user['style'] for the name of the users style...

if you need more detailed instructions just ask wink

4 (edited by Staline 2005-07-03 10:12)

Re: How to include top of punBB forum ?

Tanks, but, I don' know how to include user's CSS in my website...
I must add

echo <link rel="stylesheet" media="screen" type="text/css" title="Punbb style" href="$pun_user['style']" />

to get the CSS style ?

Re: How to include top of punBB forum ?

Well, after hours and hours of fight with punBB, I cannot include this _____ top of page !

<?php
define('PUN_ROOT', './forums/');
require PUN_ROOT.'include/common.php';
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
include(PUN_ROOT.'header.php');
include(PUN_ROOT.'footer.php');

Re: How to include top of punBB forum ?

i don't think that will work properly but you should get something.. what error does it give?

Re: How to include top of punBB forum ?

Nothing ! There are no CSS Style !

8 (edited by Holmen 2005-07-09 16:56)

Re: How to include top of punBB forum ?

I'm actually trying to do the exact same thing...
I've installed punBB into "./forums"
and I think I know what the problem is...though I haven't found any solution to it as of yet.

1.
My index.php looks like this:

<?php

//From punBB
define('PUN_ROOT', './forums/');
require PUN_ROOT.'include/common.php';
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);

//From punBB
require PUN_ROOT.'header.php';

//From punBB
require PUN_ROOT.'footer.php';

?>

When I now view page source I noticed that PUN_ROOT doesn't really work. First proof is the link to stylesheet:

<link rel="stylesheet" type="text/css" href="style/Oxygen.css" />

I copied the source to a new page and added the complete link to the stylesheet "forums/style/Oxygen.css"
and that gave me a nice page with styles.

Second thing that doesn't work are thoose links in the navbar..."./forums" isn't added to thoose either.

Re: How to include top of punBB forum ?

Pheraps copy the style's folder in the root folder ?

10 (edited by Holmen 2005-07-09 19:54)

Re: How to include top of punBB forum ?

Staline wrote:

Pheraps copy the style's folder in the root folder ?

That would just solve the first error later on with more styles installed will give you similiar errors and you need to add thoose to the root-folder.
I'm playing EVE at the moment but will try to solve the problem tomorrow if not tonight.

btw the navbar links-problem would not be solved with just copying the styles.


--- EDIT ---
I'm in the process of adding "PUN_ROOT" whereever it is needed(currently in header.php), perhaps it's not written to be used like this but I don't know atm.

Ok, I have now successfully got my own index.php and the header, announcement(if set) and footer.php added to my index.php...

To rickard: Perhaps this could be added to the release as standard?

Changes to header.php
 - Added '.PUN_ROOT.' to links on following lines 165, 168, 172(2 links on this line)
 - Removed line 65 and replaced it with: <?php echo '<link rel="stylesheet" type="text/css" href="'.PUN_ROOT.'style/'.$pun_user['style'].'.css" />' ?>
 
Changes to include/functions.php
 - Added '.PUN_ROOT.' to links on following lines 235, 236, 239, 244, 246, 247, 256, 258, 259, 263 - 266
 *BE AWARE* Additional navlinks(added thru options do not need PUN_ROOT because they will have a link relative to server-root *BE AWARE*

I think that were all links that needed a fix, please Rickard if this affects anything else I should be aware of reply here.

///
Christoffer "Holmen" Holmstedt

Re: How to include top of punBB forum ?

Well, thank you !
I'm gonna work on this next day !

Re: How to include top of punBB forum ?

Holmen: There's no need. In 1.3, PunBB outputs a <base> tag that sets the base URL for all style sheets, images etc. That should solve the problem.

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

13

Re: How to include top of punBB forum ?

Then just wait for 1.3 big_smile