I was not sure which place you are trying to put your global footer, before or after the default footer. Now I think it should be before but inside it. You can try changing the first two functions as follows:
function GHF_Main()
{
// Globalize what you need
global $context, $modSettings;
// Load what you need
// eg. loadLanguage('GHF');
// Add things in header
if (!empty($modSettings['global_head'])) {
$context['html_headers'] .= $modSettings['global_head'];
}
}
function GHF_Mid(&$buffer)
{
// Globalize what you need
global $modSettings, $context;
if (isset($_REQUEST['xml']) || $context['current_action'] == 'printpage') return $buffer;
$ghf = array();
// Description
if(!empty($modSettings['global_mid'])) {
// Insert the global_mid
$ghf_old1 = '<div id="main_content_section"><a id="skipnav"></a>';
$ghf_new1 = '<br /><div>' . $modSettings['global_mid'] . '</div>
<div id="main_content_section"><a id="skipnav"></a>';
$gfh[$ghf_old1] = $ghf_new1;
// Insert the global_foot
$ghf_old2 = '<div id="footer_section"><a id="bot"></a>';
$ghf_new2 = '<div id="footer_section"><a id="bot"></a>
<div>' . $modSettings['global_foot'] . '</div>';
$gfh[$ghf_old2] = $ghf_new2;
// Insert the global_copy
$ghf_old3 = '<li class="copyright">';
$ghf_new3 = '<li class="copyright">' . $modSettings['global_copy'] . '<br />';
$gfh[$ghf_old3] = $ghf_new3;
}
// Now let's change the title, if we're allowed to
return str_replace(array_keys($gfh), array_values($gfh), $buffer);
}
You should now have global footer before but inside the default footer and global copy as well.
I think the best practice would be adding layers. Let's wait for @emanuele 's note for that.