Thanks for the code. Unfortunately, I still cannot get it to display. Here is my full code:
<?php
/**
* @author Steven | www.phreakyourgeek.com
* @contact [email protected]
* @copyright 2009
* @software MyBB
*/
if(!defined("IN_MYBB"))
{
die('You cannot directly access this file. To use, activate the "Custom Footer" plugin from the MyBB admin panel.');
}
$plugins->add_hook("global_end", "customfooter_execute");
function customfooter_info()
{
return array(
'name' => 'Custom Footer',
'description' => 'Adds a custom footer to the forum.',
'website' => 'http://www.phreakyourgeek.com/',
'author' => 'Steven',
'authorsite' => 'http://www.phreakyourgeek.com/info.php',
'version' => '1.0.0',
'compatibility' => '14*'
);
}
function customfooter_activate()
{
global $db;
$settings_group = array(
'gid' => null,
'name' => 'customfooter',
'title' => 'Custom Footer Settings',
'description' => 'This section allows you to manage the settings for your custom footer',
'disporder' => '1',
'isdefault' => 'no'
);
$db->insert_query('settinggroups',$settings_group);
$gid = $db->insert_id();
$setting_1 = array(
'sid' => null,
'name' => 'customfooterenable',
'title' => 'Enabled',
'description' => 'Enable the custom footer?',
'optionscode' => 'yesno',
'value' => 'yes',
'disporder' => '1',
'gid' => intval($gid)
);
$db->insert_query('settings',$setting_1);
$setting_2 = array(
'sid' => null,
'name' => 'customfootercode',
'title' => 'Code',
'description' => 'Enter the HTML code for the footer.',
'optionscode' => 'textarea',
'value' => '',
'disporder' => '2',
'gid' => intval($gid)
);
$db->insert_query('settings',$setting_2);
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets('footer', '#{\$auto_dst_detection}#', "{\$auto_dst_detection}\n{\$customfooter}");
$template_1 = array(
'tid' => null,
'title' => 'custom_footer',
'template' => "<div style=\"width:100%;text-align:center;\" class=\"smalltext\">{\$customfootercode}</div>",
'sid' => '-1'
);
$db->insert_query('templates',$template_1);
rebuildsettings();
}
function customfooter_deactivate()
{
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='customfooter'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='customfooterenable'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='customfootercode'");
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='custom_footer'");
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets('footer', '#(\n?){\$custom_footer}#', '', 0);
rebuildsettings();
}
/** END CONFIGURATION FUNCTIONS **/
function customfooter_execute()
{
global $mybb, $theme, $customfooter, $templates;
$customfootercode = '';
if($mybb->settings['customfooterenable'] == 1)
{
$customfootercode = $mybb->settings['customfootercode'];
eval("\$customfooter = \"".$templates->get("custom_footer")."\";");
}
}
?>