vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Automatic Open and Closing of Forum (https://vborg.vbsupport.ru/showthread.php?t=185124)

tinkerbell 07-12-2008 08:55 PM

Automatic Open and Closing of Forum
 
Is there any mod out there where you can set your board to close and open at set times automatically.

If there isnt a mod does anyone have any suggestions?

I have searched the forum here and the net generally, I found one thread but it didnt hold much information on the 'how to' part. https://vborg.vbsupport.ru/showthread.php?t=118570

Can anyone help please.:erm:

Tinks

tinkerbell 07-16-2008 04:19 PM

I think a reasonable length of time has passed since i posted for me to bump this topic.

Its still relevent and I still need some help please.

Thank you
Tinks

Cryo 07-16-2008 07:24 PM

You'd basically have to make either make one PHP file and have it run say, at the top of the hour and check the time to decide if it should open or not. Or you could two two and make one open and one close. An example file would work like this...

One file for closing...
PHP Code:

// Close the Forums

    
$close_SQL "UPDATE tableprefix_setting SET value = 0 WHERE varname = \"bbactive\"";
    
$close mysql_query($close_SQL);

    
$close_txt_SQL "UPDATE tableprefix_setting SET value = \"Our forums are currently closed but will reopen at 8:00am EST.  Thank yoU!\" WHERE varname = \"bbclosedreason\"";
    
$close_txt mysql_query($close_txt_SQL); 

Another for opening...
PHP Code:

// Open the Forums

    
$open_SQL "UPDATE tableprefix_setting SET value = 1 WHERE varname = \"bbactive\"";
    
$open mysql_query($open_SQL); 

You would then go into your vB admin panel and, after uploading these, run them at the times you would like to open and close the boards respectively. Of course, this is extremely rough (you have to change the "tableprefix" to whatever your tables start with, and you'd also have to do the database connections, etc), but this should work.

You could probably setup some hooks to check if the time fell two times when the page loads too and just refuse the user.

tinkerbell 07-19-2008 03:27 PM

Thank you Cryo I will have a play around with it and see what happens.

Tinks:D


All times are GMT. The time now is 02:36 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.01043 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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