Bravo List
Register
Go Back   > Bravo List > Sourcecode > TBDev > Mods & Themes
Reply
  #1  
Old 13-03-16, 17:27
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 241
Default Enable / Disable Registrations
Click the image to open in full size.

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!

__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
  #2  
Old 15-11-16, 10:54
puppy's Avatar
puppy puppy is offline
Member
 
Join Date: Feb 2016
P2P
Posts: 12
Default
Does this appear on the staff panel ? Just curious as this is a inferring method.
__________________
http://www.scene-community.com
Reply With Quote
  #3  
Old 15-11-16, 15:22
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 241
Default
You can simply add the closedsignup.php file in staffpanel
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
Reply

Tags
disable , enable , registrations

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 15:03. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2017, vBulletin Solutions Inc.