TinyPortal

Development => Block Codes => Topic started by: bigguy on September 10, 2006, 10:10:09 PM

Title: PM Audio Alert
Post by: bigguy on September 10, 2006, 10:10:09 PM
I had this code installed on SMF 1.1 RC3 before TP and it worked great. I have also packaged this code into a mod. Now that TP is installed it doesn't look like it wants to work. Here is the code:

http://www.smfhelper.info/forum/index.php/topic,14.0.html

Can anyone help me with this and maybe I can make a mod that works with TP and SMF.
Title: Re: I had this code
Post by: bigguy on September 10, 2006, 11:54:16 PM
Sorry to double post but I found a bit of the problem. When I turn off the user info for SMF through the TP settings it stops the Audible PM from sounding. Does TP use a different set of code for the PM's in the sidebar. If it does were would I find it. (I hope that was understandable)
Title: Re: I had this code
Post by: bigguy on September 11, 2006, 12:46:58 AM
Ok, I'm sorry to triple post but I think I have just packaged this for TP. What this does (even if "Show user info" is put NOT to display) is when a PM comes in it gives you an audible alert saying "You've got mail" it will keep repeating that until you check your PM's. What I owuld like is for someone that has a test site to test this and see if it works first before I release this version of the mod. If anyone wants to it would be a big help.

THIS HAS BEEN TESTED NOW
Title: Re: I had this code
Post by: IchBin on September 11, 2006, 04:46:05 AM
works great on my test site.
Title: Re: I had this code
Post by: bigguy on September 11, 2006, 04:49:39 AM
I'm glad it works for you. It took me a bit to figure it out but I got it. Hope you all enjoy it. :)
Title: Re: I had this code
Post by: IchBin on September 11, 2006, 05:03:24 AM
This is a TP mod not really a snippet. But I think it's worth keeping so it's going into the Code Snippets.
Title: Re: PM Audio Alert
Post by: bigguy on September 11, 2006, 05:31:53 AM
That's great to hear. I'm glad it's staying. I hope people can find it useful, thank you. :)
Title: Re: PM Audio Alert
Post by: bigguy on October 31, 2006, 06:00:51 AM
There has been an update to this mod that can be gotten from my site or simplemachines. Audible Pm 1.5 It only sounds off the "You've got mail" Once or twice.
Title: Re: PM Audio Alert
Post by: akulion on October 31, 2006, 10:19:54 AM
good to hear :up: ill try it out as soon as i get some time :D thanks
Title: Re: PM Audio Alert
Post by: RoarinRow on October 31, 2006, 04:53:55 PM
Works great, thanks!   8)
Title: Re: PM Audio Alert
Post by: akulion on October 31, 2006, 04:59:46 PM
im thinking of recordin my own sound file which will say "HEY! u got mail u dork!"

lol
Title: Re: PM Audio Alert
Post by: RoarinRow on October 31, 2006, 05:01:44 PM
Quote from: Aku on October 31, 2006, 04:59:46 PM
im thinking of recordin my own sound file which will say "HEY! u got mail u dork!"

lol

Hahahaha, I would love that one   :2funny:   I'd send all my active members a PM, but I'm sure they'd smite me   :o
Title: Re: PM Audio Alert
Post by: akulion on October 31, 2006, 05:03:27 PM
lool

hey bigguy i wanted to ask - u know those adverts getting posted after every X posts on your forum - is that a mod? is it available for DL anywhere?
found it

thanks
Title: Re: PM Audio Alert
Post by: RoarinRow on October 31, 2006, 05:05:50 PM
After installing the package for TP 15 - http://mods.simplemachines.org/index.php?mod=454

I went to my custom theme, opened up index.template.php and added this code right before

// display user name

