Firefox PHP

Icon Rollover States

Posted by Bumblepuppy 
Icon Rollover States
February 18, 2002 09:24AM
Hiya beautiful peeps!

OK, I was just wondering if any of ya had come up with any hacks to allow rollover states for the graphics referenced in the language files...

ie:

$variable = "<img src=\"[www.url.com]\" width=\"15" height=\"27" border=\"0">"

I'm using 3.2.2a with PHP 4.

Cheers ears,

Bumblepuppy
Re: Icon Rollover States
February 19, 2002 10:07AM
OK I' ve figured it out if anyone else is interested...

Here we go:

Edit your header (forum/include/header.php and include:

<!--
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.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}

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[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.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))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

Just before the following tag:

</head>

The edit you english.php Language file (forum/lang/english.php) and edit your given variable as such:

$lMyProfile = "<img src=\"[www.your_url.com]\" width=\"70\" height=\"27\" border=\"0\" alt=\"my_image\" name=\"profile\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('my_image','','[www.your_url.com])\">";

Hope this may be of use to other Phorum users...

Live long and prosper,

Bumblepuppy

Re: Icon Rollover States
February 19, 2002 10:09AM
Whoops it does seemed to have parsed the variable bit properly...

So here it is again, (hopefully)...

"<img src=\"[www.your_url.com]\" width=\"70\" height=\"27\" border=\"0\" alt=\"my_image\" name=\"profile\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('my_image','','[www.your_url.com])\">";

Re: Icon Rollover States
February 19, 2002 10:10AM
And again...

<img src=\"[www.your_url.com]\" width=\"70\" height=\"27\" border=\"0\" alt=\"my_image\" name=\"profile\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('my_image','','[www.your_url.com])\">

But include the above code in "

and

";

Cheers ears,

Bumblepuppy

twIne
Re: Icon Rollover States
March 04, 2002 11:59AM
I've never understood why people use those Marcomedia rollover scripts. Messy...
Sorry, only registered users may post in this forum.

Click here to login