Include file containing sound if time is less than code

Go down

Include file containing sound if time is less than code Empty Include file containing sound if time is less than code

Post by jamied_uk on 5th May 2016, 18:17

Include a sound if time matches desired time for example if more or less than 1 (so for new messages a sound can be heard)!

Code:

$convertedTime = '';

$when = '';

$timeAgoObject = new convertToAgo; // Create an object for ago

$convertedTime = ($timeAgoObject -> convert_datetime($postdate));

$when = ($timeAgoObject -> makeAgo($convertedTime));

$now = date('Y-m-d H:i:s');
if($when < '1'){

include 'chat_sound.php';

}



the sound file example:




Code:
<?php
$soundclip ="media/new_message.mp3";
?>
<audio id="sound" src="<?php echo $soundclip;?>" type="audio/mp3" autoplay="yes"></audio>
<div id="sound"></div>
jamied_uk
jamied_uk
Admin

Posts : 2471
Join date : 2010-05-09
Age : 36
Location : UK

http://address-shortner.co.uk

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum