2
$(function() {
var d = new Date();
var hora = d.getHours();
if (_userdata["user_level"] > 0) {
console.log("Você é da staff e pode acessar o fórum.");
} else if (hora >= 22 || hora <= 7) {
$('body').html('<div class="forumfechado">Fórum atualmente fechado. Volte mais tarde.</div>');
};
});
This code "closes" the webpage between 22 and 7. However, it takes the time of the PC and anyone who changes the time of the PC can access the webpage. How do I make it not happen? Could I do it using a GMT/Time Zone? If so, how?
I don’t have enough knowledge to accurately guide Fábil Miguel, but I believe it is possible with Javascript, using something like this -> http://help.exacttarget.com/pt-BR/Documentation/exacttarget/content/javascript_do_server/guide_syntax/core_library_server_side_javascript_functions/funcoes_javascript_do_servor_datetime/
– David
I believe that this way will give a much greater work, and will continue without much effectiveness.
– Alan Rezende
All right! I will choose to leave as it is. thanks.
– Fábio Miguel