TinyPortal

Development => Docs => Resources => Advanced => Topic started by: Rasyr on January 13, 2006, 11:00:03 PM

Title: [Tip - Code] Adding a static footer block to Tiny Portal - SMF 1.1 RC1 + TP 0.7
Post by: Rasyr on January 13, 2006, 11:00:03 PM
Are you wanting to make it a static footer at the bottom of each and every page?

If so, that is relatively simple.

Open index.template.php and find:


function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

   echo '</td>';

         // TinyPortal integrated bars



Change it to something like the following:


function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

   echo '<table width="100%"cellspacing="0" cellpadding="5" align="center" class="tborder"><tr><td class="windowbg">This is a static footer.</td></tr></table>';

   echo '</td>';

         // TinyPortal integrated bars



Where I have it saying "This is a static footer" is where you would place the banner code. Also, the table cell does not center the content at the moment, so you might want to change that.

If you were wanting something more dynamic, such as creating a block using Edit Blocks withing TPAdmin, then that would be more problematical as TP currently isn't set up to allow for that (Bottom Blocks), though it has been discussed...

The image below shows a screenshot of what the code I gave you looks like in use. Notice that it shows up below the links to additional pages on those pages which have such links (on those without such links, is shows up directly beneath the last element in the center).

[attachment deleted by admin]
Title: Re: [Tip - Code] Adding a static footer block to Tiny Portal - SMF 1.1 RC1 + TP 0.75
Post by: JDMhustle on January 15, 2006, 06:10:34 PM
Thanks for the code and explaining, i wanted this for a while now ;)
I tried to get the banner aligned but without success, i put a align="center" wrapper in the code but i think it's not at it's right place.
<img border="0" align="center" src="http://members.home.nl/inekeleferink/banner1.jpg" width="640" height="85">

My test forum: http://rpm.teamvtec.nl/index.php?action=forum

Any ideas?
Title: Re: [Tip - Code] Adding a static footer block to Tiny Portal - SMF 1.1 RC1 + TP 0.75
Post by: Rasyr on January 15, 2006, 07:04:54 PM
Quote from: JDMhustle on January 15, 2006, 06:10:34 PM
Any ideas?

Yup...

Change:


   echo '<table width="100%"cellspacing="0" cellpadding="5" align="center" class="tborder"><tr><td class="windowbg">This is a static footer.</td></tr></table>';


to


   echo '<table width="100%"cellspacing="0" cellpadding="5" align="center" class="tborder"><tr><td class="windowbg" align="center">This is a static footer.</td></tr></table>';


You will notice that I added align="center" to the TD tag...
Title: Re: [Tip - Code] Adding a static footer block to Tiny Portal - SMF 1.1 RC1 + TP 0.75
Post by: JDMhustle on January 16, 2006, 09:21:56 PM
That did the trick..., thanks ;) what does that TD tag do anyway? everything that is being posted into the frame is centered?
Now for my next question, how do i get the catbg.jpg border on top of the static footer box? ???

Grtzz
Title: Re: [Tip - Code] Adding a static footer block to Tiny Portal - SMF 1.1 RC1 + TP 0.75
Post by: Rasyr on January 16, 2006, 11:08:57 PM
TABLE is the tag that sets the following as part of the table. However, to better format the information in the table, it needs to be divided into rows and columns.

TR is the tag for a table row. Everything between the  TR tags are on a single row.

TD stands for TABLE DATA and it is what represents a specific column within the row. Each row of a table must have the same number of TD tags (unless you have table cells that span more than one cell, but that is more advanced than what we are doing here).

The most basic table must have at least one of each of the above tags, though it can and often does have multiple rows (TR tags) and cells (TD tags).

Each of the tags can also have what is known as "attributes". The align="center" is an attribute. Used in the TABLE tag, it centers the table on the page. Used in the TD tag, it centers the content of the cell within the cell.

Does that make sense?
Title: Re: [Tip - Code] Adding a static footer block to Tiny Portal - SMF 1.1 RC1 + TP 0.75
Post by: Xarcell on January 17, 2006, 06:53:59 PM
Sweet...

I think Bloc is gonna add the feature of puuting blocks in the center below posts/articles in v8. Not sure though. Then you could just banners in there.

From that point, I don't think it'll be long until someone builds a banner module for TP.