Post by SubDevo on Aug 28, 2011 13:53:25 GMT -8
Member Birthday Alert Message by SubDevo
Tested in IE, FF, Opera, Safari and Chrome.
This code will popup an alert (with a message you provide)...
You can have three different messages. One for the birthday member. Another for multiple birthdays. And one for only one birthday. You may also disable any one or more of the alerts. For example, use the code only for the member's birthday and not all members.
Enjoy!!!
SubDevo
Variables:
var myBday="Happy Birthday #name#!"; // Message for Member's Bday
Enter the message that will appear to the member on their birthday. Use #name# where you want their name to appear in the message. You may use it more than once.
var allBday="Hey "+pb_displayname+"!\nWish these members a Happy Birthday!\n#all#"; // Message if Multiple Bdays
Enter the message that will appear to all members for multiple birthdays. Use #all# where you want the list of birthday members display names to appear. You may use it more than once.
var oneBday="Hey "+pb_displayname+"! Wish #all# a Happy Birthday!"; // Message if one Bday
Enter the message that will appear to all members if there is only one birthday. Use #all# where you want the birthday member's display name to appear. You may use it more than once.
NOTE:
Do not use HTML in the above. Use \n for line breaks.
You may disable any of the alerts by setting the variable to empty. For example, if you want to have the alert for ONLY the birthday member and not for everyone, set these to empty "".
var allBday=""; // Message if Multiple Bdays
var oneBday=""; // Message if one Bday
Location: Main Footer
<script type="text/javascript">
/* Member Birthday Alert Message by SubDevo */
/* Main Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var myBday="Happy Birthday #name#!"; // Message for Member's Bday
var allBday="Hey "+pb_displayname+"!\nWish these members a Happy Birthday!\n#all#"; // Message if Multiple Bdays
var oneBday="Hey "+pb_displayname+"! Wish #all# a Happy Birthday!"; // Message if one Bday
(function(){
var n=document.images,a,b,d=new Date(),mb=[],isBday=0,i;
function aB(a,b,c){if(a){alert(a.replace(new RegExp(b,"g"),c));}}
if(pb_action=="home"&&pb_username!="Guest"&& !/myBirthday=1/i.test(document.cookie)){
for(x=n.length-1;x>0,n[x].alt!="i";x--){
if(n[x].alt=="birthdays"){
a=n[x].parentNode.nextSibling.getElementsByTagName("a"); i=-1;
while(a[++i]){ b=a.firstChild;
if(a.href.split("=")[2]==pb_username){isBday=1;}
else{b=(b.nodeName=="FONT")?b:a; mb.push(b.innerHTML);}
} if(isBday){aB(myBday,"#name#",pb_displayname);}
if(mb[0]){ b=mb.length; if(b==1){allBday=oneBday;}
mb=(b>1)?"\n "+mb.join("\n "):mb[0];
aB(allBday,"#all#",mb); d.setDate(d.getDate()+1);
} document.cookie="myBirthday=1; expires="+d.toUTCString()+"; path=/"; break;
}}}})();
</script>
Tested in IE, FF, Opera, Safari and Chrome.
This code will popup an alert (with a message you provide)...
- for a member on their birthday.
- for all members when there are birthdays on that day
You can have three different messages. One for the birthday member. Another for multiple birthdays. And one for only one birthday. You may also disable any one or more of the alerts. For example, use the code only for the member's birthday and not all members.
Enjoy!!!
SubDevo
Variables:
var myBday="Happy Birthday #name#!"; // Message for Member's Bday
Enter the message that will appear to the member on their birthday. Use #name# where you want their name to appear in the message. You may use it more than once.
var allBday="Hey "+pb_displayname+"!\nWish these members a Happy Birthday!\n#all#"; // Message if Multiple Bdays
Enter the message that will appear to all members for multiple birthdays. Use #all# where you want the list of birthday members display names to appear. You may use it more than once.
var oneBday="Hey "+pb_displayname+"! Wish #all# a Happy Birthday!"; // Message if one Bday
Enter the message that will appear to all members if there is only one birthday. Use #all# where you want the birthday member's display name to appear. You may use it more than once.
NOTE:
Do not use HTML in the above. Use \n for line breaks.
You may disable any of the alerts by setting the variable to empty. For example, if you want to have the alert for ONLY the birthday member and not for everyone, set these to empty "".
var allBday=""; // Message if Multiple Bdays
var oneBday=""; // Message if one Bday
Location: Main Footer
<script type="text/javascript">
/* Member Birthday Alert Message by SubDevo */
/* Main Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var myBday="Happy Birthday #name#!"; // Message for Member's Bday
var allBday="Hey "+pb_displayname+"!\nWish these members a Happy Birthday!\n#all#"; // Message if Multiple Bdays
var oneBday="Hey "+pb_displayname+"! Wish #all# a Happy Birthday!"; // Message if one Bday
(function(){
var n=document.images,a,b,d=new Date(),mb=[],isBday=0,i;
function aB(a,b,c){if(a){alert(a.replace(new RegExp(b,"g"),c));}}
if(pb_action=="home"&&pb_username!="Guest"&& !/myBirthday=1/i.test(document.cookie)){
for(x=n.length-1;x>0,n[x].alt!="i";x--){
if(n[x].alt=="birthdays"){
a=n[x].parentNode.nextSibling.getElementsByTagName("a"); i=-1;
while(a[++i]){ b=a.firstChild;
if(a.href.split("=")[2]==pb_username){isBday=1;}
else{b=(b.nodeName=="FONT")?b:a; mb.push(b.innerHTML);}
} if(isBday){aB(myBday,"#name#",pb_displayname);}
if(mb[0]){ b=mb.length; if(b==1){allBday=oneBday;}
mb=(b>1)?"\n "+mb.join("\n "):mb[0];
aB(allBday,"#all#",mb); d.setDate(d.getDate()+1);
} document.cookie="myBirthday=1; expires="+d.toUTCString()+"; path=/"; break;
}}}})();
</script>