Skip to:

Re: How to insert ads other than google ads

i downloaded the plugins ADSENSE FOR BBPRESS and GOOGLE ADSENSE CONFIGURATION. The former gives an option to insert codes but when i put in my OpenX code nothing shows up. The latter, however, displays my OpenX ads, only problem is it shows up in the footer when i want it in the header and between posts. i tried inserting the html codes directly in my themes but it shows as html codes and not as an ad. am i doing something wrong? please let me know.

Also, can any of you please help me configure it to not only show up in the footer? here’s the coding for that plugin:



Plugin Name: Simple Google Adsense

Plugin URI:

Description: Add Google Adsense code in your bbPress forum, in the footer :) All users are welcome to improve on it :p

Author: Frédéric Petit

Author URI:

Version: 0.2

License: CC-GNU-GPL


add_action(‘bb_admin_menu_generator’, ‘bb_gad_configuration_page_add’);

add_action(‘bb_admin-header.php’, ‘bb_gad_configuration_page_process’);

function bb_gad_configuration_page_add() {

bb_admin_add_submenu(__(‘Google Adsense Configuration’), ‘use_keys’, ‘bb_gad_configurtion_page’);


function bb_gad_configurtion_page(){?>

<h2><?php _e(‘Google Adsense Configuration’); ?></h2>

<form class=”options” method=”post” action=””>


<label for=”ga_key”>

<?php _e(‘Google Adsense User Id:’) ?>



<textarea class=”text” name=”ga_key” id=”ga_key” value=”<?php bb_form_option(‘ga_key’); ?>” ></textarea>

<?php _e(‘Put your adsense code, without the code of the script’); ?>




<?php bb_nonce_field( ‘ga-configuration’ ); ?>

<input type=”hidden” name=”action” id=”action” value=”update-ga-configuration” />

<div class=”spacer”>

<input type=”submit” name=”submit” id=”submit” value=”<?php _e(‘Update Configuration »’) ?>” />






function bb_gad_configuration_page_process() {

if ($_POST == ‘update-ga-configuration’) {


if ($_POST) {

$value = stripslashes_deep( trim( $_POST ) );

if ($value) {

bb_update_option(‘ga_key’, $value);

} else {

bb_delete_option(‘ga_key’ );


} else {



$goback = add_query_arg(‘ga-updated’, ‘true’, wp_get_referer());



if ($_GET) {

bb_admin_notice( __(‘Configuration saved.’) );



// Bail here if no key is set

if (!bb_get_option( ‘ga_key’ ))


function createGAdCode($accountId) {

$code .= ‘<div class=’bbpress_adsense’>’ . “n”;

$code .= ‘ ‘ . $accountId . ‘ ‘ . “n”;

$code .= ‘<script type=’text/javascript’ src=’’></script>&#8217; . “n”;

$code .= ‘</div>’ . “n”;

return $code;


function insertGAdCode() {

$accountId = bb_get_option(‘ga_key’);

if ($accountId != ”) {

echo createGAdCode($accountId);



add_action(‘bb_foot’, ‘insertGAdCode’);


Skip to toolbar