Quote:
Originally posted by Boofo
350Chevy, what is your exact coding for that piece of code?
|
Take all the code out of index.php that you added...
Make sure this code is NOT in index.php
PHP Code:
function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); }
and place in in global.php under
next find this in global.php
PHP Code:
$headnewpm='';
if ($checknewpm and $bbuserinfo['userid']!=0 and $bbuserinfo['pmpopup']==2) {
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]";
}
$newpmmsg=1;
eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}
Add this under that code:
PHP Code:
$headerpms='';
$permissions=getpermissions();
if ($enablepms==1 and $permissions['canusepm'] and $bbuserinfo['receivepm']) {
$ignoreusers="";
if (trim($bbuserinfo['ignorelist'])!="") {
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' ',$bbuserinfo[ignorelist]));
}
$headpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
if ($headpm['messages']!=0) {
srand(make_seed()); $srand_snd = rand (1,10);
$sound='<embed src="audio\sound'.$srand_snd.'.wav" autostart="true" loop="0" hidden="true"></embed>';
} else {
$sound=''
}
}
and place your sound1.wav - sound10.wav files in the sub folder called audio.
then open your header template and place $sound anywhere you see fit.
That should do it.