-------------------------------------------------------------------------------------------------
-U2U SOUND NOTIFICATION  v3.0
-ORIGINAL CODE BY: Planet_Master
-VERSION COMPATIBILITY: XMB 1.9.8 SP3
-REWRITTEN FOR 1.9 BY: WormHole @ xmbgarage.com
-Install Guide
-------------------------------------------------------------------------------------------------

DESCRIPTION: This modification will enable a sound notification of a new u2u message and a different sound notification for more than 1 u2u message.

COMPATIBILITY: XMB 1.9.8 SP3
Code Updated for XMB 1.9.5 by: GuldantheWarlock @ XMB Garage

     2009 XMB Garage
    http://www.xmbgarage.com

    Last Updated On: 07-12-09
    Last Updated By: WormHole @ XMB Garage

    All copyright information must remain visible and cannot be removed.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Note: BACKUP ALL OF YOUR PHP FILES, TEMPLATES AND DATABASE BEFORE INSTALLING THIS MODIFICATION.

============================================================================================================================
=======
Step 1.
=======
=================
Edit File: header.php
=================
======
Find:
======

// if the user is registered, check for new u2u's
$newu2umsg = '';
if (X_MEMBER) {
    $query = $db->query("SELECT COUNT(readstatus) FROM ".X_PREFIX."u2u WHERE owner='$self[username]' AND folder='Inbox' AND readstatus='no'");
    $newu2unum = $db->result($query, 0);
    if ($newu2unum > 0) {
        $newu2umsg = "<a href=\"#\" onclick=\"Popup('u2u.php', 'Window', 700, 450);\">$lang[newu2u1] $newu2unum $lang[newu2u2]</a>";
    }
    $db->free_result($query);
}

============
Replace With:
============

// if the user is registered, check for new u2u's
// U2U Sound Notification Mod Begin
$newu2usound = '';
$newu2umsg = '';
if (X_MEMBER) {
    $query = $db->query("SELECT COUNT(readstatus) FROM ".X_PREFIX."u2u WHERE owner='$self[username]' AND folder='Inbox' AND readstatus='no'");
    $newu2unum = $db->result($query, 0);
    if ($newu2unum > 0) {
        $msglang   = ($newu2unum > 1) ? $lang['newu2u3'] : $lang['newu2u2'];
        $newu2umsg = "<img src=\"images/newu2usnd.gif\" /> <a href=\"#\" onclick=\"Popup('u2u.php','Window', 700, 450);\">$lang[newu2u1] $newu2unum $msglang</a>";
    }
}
// U2U Sound Notification Mod End

============================================================================================================================
=======
Step 2.
=======
================
Edit File: index.php
================
======
Find:
======

eval('echo "'.template('header').'";');

===========
Add Above:
===========

// U2U Sound Notification Mod Begin
if ($newu2unum > 0) {
    $u2usnd      = ($newu2unum > 1) ? 'newu2u.mp3' : 'newu2u2.mp3';
    $newu2usound = "<embed src=\"images/".$u2usnd."\" border=\"0\" CONTROLLER=\"false\" WIDTH=\"1\" and HEIGHT=\"1\" hidden=\"true\">";
    $newu2umsg  .= $newu2usound;
}
// U2U Sound Notification Mod End

============================================================================================================================
=======
Step 3.
=======
=======================
Edit File: lang/English.lang.php
=======================
======
Find:
======

$lang['newu2u2'] = "new u2u message(s)";

============
Replace With:
============

// U2U Sound Notification Mod Begin
$lang['newu2u2'] = "new u2u message";
$lang['newu2u3'] = "new u2u messages";
// End U2U Sound Notification End

============================================================================================================================
=======
Step 4.
=======

Now upload the header.php, index.php and English.lang.php files to your forum directory.
Get 2 sound files, either mp3 or wav, and upload them to your images directory. 2 samples have been provided for you in the Contents folder.
Get a new u2u image (newu2usnd.gif) and upload to your images directory. One has been provided for you located in the Contents folder.
If you don't want to use the u2u image then simply remove this line, <img src=\"images/newu2usnd.gif\" /> from the code you put in header.php.

============================================================================================================================
Enjoy!