Hey, this is sort of hard to explain but I'll try my best. I am trying to make a offline script for my site, so a function will check if the offline variable is set to 0 or 1. If it's set to 1, then it shows an offline page. I had it working, but that way made every page have the offline code on it. So, I have a functions.php script, and I have tried this:
I apologize for it being a long code, but it's the only way I could show you. So, as you can see it checks if $offline (defined above that code) is either 0, 1 or neither. If it's 0 it will return false, and the rest just sorta shows the code. When I put check_offline() on my pages, and set the variable to 0 (site online) it just shows the configuration issue error (see here).
Does anybody know what I should and can do? Thanks![/url]
| Code: |
|
<?php function check_offline() { if($offline == "0") { return false; } else if($offline != "0" || $offline != "1") { ?> <link rel="StyleSheet" type="text/css" href="template/template.css" /> <center><img src='images/header.jpg'></center><BR><BR> <fieldset> <legend>Site Offline</legend> <b><font color='yellow'>WARNING</font></b>: The site configuration variables seem to have been edited by hand. The ONLINE variable in the config.ini is set to something other than 0 or 1. Please check that the variable is set to either 0 or 1. The number 0 makes the site online while the number 1 makes the site offline to normal members. Administrators will have the priviledge to login to the administrator panel and change the site from online or offline. </fieldset> <?php } else if($offline == "1") { ?> <link rel="StyleSheet" type="text/css" href="template/template.css" /> <center><img src="images/header.jpg"></center><BR><BR> <fieldset> <legend>Site Offline</legend> <b><font color="yellow">WARNING</font></b>: This website, <?php echo $webname; ?>, is currently offline. This could be caused by site maintance or site closure. </fieldset> <?php } } ?> |
I apologize for it being a long code, but it's the only way I could show you. So, as you can see it checks if $offline (defined above that code) is either 0, 1 or neither. If it's 0 it will return false, and the rest just sorta shows the code. When I put check_offline() on my pages, and set the variable to 0 (site online) it just shows the configuration issue error (see here).
Does anybody know what I should and can do? Thanks![/url]
