PDA

View Full Version : CRON the enabling/disabling of a plugin


dartho
11-10-2006, 02:04 AM
How could I set up a plugin to be automagically enabled/disabled in certain days/times?

dartho
11-14-2006, 02:32 AM
Anyone? Bueller?

dartho
10-27-2007, 01:07 AM
I've come back to this. I'm still looking for a way to schedule the activation of a plugin..

I've tried creating a PHP file which toggles the "active" status of a plugin directly in the database - but this seems to have no effect.

Any other suggestions where I may look would be appreciated.

Thanks

Marco van Herwaarden
10-27-2007, 07:44 AM
did you also update the datastore?

dartho
10-27-2007, 09:59 AM
um, no - I didn't. I'll go see if I can work it out now - any further guidance appreciated

Thanks!

--------------- Added 1193489532 at 1193489532 ---------------

OK- I had a look, and on the face of it - it seems too hard for my puny intellect to grasp.

I guess I could go with modifying the plugin so it's execution is dependent on say the existence of a flag file and cron the creation/deletion of the flag file as opposed to enabling/disabling the plugin itself...

Edit: works a treat!

|Jordan|
02-06-2008, 06:50 AM
um, no - I didn't. I'll go see if I can work it out now - any further guidance appreciated

Thanks!

--------------- Added 1193489532 at 1193489532 ---------------

OK- I had a look, and on the face of it - it seems too hard for my puny intellect to grasp.

I guess I could go with modifying the plugin so it's execution is dependent on say the existence of a flag file and cron the creation/deletion of the flag file as opposed to enabling/disabling the plugin itself...

Edit: works a treat!

Any chance you can release it?

dartho
02-07-2008, 12:05 AM
What I did was this:

Edit the plugin code and add the following:

$filename = "/path/to/forum/plugin.go";
if (file_exists($filename)) {


PLUGIN CODE


}


and then create 2 CRON jobs (I did it via cpanel) with the following as the command:
1. date>/path/to/forum/plugin.go and scheduled it to run when I wished to enable the plugin

2.
rm /path/to/forum/plugin.go and scheduled it to run when I want the plugin disabled

You could probably create a php file and use vBulletin's Scheduled Tasks
to do the CRON for you. It ain't pretty, but t works