Navigation

Adding Google Adsense to phpBB3

[nodeinfo|56|body|0.81268400 1199307226][inline_autoadd][image=1]Recently, I have had several readers ask me how to add Google ads to phpBB3 forums. This is actually quite simple:


To add adsense to the header (above the forum topics):


Find the following in overall_header.html

  1. <tr>
  2. <td class="gensmall"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ENDIF --></td>
  3. <td class="gensmall" align="right">{CURRENT_TIME}<br /></td>
  4. </tr>
  5. </table>
  6. </div>



And change it to the following:
  1. <tr>
  2. <td class="gensmall"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ENDIF --></td>
  3. <td class="gensmall" align="right">{CURRENT_TIME}<br /><div align="center">{your google code}</div></td>
  4. </tr>
  5. </table>
  6. </div>



To add adsense to the bottom of your forums, find the following in overall_footer.html:

  1. <div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> {PHPBB_VERSION} &copy; 2002-2006 phpBB Group
  2. </div>



And change it to the following:
  1.   <div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> {PHPBB_VERSION} &copy; 2002-2006 phpBB Group
  2.    <div class="copyright">
  3.                  <br>{YOUR GOOGLE CODE}<br/>
  4.       <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
  5.       <!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
  6.       <!-- IF U_ACP --><br /><strong><a href="{U_ACP}">{L_ACP}</a></strong><!-- ENDIF -->
  7.    </div>
  8. </div>
  9.  
  10. </div>



Please note that in both examples, you need to replace {YOUR GOOGLE CODE} with the Google generated code from the Adsense website.