Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on October 10, 2014, 07:34:40 PM

Title: Styled Maintenance Mode Message
Post by: dougiefresh on October 10, 2014, 07:34:40 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3952)


STYLED MAINTENANCE MODE MESSAGE v1.4
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3952)


Introduction
SMF has TWO maintenance modes, as defined in Settings.php by the variable $maintenance in your forum folder.  Setting this variable to 1 allows the adminstrators access to perform any necessary actions that don't require taking the database offline.  Setting this variable to 2 (hardcore maintenance mode) makes the forum itself unaccessable for EVERYBODY.  Not even adminstrators can log into the forum.

What This Mod Changes
When any Simple Machines forum is in maintenance mode (where $maintenance in Settings.php is set to 2), there is absolutely no CSS style to make the maintenance message look consistent with the rest of the site.  This mod attempts to resolves this issue, using the default theme CSS, to style the maintenance mode message shown to the user. 

Arantor (https://www.simplemachines.org/community/index.php?action=profile;u=318771) stated in this post (https://www.simplemachines.org/community/index.php?topic=528839.msg3755027#msg3755027):
Quote
There are two levels of maintenance mode. General maintenance mode - which shows the theme like it should, and hardcore maintenance mode, which shows a basic page.

Considering that the ONLY time the white screen should be applicable is during upgrades - in which state even the default theme is by definition in flux and not necessarily reliable to be used
(Yes, there are several more lines in the post which are omitted!)

Restrictions
Since theme support has not been loaded as of this point, other themes cannot be selected within the UI at this point.  This may change in future versions, but I doubt it.

Admin Settings
There are none.  You must uninstall this mod to remove it.

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on SMF 2.1 Beta 1, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/styled-maintenance-mode-message/?tab=1).

License
Copyright (c) 2015 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Styled Maintenance Mode Message
Post by: Joomlamz on October 11, 2014, 01:34:34 AM
Nice Work
When have linguage files send any news to Update Portuguese file
Title: Re: Styled Maintenance Mode Message
Post by: dougiefresh on October 11, 2014, 04:18:36 AM
Thanks!

The original SMF code for the maintenance mode (found in Sources/Errors.php) didn't use any language files to display the code.  It's noted in the code that language files haven't been loaded yet, so it can't use any language files....  My mod doesn't change this, only fixes the code so that the maintenance mode message is CSS-styled using the default theme.....

Will this ever change?  It won't in any branch of v2.0.x, at least for my mod.....
Title: Re: Styled Maintenance Mode Message
Post by: Ninja ZX-10RR on October 16, 2014, 11:25:16 AM
Sure again you and another useful mod! Congrats! It should be in smf core to me.
Title: Re: Styled Maintenance Mode Message
Post by: Arantor on October 16, 2014, 01:48:51 PM
Sure again you and another useful mod! Congrats! It should be in smf core to me.

Strongly disagree.
Title: Re: Styled Maintenance Mode Message
Post by: Ninja ZX-10RR on October 16, 2014, 02:19:03 PM
Why you prefer an ugly black and white page versus a pretty and styled page is a thing I would like you to explain :)
Title: Re: Styled Maintenance Mode Message
Post by: Arantor on October 16, 2014, 02:25:55 PM
What made you think it was about preference? I also see no reason to explain all my thought processes to you.
Title: Re: Styled Maintenance Mode Message
Post by: Ninja ZX-10RR on October 16, 2014, 02:37:31 PM
The fact that you are being nervous because you just came back home is not my problem, neither your rudeness.

This is a FORUM, so I expressed my opinion and I explained the reasons for it, you expressed your opinion and then refuse to explain it? That's against any forum purpose and also useless, if you want to express your opinions without supporting them nobody will actually care about them since they would be pointless for everybody else except you, the only person that can understand them since you are the one who thought about them. Please explain it or either don't post things like "I see no reason to explain", then don't post and leave? It's nice if I or even we as a community can learn from your thoughs, but it's not nice if you just say "no" and then "no I won't explain", that's absurd.
Title: Re: Styled Maintenance Mode Message
Post by: Arantor on October 16, 2014, 02:43:08 PM
Quote
The fact that you are being nervous because you just came back home is not my problem, neither your rudeness.

It's not nervousness.

You expressed an opinion. I expressed a counter opinion. I neither have to defend nor justify my opinions to anyone, just as you do not have to defend or justify yours.

I have just learned from too much time around certain people here that my explanations are usually unwanted and unheeded and that it's simply better to express an opinion and move on.
Title: Re: Styled Maintenance Mode Message
Post by: Ninja ZX-10RR on October 16, 2014, 03:43:11 PM
Did I ever refuse your opinion without even listening? No, I always encouraged you to express it since it's one of the most valuable in here, to me.
Title: Re: Styled Maintenance Mode Message
Post by: dougiefresh on October 16, 2014, 05:26:02 PM
Well, for the record, I thought it was a good idea to do this mod.  As of this post, 44 downloads have been made in the last week....  Says something, doesn't it?
Title: Re: Styled Maintenance Mode Message
Post by: Ninja ZX-10RR on October 16, 2014, 05:27:05 PM
That's a good result to me! :)
Title: Re: Styled Maintenance Mode Message
Post by: Westwegoman on October 16, 2014, 11:00:52 PM
Forgive me if I am missing something here but, I don't have this mod installed yet when I put my forum into maintenance mode, it does not have just a white screen with a message. It has the same styling as the forum it's self. Always has.

I'm using the default theme.

Title: Re: Styled Maintenance Mode Message
Post by: Arantor on October 17, 2014, 12:01:37 AM
There are two levels of maintenance mode. General maintenance mode - which shows the theme like it should, and hardcore maintenance mode, which shows a basic page.

Considering that the ONLY time the white screen should be applicable is during upgrades - in which state even the default theme is by definition in flux and not necessarily reliable to be used, I don't understand what benefit this provides because I don't understand how many people spend *any* amount of time in hardcore maintenance mode.

Let me put it this way: the total time my sites have spent in such, over the last 8 YEARS of running sites has that total time measured in hours. Over 8 years.

There is no benefit that I can see to having it.
Title: Re: Styled Maintenance Mode Message
Post by: Westwegoman on October 17, 2014, 12:13:00 AM
There are two levels of maintenance mode. General maintenance mode - which shows the theme like it should, and hardcore maintenance mode, which shows a basic page.
That certainly clarifies things. Thanks! :)
Title: Re: Styled Maintenance Mode Message
Post by: dougiefresh on October 20, 2014, 07:45:34 AM
I'm trying to write a more reliable backup system for SMF and I thought it would be nice to have a maintenance page that didn't scream "LAME!" during those times that the forum is down due to the backup code....
Title: Re: Styled Maintenance Mode Message
Post by: Arantor on October 20, 2014, 07:58:37 AM
This would be infinitely more feasible if SMF used transactions for everything, though.
Title: Re: Styled Maintenance Mode Message
Post by: dougiefresh on January 19, 2015, 09:45:12 AM
Uploaded v1.1 - January 19th, 2015
o License change to Simplified BSD.  No functionality change.
Title: Re: Styled Maintenance Mode Message
Post by: dougiefresh on April 10, 2015, 07:40:14 PM
Uploaded v1.2 - April 6th, 2015
o Updated for SMF 2.1 Beta 1
Title: Re: Styled Maintenance Mode Message
Post by: njtweb on May 17, 2018, 08:29:17 PM
I am running 2.0.15 and when maint mode is enabled it's not a white page. It's the login page with the maintenance mode message over the login fields. Does this mod override that page as well?
Title: Re: Styled Maintenance Mode Message
Post by: vbgamer45 on May 17, 2018, 10:23:26 PM
I am running 2.0.15 and when maint mode is enabled it's not a white page. It's the login page with the maintenance mode message over the login fields. Does this mod override that page as well?
No
Title: Re: Styled Maintenance Mode Message
Post by: njtweb on May 18, 2018, 08:57:59 AM
Ok, thank you
Title: Re: Styled Maintenance Mode Message
Post by: dougiefresh on May 22, 2018, 12:00:24 AM
Uploaded v1.3 - May 21st, 2018
o Updated documentation.  No functionality change.
Title: Re: Styled Maintenance Mode Message
Post by: dougiefresh on November 02, 2018, 01:52:49 PM
Uploaded v1.4 - November 2nd, 2018
o No functionality change.
o Updated documentation to point to new website.