TinyPortal

Development => Support => Topic started by: Techdomain on June 23, 2006, 10:52:41 AM

Title: Adding a line to footer or credits
Post by: Techdomain on June 23, 2006, 10:52:41 AM
I am wondering how exactly do you add a line to the footer, below (or above) the

Powered by SMF 1.1 RC2 | SMF ÂÃ,© 2001-2005, Lewis Media   | XHTML | CSS
TinyPortal v0.9.5 ÂÃ,© Bloc | Bz11 design by Bloc | Page created in 0.235 seconds with 23 queries.

bit??
Title: Re: Adding a line to footer or credits
Post by: G6Cad on June 23, 2006, 11:09:26 AM
In your index.template.php file for the theme you want to add more copywrite text to.
About in the middle of the body code you find the copy write text :)
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 23, 2006, 11:21:24 AM
thanks mate :)
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 24, 2006, 01:45:53 AM
I have found the code, but cant seem to place it (and get it to display). I am using a couple of themes, but putting it in /default/index.template.php should do it shouldnt it?

Here is what I am trying to do:

I am trying to add the line at the bottom atm, but it isnt displaying (probably to do with the whole php/html thing...

   

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'right' : 'left', '">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
                           <td valign="middle" align="center" style="white-space: nowrap;" class="smalltext">
                                        ', theme_copyright(), ' <br />', tportal_version() , '
                                </td>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';
// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';
// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}
if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
echo '
// ]]></script>';
}
echo '
</div>


I need to add this line to the above:
<A href="http://http://www.websmartcentral.com/">TechDomain hosted in Australia by WebSmartCentral</A>

if anyone has any ideas or hints - I would love to know!
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 24, 2006, 10:41:21 AM
bump. does anyone know? do I need to add it to ALL the index.template.php files?
Title: Re: Adding a line to footer or credits
Post by: Crip on June 24, 2006, 10:48:49 AM
just add that with a break 1st after ', tportal_version(), ' .. thats it. :)
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 24, 2006, 11:23:48 AM
ok. thanks!
Title: Re: Adding a line to footer or credits
Post by: gerrymo on June 24, 2006, 11:30:29 AM
Easy. Find

<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'right' : 'left', '">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
', theme_copyright(), '
</td>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';


Replace with

<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="56%" valign="middle" align="', !$context['right_to_left'] ? 'right' : 'left', '" colspan="3">
                    <p align="center"><A href="http://http://www.websmartcentral.com/">TechDomain hosted in Australia by WebSmartCentral</A>
</td>
</tr>
<tr>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'right' : 'left', '">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
', theme_copyright(), '
</td>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';


This will add the line just above the copyright.

(this is for the default theme. Other themes will vary a little in the code).
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 25, 2006, 07:54:29 AM
love your work!!
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 25, 2006, 08:37:35 AM
yep - that worked well... any thoughts on amber_tp?

I tried, but just keep getting errors.


echo '
</td>
<td style="background-image: url('.$settings['images_url'].'/img/right.jpg); background-repeat: repeat-y;" ><img src="'.$settings['images_url'].'/img/right.jpg" alt="" style="margin: 0;" /></td>
</tr>
<tr>
<td valign="bottom" style="border-top: solid 4px white;"><img src="'.$settings['images_url'].'/img/bot_left.jpg" alt="" style="margin: 0;" /></td>
<td valign="top" align="center" colspan="3" style="padding-top: 8px; background-image: url('.$settings['images_url'].'/img/bot.jpg); background-position: bottom; background-repeat: repeat-x;">';

// bottom stuff
theme_copyright();

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

echo '<div class="smalltext">
<b>Amber</b> | ', tportal_version() , '</div>';

echo '
</td>
<td valign="bottom"><img src="'.$settings['images_url'].'/img/bot_right.jpg" alt="" style="margin: 0;" /></td>
</tr>
</table>';

echo '
</body>


the line is

<A href="http://www.websmartcentral.com/">Techdomain Hosted in Australia by WebSmartCentral</A>
Title: Re: Adding a line to footer or credits
Post by: gerrymo on June 25, 2006, 12:29:20 PM
Post your index.template and I'll have a look. No promises though.
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 26, 2006, 01:16:48 AM
ok. I have tried, but it just crashes the whole site no matter what/where I put it... having said that, i am no php genious!

the line that needs adding is:

<A href="http://www.websmartcentral.com">TechDomain hosted in Australia by WebSmartCentral</a>

here is the file:
Title: Re: Adding a line to footer or credits
Post by: gerrymo on June 26, 2006, 08:34:16 AM
OK, try this one. But backup the one you have, in case this doesnt work 100% correctly.
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 27, 2006, 12:42:54 AM
ok thanks. will let you know how I go.
Title: Re: Adding a line to footer or credits
Post by: Techdomain on June 27, 2006, 01:29:15 AM
That file worked fine - I managed to do it with the glabal headers and footers mod, which shows it on all the themes.

Thankyou for your help :)