XF 2.1 Change options via cron

Ozzy47

Well-known member
If possible, how would one go about setting up a cron job to turn off a option in a addon? the option is a simple On/Off checkbox. The addon option is called, spaminator_show_honeypots.
 
Create a cron job (Tools->Cron entries) that calls your PHP file.
In that PHP file have a static function:
PHP:
public static function myFunctionName()
{
    $optionsRepo =\XF::Repository('XF:Option');
    $optionsRepo->updateOption('spaminator_show_honeypots', 0);
}
 
Create a cron job (Tools->Cron entries) that calls your PHP file.
In that PHP file have a static function:
PHP:
public static function myFunctionName()
{
    $optionsRepo =\XF::Repository('XF:Option');
    $optionsRepo->updateOption('spaminator_show_honeypots', 0);
}

This worked out perfect, thank you. :)(y)
 
Back
Top Bottom