Archive for howtodoit.myfastforum.org 
 



       howtodoit.myfastforum.org Forum Index -> Add-on`s for your forum
Symon

Logo Change For Each Section

This little hack will create a different logo or image on each refresh.


Ok here is HOWTODOIT

Please remember to use the Editor account before making any template changes, If you have not made an editor account yet please read HERE

Second you must have all ready a template you can edit.

If you have not done this please read HOWTODOIT


1. Goto admin panel --- 3. Styles --- Edit Templates/Logos -- the template you wish to edit (EG myff_howtodoit1)--- Submit

Now look at the top in the area marked Choose Forum template/javascript/css File to Edit use the drop down bar and find

overall_header.tpl

Now place this code Just after
Code:
<head> or <HEAD>


Code:
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin



var maxAdNo = 4

var adNo

var myAd = new Array()



myAd[0] = '<center><a href="http://www.myfreeforum.org"><img src="http://forum.myfreeforum.org/templates/myff_forum3/images/newlogo_4851_040.gif" width="128" height="89" border="0" title="MyFreeforum"><a/></center>'

myAd[1] = '<center><a href="http://www.farnboroughinvincibles.co.uk">Farnborough Invincibles</a></center>'

myAd[2] = '<center><a href="http://www.farnboroughinvincibles.co.uk"><img src="http://www.farnboroughinvincibles.co.uk/templates/myff_farnboroughinvincibles1/images/logo.jpg" width="128" height="89" border="0" title="The Invincibles"><a/></center>'

myAd[3] = '<center><a href="http://www.assiejack.inx-gaming.co.uk"><img src="http://www.assiejack.inx-gaming.co.uk/forum/templates/cs_red/images/logo1.png" width="128" height="89" border="0" title="AssieJack"><a/></center>'

myAd[4] = '<center><a href="http://135.196.23.137/pls/gn/V3_League.HomePage?partner_id=109"><img src="http://135.196.23.137/images/logos/nehyl.jpg" width="128" height="89" border="0" title="NEHYL"><a/></center>'



//  End -->

</script>


Now find you currant logo code it may look like this

Code:
<img src="templates/myfs_testhtml1/images/logo_phpBB.jpg" align="right" border="0"></a>


Replace that with

Code:
<SCRIPT LANGUAGE="JavaScript">



<!-- Begin

  adNo = Math.round(Math.random() * maxAdNo)

  document.write(myAd[adNo])

//  End -->

</script>


So the final code may look like this

Code:
<a name="top"></a>

<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
   <tr>
      <td class="bodyline"><table width="100%" cellspacing="0" cellpadding="0" border="0">
         <tr>
            <td><SCRIPT LANGUAGE="JavaScript">



<!-- Begin

  adNo = Math.round(Math.random() * maxAdNo)

  document.write(myAd[adNo])

//  End -->

</script> </td>
            <td align="center" width="100%" valign="middle"><span class="maintitle">{SITENAME}</span><br /><span class="gen">{SITE_DESCRIPTION}<br />&nbsp; </span>


Hints

1. Make sure the

Code:
var maxAdNo = 4


Is the same number as different logos you have.


To add more logos just add this code below but remeber to make the myad number one above the last one you have , and th enumber must match the var number.


Code:
myAd[5] = '<center><a href="http://135.196.23.137/pls/gn/V3_League.HomePage?partner_id=109"><img src="http://135.196.23.137/images/logos/nehyl.jpg" width="128" height="89" border="0" title="NEHYL"><a/></center>'



So if you wanted 8 logos you would have


Code:
var maxAdNo = 8


And the last logo block would be

Code:
myAd[8] = '<center><a href="http://135.196.23.137/pls/gn/V3_League.HomePage?partner_id=109"><img src="http://135.196.23.137/images/logos/nehyl.jpg" width="128" height="89" border="0" title="NEHYL"><a/></center>'



And thats HOWTODOIT

       howtodoit.myfastforum.org Forum Index -> Add-on`s for your forum
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum