Hej
I have a lot of banners of my page, which are coded into my ubbt_footer.tmpl file. Sometimes they are flashing which is very annoying when reading posts. To avoid this, I added some new footer php code into my ubbt.inc.php file, so I can switch off the annoying banners when reading posts, without changing the footer file in every forum. Heres how to do.
Open your ubbt.inc.php file and find the send_footer function.
// #######################################################################
// Send the footer
// #######################################################################
function send_footer() {
global $config, $theme, $thispath, $VERSION, $ubbt_lang, $tempstyle, $timea,$querycount,$zlib,$fheader,$Board;
if ($config['privacy']) {
$template['privacy_statement'] = " | <a href=\"{$config['phpurl']}/viewprivacy.php\">{$ubbt_lang['PRIVACY']}</a>";
}
if ($config['debug']) {
$timeb = getmicrotime();
$time = $timeb - $timea;
$time = round($time,3);
$debug = "<p align=\"center\" class=\"small\">Generated in $time seconds. $querycount queries. $zlib</p>";
}
if ($fheader) {
$file = "footer_$Board.php";
}
else {
$file = "footer.php";
}
$insert = @file("{$config['path']}/includes/$file");
if (!is_array($insert)) {
$insert = @file("{$config['phpurl']}/includes/$file");
}
if ($insert) {
$footerfile = implode('',$insert);
}
$test = @include("$thispath/templates/$tempstyle/ubbt_footer.tmpl");
if (!$test) {
@include("{$config['path']}/includes/$file");
}
}
Then create a new footer file and name it : ubbt_newfooter.tmpl and upload it into your tmpl. directory. Then add the following code into your ubbt.inc.php file,right after the above send_footer function.
// ######################################################################
// Send new footer - af Arentzen
// ######################################################################
function send_new_footer() {
global $config, $theme, $thispath, $VERSION, $ubbt_lang, $tempstyle, $timea,$querycount,$zlib,$fheader,$Board;
if ($fheader) {
$file = "footer_$Board.php";
}
else {
$file = "footer.php";
}
$insert = @file("{$config['path']}/includes/$file");
if (!is_array($insert)) {
$insert = @file("{$config['phpurl']}/includes/$file");
}
if ($insert) {
$footerfile = implode('',$insert);
}
$new_footer = @include("$thispath/templates/$tempstyle/ubbt_newfooter.tmpl");
if (!$new_footer) {
@include("$thispath/templates/$tempstyle/ubbt_footer.tmpl");
}
}
Then open showflat.php and showthreaded.php, and go to the bottom and find the code:
Edit the code to:
$html -> send_new_footer();
And voila! you can now read posts with your new footer file! If you want the new footer on more pages, simply open your php.files and add the code.