Text
Logo change on every refresh

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    howtodoit.myfreeforum.org Forum Index -> Add-on`s for your forum
View previous topic :: View next topic  
Author Message
Please Register and Login to this forum to stop seeing this advertsing.





Add Karma

Posted:     Post subject:

Back to top
symon
Site Admin
Site Admin

Location: 

Joined: 13 Mar 2006
Posts: 866


Location: Hampshire Add Karma

PostPosted: Sat Sep 15, 2007 9:40 pm    Post subject: Logo change on every refresh Reply with quote

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


Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    howtodoit.myfreeforum.org Forum Index -> Add-on`s for your forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
HOWTODOIT was designed and built by Symon Field
Creator Of ☆ FarnboroughInvinciblesAgonyAuntFairiesAsylum Alliance FunnyWorldHOWTODOIT PHPbb3
HOWTODOIT© Symon Field 2006,2007,2008

Powered by phpBB Group © 2001,2005.
 

Create your own free forum | Buy a domain to use with your forum