Topic: parsing PunBB into a page.

OK my site is at http://kafene.org/.

As you can see, each page has a consistent design, except the forum. What I want to do is make it so that the forum goes in the right side like everything else. Each page is parsed into the main div (the right side) depending on which page is requested.

Here is the part where it needs to be parsed:

<div id="main">

<?php
if ($url == copyright){
    include "lic.php"; }
elseif ($url == atkafene) {
    include "atkaf.php"; }
elseif ($url == contact) {
    include "contact.php"; }
elseif ($url=="propaganda") {
    include "prop.php"; }
elseif ($url=="forum") {
    include "forum.php"; }
elseif ($url=="todo") {
    include "todo.php"; }
elseif ($url=="blog") {
    include "blog.php"; }
elseif ($url=="main") {
    include "main.php"; }
elseif ($url=="") {
    include "main.php"; }
else {
    echo "That is not a valid location!"; }
?>

</div>

If anyone has any tips on stripping down the punbb source or something, please let me know. If you need the full page source, I can give that too, but it's a little big so i wont post it yet.

Thanks.

2

Re: parsing PunBB into a page.

I use "module" instead "url".

If your people come crazy, you will not need to your mind any more.

3

Re: parsing PunBB into a page.

Your code is shit man.... if ($var == sdasdasd) ... NO! if assdads is a string, then surround it in fucking quotes! There are so many second rate PHP coders out there... learn how to fucking code!

4 (edited by mcovey 2004-08-16 18:08)

Re: parsing PunBB into a page.

bob wrote:

Your code is shit man.... if ($var == sdasdasd) ... NO! if assdads is a string, then surround it in fucking quotes! There are so many second rate PHP coders out there... learn how to fucking code!


I started learning PHP a week ago, and I copy and pasted that code from an example and modified it. Honestly, it parses perfectly on my personal website, so I dont care if the code isnt perfect. So excuse me.

You know, there are a lot off arrogant programmers out there who think that because they can write good code, that somehow makes them better than everyone else. I write for pleasure, and a personal website. My job is not to code. My real interest is lingustics, anyways; the PHP is for convenience.

A question: do you get this mad at people who use <? ?> or <% %> for their code? I mean... it's not the standard!

5

Re: parsing PunBB into a page.

mcovey: I'm no php expert myself but I can't see how your idea would work with PunBB. My reasoning is that PunBB produces entire web pages not just chunks of xhtml which could be incorporated into an existing page. By far the easiest way to achieve the result you want would be to edit the template file main.tpl to include the relevant portions of your website. In other words, instead of including bits of PunBB in your website you would include bits of your website in PunBB. A way of starting off would be to take a copy of your index page, wipe out the content in the right column and then include the relevant bits from main.tpl. Now save that file as main.tpl and place it back in PunBB's directory. You will of course have to do a certain amount of playing around with information in the document head.

6

Re: parsing PunBB into a page.

bob wrote:

Your code is shit man.... if ($var == sdasdasd) ... NO! if assdads is a string, then surround it in fucking quotes! There are so many second rate PHP coders out there... learn how to fucking code!

There are so many second rate intellects out there; unable to express an opinion intelligently without recourse to expletives.

Re: parsing PunBB into a page.

Paul wrote:

mcovey: I'm no php expert myself but I can't see how your idea would work with PunBB. My reasoning is that PunBB produces entire web pages not just chunks of xhtml which could be incorporated into an existing page. By far the easiest way to achieve the result you want would be to edit the template file main.tpl to include the relevant portions of your website. In other words, instead of including bits of PunBB in your website you would include bits of your website in PunBB. A way of starting off would be to take a copy of your index page, wipe out the content in the right column and then include the relevant bits from main.tpl. Now save that file as main.tpl and place it back in PunBB's directory. You will of course have to do a certain amount of playing around with information in the document head.

actually I got punbb to go into the page, but I had to open a huge security hole. I had it so that any page that the URL variable was given to would work. So I could do index.php?url=http://kafene.org/forum, which worked, and so forth. But the problem is that someone could do index.php?url=http://hackerswebsite.com/malicious/script and screw up my page.

Is there any way to protect myself from this, by letting only pages on my domain be parsed into the page, for example?

Re: parsing PunBB into a page.

Settle down bob.

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

Re: parsing PunBB into a page.

How did you set about doing that mcovey? Using an iframe with source set by the url?

An Iframe isn't the way to go about it, you can get some good results using one but as far as I know when a site in an iframe jumps to an anchor it just moves the site inside the iframe and not the site inclusing it.

10

Re: parsing PunBB into a page.

Maybe it's possible to take all a forum with RSS ? no ? (and in this case, your forum will still /forum but resultats could be displayed in forum.php) ?

This solution is for me the best : I don't want people change repertory ...