News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

inhibit registration during certain hours.

Started by Het Bosje, June 26, 2016, 05:52:13 AM

Previous topic - Next topic

Het Bosje

Hello just upgraded from version 1.1.20 to 2.0.11.
Is there a tweak to do the automatically inhibit registration during certain hours?

I used this php-script controlled by cron.


#!/usr/bin/php
<?php
$host="localhost";
$password="";
$user="";
$db="smf";

$table="smf_settings";
$record="variable";

@mysql_connect($host, $user, $password) or die('No connection possible');
@mysql_select_db($db);

$query = "SELECT value FROM $table WHERE $record='registration_method'";
$result = @mysql_query($query);
$answer = @mysql_fetch_array($result);

if ($answer["value"] == 2) $waarde=3; else $waarde=2;

$query = "UPDATE $table SET value=$waarde WHERE $record='registration_method'";
$result = @mysql_query($query);

echo "settting changed into $waarde\n";
?>



Value 2 open for registratie
Value 3 closed

In the new situation I don't have shell acces so a crontab entry is no option.

Hope there is a solution.

best regards Pieter.

Advertisement: