News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Sound notice's

Started by Bigguy, December 19, 2005, 01:26:59 AM

Previous topic - Next topic

Bigguy

Well I cant argue with you, you guys are the programmers I just install the stuff, LOL. But I gotta say I love this and it works awesome.

Psyclones

i think i will change the code to use a java script version of it,

thats if i can get it working without parse errors  ;D

will be after crimbo tho.

happy christmas everyone and have a great new year

Bigguy

probably a dumb question but will this work for RC2 ???

dtm.exe

Quote from: Bigguy on January 09, 2006, 12:12:14 AM
probably a dumb question but will this work for RC2 ???

Most likely, yes.

Bigguy

I just tried to search for the line of code he says to on the first page, in the index.template.php file and I cant find it in there.

dtm.exe

Quote from: Bigguy on January 09, 2006, 12:26:19 AM
I just tried to search for the line of code he says to on the first page, in the index.template.php file and I cant find it in there.

Try breaking the line up and searching for something similar.

Bigguy

All there is in the "Index.template.php" file about PM`s is this:

Quote// Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
            </td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Psyclones

Bigguy

I will download and install RC2 on my test server, and look into modifying it for you thats if its still required.

Let me know please, before I put the time in.

thanks
Psyclones

Bigguy

I would like this modification, it was great having it on the forum. I dont want you to go to any extra work but if you have some time on your hands that would be great.

Psyclones

Open themes/default/index.template.php and Find this

Quote
// Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
            </td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Add a new line after the ; and paste this directly underneath it


//play audio for you got mail
if (($context['user']['unread_messages']) >= 1){
echo '<embed src="gotmail00.wav" hidden="true" autostart="true" loop="false">';
echo '<noembed><bgsound src="gotmail00.wav"loop="infinite"></noembed>';
}


make sure you copy the wav into your smf forums directory if its not already there.

ive tested it and it works
hope this helps
Psyclones

Bigguy

So right after this line:

Quote</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Directly under it I put what you posted.  ???

Bigguy

Ok when I do that I get this:



(Sorry for dbl posting)

Psyclones

I think you have pasted it in the wrong place.

it should look like this when complete


// Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
            </td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

//play audio for you got mail
if (($context['user']['unread_messages']) >= 1){
echo '<embed src="gotmail00.wav" hidden="true" autostart="true" loop="false">';
echo '<noembed><bgsound src="gotmail00.wav"loop="infinite"></noembed>';
}

Bigguy

#33
Ok, I`ll check on that soon. I did put it in the wrong place, I put it right underneath it.Thank you very much for your help.

(Message edited)

Col

Have you got anywhere with the JS version?

Also, maybe it should be optional in user profiles. Maybe not optional if the mail comes from the top admin. I know this would be a lot more work though.

Bigguy

I`m still getting an error when I put it in. I have other mods installed, could that be the problem ??? I`m probably doing it wrong but I cant see that as I did it the first time ok.

Psyclones

Col: Its on my to do list, might move it to top if i get time.

Bigguy: Cannot understand why it is not working here is the code from my index.template.php


// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
if (($context['user']['unread_messages']) >= 1){
echo '<embed src="gotmail00.wav" hidden="true" autostart="true" loop="false">';
echo '<noembed><bgsound src="gotmail00.wav"loop="infinite"></noembed>';
}
// The [calendar]!

Psyclones

#37
Right guys done a Flash swf version

find this code

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' , $context['current_time'], '</span>';


add a new line underneath it and paste this code

//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>';

}


Right click and save file gotmail.swf into your root directory

http://allinhosting.co.uk/gotmail.swf
Have phun.

Bigguy

I`ll try this, and then maybe the other one to. Thanks again.

Quote from: Psyclones on January 11, 2006, 04:49:19 PM
Col: Its on my to do list, might move it to top if i get time.

Bigguy: Cannot understand why it is not working here is the code from my index.template.php


// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
if (($context['user']['unread_messages']) >= 1){
echo '<embed src="gotmail00.wav" hidden="true" autostart="true" loop="false">';
echo '<noembed><bgsound src="gotmail00.wav"loop="infinite"></noembed>';
}
// The [calendar]!


Bigguy

#39
I tried your flash version but for some reason I dont here anything.

EDIT: I hear it now but I put it in the directory that smf is installed to not the directory the theme is in. It works great btw. No plug in necessary lol. Good work.

Advertisement: