Welcome, Guest. Please Login or Register.
May 03, 2025, 12:54:39 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Default Settings mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Default Settings mod  (Read 444 times)
pablo
Noobie
*
Posts: 32


Don't worry - it's just a mental crisis

WWW
Default Settings mod
« on: May 08, 2002, 12:02:47 PM »
Reply with quote

I have just experienced the effect of the default settings being used to reset my YaBB forum when a fault occurred as an administrator was saving some changes to the settings.

The purpose behind having these default settings is, I'm sure, to provide a graceful recovery from potential catastrophe.

The actual effect was to let all hell break loose.

And I suspect that this is a problem waiting to happen on everybody's YaBB system, because of the way the defaults are written (ie. deeply embedded into the PHP code).

One problem (could call it a bug) is that the default settings do not reflect the defaults of the system that it is installed into. (They do not even reflect the defaults that are offered during the installation process.)

The solution I'm proposing might actually be simpler than what is currently done in Admin.php.

  • Create a file called Settings_def.php that is used to house all the default settings. The layout of Settings_def.php can be identical to Settings.php.

  • In Admin.php, when there is the need to reimpose the default settings, Settings_def.php can be copied as Settings.php. If it's also necessary to have those values for immediate use in Admin.php, an include_once('Settings_def.php') should do the trick.

  • As the final step of the installation process, Settings.php would be copied to Settings_def.php to establish a useful set of defaults.

  • It would also be useful to add a link to the admin page, saying "Update default settings with current settings", so that the administrator can bring the defaults up to date when they want.
I'd be very interested in comments from the YaBB creators. If you can't see any problems with this, I'll have a go at creating the mod myself. {gulp}

Cheers,
Paul.
Logged
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:Default Settings mod
« Reply #1 on: May 08, 2002, 01:33:42 PM »
Reply with quote

Although Settings_bak.php has the "out of the box" settings in it, I can see a couple updated uses for such a thing, more like a better back up type of thing. You could update the backup of your settings at any time if your sure things are working properly. This would be a very nice mod as I sometimes worry about making people admins (so I just make them global mods) because I'm scared that someone will screw up the settings (and in fact, I've had this happen before.)
Logged
pablo
Noobie
*
Posts: 32


Don't worry - it's just a mental crisis

WWW
Re:Default Settings mod
« Reply #2 on: May 08, 2002, 02:22:10 PM »
Reply with quote

When things all screwed up a few days ago I did indeed replace Settings.php with Settings_bak.php (manually).

It's true that Settings_bak.php does have the latest version of the settings and could be used in the same way as I'm suggesting (in place of a Settings_def.php).

The only risk is perhaps that Settings_bak.php gets updated with corrupted data during the 'Save' process that triggers the error detection code. Then you'd end up with a completely screwed system. If that's a possibility, then a Settings_def.php becomes a life-saver.

I'm going to add a new element to my mod suggestion:
Also have a 'Revert to default settings' link on the admin window, so that the administrator can re-impose the defaults without having to leave the YaBB interface.


Paul.
Logged
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:Default Settings mod
« Reply #3 on: May 08, 2002, 02:34:07 PM »
Reply with quote

Oh, I wasn't aware that Settings_bak.php updated, I just thought it was the original settings that came with the package.
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:Default Settings mod
« Reply #4 on: May 08, 2002, 02:52:47 PM »
Reply with quote

Yes Settings_bak.php is saved to as a backup just incase when you alter your settings.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Default Settings mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.011 seconds with 17 queries.