05-03-2017, 05:33 PM
heres what I've done,
create a new file maintenance.php, add the usual require init.php, header.php & navigation.php. add your html as you please and don't forget to require your footers aswell. anything is possible here including the use of fancy coming soon pages with countdowns etc.
in header.php
i changed:
<pre></pre>
and replaced with:
`//dealing with if the user is logged in
if($user->isLoggedIn() && !checkMenu(2,$user->data()->id)){
if (($settings->site_offline==1) && (!in_array($user->data()->id, $master_account)) && ($currentPage != 'login.php') && ($currentPage != 'maintenance.php')){
Redirect::to($us_url_root.'users/maintenance.php');
}
}
//deal with non logged in users
if(!$user->isLoggedIn() && !checkMenu(2,$user->data()->id)){
if (($settings->site_offline==1) && ($currentPage != 'login.php') && ($currentPage != 'maintenance.php')){
Redirect::to($us_url_root.'users/maintenance.php');
}
}
//notifiy master_account that the site is offline
if($user->isLoggedIn()){
if (($settings->site_offline==1) && (in_array($user->data()->id, $master_account)) && ($currentPage != 'login.php') && ($currentPage != 'maintenance.php')){
err("<br>The site is currently offline.");
}
}
'
now users are redirected to the maintenance page, you can go one further and have a link available only to admins to login
hope thats some use
create a new file maintenance.php, add the usual require init.php, header.php & navigation.php. add your html as you please and don't forget to require your footers aswell. anything is possible here including the use of fancy coming soon pages with countdowns etc.
in header.php
i changed:
<pre>
Code:
//dealing with if the user is logged in
if($user->isLoggedIn()){
if (($settings->site_offline==1) && (!in_array($user->data()->id, $master_account)) && ($currentPage != 'login.php')){
die("The site is currently offline.");
}
}
//deal with non logged in users
if(!$user->isLoggedIn()){
if (($settings->site_offline==1) && ($currentPage != 'login.php')){
die("The site is currently offline.");
}
}
//notifiy master_account that the site is offline
if($user->isLoggedIn()){
if (($settings->site_offline==1) && (in_array($user->data()->id, $master_account)) && ($currentPage != 'login.php')){
err("<br>The site is currently offline.");
}
}
and replaced with:
`//dealing with if the user is logged in
if($user->isLoggedIn() && !checkMenu(2,$user->data()->id)){
if (($settings->site_offline==1) && (!in_array($user->data()->id, $master_account)) && ($currentPage != 'login.php') && ($currentPage != 'maintenance.php')){
Redirect::to($us_url_root.'users/maintenance.php');
}
}
//deal with non logged in users
if(!$user->isLoggedIn() && !checkMenu(2,$user->data()->id)){
if (($settings->site_offline==1) && ($currentPage != 'login.php') && ($currentPage != 'maintenance.php')){
Redirect::to($us_url_root.'users/maintenance.php');
}
}
//notifiy master_account that the site is offline
if($user->isLoggedIn()){
if (($settings->site_offline==1) && (in_array($user->data()->id, $master_account)) && ($currentPage != 'login.php') && ($currentPage != 'maintenance.php')){
err("<br>The site is currently offline.");
}
}
'
now users are redirected to the maintenance page, you can go one further and have a link available only to admins to login
hope thats some use