Topic: Customize forums

Hello all ....I just got my punbb forums up and running on my site over the weekend. and i have been looking at how people have added banners and images to the background of the set. I am looking to ad the banner of the home page to the top of the forums to keep the forums themed with the whole site, but not sure on how to edit the php. is there any documentation on mods?

2

Re: Customize forums

Look in /include/template/main.tpl to add a banner.

Re: Customize forums

I used Dreamweaver to modify main.tpl. Very easy. I just dropped the php includes into my pre-existing template for my site and it was done. (I did have to change the background color in the CSS file, though.) Very simple modification was one of the main reasons I decided to go with punBB.

Do you love physics? :) http://www.ilovephysics.com
Interested in Internet Marketing? http://www.keyliberty.com

4 (edited by andy1974 2004-10-11 21:23)

Re: Customize forums

i opened /include/template/main.tpl to add a banner. but it was blank... i just dont want to crash the thing

Re: Customize forums

Sorry, there aren't php includes in the template file. PunBB uses special tags in the template file. Main.tpl shouldn't be empty. It may appear that way in a WYSIWYG editor like dreamweaver.

Here is what my main.tpl file looks like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<pun_head>
</head>

<body bgcolor="#000066">
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><img src="http://ilovephysics.com/images/header.gif" width="740" height="95" border="0"></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"><img src="http://ilovephysics.com/images/menu.gif" width="740" height="30" border="0" usemap="#Map"> 
      <map name="Map" id="Map"><area shape="rect" coords="119,0,190,21" href="http://www.ilovephysics.com/forum" />
        <area shape="rect" coords="49,1,103,21" href="http://www.ilovephysics.com" />
      </map>
    </td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> <table align="CENTER" width="95%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td> <table class="punmain" cellspacing="1" cellpadding="4">
              <tr class="punhead"> 
                <td class="punhead"> <span class="puntitle"><pun_title></span><br> 
                  <pun_desc> </td>
              </tr>
              <tr> 
                <td class="puncon1"> <pun_navlinks><br> <br> <pun_status> </td>
              </tr>
            </table>
            <pun_announcement> <pun_main> <pun_footer> </td>
        </tr>
      </table>
      <p> </p></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"><img src="http://ilovephysics.com/images/footer.gif" width="740" height="25" border="0"></td>
  </tr>
</table>
</body>
</html>

The important part (no specific to my site) is:

<table class="punmain" cellspacing="1" cellpadding="4">
              <tr class="punhead"> 
                <td class="punhead"> <span class="puntitle"><pun_title></span><br> 
                  <pun_desc> </td>
              </tr>
              <tr> 
                <td class="puncon1"> <pun_navlinks><br> <br> <pun_status> </td>
              </tr>
            </table>
            <pun_announcement> <pun_main> <pun_footer> </td>
        </tr>
      </table>
Do you love physics? :) http://www.ilovephysics.com
Interested in Internet Marketing? http://www.keyliberty.com

6

Re: Customize forums

Topic moved here from "Show Off".

Re: Customize forums

jchristophm wrote:

Sorry, there aren't php includes in the template file.

Not sure what you mean. You can include PHP scripts from within the template (with <pun_include "file.php">).

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

Re: Customize forums

I meant that the template file doesn't use php includes to include the forum. The tpl file has tags like <pun_title>, <pun_main>, <pun_footer> etc.

My original post I said I dropped the php includes into my site template. I actually dropped in the tags.

Do you love physics? :) http://www.ilovephysics.com
Interested in Internet Marketing? http://www.keyliberty.com

Re: Customize forums

Ah, ok. My mistake.

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

Re: Customize forums

so what do i use to edit that main.tpl file?

11

Re: Customize forums

andy1974 wrote:

so what do i use to edit that main.tpl file?

Whatever you would normally use to edit html or text files. Notepad is fine. Just think of main.tpl as a basic web page with a few funny tags in it.

12 (edited by andy1974 2004-10-13 13:58)

Re: Customize forums

I was able to open the main.tpl with dreamweaver and add the banner to the top.....but its difficult to know where things really go ...i see the code if I set the screen on split half design and half code. but there are other things like changing the background color. I am not firmilar with code i am a gui guy .......yea yea ...i know what your gonna say....LEARN IT....lol....is there a better gui editor that i could use that would show how it looks, as i customize it??

Re: Customize forums

Dreamweaver is the best I know of! Though, if you open the template file in dreamweaver you shouldn't see anything. Because there is nothing to see. The default template is just a table with the "funny tags" in it. Dreamweaver doesn't know what to do with those funny tags, so it doesn't show them. It would look the same in any WYSIWYG editor.

What I did, as you can see from the code in my post above, is make a four row table: 1 row for the header, 1 row for the menu, 1 row for the content, and 1 row for the footer. I cut and pasted the "funny tags" into the content row.

As far as changing the background color, you was to edit the CSS file. I just set the background color in the template file. It looked great in Dreamweaver, but when I posted it, the BG color was not what I wanted. PunBB actually calls the CSS stylesheet to get the BG color, and this overrides what I set in the template file. So I just changed the BG color in the Oxygen.CSS. I left the other style sheets alone. Some users like them. They don't go with the theme of the site, but hey, I don't like being a dictator.

Do you love physics? :) http://www.ilovephysics.com
Interested in Internet Marketing? http://www.keyliberty.com

Re: Customize forums

ok got it thanks for you help....i am still learning and apreciate the help from you.

Re: Customize forums

A little word of warning regarding Dreamweaver and the templates. DW doesn't quite like the row <body<pun_body>>. It has a tendency to remove one of the two >'s at the end. If it does, just re-add it manually.

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

Re: Customize forums

i will keep that in mind thanks