Include file containing sound if time is less than code

View previous topic View next topic Go down

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>
avatar
jamied_uk
Admin

Posts : 2243
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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