php forum
php mysql forum
php mysql smarty
 
Topic Options
#311830 - 10/28/06 06:15 PM 2 different footers in UBB Threads 6.x.x
arentzen Offline
Newbie

Registered: 10/05/06
Posts: 18
Loc: Denmark
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.
Code:
 // ####################################################################### 
  // 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.
Code:
// 	######################################################################
//	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:
Code:
$html -> send_footer(); 

Edit the code to:
Code:
$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.


Edited by arentzen (10/28/06 06:25 PM)
_________________________
Peter Arentzen
trosfrihed.dk

Top
#311840 - 10/30/06 06:52 PM Re: 2 different footers in UBB Threads 6.x.x [Re: arentzen]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25366
Loc: Texas
Cool, thank you for sharing Peter thumbsup
_________________________
- Allen wavey
- What Drives You?

Top


Moderator:  Ian_W 
Top Posters Last 30 Days
AllenAyres 82
Gizmo 29
sirdude 25
Zarzal 23
blaaskaak 12
swebs 6
willing 5
Who's Online
1 Registered (M4D), 34 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
User Authentication Class
by sirdude
Today at 06:11 PM
Multiple Identity Detector
by Myke
Today at 05:45 AM
FlashChat with UBB.Threads 7.0.2
by Gizmo
Today at 12:30 AM
Nice Ajax Chat
by Thelockman
07/06/08 09:07 AM
[7.x] UBB.Post Templates v0.1
by sirdude
07/05/08 12:48 PM
Team UBBDev Rides Again!
by AllenAyres
07/04/08 10:56 PM
[7.3.x] ubb.links
by AllenAyres
07/03/08 06:15 PM
New Mods
Protect users emails
by Basil Fawlty
06/29/08 08:44 AM
[7.3.x] Scheduled board close for backup
by blaaskaak
06/26/08 04:01 AM
[7.3+] CustomTag - Audo Embedding
by Gizmo
06/24/08 07:52 PM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.3] Dissallow quotes more then 3 levels deep
by blaaskaak
06/09/08 09:01 AM
Newest Members
nunny, lpzie, DoubleDutch, ryzilla, M4D
13305 Registered Users

 

 

 
fusionbb message board php hacks