01-27-2017, 01:54 PM
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></pre>
in the login.php
I added an echo for the $maintenance_text.
I guess you should remove
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
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. ';}
}}
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