MyBB Community Forums

Full Version: Open/Close board automatically
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have a request for a mod or a solution, please!

My (academic) forum is full of students who have become addicted to spending hours on end on the forum--sometimes all night! Now that the exams will begin in a few days from now, I need to force my students to either logout after spending an "x" amount of time on the forum, and not to be able to login again in the same day, or to schedule my board to close automatically (and possibly open again) at specified times of the day.

If this seems strange to apply in terms of a mod, can my board settings ("on" or "off") be controlled automatically?

I will highly appreciate your help.

Best regards.
I do beleave I mod can be easlly made to do this. I don't have time to make it right now but I'm sure one of the other coders could.
Hello Dear matty, I know that I have saw something (script) like that, but it's allow you to turn off and on your server (not just the forum) so I'll try to find it again and I'll p-m you with a detail link to know how to use it (honestly I'm not sure if it's free and ready to download it, or paid script..)
BTW, I saw it on arabic scripting site.
Snake Wrote:I do beleave I mod can be easlly made to do this. I don't have time to make it right now but I'm sure one of the other coders could.

Thanks for giving me hope that such mod can be implemented. Such mod may have many other useful usages for forum admins, each accoding to his or her needs . I'm sure our generous coders will spare no effort to help, if it were really possible.

Many thanks for your concern

maatty
pepotiger Wrote:it allows you to turn off and on your server (not just the forum)...

My dearest PepoTiger...thanks for deep concern..I'll consider this possibility too of turning off the whole server although this means turning off the main site as well, at least we have a bird in the hand. I'll wait anyway till our great coders here have their say.

Yours
maatty
pepotiger Wrote:it allows you to turn off and on your server (not just the forum)...

My dearest PepoTiger...I saw the script demo and it is precisely what I had in mind, but unfortunately they only provide a demo and not the actual script. I could also see the possibility of applying this script to the forum itself and not necessarily the whole server.

My very best wishes
maatty
hello Dear maatty
maatty Wrote:I could also see the possibility of applying this script to the forum itself and not necessarily the whole server.
no there is much defrant, the script it use something called corn jobs, this can't be use to close the forum only, it's totaly defrant..
and for how to get this script till now I think you should contact the author.. you can do that
Here
yours,
Ahmed
You can create a cron job for this.

Create a php file with this inside it.

<?php

define("IN_MYBB", 1);

require_once "./global.php";

global $mybb, $db;

if (action == "close"){
$db->query("UPDATE ".TABLE_PREFIX."settings SET value='yes' WHERE name='boardclosed'");
}


if (action == "open"){
$db->query("UPDATE ".TABLE_PREFIX."settings SET value='no' WHERE name='boardclosed'");
}
?>

Now that's not secure so anyone executing that and knowing it's name would be able to open and close your board so name the file something long and cryptic like 48jfds93rj3.php

Now you will need 2 cron jobs..one to close and one to open.

/path/to/file/48jfds93rj3.php?action=open

/path/to/file/48jfds93rj3.php?action=close

Test this because sometime php doesn't execute in this manner and you will need to add /usr/local/bin/php -p (path to your php executable)

Something like this:

/usr/local/bin/php -p /path/to/file/48jfds93rj3.php?action=open

Of course cron also requires the time in front of it..if you have cpanel it's usually simple. Let me know how this goes for you.
pepotiger Wrote:the script uses something called corn jobs...
Dearest Pepotiger...it is getting more complicated then...unfortunately I don't know the difference between corn jobs and corn flakes! Surely, I don't want to sacrifice my site for the sake of my forum. The only alternative I have now is to create a group with limited permissions and put my "addicted" students in it, till they finish their exams, or to use DennisTT's Additional User Settings plugin to disallow them from posting, but this could be a very tedious job having to do with hundreds of them. The idea of closing my forum at certain times would also be healthy for me as an "addicted administrator"! Anyway, there is never an end to my hope. By the way, I have put this issue of "forum addiction" in my forum, and I would like you to read it please:
http://www.edcu.net/forums/showthread.php?tid=1776

Thanks dear
Mohamed
labrocca Wrote:You can create a cron job for this.

Thanks a lot dear abrocca. I have just read your reply. I'll try your suggested corn jobs immediately. I'm so excited to know the results. I'll let you know how it goes. I'm so grateful for your deep concern.

Yours sincerely
Mohamed
Pages: 1 2