I was experimenting with phpBB3 and I was looking for hacks that would insert google adsense.
There are some hacks out there but I want to show you how I did it.


Take note that phpBB3 is in beta version, both the phpBB3 team and monmonja.com will
not be held responsible for any damage or injury that this hack might result into.
Use it at your own risk.

To insert your adsense code after the first post of every page:

  1. Open viewtopic.php
  2. Search for the line:unset($attachments[$row['post_id']]);
  3. Insert this after that line


    if($i == 0){
    $postrow = array(
    'POST_AUTHOR_FULL' => "Google Ads",
    'POST_AUTHOR' => "Google Ads",
    'U_POST_AUTHOR' => "Google Ads",
    'POST_DATE' => $user->format_date(time()),
    'POST_SUBJECT' => "Advertisement",
    'MESSAGE' => 'YOUR GOOGLE ADSENSE CODE',
    'S_POST_UNAPPROVED' => false,
    );
    $template->assign_block_vars('postrow', $postrow);
    };

To insert at the top of every post (This does not invalidate the terms of google adsense)

  1. Go to Styles Folder
  2. Go to subSilver (the default folder)
  3. Go to template folder
  4. Open the file viewtopic_body.html
  5. Insert your adsense code at line 2

Example site at http://monmonja.com/forum/viewtopic.php?f=2&t=3
http://forum.monmonja.com/viewtopic.php?f=7&t=32

Share and Enjoy:
  • Digg
  • Reddit
  • Slashdot
  • del.icio.us
  • StumbleUpon
  • TwitThis
  • Fark
  • Facebook
  • Technorati
  • Sphinn
  • Furl
  • Google
  • Mixx