Private Message Sound Notification
Created by: 350Chevy
www.lssix.com
Thanks to Onkel_Tom and EvilLS1 for some fixes!
***** MAKE SURE YOU MAKE BACK-UPS! *****
FILE MODIFICATIONS (2)
global.php
profile.php
TEMPLATE MODIFICATIONS (2)
navbar
modifyoptions
ADD PHRASE (1)
***** QUERY *****
ALTER TABLE user ADD pmsound varchar(7) NOT NULL
***** File Modifications *****
OPEN global.php
***** FIND *****
// identify where we are
***** ADD ABOVE: *****
function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); }
***** FIND *****
// #############################################################################
// get new private message popup
$newpmmsg = 0;
$shownewpm = false;
if ($vboptions['checknewpm'] AND $bbuserinfo['userid'] AND $bbuserinfo['pmpopup'] == 2)
{
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmpopup = 1 WHERE userid = $bbuserinfo[userid]", 'pmpopup');
if (THIS_SCRIPT != 'private')
{
$newpmmsg = 1;
$newpm = $DB_site->query_first("
SELECT pm.pmid, title, fromusername
FROM " . TABLE_PREFIX . "pmtext AS pmtext
LEFT JOIN " . TABLE_PREFIX . "pm AS pm USING(pmtextid)
WHERE pm.userid = $bbuserinfo[userid]
ORDER BY dateline DESC
LIMIT 1
");
$newpm['username'] = addslashes(unhtmlspecialchars($newpm['fromusername'], true));
$newpm['title'] = addslashes(unhtmlspecialchars($newpm['title'], true));
$shownewpm = true;
}
}
***** ADD BELOW: *****
if ($bbuserinfo['pmsound'] == 0)
{
srand(make_seed()); $srand_snd = rand (1,10);
$sound = iif($bbuserinfo['pmunread'], '<embed src="sounds/message'.$srand_snd.'.wav" autostart="true" loop="0" hidden="true"></embed>');
}
***** Save and Close *****
OPEN profile.php
***** FIND *****
globalize($_POST, array('newstyleset' => INT, 'dst' => INT, 'showvbcode' => INT, 'pmpopup' => INT, 'umaxposts' => INT, 'prunedays' => INT,
'timezoneoffset', 'startofweek' => INT, 'languageid' => INT, 'threadedmode' => INT, 'invisible' => INT, 'autosubscribe' => INT,
'options', 'modifyavatar'));
***** REPLACE WITH: *****
globalize($_POST, array('newstyleset' => INT, 'dst' => INT, 'showvbcode' => INT, 'pmpopup' => INT, 'pmsound' => INT, 'umaxposts' => INT, 'prunedays' => INT,
'timezoneoffset', 'startofweek' => INT, 'languageid' => INT, 'threadedmode' => INT, 'invisible' => INT, 'autosubscribe' => INT,
'options', 'modifyavatar'));
***** FIND *****
pmpopup = $pmpopup,
***** ADD BELOW: *****
pmsound = $pmsound,
***** Save and Close *****
Create a new folder in your Forum home directory called sounds. (ie. /www/yourweb/forums/sounds)
Upload included wav files (or any other sounds of your choice and rename them to message1.wav, message2.wav, ect.. ect.. ect..) to the sounds folder
Upload and overwrite global.php and profile.php
***** Template Modifications *****
***** Open Template: navbar *****
***** FIND *****
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php?$session[sessionurl]"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>
</td>
***** ADD BELOW: *****
<if condition="THIS_SCRIPT!='private' and THIS_SCRIPT!='usercp'">
<if condition="$show['pmstats']">$sound </if>
</if>
***** Save and Close *****
***** Open Template: modifyoptions *****
***** FIND *****
<tr>
<td><label for="cb_pmpopup"><input type="checkbox" name="pmpopup" value="1" id="cb_pmpopup" $checked[pmpopup] />$vbphrase[show_pm_popup]</label></td>
</tr>
***** ADD BELOW: *****
<tr>
<td><label for="cb_pmsound"><input type="checkbox" name="pmsound" value="1" id="cb_pmsound" $checked[pmsound] />$vbphrase[disable_pm_sound]</label></td>
</tr>
***** FIND *****
<input type="hidden" name="pmpopup" value="$bbuserinfo[pmpopup]" />
***** ADD BELOW: *****
<input type="hidden" name="pmsound" value="$bbuserinfo[pmsound]" />
***** Save and Close *****
*** In your Admin Control Panel ***
Under Languages & Phrases, click "Phrase Manager"
Add New Phrase
Phrase Type: GLOBAL
Varname: disable_pm_sound
Text: Disable PM Sounds
Done!
You can find plenty more sounds here
http://www.thefreesite.com/Free_Sounds/Free_WAVs/
Enjoy!
то что
красным - нет или не совпадает