//Sound Notify On Messages
  if (($context['user']['unread_messages']) >= 1){
echo '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="     http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="gotmail" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gotmail.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="gotmail.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="gotmail" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>';

}  
if ((isset($_SESSION['unread_sound']) && $_SESSION['unread_sound'] < $context['user']['unread_messages']) || (!isset($_SESSION['unread_sound']) && $context['user']['unread_messages'] >= 1))
{
echo '
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="     http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="gotmail" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gotmail.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="gotmail.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="gotmail" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>';

// Save a session so it wont loop
$_SESSION['unread_sound'] = $context['user']['unread_messages'];
}
Title: Re: PM Audio Alert
Post by: bigguy on October 31, 2006, 05:26:59 PM
Yeah this mod like most of the rest only installs to the default theme.
Title: Re: PM Audio Alert
Post by: Crip on October 31, 2006, 05:37:18 PM
It only repeats [YOU GOT MAIL] once..thats all
Title: Re: PM Audio Alert
Post by: Crip on October 31, 2006, 05:39:02 PM
PLAY LOOP?
Title: Re: PM Audio Alert
Post by: bigguy on October 31, 2006, 05:43:35 PM
This version does not play the loop. It should only play "You've got mail" once or twice.
Title: Re: PM Audio Alert
Post by: RoarinRow on October 31, 2006, 07:06:02 PM
Quote from: bigguy on October 31, 2006, 05:43:35 PM
This version does not play the loop. It should only play "You've got mail" once or twice.

I only heard it twice.
Title: Re: PM Audio Alert
Post by: TolerancE on October 31, 2006, 07:43:55 PM
the notification plays each time you reload a page. Impossible not to notice.
Title: Re: PM Audio Alert
Post by: akulion on October 31, 2006, 08:06:08 PM
wheres knat? lol he should have a sex sound on his site :2funny: since he runs a porn site
Title: Re: PM Audio Alert
Post by: RoarinRow on October 31, 2006, 09:15:48 PM
Quote from: Aku on October 31, 2006, 08:06:08 PM
wheres knat? lol he should have a sex sound on his site :2funny: since he runs a porn site

oh maybe I'll swap wave files for that   :o
Title: Re: PM Audio Alert
Post by: bigguy on October 31, 2006, 11:22:13 PM
It's quite easy to do actually. Change a small line of code and the sound file. That should do it, although I have never experimented.
Title: Re: PM Audio Alert
Post by: pjr on November 01, 2006, 12:17:30 AM
Nice piece of work I had to insert it into my theme as well but it went well. And I love it I'm always missing PM's
Title: Re: PM Audio Alert
Post by: bigguy on November 01, 2006, 12:18:37 AM
Really glad you like it. I will have version 2 out soon I hope.
Title: Re: PM Audio Alert
Post by: RoarinRow on November 01, 2006, 03:56:32 AM
Quote from: bigguy on November 01, 2006, 12:18:37 AM
Really glad you like it. I will have version 2 out soon I hope.

ohhh, what's v.2 going to have?
Title: Re: PM Audio Alert
Post by: bigguy on November 01, 2006, 06:59:18 AM
Not really to much different. It was supposed to be done last week, just haven't had the time.
Title: Re: PM Audio Alert
Post by: yjobcreations on February 07, 2007, 03:44:54 AM
can somebody make a PM Alert which uses gif animation instead of sound?
Title: Re: PM Audio Alert
Post by: IchBin on February 07, 2007, 04:29:34 AM
There's already a post on that. Feel free to use the search. In fact, its probably in the block code snippet index at the top of this page.
Title: Re: PM Audio Alert
Post by: RoarinRow on February 07, 2007, 04:46:00 AM
Quote from: yjobcreations on February 07, 2007, 03:44:54 AM
can somebody make a PM Alert which uses gif animation instead of sound?

