Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: SMiFFER on March 11, 2020, 05:43:11 PM

Title: MAINTENANCE mode
Post by: SMiFFER on March 11, 2020, 05:43:11 PM
I am trying but obviously missing something.

When I set maintenance mode = on

I want to display another webpage.

What I did so far was amend "LOAD.php" and "ERRORS.php", but I for some reason I ask you guys I can not get it done.

What I want to do is show another HTML-page and have it displayed.
I have therefore commented out this

/*
*         echo '
*      <title>', $mtitle, '</title>
*   </head>
*   <body>
*      <h3>', $mtitle, '</h3>
*      ', $mmessage, '
*   </body>
*</html>';
*/


and put in

header('Location: https://www.page-to-show.html');


But what's in the way so that this does not work?
Title: Re: MAINTENANCE mode
Post by: Herman's Mixen on March 11, 2020, 08:30:37 PM
use the code tags !

you can you need to modify some of your files.. its not that hard..
Title: Re: MAINTENANCE mode
Post by: Sir Osis of Liver on March 11, 2020, 10:32:07 PM
Subs-Auth.php




// Display a message about the forum being in maintenance mode, etc.
function InMaintenance()
{
global $txt, $mtitle, $mmessage, $context, $smcFunc;

loadLanguage('Login');
loadTemplate('Login');

// Send a 503 header, so search engines don't bother indexing while we're in maintenance mode.
header('HTTP/1.1 503 Service Temporarily Unavailable');

header("Location: http://www.yourforum.com/readme.html");

// Basic template stuff..
$context['sub_template'] = 'maintenance';
$context['title'] = $smcFunc['htmlspecialchars']($mtitle);
$context['description'] = &$mmessage;
$context['page_title'] = $txt['maintain_mode'];
}



Of course, it leaves you with no way to login.  You'd have to take it out of maint mode in Settings.php.

Title: Re: MAINTENANCE mode
Post by: SMiFFER on March 12, 2020, 10:05:33 AM
Thank you!