Re: Google Adsense
Hi Null, to do that you need to change your template a bit and create a new hook, which is dead easy, and a testament to the flexibility of the event model that underpins both WP&bb.
- Copy
topic.php
frombb-templates
intomy-templates
(you may need to create this folder). - Find the for loop near line 29 – it will read something like this:
<?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>
- Immediately before it (outside the loop, but inside the
<?php
) add the line$need_to_show_ad=true;
- Then change the line
<?php bb_post_template(); ?>
to read<?php bb_post_template(); if ($need_to_show_ad) { do_action('showadvert'); $need_to_show_ad=false; } ?>
- Finally, change the action in the plugin so it fires on your newly created hook
add_action('showadvert', array('bb_adsense','wide_advert'));
… and an admin page? Maybe when bbPress matures!