Page 1 of 1

Site Online/Offline

PostPosted: Tue Dec 20, 2011 11:49 am
by keinelust
Hello

times have made ​​a small hack
Site Online / Offline

Open config.php and add to
Code: Select all
$fop =  fopen('secure/settings.dfh', 'r');
$content = fread($fop, '999');
fclose($fop);
$content = explode("|", $content);


after
Code: Select all
$GLOBALS["SITE_ONLINE"] = true;


please change to the header.php and open
and after
Code: Select all
require_once("./functions.inc.php");

the insert
Code: Select all
if (!$GLOBALS["SITE_ONLINE"])
    die("The site is currently not available due to maintenance work. ");


true = Online
false = Offline


sorry for my english I speak German

Re: Site Online/Offline

PostPosted: Tue Dec 20, 2011 7:59 pm
by iheartbreakz
it be better if you can make it so you can choose site online/offline from admin panel but good mod though

Re: Site Online/Offline

PostPosted: Tue Dec 20, 2011 9:11 pm
by keinelust
on Admin panel I tested it only makes offline then I'll sit on the days ran again

Re: Site Online/Offline

PostPosted: Wed Dec 21, 2011 3:10 am
by iheartbreakz
sorry i didn't understand what you said.. but if you can make it like on the admin panel settings you can have a setting called "Offline" and have its options as "on" "off".. that be great.. so if you choose on, the site will go offline and if you choose off the site will be online like usual

Re: Site Online/Offline

PostPosted: Wed Dec 21, 2011 5:26 am
by keinelust
hello, I meant I have already tried it on admin panel nothing brings if side completely off-line then is also off-line adminl panel

sorry for mine bad english I speak in German

Re: Site Online/Offline

PostPosted: Wed Dec 21, 2011 4:45 pm
by iheartbreakz
ohhh.. is there anyway you can make the admin panel accessable and others not

Re: Site Online/Offline

PostPosted: Sat Jan 25, 2014 3:38 pm
by gyurma
Sziasztok!
Elnézést hogy nem angolul írok de hibás a google fordító.
Nagyon köszönöm ezt a remek kis kódot szuper nagy hasznát vettem.
És ennek örömére ki bővitettem azzal hogy ha offline re állítod az oldalt attól még te el tudd érni az oldalt a saját ip címedről mert ez is fontos fejlesztés alatt.
Itt a kód

Code: Select all
$sip = $_SERVER['REMOTE_ADDR'];
if ($sip !=="192.168.156.220") {
$fop =  fopen('settings.dfh', 'r');
$content = fread($fop, '999');
fclose($fop);
$content = explode("|", $content);
$GLOBALS["SITE_ONLINE"] = false;
if (!$GLOBALS["SITE_ONLINE"])
    die("Az oldal zárva!!!");
}

Re: Site Online/Offline

PostPosted: Sat Feb 08, 2014 11:22 pm
by Synetics
Thanks