Home>
Not strong in php, please help. It is necessary to make sure that when the text NOW WATCHES appears on the site (it appears in the admin panel, if the user entered the site there was a sound signal, the sound file was played once). In this case, an update occurs every 5 seconds, the user is found, that is, when updating, if the function is hanged, it can be re-executed every 5 seconds. How to avoid it? I've been scratching my head for more than one day, I ask for help. Code below
<div class="metrics_info"> <?php echo $geo; ?> <br> <?php if((strtotime($value["date_view"]) + 180) > time()){ ?> <span class="online badge-pulse-green-small"></span> are watching now
<br> <?php } ?> <?php if($value["view_page_title"]){ ?> <a title="<?php echo $value["view_page_title"]; ?>" target="_blank" href="<?php echo $value["view_page_link"]; ?>"> <?php echo custom_substr($value["view_page_title"],40, "..."); ?> </a> <?php }else{ ?> <a title="<?php echo $value["view_page_link"]; ?>" target="_blank" href="<?php echo $value["view_page_link"]; ?>"> <?php echo custom_substr($value["view_page_link"],40, "..."); ?> </a> <?php } ?></div>
-
Answer # 1
Related questions
- javascript : Output and immediately insert data into the database
- javascript : Persistent open tabs
- javascript : AJAX requests, JS and PHP [duplicate]
- javascript : PHP code initializes variable all over again and over again
- javascript : Launching Fortnite or games from EpicGames via the link
- javascript : Repeated GET request to the image when flipping the slider in the firefox browser
- javascript : js code execution protection
- javascript : How can I transfer Recaptcha v2 for solution to another person
- javascript : $("#element").va() returns an empty string, but if this is written in the console (ctrl+shift+i), then the correct
You can add a function definition
beep
, and if you want to play a sound, add to the page output.
A source
In principle, it is clear, but how to change the sound to your own? I can not find !
Андрей Черемушкин2022-01-22 17:16:45Ah, well, this is a sequencer, by changing the frequency you can achieve interesting sounds. For example, the tone dial buttons on a telephone produce sounds of frequencies: 1= 700/900 2= 700/1100 3= 900/1100 4= 700/1300 5= 900/1300 6= 1100/1300 7= 700/1500 8= 900/1500 9= 1100/1500 0= 1300/1500 #= 700/1700 *= 1300/1700
DiD2022-01-22 17:35:51Works only in this sequence now they watch , but the data about the user on the site is updated every 5 seconds, AND every 5 seconds there is a sound !! I don't understand how to solve this
Андрей Черемушкин2022-01-22 18:56:41I would like to consider the option with personal sounds in the form of mp3 for notification. Your variant works but something is wrong in the function call.
Андрей Черемушкин2022-01-22 19:02:30