Did you see this on SMF - Email Flash (http://www.simplemachines.org/community/index.php?topic=69182.0)
Title: Re: PM Audio Alert
Post by: slvreagl on February 10, 2007, 03:53:52 AM
I tried this on my custom Helios theme and got nothing... running smf1.1.1 and tp 0.9.7 yet it works fine in my default theme

Quote from: RoarinRow on October 31, 2006, 05:05:50 PM
After installing the package for TP 15 - http://mods.simplemachines.org/index.php?mod=454

I went to my custom theme, opened up index.template.php and added this code right before

// display user name


Title: Re: PM Audio Alert
Post by: brianjw on February 10, 2007, 03:56:33 AM
Is the gotmail.swf and other files needed in the right directory to be listed? ???
Title: Re: PM Audio Alert
Post by: RoarinRow on February 10, 2007, 03:57:17 AM
Quote from: slvreagl on February 10, 2007, 03:53:52 AM
I tried this on my custom Helios theme and got nothing... running smf1.1.1 and tp 0.9.7 yet it works fine in my default theme

Quote from: RoarinRow on October 31, 2006, 05:05:50 PM
After installing the package for TP 15 - http://mods.simplemachines.org/index.php?mod=454

I went to my custom theme, opened up index.template.php and added this code right before

// display user name

//Sound Notify On Messages
  if (($context['user']['unread_messages']) >= 1){
echo '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="     http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="gotmail" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gotmail.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="gotmail.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="gotmail" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>';

}  
if ((isset($_SESSION['unread_sound']) && $_SESSION['unread_sound'] < $context['user']['unread_messages']) || (!isset($_SESSION['unread_sound']) && $context['user']['unread_messages'] >= 1))
{
echo '
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="     http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="gotmail" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gotmail.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="gotmail.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="gotmail" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>';

// Save a session so it wont loop
$_SESSION['unread_sound'] = $context['user']['unread_messages'];
}


i have several themes on my site I can't get it to work with all of them either   ???
Title: Re: PM Audio Alert
Post by: brianjw on February 10, 2007, 03:59:56 AM
Nevermind then, two people are getting this problem and one is RR so um obviously there is a problem, lol :2funny:
Title: Re: PM Audio Alert
Post by: RoarinRow on February 10, 2007, 04:08:12 AM
Quote from: brianjw on February 10, 2007, 03:59:56 AM
Nevermind then, two people are getting this problem and one is RR so um obviously there is a problem, lol :2funny:

I ain't the creator.  I just posted what I got out of my index.template.php file   :o   Hahaha, let me check my Helios index.template.php file. brb

Edit - just as I suspected, I don't have it in my Helios theme.
Title: Re: PM Audio Alert
Post by: brianjw on February 10, 2007, 04:11:09 AM
Quote from: RoarinRow on February 10, 2007, 04:08:12 AM
Quote from: brianjw on February 10, 2007, 03:59:56 AM
Nevermind then, two people are getting this problem and one is RR so um obviously there is a problem, lol :2funny:

I ain't the creator.  I just posted what I got out of my index.template.php file   :o   Hahaha, let me check my Helios index.template.php file. brb

Edit - just as I suspected, I don't have it in my Helios theme.
lol! :2funny: well then the problem is on...........
Title: Re: PM Audio Alert
Post by: RoarinRow on February 10, 2007, 05:29:34 AM
I tried putting the code in different areas of the index.template.php file.  can't figure it out   :idiot2:
Title: Re: PM Audio Alert
Post by: bigguy on February 13, 2007, 05:21:46 PM
Try this version. The code you have to insert if you use a custom theme is as posted.

In your index.template.php find:

     if($context['TPortal']['showtop']==1)

After that add:

if ((isset($_SESSION['unread_sound']) && $_SESSION['unread_sound'] < $context['user']['unread_messages']) || (!isset($_SESSION['unread_sound']) && $context['user']['unread_messages'] >= 1))
{
echo '
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="     http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="gotmail" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gotmail.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="gotmail.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="gotmail" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>';

// Save a session so it wont loop
$_SESSION['unread_sound'] = $context['user']['unread_messages'];
}


I will attach the file to this post which should be installed first before doing these edits to your custom theme.
Title: Re: PM Audio Alert
Post by: slvreagl on February 13, 2007, 06:43:09 PM
Thanks bigguy that piece of code did make the audiable pm work in my helios_multi11_rc3_tp theme, however it re-enabled my top header with the user box and created a second instance of my AJAX ShoutBox inside the userbox  :idiot2:

Here is my index.template code, without your code. Maybe you can see why this happens :-\
Title: Re: PM Audio Alert
Post by: bigguy on February 13, 2007, 09:00:10 PM
That is very wierd. I have never heard of it doing that. After I upgrade my forum I will take a look.
Title: Re: PM Audio Alert
Post by: bigguy on February 14, 2007, 10:11:29 PM
Well i have added the code and there are no erros. See if this works or not:
Title: Re: PM Audio Alert
Post by: slvreagl on February 14, 2007, 11:21:43 PM
Quote from: bigguy on February 14, 2007, 10:11:29 PM
Well i have added the code and there are no erros. See if this works or not:

Same problem using your attached file, audible pm works but shows a userbox and news box above the button menu on the top of the page, and adds another instance of my shoutbox inside the userbox
Title: Re: PM Audio Alert
Post by: bigguy on February 16, 2007, 06:12:56 AM
Well, I will have to look into this further then. I am very sorry for any inconvenience on your part. Obviously the mod was not supposed to work this way. If/when I figure it out I will post back. again I am sorry.