Log in

View Full Version : Need to turn on/off all the forum at set times


passionboss
11-01-2005, 09:53 PM
Could anyone help me with this task. I need to activate the turn off function at 18:30 at nite and reactivate it at 06:00 Monday to friday. Also off all weekend. How would it carry this out as a scheduled task?

I have seen some sql querys that would do it....but the task window only uses php. I'm sure this can be done :ermm:

passionboss
11-03-2005, 09:59 AM
Ok, so a few views but no responses as of yet. Hope I'm asking this in the right forum, I believe I am.

Right what I have learnt so far is that there are query's I can run, that allow me to turn off and on vb........


Turn Off:
UPDATE datastore SET data=REPLACE(data,'"bbactive";s:1:"1"','"bbactive" ;s:1:"0"') WHERE title='options'

UPDATE setting SET value=0 WHERE varname='bbactive'


Turn On:
UPDATE datastore SET data=REPLACE(data,'"bbactive";s:1:"0"','"bbactive" ;s:1:"1"') WHERE title='options'

UPDATE setting SET value=1 WHERE varname='bbactive'



So now I understand these can be put into 2 php files, boardoff.php and boardon.php. These can then be run from the cron folder via scheduled tasks. What I need is the php code that I need to put into each file for each function. I assume its just a bit of php telling it to run the following query. But I know sod all about php coding, well very little! Can anybody help?

Thanks in advance,

Boss

passionboss
11-06-2005, 09:47 PM
Unashamedly bumped

StarBuG
11-06-2005, 10:34 PM
no guaranty cause I am no coder but try

as 1st line:

<?php

and as last:

?>

between that your query

hope it helps

Paul M
11-06-2005, 10:46 PM
Use this ;

<?php

error_reporting(E_ALL & ~E_NOTICE);

if (!is_object($vbulletin->db))
{
exit;
}

$vbulletin->db->query_write("
SQL UPDATE QUERY HERE
");

?>

Repeat the update section of code for multiple queries.