Topic: Seeking help integrating into an HTML/.php site

Okay trying this again! My first post didn't make it to the board somehow.

I have a site written in html, with a .php header & footer to it. (http://www.hallofdivinity.net if you want to see what I'm working with, here.) I'd like to get the messageboards into that main content area (it's in a table, if that matters) with the parchment colored background behind them.

Now, I know nothing about this messageboard system but what I have read here - I've searched extensively through the integration area trying to find some pointers on this. And most of it has confused me more, unfortunately - I don't know all the jargon used here relating to the board parts & programming.

I saw that many times people were directed to the FAQ that came with the download, so I read there. I found the section "3.3 - How do I add my own footer/header so that I can integrate my forums into design of the rest of my website? " and that sounded like exactly what I needed to know! But... while it points me to the files I'd need to edit, it doesn't explain what parts of them to edit, or how! I looked into the main.tpl file and I see there <pun_head> and <pun_footer>. My first guess would be to edit these, but how?

I tried adding my own info like a value. i.e. <pun_head="http://www.hallofdivinity.net/header.php"> but all that did was remove everything from the page but the text. Do I replace that whole thing with my info? What do I edit and what info do I plug in there in it's place? (I know you don't know all my file names but I mean in general terms...) I am so lost! lol!

I'm very new to all this, and I need some very basic, baby-steps type advice here. It took me three tries to install this and get it working properly, so I am really hesitant to go in and just start fiddling with things in the program files that I don't understand. If anyone can please help shed some light on this for me I would be ever so grateful!

Thank you very, very much in advance for any help anyone can offer with this!!

Re: Seeking help integrating into an HTML/.php site

I don't know if this will help you but it will clear some stuff up.

The <pun_header> and stuff you see in main.tpl are replaced with code in subsets in header.php (using string replace)

Re: Seeking help integrating into an HTML/.php site

Hmm, so should I replace the header.php & footer.php files with my own header & footer?

Re: Seeking help integrating into an HTML/.php site

No because that can really mess up your board.

Edit your header and footer but keep the important punb stuff

Re: Seeking help integrating into an HTML/.php site

you can include your own header and footer via main.tpl  see http://punbb.org/docs/faq.html#faq3_4

Re: Seeking help integrating into an HTML/.php site

Thank you, shinko. And thank you, Connorhd... I read this already:

3.3 - How do I add my own footer/header so that I can integrate my forums into design of the rest of my website?
For this purpose, PunBB has a simple template system. The template files are located in include/template/. There are five templates - main.tpl, admin.tpl, help.tpl, maintenance.tpl and redirect.tpl. The file main.tpl contains the template for almost all pages that are displayed in the forum, admin.tpl is the template for the admin interface, help.php is for the help screen, maintenance.tpl is the template for the message page that is displayed when the forum is put in maintenance mode, and finally the file redirect.tpl is used to display the redirect pages e.g. when logging in or when posting a message.
The templates contain variables that are replaced with actual content when a page is displayed. All variables in PunBB are enclosed in less-than and more-than signs (< and >). For example, the variable for the title of the forums is called <pun_title>. When PunBB displays the index page, it reads the file main.tpl and replaces <pun_title> with the title of the forums. There are 11 replacement variables in main.tpl.
If you want to customize the look of PunBB so that it fits the design of other pages on your website, it is primarily the template files you should edit. For example, if you wanted to add your own logo at the top of all forum pages, you would edit main.tpl and add markup for displaying your logo at the appropriate position in the file. It is possible to include PHP scripts from the templates. See the next FAQ entry for more info on that.
3.4 - Is it possible to include my own PHP scripts in the templates?
Yes. PunBB has a special replacement variable called pun_include for including scripts in the templates. For example, if you wanted to include a script called banner.php (located in the forum root directory) at the bottom of all forum pages, you would add the following to your template files:
<pun_include "banner.php">The path to banner.php is relative to the forum root directory. PunBB will execute the script and the pun_include variable will be replaced by any output that the script produces. Please note that all included scripts have access to the PunBB variables, so if you e.g. wanted to access the database, you could use the $db object just like the rest of PunBB does. Replacement of the pun_include variable is the last thing that PunBB does when it outputs a page, so you don't have to worry about not using variable names that PunBB uses.

But as I said in my initial post is I have no idea what this means as it explains what to change but not HOW to change it, or what to change it to. Additionally I don't want to include a "script". I want to intagrate the board into the main content area of the webpage linked above. Are they talking about a traditional script or does this refer to any file as a "script"... either way this does not tell me how to handle a footer or header file. If you could explain what you directed me to that would be extremely helpful and I would be very appreciative!

