<?php
// +-------------------------------------------------------------+
// | HiveMail™ version 1.3.1
// +-------------------------------------------------------------+
// | HIVEMAIL™ IS NOT FREE SOFTWARE
// | If you have downloaded this software from a website other
// | than Hivemail or if you have otherwise received
// | this software from someone who is not a representative of
// | this organization you are involved in an illegal activity.
// +-------------------------------------------------------------+
// | $RCSfile: user.sound.php,v $ - $Revision: 1.10 $
// | $Date: 2004/07/21 02:49:32 $ - $Author: tubedogg $
// +-------------------------------------------------------------+

error_reporting(E_ALL & ~E_NOTICE);
$templatesused = '';
require_once('./global.php');

// ############################################################################
// Verify the sound ID
$sound = getinfo('sound', $soundid, false, false, false);

// ############################################################################
// Default sound
if (!$sound) {
	$fp = fopen('./misc/youvegotmail.wav', 'rb');
	$filedata = fread($fp, filesize('./misc/youvegotmail.wav'));
	fclose($fp);

	$sound = array(
		'filename' => 'youvegotmail.wav',
		'data' => $filedata,
	);
}

// ############################################################################
// Server file
if (stristr($HTTP_USER_AGENT, 'MSIE')) {
	$atachment = '';
} else {
	$atachment = ' atachment;';
}
$extension = getextension($sound['filename']);
header('Cache-control: max-age=31536000');
header('Expires: '.gmdate('D, d M Y H:i:s', TIMENOW + 31536000).'GMT');
header('Last-Modified: '.gmdate("D, d M Y H:i:s", TIMENOW).'GMT');
header('Content-disposition:'.$atachment.' filename='.$sound['filename']);
header('Content-Length: '.strlen($sound['data']));
header('Content-type: '.$mimetypes["$extension"]);
echo $sound['data'];

?>