/***********************************************
Emergency Message System (EMS)
Created by Nitemare
http://www.nitemare.ca
beta tested by Jan
Releace date: aug 15th 2008
************************************************/
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.
Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("global_start", "ads_globals");
$plugins->add_hook("admin_config_menu", "ads_nav");
$plugins->add_hook("admin_config_action_handler", "ads_actionhandler");
$plugins->add_hook("admin_load", "ads_admin");
function ads_info()
{
return array(
"name" => "Ad Rotation system",
"description" => "This Pluging will display an ad on the main page from a database",
"website" => "http://nitemare.ca",
"author" => "Nitemare",
"authorsite" => "http://nitemare.ca",
"version" => "5.0.1",
"guid" => "",
"compatibility" => "16*"
);
}
function ads_install(){
global $db;
$db->query("CREATE TABLE `".TABLE_PREFIX."ads` (`aid` int(11) NOT NULL auto_increment,`code` text NOT NULL,`mode` int(11) NOT NULL default '0',`shown` int(11) NOT NULL default '0',`max` int(11) NOT NULL default '0',PRIMARY KEY (`aid`)) ;");
}
function ads_is_installed()
{
global $db;
if($db->table_exists("ads")){
return true;
}
return false;
}
function ads_activate(){
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
find_replace_templatesets(
"footer",
'#'.preg_quote('