(I asked above about replacing the header & footer of punBB with my own header & footer; Shinko let me know this would mess up the whole board... but this sounds like that is exactly what it's saying to do... the banner.php they used the include tag with is in the forum root directory... how can this be right for what I'm trying to do? I don't understand.)

If you want to customize the look of PunBB so that it fits the design of other pages on your website, it is primarily the template files you should edit. For example, if you wanted to add your own logo at the top of all forum pages, you would edit main.tpl and add markup for displaying your logo at the appropriate position in the file.

This is something I really think would be helpful if someone could please explain it... add what kind of markup? What is the appropriate position? I don't understand the punBB system so I can't determine on my own where the appropriate area would be to add things... or how to add them. Just add regular HTML tags? Or what?

Butr my main need is, as I said before, just to figure out how to get my header & footer around the board... in "baby-steps"; I need help understanding with some explanations. Again any helpful insight someone can provide will be MOST appreciated!!! Thank you again!

Re: Seeking help integrating into an HTML/.php site

you can edit main.tpl it is just HTML thats all, the <pun_main> bits are replaced by punbb so leave them alone, just add your header and footer around them.

Scripts are php code you might want to include if your header and footer change, but if not just add the html to main.tpl.

Make a backup and use trial and error wink

Re: Seeking help integrating into an HTML/.php site

Ahhhh! So I have to add the entire piece that will do the header and footer, I don't actually change anything already there? Just like I did for all my regular pages? This will make it tons easier and not so complicated!

I will do this like you suggest by doing a backup first. That takes some of the stress of screwing the entire thing up off me, hehe. (I'd have thought of that... eventually... tongue)

Thank you thank you for this info; I so appreciate it! Cross your fingers for me that this will work and I'll be out of your hair! smile

Re: Seeking help integrating into an HTML/.php site

Ugh.

So far the best I can do is when using the <pun_include> and supplying the path to my own header & footer, I get this at the top of my page:

Warning: main(./http://www.hallofdivinity.net/header.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(./http://www.hallofdivinity.net/header.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(): Failed opening './http://www.hallofdivinity.net/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/divinity/public_html/forums/footer.php on line 146

and this at the bottom:

Warning: main(./http://www.hallofdivinity.net/footer.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(./http://www.hallofdivinity.net/footer.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(): Failed opening './http://www.hallofdivinity.net/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/divinity/public_html/forums/footer.php on line 146

Now what am I doing wrong? I've tried putting it in different spots in relation to all the normal data in the main.tpl file but this is as far as I get. I don't understand why it's looking for a file in the path the "/home/divinity/public_html/forums/footer.php" when I'm specifying it to look in the root directory... do I just have my stuff in the wrong place?

Using the normal php tags like on the rest of my pages didn't do anything, so I tried using the include tags. Do I need to change the wording? I have it worded like this:

<pun_include "http://www.hallofdivinity.net/header.php"> and <pun_include "http://www.hallofdivinity.net/footer.php">

Again, any help is very much appreciated!!! Thank you!

Re: Seeking help integrating into an HTML/.php site

I have also now tried copying & pasting my whole header & footer files into new files, naming them "header2.php" and "footer2.php", and putting them in the /forums folder this thing wants to keep looking in. Also I tried changing the include tags to the following:

<pun_include /home/divinity/public_html/forums/header2.php> and <pun_include /home/divinity/public_html/forums/footer2.php>

since the errors kept wanting to look in a path like this. I still get the same errors however:

Warning: main(./home/divinity/public_html/forums/header2.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(./home/divinity/public_html/forums/header2.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(): Failed opening './home/divinity/public_html/forums/header2.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/divinity/public_html/forums/footer.php on line 146

and

Warning: main(./home/divinity/public_html/forums/footer2.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(./home/divinity/public_html/forums/footer2.php): failed to open stream: No such file or directory in /home/divinity/public_html/forums/footer.php on line 146

Warning: main(): Failed opening './home/divinity/public_html/forums/footer2.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/divinity/public_html/forums/footer.php on line 146

Re: Seeking help integrating into an HTML/.php site

Finally! I think I got this right! I just copied & pasted the html from my header & footer into the .tpl files and voila! It fit right in.

Also had to go and change a teeny bit of info in the style/imports .css files so the background of the page would be black to match the table backgrounds, but that was not so crazy to figure out.

Thank you both again for your help and your patience with this, I really and truly appreciate it!