Enabling or Disabling New User Registrations Mod 2026/08/18 by Ami Sapphire Last Updated: 2026/09/07 2026 [0907] Better setreg behavior - Page works in Page Links from the Admin Panel as intended Formatting changes This mod adds a feature that can enable or disable new user registrations through user/register.php. This can also be used to temporarily stop spam registrations through user/register.php as a nuclear option. This version is meant to be patched for eFiction 3.5.6 to future 3.5.9. This will also work with the original eFiction 3.5.3, but one entry will need some modification (since eFicton 3.5.3 and earlier use divs for formatting and 3.5.5 and later use tables for formatting) and a few lines are in different line positions in some files. admin/settings.php Line 240 Insert into -> Add this line: $setreg = $_POST['newsetreg'] == 1 ? 1 : 0; Line 246 Replace this line: $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET tinyMCE = '$tinyMCE', favorites = '$favorites', multiplecats = '$multiplecats', allowed_tags = '$allowed_tags', newscomments = '$newscomments', logging = '$logging', maintenance = '$maintenance', debug = '$debug', captcha = '$captcha' WHERE sitekey ='".SITEKEY."'"); with this: $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET tinyMCE = '$tinyMCE', favorites = '$favorites', multiplecats = '$multiplecats', setreg = '$setreg', allowed_tags = '$allowed_tags', newscomments = '$newscomments', logging = '$logging', maintenance = '$maintenance', debug = '$debug', captcha = '$captcha' WHERE sitekey ='".SITEKEY."'"); Around Line 444 [data has since shifted] Note: format is different pre-eFiction 3.5.5 Insert into -> Add this segment: [?]"._HELP_SETREG." -- docs/settingstable.sql [optional] Line 31 Insert into -> Add this line: `setreg` tinyint(1) NOT NULL default '1', -- docs/tables.sql [optional] Line 518 Insert into -> Add this line: `setreg` tinyint(1) NOT NULL default '1', -- install/install.php [optional] Around Line 930 [data has since shifted] Insert into -> Add this line: `setreg` tinyint(1) NOT NULL default '1', -- languages/en.php Line 306 Insert into -> Add this line: define ("_REGDISABLED", "The administrator has disabled new user registrations to this website."); --- languages/en_admin.php Line 214 Insert into -> Add this line: define ("_SETREG", "Enable New User Registrations"); Line 334 Insert into -> Add this line: define ("_HELP_SETREG", "Enables or disables new user registrations to your website."); --- user/register.php [This disables the page outright.] Line 27 Add this segment: if(isset($setreg) && $setreg == 0) { $output .= "
"._REGDISABLED."
"; } -- user/register.php [This disables the page for non-admins so you can test the page in the Page links settings from the Admin panel. This is proper.] Line 27 Add this segment: // This is to show the registration page as admin regardless of the registration setting // for the Page Links section in the Admin Panel if((isADMIN && uLEVEL == 1) && (isset($setreg) && $setreg == 0)) { include ("user/editbio.php"); } else if ((!isADMIN && uLEVEL != 1) && (isset($setreg) && $setreg == 0)) { $output .= "
"._REGDISABLED."
"; } -- update.php [optional] Line 290 Insert into -> Add this line: if (!dbassoc(dbquery("SHOW COLUMNS FROM ".TABLEPREFIX."fanfiction_settings LIKE 'setreg'"))) dbquery("ALTER TABLE `".TABLEPREFIX."fanfiction_settings` ADD `setreg` tinyint(1) NOT NULL DEFAULT '1' AFTER `multiplecats`"); -- Your database will need to be updated to support this feature: SELECT [database]; SHOW COLUMNS FROM [tableprefix]fanfiction_settings LIKE 'setreg'; If the setreg column does not exist, run this query: ALTER TABLE `[tableprefix]fanfiction_settings` ADD `setreg` TINYINT(1) NOT NULL DEFAULT '1' AFTER `multiplecats`;