Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Enable / Disable Registrations (http://www.bvlist.com/showthread.php?t=10768)

Chez 13th March 2016 17:27

Enable / Disable Registrations
 
http://s29.postimg.org/ra3j1adhz/screenshot_43.png

SQL:

PHP Code:

CREATE TABLE `config` (
 `
namevarchar(255NOT NULL default '',
 `
valuevarchar(255NOT NULL default '',
 
PRIMARY KEY (`name`)
TYPE=MyISAM;

INSERT INTO `config` (`name` ,`value`)VALUES ('signup''0'); 


Then in signup.php find:

PHP Code:

require_once("include/bittorrent.php");
dbconn(); 



And add this code below:

PHP Code:

$signup mysql_result(mysql_query("SELECT value FROM config WHERE name = 'signup'"), 0);
if (
$signup == 0)
stderr("Error""Registrations close. Please come back later!"); 

Then create a file called closesdignup.php and add this code:

PHP Code:

<?
ob_start("ob_gzhandler");
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
$signup = (int)$_GET['signup'];
if (get_user_class() < UC_SYSOP){
stderr("w00t", "You don't have access to this site");
stdfoot();
exit;
}
stdhead("");
if ($CURUSER[stylesheet]=='1' || $CURUSER[stylesheet]>='3')
begin_frame("Open / Close registrations");
echo '<center>';
echo 'On this page you can open and close registrations:)<p>';
if ($signup != "")
{
 if ($signup == 1)
 {
 mysql_query("UPDATE config SET value = '1' WHERE name = 'signup'");
 write_log("Registrations open by $CURUSER[username]");
 }
 if ($signup == 2)
 {
 mysql_query("UPDATE config SET value = '0' WHERE name = 'signup'");
 write_log("Registration closed by $CURUSER[username]");
 }
}
$signup = mysql_result(mysql_query("SELECT value FROM config WHERE name = 'signup'"), 0);
if ($signup == 0)
{
    echo 'Registration is already closed<br/><a href=?signup=1>Click here to open registration!</a>';
}
else
{
    echo 'Registration is already open<br/><a href=?signup=2>Click here to close Registrations!</a>';
}
echo '</center>';
if ($CURUSER[stylesheet]=='1' || $CURUSER[stylesheet]>='3')
end_frame();
stdfoot();    
?>

That's it!
Hope this will be helpful!
Good luck!


puppy 15th November 2016 10:54

Does this appear on the staff panel ? Just curious as this is a inferring method. :friend:

Chez 15th November 2016 15:22

You can simply add the closedsignup.php file in staffpanel


All times are GMT +2. The time now is 16:20.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2022, vBulletin Solutions Inc.