Matt
Graphics Admin
Great admin or greatest admin?
Posts: 4,891
|
Post by Matt on Apr 20, 2006 17:41:27 GMT -5
This code will add the image of your choosing to the mini-profile of each user who has a birthday today. This code stores the bithday info in the cookie and should not be used by forums who have thousands of members. A user has to visit the main page in order to get the initial birthday info. Edit where indicated.
Created By: Wonder
Global Footer
<script> //Birthday Image in Mini-Profile v1.0
//Copyright 12-01-2005 by ~Wonder //May be reposted anywhere as long as this header remains in tact
//Enter the url to the image you want displayed if it's a members birthday bdimage="http://img221.imageshack.us/img221/3871/evil1vp.gif";
if(!location.href.match(/\=/)) { bdays=new Array(); for(i=0;i<document.links.length;i++) { if(document.links[i].parentNode.innerHTML.match(/\d birthday(s)? today./)) { bdays.push(document.links[i].href.split("user=")[1]); } } d=new Date();d=new Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59) document.cookie="bd="+bdays.join(",")+"; expires="+d; } else if(location.href.match(/action=(display|goto|viewprofile|pmview|recent)/)) { var td=document.getElementsByTagName("td"); bdays=""; document.cookie.match(/bd=/)?bdays=","+document.cookie.split('bd=')[1].split(';')[0]+",":""; for(i=0;i<td.length;i++) { if(td[i].width=="20%" && td[i].className.match(/windowbg/) && td[i].innerHTML.match(/user\=(.*?)"/)) { bdays.match(","+RegExp.$1+",")?td[i].innerHTML+="<br><center><img src=\""+bdimage+"\"></center>":""; } } } </script>
|
|