Web Page Server Logo Link Script

This is the place where you can find everything related to the dedicated server, control scripts and community tools.

Moderators: Pit Crew, TM-Patrol

Post Reply
User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Web Page Server Logo Link Script

Post by Ant » 22 Feb 2009 00:26

Ok - I have made a little script (my first for the community :D ) that you can place in your web page, it enables you to link to your server via a picture that changes on mouseover to another picture, then opens up trackmania once its clicked and joins your server.

You can see an example of this on my web page, its located at the bottom left of the page just above the hit counter (starts off with TM Forever logo then changes to my server logo on mouseover).

My server isn't up all the time so you might not get into the server when you click it but you will see how the script works :wink:

to change this script for your preferences there are 2 lines that you need to edit (I left my images and links in there as default)

Line 32 :

Code: Select all

<body onload="MM_preloadImages('http://xxxant.webs.com/img/xxxantforeverlogo.png')">
* Change

Code: Select all

http://xxxant.webs.com/img/xxxantforeverlogo.png
to an image of your choice (This is the image it will change to on mouseover)

Line 33 : (Is all on one line in the script)

Code: Select all

<a href="tmtp://#join=xxxant" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','http://xxxant.webs.com/img/xxxantforeverlogo.png',1)"><img src="http://xxxant.webs.com/img/tmnf_logo.jpg" name="Image1" width="300" height="170" border="0" id="Image1" /></a>
* Change

Code: Select all

tmtp://#join=xxxant
to your server link

* Change

Code: Select all

http://xxxant.webs.com/img/xxxantforeverlogo.png
to your server logo (This is the image it will change to on mouseover)

* If you don't want it to show the TM Forever logo before mouseover then change

Code: Select all

http://xxxant.webs.com/img/tmnf_logo.jpg
to whatever image you want

* and finally you can customize the size of the whole thing by changing the values in

Code: Select all

width="300" height="170" border="0"
to whatever you prefer.

I hope this is useful to anyone and I welcome any feedback about it and also will gladly answer any questions such as how to implement this into your web page.

Have Fun :mrgreen:

Oh yeah, Click Here for the download :thumbsup:

jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland

Re: Web Page Server Logo Link Script

Post by jouko100 » 22 Feb 2009 07:54

In manialink u can use this

Code: Select all

<label
					posn='-17 -44 6'
					halign='center'
                                        style='CardButtonSmall'					
					text='Join my server' 					
					manialink='tmtp://#join=jou maps'
				/>

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Web Page Server Logo Link Script

Post by Ant » 22 Feb 2009 17:12

Yeah but this is different, its for a normal web page (not maniazones) and looks nice and smooth :thumbsup:
Last edited by Ant on 23 Feb 2009 21:03, edited 1 time in total.

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Web Page Server Logo Link Script

Post by Ant » 23 Feb 2009 21:02

If anyone's downloading and using this, please let me know what you think of it.

User avatar
f*ckfish
Pit Crew
Pit Crew
Posts: 1302
Joined: 15 Jun 2007 07:59
Owned TM-games: TMNF, TMUF
Location: Dresden, Germany
Contact:

Re: Web Page Server Logo Link Script

Post by f*ckfish » 24 Feb 2009 03:33

You forgot the actual javascript source doing the swapping...

Code: Select all

<script type="text/javascript"> 
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//--> 
</script> 
inactive, sorry

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Web Page Server Logo Link Script

Post by Ant » 24 Feb 2009 06:05

f*ckfish wrote:You forgot the actual javascript source doing the swapping...
What dya mean?? its all in the download :roll:

User avatar
f*ckfish
Pit Crew
Pit Crew
Posts: 1302
Joined: 15 Jun 2007 07:59
Owned TM-games: TMNF, TMUF
Location: Dresden, Germany
Contact:

Re: Web Page Server Logo Link Script

Post by f*ckfish » 26 Feb 2009 03:17

Ah ok, I oversaw your download link :oops:
inactive, sorry

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Web Page Server Logo Link Script

Post by Ant » 26 Feb 2009 14:38

lol, its all in the details man ! :mrgreen:

Post Reply