News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Audible PM v1.0

Started by Bigguy, September 07, 2006, 07:45:15 PM

Previous topic - Next topic

steve in houston

basically i just hijacked the on/off switch that was for a popup box and made it
work for the audible.

i have no objections  8)

URPG

Sorry, still waiting for my 3 main themes to be up to date, can't try the PM thingy before that :-(

steve in houston

Quote from: URPG on September 13, 2006, 07:32:51 AM
Sorry, still waiting for my 3 main themes to be up to date, can't try the PM thingy before that :-(

the original mod will require each theme to be changed.
the new update that replaces the popup box changes 1 core file
so it will work on all themes.

Bigguy

Ok I'll work on this today.

Bigguy

THIS MOD HAS ERRORS DO NOT DOWNLOAD


DOWNLOAD

hey steve in houston can you check this out and see what might be wrong with it. or actually anyone that knows how to pack mods. I am ABSOLUTELY positive I have this right. It might just be my test server I don't know.

steve in houston

ive never submitted a mod before.

Bigguy

Oh, well.....damn, lol. I guess we will wait till someone is brave enough to try it out. I can post the contents of the modification.xml maybe that would be better. Like I said I think I got it right I just don't see the problem but if someone could give me a hint it would be great. it debugs fine and all but it fails on doing the edits to the Subs.php file.

Bigguy

the code I find in Subs.php is this and with the cdata stuff in the middle of the javascript it makes it hard to replace the code. I have bolded the code you left out in your post:

   // This is done to make it easier to add to all themes...
   if ($context['user']['popup_messages'] && !empty($options['popup_messages']) && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'pm'))
   {
      $context['html_headers'] .= '
   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      if (confirm("' . $txt['show_personal_messages'] . '"))
         window.open("' . $scripturl . '?action=pm");
   // ]]></script>';
   }

The bolded part is part of the package code. This:

[CDATA[ code you are replacing goes here]]>

can not be in the code you are trying to add to the package. (If that makes sense.) There is another way but I have never done that. I will keep trying though.The full "modification.xml" file I have is this:

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">

<id>bigguy:AudiblePM</id>

<version>1.5</version>

<file name="$sourcedir/Subs.php">

<operation>

<search position="before"><![CDATA[ // This is done to make it easier to add to all themes...
if ($context['user']['popup_messages'] && !empty($options['popup_messages']) && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'pm'))
{
$context['html_headers'] .= '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
if (confirm("' . $txt['show_personal_messages'] . '"))
window.open("' . $scripturl . '?action=pm");
// ]]></script>';
}]]></search>


<add><![CDATA[ // This is done to make it easier to add to all themes...
if ($context['user']['popup_messages'] && !empty($options['popup_messages']))
{
$context['html_headers'] .= '
<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>';
}]]></add>

</operation>


<operation>
<file name="$languagedir/Profile.english.php">
<search position="replace"><![CDATA[$txt['popup_messages'] = 'Show a popup when you receive new messages?';]]></search>

<add><![CDATA[$txt['popup_messages'] = 'Allow an audible alert when you receive new messages?';]]></add>

  </file>
</operation>
</file>
</modification>


URPG

Great news, thanks, still i need the themes i want to install to be RC3 compatible, and they are not... so i need to wait until the themes i need will run under TP0.95/RC3 then i can go check your mod :)

diegolyanky

#29
Great MOD !!!....

I translated to SPANISH ... If anyone need the Spanish file ( Tienes un mensaje nuevo ) , just replace the gotmail.swf file with THIS ONE in the SMF root director after installed the MOD.

Thanks bigguy for the MOD and for the idea ;)

SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Bigguy

Thats great that you translated it, thanks alot. Did you translate the code above or the first version of Audible PM. ??? The version above is not packed yet but the code should work.

URPG

If you mark the code displayed i could do a german translation...

steve in houston

Quote from: URPG on September 14, 2006, 07:28:27 PM
If you mark the code displayed i could do a german translation...

This is found in index.english.php:

$txt['show_personal_messages'] = 'You have received one or more new personal messages.\\nView them now (in a new window)?';


URPG

That's all you need?

Informal: 'Du hast ein oder mehr persönliche Nachrichten empfangen.\\nJetzt anzeigen (in einem neuen Fenster)?';

Formal you replace the Du with Sie.

Bigguy

There is a new version available for download, either here or at my site: www.smfhelper.com This version was made (tweaked) with the help of JayBatchatero. it was made so that the "You've got mail" sound will turn off automatically after the first page refresh, so its not going off until you answer you PM's. There is also a Tiny portal version for download.

Garry1953

Installed and work fine.
Thanks

Bigguy

Your welcome. Did you install version 1 or 1.5 ???

Vinspire

Bigguy, i think it would be good if there is a screenie of this mod :D

Garry1953

Quote from: Bigguy on October 24, 2006, 10:04:43 PM
Your welcome. Did you install version 1 or 1.5 ???
Version 1.5 on RC3

Bigguy

I'm glad you got the latest installed. Well I would put a screenie up but it's an AUDIBLE mod so I don't think I can do that. The next version could have a screenie though.

Advertisement: