Home - AdToll Blog - AdToll Integration Into PHPBB Forums
Create an Account - Log In

AdToll Integration Into PHPBB Forums


February 26th, 2008 by Dan

PHPBB Forum IntegrationWe have a lot of Publishers who use forum software and in particular the very popular PHPBB forum, which is free.

Software like PHPBB is designed in a way so as to extrapolate functional code from the design, known as “templating”. This allows forum owners to easily modify the look and feel of their forum and even use pre-built themes that they can plug in and have running almost instantly.

Occasionally we get an e-mail from a Publisher who is having issues plugging in our ad code; usually reporting an error something like:

Parse error: syntax error, unexpected '}' in /yoursite/includes/template.php(127) : eval()'d code on line 182

This is happening due to the “templating” system that PHPBB uses, which doesn’t like the use of the curly brackets in the TPL (template) file.

This issue is easily solved! Let’s take the following ad code as an example:

<!-- START ADTOLL.COM CODE V1.0 -->
<STYLE>
A.at_adv_here_
3987453, A.at_pow_by_3987453 {font-family: Tahoma,Arial; font-size: 10px; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; color: #5A8C35; text-decoration: none; }
A.at_adv_here_
3987453:hover, A.at_pow_by_3987453:hover { color: #FA880B; text-decoration: underline; }
</STYLE>
<SCRIPT type="text/javascript">
adtoll_see_your_ad_here = 1;
adtoll_your_text = "Advertise here";
adtoll_show_powered_by = 1;
</SCRIPT>
<SCRIPT src="http://adserve.adtoll.com/js/at_ag_3987453.js" type="text/javascript"></SCRIPT>
<!-- END ADTOLL.COM CODE V1.0 -->

Any webmaster with experience in HTML will clearly see the top part of the code contains styles (between the <STYLE> tags) and the bottom part of the code contains the javascript needed to produce the ads.

To get our ads working in PHPPBB all that needs to be done is the styles moved to the CSS file and the javascript into the TPL file. This is demonstrated below.

This code is to be put into the themes CSS file:

A.at_adv_here_3987453, A.at_pow_by_3987453 {font-family: Tahoma,Arial; font-size: 10px; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; color: #5A8C35; text-decoration: none; }
A.at_adv_here_
3987453:hover, A.at_pow_by_3987453:hover { color: #FA880B; text-decoration: underline; }

This code is to be put into the TPL file:

<SCRIPT type="text/javascript">
adtoll_see_your_ad_here = 1;
adtoll_your_text = "Advertise here";
adtoll_show_powered_by = 1;
</SCRIPT>
<SCRIPT src="http://adserve.adtoll.com/js/at_ag_3987453.js" type="text/javascript"></SCRIPT>

It’s actually that easy and it will work every time! This solution not only works for PHPBB but almost any free software designed with a “templating” system.


If you like this post then please consider subscribing to our full feed RSS. You can also subscribe by Email and have new posts sent directly to your inbox.



5 Responses to “AdToll Integration Into PHPBB Forums”

  1. MBS Says:

    Hmm… I have never tried it this way but for the css file, would it not be more correct to remove the tags and just put the CSS code?

  2. admin Says:

    Sorry don’t understand what you are trying to say? I have done this myself and it works perfectly. The styles need to be separated from the script.

    Styles -> go to CSS file
    Javascript -> go to TPL file

  3. MBS Says:

    Oh sorry, I meant to say the STYLE and /STYLE tags but i had them encased and they got removed. Although more than likely the tags would not do anything, I do not think it would be valid css.

  4. admin Says:

    OK yes I see the issue I am fixing the blog entry now!

  5. Josh4444 Says:

    can anyone help me I am confused with this


Leave a Reply


You must be logged in to post a comment.