Topic: Possible conflict between phpadsnew and punBB

Using local invocation code, my banner won't show when coupled with my punBB forum (http://pcfred.teddypokerdeals.com/tpd/forum/index.php).  Same code work's well  on my portal (http://pcfred.teddypokerdeals.com/tpd/index.php) and in the tpd/forum when I retire the punBB code of the html.

Here's the phpadsnew invocation code in question:

<?php
                if (@include(getenv('DOCUMENT_ROOT').'/tpd/adserver/phpadsnew.inc.php')) {
                if (!isset($phpAds_context)) $phpAds_context = array();
                $phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
                echo $phpAds_raw['html'];
                }
?>

Does it have something to do with 'document_root'?
-

A new poker community is rising : see for yourselft at unbluffed.com

Re: Possible conflict between phpadsnew and punBB

If you want to test, remove the @ before the include and see if you get a warning smile

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: Possible conflict between phpadsnew and punBB

I tried to remove the @
Did not get any warning.... 

Does this thing have something to do with the punBB templates ?

A new poker community is rising : see for yourselft at unbluffed.com

4 (edited by Smartys 2006-03-28 02:49)

Re: Possible conflict between phpadsnew and punBB

Looking at your HTML, I now see the problem

        <div id="adserver">
            <?php
                if (include(getenv('DOCUMENT_ROOT').'/tpd/adserver/phpadsnew.inc.php')) {
                if (!isset($phpAds_context)) $phpAds_context = array();
                $phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
                echo $phpAds_raw['html'];
                }
            ?>

        </div>

PHP is not allowed directly in the templates. You'll want to look at this
Edit: Silly messed up BBCode

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

5 (edited by freddykgb 2006-03-28 01:53)

Re: Possible conflict between phpadsnew and punBB

The code you were looking at has been added to an external html page wich is then called into the main.tpl file. To resume my integration :

I called
<tpd_header> in main.tpl

Then I add in header.php
// START SUBST - <tpd_header>
    $tpl_temp = file_get_contents('../tpd_header.php');
    $tpl_main = str_replace('<tpd_header>', $tpl_temp, $tpl_main);
// END SUBST - <tpd_header>

It works well except the phpadsnew invocation code included in 'tpd_header.php' is failing to show the banner.

A new poker community is rising : see for yourselft at unbluffed.com

Re: Possible conflict between phpadsnew and punBB

That wasn't my suggestion tongue
My suggestion was to follow the FAQ entry and use <pun_include>. And your HTML still looks like this:

        <div id="adserver">
<?php
    if (@include(getenv('DOCUMENT_ROOT').'/tpd/adserver/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
        echo $phpAds_raw['html'];
    }
?>


        </div>
http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: Possible conflict between phpadsnew and punBB

Alright!  wink

But do you mean save this code as html and call it back later with pun_include ?

A new poker community is rising : see for yourselft at unbluffed.com

Re: Possible conflict between phpadsnew and punBB

No, read what it says tongue
You're showing me PHP, it can't be saved as HTML and expected to work smile

OK, I'm going to walk you through the steps:
- Save the PHP as ads.php
- Put it in include/user in the forum directory
- Put <pun_include "ads.php"> in the template where you want the ads tongue

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

9 (edited by freddykgb 2006-03-30 23:53)

Re: Possible conflict between phpadsnew and punBB

Woaaaaaaaaaa
Big thanks to you smartys! Works fine.  Sorry for making you repeat but i'm was not familiar with the pun_include fonction.  Now I am! big_smile

See results at http://pcfred.teddypokerdeals.com/tpd/forum/index.php
or later : http://www.teddypokerdeals.com/forum/

A new poker community is rising : see for yourselft at unbluffed.com