![]() |
Play Sound When Private Message Received - the Amy Way
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 |
Excellent work there, young lady. Let me be the first to (c)lick the install button. ;)
|
You see, Amy? Now who's flirting with you? :p
Nice :) |
Yeah, but I'm old and harmless. I can't even handle what I have at home let alone anything else. ;)
|
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: Code:
<tr> Add after: Code:
<tr> |
See what happens when you guys flirt? I get distracted and make mistakes :D
Amy |
Sweet hack.
*installed. |
Amy.. I cannot get this to work...
No sound.. nothing |
I checked my files.
and it looks like I did everything correctly.. and yes I checked recieve sound pm in modify options |
Quote:
In youre header template, you need to put : Code:
$headsound Off to update the documentation. Amy |
Does not work for me.... No sound at all....
Have done all in the zip and all you have said over here... |
Might want to put some screenies in the thread somewhere amy ;)
- miSt |
Quote:
You must mean the headinclude template |
Ok I put it in the headinclude template and it works like a charm!
Thanks! |
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.. :) |
Quote:
Amy |
Quote:
|
Hm.... Still not working.... :(
|
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 |
After adding $headsound in the headunclude template, it worked fine for me :)
|
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 |
Wonder if I have found the error.... In global.php there are several $templatesused.=' Witch one of them do I change?
|
partang2 put it in the headinclude template and it will work
|
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.
|
Thank you, had no problems installing. Checked install :D
|
Quote:
Anyway, nice hack I'm putting this one up too. :) [high]* Red Blaze kicks and runs laughing. o.o?[/high] |
Hey this is a really good idea.. Exactly how many queries will this add to things? :)
|
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 |
Thanks so much for your quick reply, Amy! :)
[high]* Alien clicks install.[/high] |
Nice work! I had a little trouble, at first. I forgot something. DOH! But, it works great now. *Goes to click install* :)
|
Nice work Amykhar - works great :).
[high]* Intex clicks install.[/high] |
anyone have a better sounding wav
like maybe a girls voice saying you got a message |
<a href="http://www.kcbx.net/~rloomis/mailcall.html" target="_blank">http://www.kcbx.net/~rloomis/mailcall.html</a>
|
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 ? |
You would have to hack register.php to insert the preferences in the database and not just modify the template.
Amy |
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? |
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.
|
but it would be a nice edition. -.- :bunny:
|
Quote:
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 :( |
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.
Code:
<embed src="message.wav" autostart="true" hidden="true" width="0" height="0"> |
All times are GMT. The time now is 07:35 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|