Joomla schedule plugin activation

自闭症网瘾萝莉.ら 提交于 2021-01-29 11:16:57

问题


I have a problem for a long time about having my Joomla site go in offline mode in certain part of the week. I want to make in unaccesable to users for example thursday 12pm to friday 12pm. Is there some kind of plugin or something that can schedule such task? (sorry for bad English)


回答1:


I elaborate on Sergey's answer.

You could write a system plugin as I explain below, it won't take long. I'm not sure whether it exists already.

Instead of putting the site offline, your plugin can redirect output to the page you desire and clear the document content, or even load a different template.

With such behaviour, the site will be online or offline depending exclusively on the plugin, thus you need not worry about scheduling actions.




回答2:


No it is impossible to create plugin. plugin is triggered only i someone access site. If no one access then it will still be online. That half of the problem. You may put it offline as soon as first visitor try to access with certain timeframe. But after site is offline plugin will not be triggered anymore, so you cannot put it online.

The only option to automate is to write small PHP script that alter configuration.php file and change its offline parameter to 1. And then schedule this script in Cron.



来源:https://stackoverflow.com/questions/19856216/joomla-schedule-plugin-activation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!