vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need to turn on/off all the forum at set times (https://vborg.vbsupport.ru/showthread.php?t=99870)

passionboss 11-01-2005 09:53 PM

Need to turn on/off all the forum at set times
 
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........


Quote:

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'
Quote:

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 ;

Code:

<?php

error_reporting(E_ALL & ~E_NOTICE);

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

$vbulletin->db->query_write("
        [high]SQL UPDATE QUERY HERE[/high]
");

?>

Repeat the update section of code for multiple queries.


All times are GMT. The time now is 02:42 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01396 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete