vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Play a sound when a user has a new PM. (https://vborg.vbsupport.ru/showthread.php?t=92524)

amykhar 07-19-2005 10:00 PM

Play a sound when a user has a new PM.
 
This is a simple template mod that will make a sound file play when your user has an unread private message.

No screen shots enclosed because I can't take a picture of a sound. ;)

-------------
If you have firefox users, you may want to point them to this link if they are having issues:
http://www.eaforums.com/forums/showthread.php?t=40220
------------

Amy

.Tim 07-20-2005 12:11 AM

Can the user turn it off if they don't want a sound played?

amykhar 07-20-2005 12:14 AM

You can set up a custom userfield and wrap a conditional around the code in the template. I am not posting the code here because supporting userfield conditionals for non-coders ends up being as fun as having a root canal without anasthesia :D

TTG 07-20-2005 01:00 AM

Quote:

Originally Posted by amykhar
ends up being as fun as having a root canal without anasthesia :D

Mmmm .. won't be adding that to my list of "things I must do before I die" :rolleyes:

Useful hack .. thanks amy
Clicked install

Tony G 07-20-2005 04:42 AM

Quote:

No screen shots enclosed because I can't take a picture of a sound.
Someone will end up still asking. XD.

Thanks for sharing, neat mod. :)

aethro 07-20-2005 07:44 AM

Any screenshots?

[high]* aethro clicks install and runs away before being smacked
[/high]
:p

turksengel 08-09-2005 10:30 AM

he said that
Quote:

No screen shots enclosed because I can't take a picture of a sound.

Tony G 08-09-2005 10:49 AM

A) She.
B) He/she is obviously joking.

Way to recognise jokes. :p

amykhar 08-09-2005 11:17 AM

Without the :p, I wouldn't have been sure myself ;)

Boofo 08-09-2005 11:21 AM

Amy is there any way to have this NOT play when you are in the actual pm area? If you have more than 1 message waiting, it plays everytime you answer or view a message or listing.

Oblivion Knight 08-09-2005 08:04 PM

The easiest and rather sloppy way of achieving that would be to change this line:
HTML Code:

<if condition="$vbulletin->userinfo[pmunread]>0">
To this:
HTML Code:

<if condition="$vbulletin->userinfo[pmunread]>0 AND THIS_SCRIPT != 'private'">
I think that should sort you out.. ;)

Boofo 08-09-2005 08:05 PM

Quote:

Originally Posted by Oblivion Knight
The easiest and rather sloppy way of achieving that would be to change this line:
HTML Code:

<if condition="$vbulletin->userinfo[pmunread]>0">
To this:
HTML Code:

<if condition="$vbulletin->userinfo[pmunread]>0 AND THIS_SCRIPT != 'private'">
I think that should sort you out.. ;)

Bingo! I never even thought of that. I guess I HAVE been away too long, huh? ;)

Thank you, sir. ;)

Wayne Luke 08-23-2005 03:23 PM

Can anyone recommend any free sounds for this?

amykhar 08-23-2005 03:27 PM

I included one with the mod. Another I like is the AOL "You've got mail" wav.

Here's some others:
http://humor.about.com/cs/soundbites/p/ds042804.htm

Biker_GA 08-23-2005 03:28 PM

Heh... Just fire up a sound recorder and make your own. Oh the fun I'm going to have with this! LMAO!

Boofo 08-23-2005 04:44 PM

Wayne, I got one where the 7-11 guy says "You've got mail in your inbox". ;)

bonnmac 08-23-2005 09:49 PM

is there any way to play random sounds? thanks for a great hack

amykhar 08-24-2005 02:03 AM

Yes. You could put your sounds in a folder and give them names like 1.wav, 2.wav etc. Then, have a plugin pick a random number to select the wav for you. That would be the easiest way that I can think of.

bonnmac 08-24-2005 03:39 AM

Quote:

Originally Posted by amykhar
Yes. You could put your sounds in a folder and give them names like 1.wav, 2.wav etc. Then, have a plugin pick a random number to select the wav for you. That would be the easiest way that I can think of.

well i am a lamer when it comes to doing this how about sometime in the near future you can do this as one of your projects lol your so good at this thanks for all your grat stuff

Jagged Tooth 08-24-2005 09:25 AM

I just followed that link through with all the .wav's and it gave me a trojan so yeah, just watch out.

carrie31 09-27-2005 04:42 PM

thank you so much ! it's perfect !

lordnex 09-29-2005 08:16 AM

