Show line of code according to date

Asked

Viewed 51 times

0

I have a static page that will work offline with the proposal to be a control panel that will have the "day schedule" of a church. In one of the columns (as shown in the image) one of the videos will be changed daily and all the rest will remain intact. The question is: is there a possibility to leave all the tags of the videos I will use already listed (but hidden) and show only the video I need for that day, preset by a command that takes into account the date?

Current line of code:

<video class="borda-player" src="videos/1.mp4" controls="true"></video>

inserir a descrição da imagem aqui

  • Will you have videos for every day? How are the videos/tags stored? Do they come from a database? You should put the relevant code about videos/tags, https://answall.com/posts/265301/edit

  • Good afternoon Miguel! It will be a different video for every Saturday of the month. this is the line I’m using: <video class="edge-player" src="videos/1.mp4" Controls="true"></video>

  • It would be something like this: https://ideone.com/Do6ehs. in which the keys of the array will be the days of the Saturdays of the month? you can test by placing 26 as one of the keys of the array that is today

1 answer

0

Good afternoon Talles,

You can do it two ways:

In the code itself you put an IF clause with Now() to check the date and present the video that.

Or make a database for and in the database (can be a simple mysql) and register which video path you want for that day.

I hope I’ve helped.

  • Good afternoon Rodrigo! Thank you for your help! Could you give me a light? This goes beyond the basic knowledge that I still have.rs My line of code is very simple. See: <video class="edge-player" src="videos/1.mp4" Controls="true"></video>

  • if(strtotime('2017-12-25') == now()) { echo(<video class="edge-player" src="videos/Feliznatal.mp4" Controls="true"></video>); } elseif(strtotime('2017-12-31') == now() { echo(<video class="edge-player" src="videos/Felizanonovo.mp4" Controls="true"></video>); } Else { echo(<video class="edge-player" src="videos/Diasnormal.mp4" Controls="true"></video>); }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.