Well sadly MyBB 1.6 doesn't have any decent ad plugins (that I could find), so I decided to write my own. It is no where near complete, but it will display it just below the header on every page except the AdminCP. I'll work on allowing different types of ads, like right after the first post of a thread, or inside the first post of a thread, etc.
Code:
<?php
/**
* Ads 1.0
* Copyright © 2010 Justin Conner ([email protected])
* Feel free to contact me with any questions, comments, or concerns.
*/
if(!defined("IN_MYBB")) {
die("You cannot access this file directly, try visiting the main site.");
}
$plugins->add_hook("pre_output_page", "display");
function display($page) {
global $mybb;
if($mybb->settings['enabled_ads'] == 1) {
$page = str_replace("<div id=\"content\">", "<div id=\"content\">".$mybb->settings['ad_code']." ", $page);
}
return $page;
}
function ads_info() {
return array(
"name" => "ads",
"description" => "Displays ads, like Google AdSense, on your forums",
"website" => "",
"author" => "Justin Conner",
"authorsite" => "",
"version" => "1.0",
"guid" => "",
"combatibility" => "*"
);
}
function ads_activate() {
global $db;
$ads_group = array(
'gid' => 'NULL',
'name' => 'ads',
'title' => 'Ads',
'description' => 'Settings for the Ads plugin',
'disporder' => '1',
'isdefault' => 'no'
);
$db->insert_query('settinggroups', $ads_group);
$gid = $db->insert_id();
$ads_enable_setting = array(
'sid' => 'NULL',
'name' => 'enabled_ads',
'title' => 'Enable Ads Plugin',
'description' => 'If yes, your ads will be displayed on your site',
'optionscode' => 'yesno',
'value' => '1',
'disporder' => 1,
'gid' => intval($gid)
);
$db->insert_query('settings', $ads_enable_setting);
$ads_adcode_setting = array(
'sid' => 'NULL',
'name' => 'ad_code',
'title' => 'Ad Code',
'description' => 'Code to display your add',
'optionscode' => 'textarea',
'value' => '',
'disporder' => 2,
'gid' => intval($gid)
);
$db->insert_query('settings', $ads_adcode_setting);
rebuild_settings();
}
function ads_deactivate() {
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN ('enabled_ads')");
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='ads'");
rebuild_settings();
}
?>
AdminCP Settings:

Proof it works: