The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maintenance mode
#1
I just set my website to "offline", in the admin panel. But I was missing a maintenance mode. So I did the following;

added this to header.php

<pre>
Code:
if ($user->data()->username == 'admin'){ $maintenance_text=' your website is in maintance mode! ';}

else{
if ($settings->site_offline==1){

        $urlasstring = $_SERVER['REQUEST_URI'];
        $findme   = 'login.php';
        $pos = strpos($urlasstring, $findme);
                //not login.php
        if ($pos === false) {
            Redirect::to($us_url_root.'users/login.php');
        }
        else {$maintenance_text = ' Website is not available due to maintenance. ';}
}}
</pre>


in the login.php

I added an echo for the $maintenance_text.

I guess you should remove
Code:
if ($settings->site_offline==1){die("The site is currently offline.");}?>

from line 10 in the user_settings.php or you won't be able to see this as "admin"

Now I can work on my site, without the user using the website Smile
  Reply


Messages In This Thread
Maintenance mode - by emanresu - 01-27-2017, 01:54 PM
Maintenance mode - by mudmin - 02-03-2017, 02:18 PM
Maintenance mode - by firestorm - 05-03-2017, 05:33 PM
Maintenance mode - by Brandin - 05-06-2017, 11:36 AM
Maintenance mode - by firestorm - 05-08-2017, 05:48 AM
Maintenance mode - by mudmin - 05-09-2017, 10:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)