Hello,
Is there anyway to automatically turn off/close and then turn back on forums a specific time of the day ? maybe through a cron job or something ?
I get the feeling the hard part is what he'd struggle with
I've actually pretty much written this already. I misunderstood earlier I thought it was individual nodes for some reason rather than the entire board.
So it's only taken less than 30 minutes
I have asked a question in the resource requests page to find out how long the board needs to be off for, but basically, here's the code. I'm going to add a few admin CP options which don't feature yet. It needs a Board On Cron Entry and a Board Off Cron Entry.
PHP:
<?php
class BoardActiveCron_CronEntry_BoardOnOff
{
public static function boardOn()
{
$db = XenForo_Application::getDb();
$db->update('xf_option', array('option_value' => 1), 'option_id = "boardActive"');
XenForo_Model::create('XenForo_Model_Option')->rebuildOptionCache();
}
public static function boardOff()
{
$db = XenForo_Application::getDb();
$db->update('xf_option', array('option_value' => 0), 'option_id = "boardActive"');
XenForo_Model::create('XenForo_Model_Option')->rebuildOptionCache();
}
}
It'd be a lot easier if there was a function. For example, there's XenForo_Application::get('options'), it'd be better if we could update options with something like:
XenForo_Application::set('options', 'boardActive', 0);
It'd be a lot easier if there was a function. For example, there's XenForo_Application::get('options'), it'd be better if we could update options with something like:
XenForo_Application::set('options', 'boardActive', 0);