============================================================================================================================
-U2U SOUND NOTIFICATION  v3.0
-ORIGINAL CODE BY: Planet_Master
-VERSION COMPATIBILITY: XMB 1.9
-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.5 SP1
Code Updated for XMB 1.9.5 by: GuldantheWarlock @ XMB Garage

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

    Last Updated On: 04-25-10
    Last Updated By: GuldantheWarlock @ 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 v3 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
-------------------------------------------------------------------------------------------------

Notes: BACKUP ALL OF YOUR PHP FILES, TEMPLATES AND DATABASE BEFORE INSTALLING THIS MODIFICATION.
============================================================================================================================
=======
Step 1.
=======
=================
Edit File: header.php
=================
==========
Find Code:
==========

// if the user is registered, check for new u2u's
$newu2umsg = '';
if (X_MEMBER) {
    $query = $db->query("SELECT COUNT(readstatus) FROM $table_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>";
    }
}

================
Replace Code 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 $table_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/newu2u.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 Code:
==========

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

===============
Add Code 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: English.lang.php
====================
==========
Find Code:
==========

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

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

// U2U Sound Notification Mod Begin
$lang['newu2u2'] = "new u2u message";
$lang['newu2u3'] = "new u2u messages";
// U2U Sound Notification Mod 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.
Get a new u2u image (newu2u.gif) and upload to your images directory.
You don't want to put this image in the theme directories as it will overwrite a gif with the same name that is used for the u2u interface.
If you don't want to use the u2u image then simply remove this line, <img src=\"images/newu2u.gif\" />, from the header.php file.

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