just a hint for those that are looking for sounds, there was a hack released for 3.0.x that did this exact thing and had 10 small wav files that did it. :D I don't remember which one but a quick search will show it and you can grab those 10 wav files quickly. Fantastic though that someone brought it to 3.5.

Amy I'm one of those lurker types but I have to say you're fantastic :D

Colejo 10-03-2005 04:25 AM

Thanks I installed it and used a sound file for Meg Ryan from the movie you've got mail.

Bubble #5 10-03-2005 10:52 PM

Has anyone installed this on 3.5 gold?

Colejo 10-09-2005 04:32 AM

Quote:

Originally Posted by Bubble #5
Has anyone installed this on 3.5 gold?

Yes.

Carl Anderson 10-09-2005 04:40 AM

Is this going to play just one time or every time a page is refreshed...?

I don't want to bother users and for it to get anoying...

Colejo 10-09-2005 04:49 AM

Quote:

Originally Posted by Carl Anderson
Is this going to play just one time or every time a page is refreshed...?

I don't want to bother users and for it to get anoying...

Mine plays whenever I refresh the page or go to a new page if I haven't checked the PM. But I did set it so that users have the option to turn it off.

Carl Anderson 10-09-2005 02:36 PM

Quote:

Originally Posted by Colejo
Mine plays whenever I refresh the page or go to a new page if I haven't checked the PM. But I did set it so that users have the option to turn it off.

Its nice to be able to turn it off but I think I will pass on installing this. Hope someone or the author of this figures out a way to get it to play just when a new PM for the user is in their box.

ggiersdorf 10-13-2005 09:12 PM

ok Guess Im dumb? I followe the instructions and nothign happens

I went into my style, and opened my navbar template (navbar breadcrumb section)
and added this

<!--- New Mail Wav -->
<if condition="$vbulletin->userinfo[pmunread]>0">
<script>
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
</script>

<embed src="/forums/message.wav" autostart=true hidden=true id="sound1"
enablejavascript="true">
</if>

I than copied my message.wav file to my websites root and forum directory and It doesnt do anything for me..

Im using VB 3.5 Gold..

Any help!?

I also sent myself a number of new emails for testing..

amykhar 10-13-2005 09:23 PM

It's not for emails. It's for private messages. Also, if you are testing it with private messages, what browser are you using?

ggiersdorf 10-13-2005 11:07 PM

sorry I meant Private Messages, and Im using IE Maxathon

ggiersdorf 10-13-2005 11:26 PM

I fixed it amy, it was a pathing issue to the sound file. Now has anyone figured out a way to allow it to only Say ONCE you have new mail when you login!?

cbr929rrerion 11-09-2005 03:35 AM

One can you get it to play a small mp3 file with pm..

and 2.. I have a quicktime issue.. it works fine with fire fox but in IE it autostarts and has no control bar, even tho the code says autostart=false and controller =true... or whatever..

any ideas?

Thanks

brvheart 11-17-2005 04:42 PM

well, installed does not work for me, can I add that code anywhere within the navbar template? I added it right at the bottm, very last thing.

cbr929rrerion 11-17-2005 04:51 PM

again I beg, anyway to get the site to play a mp3 when a new pm arrives?

Rickie3 11-18-2005 12:38 AM

Quote:

Originally Posted by cbr929rrerion
again I beg, anyway to get the site to play a mp3 when a new pm arrives?

just upload a mp3 to your forum root,then make the change in the navbar template to where the mp3 is in your server directory eg

<embed src="/forums/mp3" autostart=true hidden=true id="sound1"
enablejavascript="true">
</if>

cbr929rrerion 11-21-2005 12:23 AM

anyway to put the script in another template, if they have a pm and dont check it it replays everytime they navigate on the site, maybe a way to have it just play once? any ideas?

I have it set for navbar to change colors on new pm now, and I added your script to the pm_messagelist template so when they load the pm list it plays the sound...

Works for me..

AWI 12-08-2005 07:21 AM

Great addon...does anybody know how to make it so users can select to turn this option on or off and also maybe give the users the option of selecting a sound file on the server they prefer?

brvheart 12-13-2005 04:18 PM

Quote:

Originally Posted by ravenes
well, installed does not work for me, can I add that code anywhere within the navbar template? I added it right at the bottm, very last thing.


any help here? Mine does not work at all, I added it right under the "<!-- breadcrumb, login, pm info -->" but it does not work for me...anyone please?

Ramsesx 12-14-2005 04:21 AM

Nice idea and I would install if user can on/off and it's only playing 1 time sound.


All times are GMT. The time now is 04:46 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
  • Page Generation 0.01428 seconds
  • Memory Usage 1,817KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_html_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete