PDA

View Full Version : Play midi on Birthday?


Delhaze
07-20-2001, 12:22 AM
I'd like to embed a Happy Birthday midi for users who log on on their birthday.

Any takers?

Delhaze
07-20-2001, 08:20 PM
Never mind, managed to do it myself :) :D :p :cool:

webhost
07-22-2001, 12:36 PM
yes how?

Delhaze
07-22-2001, 06:48 PM
Well it's not exactly pretty, but it seems to work !

Create a new template called "birthdayhack", it's basically a copy of the "forumhome_birthdaybit" template with the midi file inserted.

Insert the following text

<bgsound src="midi/happy.mid" loop="-1"><hr>Today's Birthdays: $birthdays

Create a new folder under your forum root called "midi" and place the "happy.mid" in it.

Then backup your index.php file, and make the following modifications.

Find:


if ($birthdays) {
eval("\$birthdaybits = \"".gettemplate("forumhome_birthdaybit")."\";");
}


and replace it with:


if ($birthdays) {
if (eregi($username,$birthdays)) {
eval("\$birthdaybits = \"".gettemplate("birthdayhack")."\";");
}
else {
eval("\$birthdaybits = \"".gettemplate("forumhome_birthdaybit")."\";");
}
}


Using the <bgsound> tag means it only works with Internet Explorer, but i'm happy with that.

If any real PHP coders want to improve it please do.

webhost
07-22-2001, 06:49 PM
thanks