PDA

View Full Version : Play Sound When Private Message Received - the Amy Way


amykhar
03-17-2003, 10:00 PM
This hack is based off of one by EvilLS1 who also kindly contributed the wav file.

His hack plays a sound when the user visits the forumhome page if they have a new PM.

My version plays the sound on any page much the same as the PM popup works. In addition, my version has a usercp option for members to turn off sounds if they wish.

It's a rather easy hack to install.

Amy

Boofo
03-18-2003, 12:52 AM
Excellent work there, young lady. Let me be the first to (c)lick the install button. ;)

filburt1
03-18-2003, 12:55 AM
You see, Amy? Now who's flirting with you? :p

Nice :)

Boofo
03-18-2003, 12:57 AM
Yeah, but I'm old and harmless. I can't even handle what I have at home let alone anything else. ;)

amykhar
03-18-2003, 01:54 AM
I left out two steps in the documentation earlier. The zip is updated, but if you already installed, here is the rest:

Run this query:

ALTER TABLE `user` ADD `pmsound` TINYINT DEFAULT '1' NOT NULL;


In the modifyoptions template
Find:


<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Pop up a box when you receive a Private Message?</b></normalfont><br>
<smallfont>This will pop up a small warning box when you receive a Private Message asking whether you want to view the message.</smallfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>
<input type="radio" name="pmpopup" $pmpopupchecked value="yes"> yes
<input type="radio" name="pmpopup" $pmpopupnotchecked value="no"> no
</normalfont></td>
</tr>




Add after:



<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Play a sound when you receive a Private Message?</b></normalfont><br>
<smallfont>This will play up a sound when you receive a Private Message.</smallfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>
<input type="radio" name="pmsound" $pmsoundchecked value="yes"> yes
<input type="radio" name="pmsound" $pmsoundnotchecked value="no"> no
</normalfont></td>
</tr>

amykhar
03-18-2003, 01:55 AM
See what happens when you guys flirt? I get distracted and make mistakes :D

Amy

Vile
03-18-2003, 03:52 AM
Sweet hack.

*installed.

SgtSling
03-18-2003, 11:47 AM
Amy.. I cannot get this to work...
No sound.. nothing

SgtSling
03-18-2003, 11:49 AM
I checked my files.
and it looks like I did everything correctly..

and yes I checked recieve sound pm in modify options

amykhar
03-18-2003, 01:24 PM
Today at 08:47 AM SgtSling said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=368559#post368559)
Amy.. I cannot get this to work...
No sound.. nothing

That's because I forgot another step in the documentation. I am not a night person. Gotta quit releasing these things at night.

In youre header template, you need to put :


$headsound


I put it at the very top of my header template.

Off to update the documentation.

Amy

partang2
03-18-2003, 02:39 PM
Does not work for me.... No sound at all....
Have done all in the zip and all you have said over here...

Dean C
03-18-2003, 03:41 PM
Might want to put some screenies in the thread somewhere amy ;)

- miSt

SgtSling
03-18-2003, 04:27 PM
Today at 03:24 PM amykhar said this in Post #10 (https://vborg.vbsupport.ru/showthread.php?postid=368577#post368577)


That's because I forgot another step in the documentation. I am not a night person. Gotta quit releasing these things at night.

In youre header template, you need to put :


$headsound


I put it at the very top of my header template.

Off to update the documentation.

Amy



You must mean the headinclude template

SgtSling
03-18-2003, 04:28 PM
Ok I put it in the headinclude template and it works like a charm!

Thanks!

SgtSling
03-18-2003, 04:29 PM
does anyone have any variations of the sound.wav file?

I want a funny one...
like that says
Beeatch! You better check yo mail!

uh.. I am serious..
:)

amykhar
03-18-2003, 05:45 PM
Today at 01:27 PM SgtSling said this in Post #13 (https://vborg.vbsupport.ru/showthread.php?postid=368654#post368654)




You must mean the headinclude template

It's actually working in my header. Well, at least we have a couple of different options to try :)

Amy

amykhar
03-18-2003, 05:50 PM
Today at 12:41 PM Mist said this in Post #12 (https://vborg.vbsupport.ru/showthread.php?postid=368621#post368621)
Might want to put some screenies in the thread somewhere amy ;)

- miSt

Yep. Here ya go.

partang2
03-18-2003, 08:19 PM
Hm.... Still not working.... :(

amykhar
03-18-2003, 09:09 PM
partang2, Here is how I would go about debugging.

In global.php comment out the code that resets the pmsound field to 1. Then send yourself a PM and make sure the database value is getting set to 2 when you do so.

If it isn't, your problem is in private.php.

If it is, then your problem is most likely that you either haven't created or called the templates. If you haven't uploaded the sound file, you will probably see an error. I did. However, make sure that the wav file is uploaded in binary format where it belongs.

Amy

Vile
03-18-2003, 11:51 PM
After adding $headsound in the headunclude template, it worked fine for me :)

amykhar
03-19-2003, 02:02 AM
I wonder why it's working in my header and you guys need to put it in the headerinclude? Ah well, these are the mysteries of coding for the web I guess.

Amy

partang2
03-19-2003, 05:52 AM
Wonder if I have found the error.... In global.php there are several $templatesused.=' Witch one of them do I change?

SgtSling
03-19-2003, 11:07 AM
partang2 put it in the headinclude template and it will work

zajako
03-19-2003, 01:01 PM
sounds cool, however the blinking pm is what i use,and i think sound might take a bit longer to load. Ill possibly add this when i get my new server up and going.

Classy
04-06-2003, 08:15 PM
Thank you, had no problems installing. Checked install :D

Red Blaze
04-08-2003, 04:39 PM
03-18-03 at 11:02 PM amykhar said this in Post #21 (https://vborg.vbsupport.ru/showthread.php?postid=369017#post369017)
I wonder why it's working in my header and you guys need to put it in the headerinclude? Ah well, these are the mysteries of coding for the web I guess.

Amy

Do you have it between <head> </head> anything between that is part of headinclude, if not some of it. ^^;;

Anyway, nice hack I'm putting this one up too. :)

* Red Blaze kicks and runs laughing. o.o?

Alien
04-10-2003, 01:51 AM
Hey this is a really good idea.. Exactly how many queries will this add to things? :)

amykhar
04-10-2003, 02:08 AM
Two if you have a PM. One to set the notifier that a PM exists and one to clear it when the window pops up.

Amy

Alien
04-10-2003, 08:54 PM
Thanks so much for your quick reply, Amy! :)

* Alien clicks install.

SloppyGoat
04-10-2003, 09:17 PM
Nice work! I had a little trouble, at first. I forgot something. DOH! But, it works great now. *Goes to click install* :)

Intex
04-27-2003, 10:30 AM
Nice work Amykhar - works great :).

* Intex clicks install.

Mike11212
05-02-2003, 01:40 PM
anyone have a better sounding wav
like maybe a girls voice saying you got a message

amykhar
05-02-2003, 02:52 PM
<a href="http://www.kcbx.net/~rloomis/mailcall.html" target="_blank">http://www.kcbx.net/~rloomis/mailcall.html</a>

SemperFidelis
05-08-2003, 02:18 PM
Nice work Amy
And thanks for the additional sounds too.

Would it also be a good idea to add this to the registeradult and registercoppa templates too ?
And if so is it just a case of adding the same code as added to modifyoptions ?

amykhar
05-10-2003, 02:23 AM
You would have to hack register.php to insert the preferences in the database and not just modify the template.

Amy

-Sidekick-
06-05-2003, 04:30 AM
This may be too much for such a hack, though this has been requested...

I have users that have their own wav they'd like to have play. So any chance of this hack being expanded to the point where in Options, users can choose from a list of wav files uploaded for the hack by a administrator?

amykhar
06-05-2003, 11:19 AM
Sidekick, it could be done but I am probably not going to be doing it. Users on my board have mostly opted out of using the sound alert.

-Sidekick-
06-06-2003, 02:55 AM
but it would be a nice edition. -.- :bunny:

Hobbes
06-10-2003, 04:34 AM
06-05-03 at 08:55 PM -Sidekick- said this in Post #38 (https://vborg.vbsupport.ru/showthread.php?postid=405012#post405012)
but it would be a nice edition. -.- :bunny:


hehe....it would...anyway...

i placed it header....randomly...like...right dab in the middle...and it works....but,....it only plays it when
im in my PM box....not if im on forumhome....or anywhere else :(

Infopro
06-18-2003, 04:13 PM
I have a user that uses Opera only, he suggested I add this to the code so he didn't have a big empty space on the top of his browser.
<embed src="message.wav" autostart="true" hidden="true" width="0" height="0">

I thought I'd pass it along. ;)

S.Shady
06-18-2003, 04:37 PM
* S.Shady click install. Thanks

Today at 01:13 PM Infopro said this in Post #40 (https://vborg.vbsupport.ru/showthread.php?postid=410393#post410393)
I have a user that uses Opera only, he suggested I add this to the code so he didn't have a big empty space on the top of his browser.
<embed src="message.wav" autostart="true" hidden="true" width="0" height="0">

I thought I'd pass it along. ;)


Thanks for this also. :) Now opera users wont hunt me down and beat me with my IE :)


I have the best comedian ever, my idle next to you know who as my sound. my sound is george carlin :)

-Sidekick-
06-18-2003, 05:41 PM
The sound only plays once when you receive a PM. I missed a couple of PM's due to the volume being off. Is there a way to make the sound keep playing, like a popup keeping popping up untill the message is viewed?