AdToll Integration Into PHPBB Forums
We 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.


February 27th, 2008 at 9:25 am
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?
February 27th, 2008 at 9:28 am
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
February 28th, 2008 at 6:37 am
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.
February 28th, 2008 at 8:38 am
OK yes I see the issue I am fixing the blog entry now!
March 20th, 2008 at 5:52 am
can anyone help me I am confused with this