Wednesday 01st October 2008
 
 
 
 
 
 


 
 
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...

Maintenance Mode TPL

March 27, 2006 Author: Chris T Posted in: Seditio Core Hacks
 

Credits

This was originally created by Koradhil of ldu-dev.net, but the site is now closed thanks to dyllon who managed to find this core hack and posted in bhsdesign.com


Open /system/functions.php and find the function ldu_diemaintenance.
In ldu 802 this is how the function looks:

Find

function ldu_diemaintenance($reason)
    {
    global $L, $cfg;
 
    $msg = $L['com_maintenance']."<br />";
    $msg .= $L['Reason']." : ".$reason."<br />";
    $msg .= "<p>".$L['com_maintenance_login']."<br />";
    $msg .= "<form id=\"login\" action=\"auth.php?m=login&a=check\" method=\"post\">User name : <input type=\"text\" class=\"text\" name=\"rusername\" size=\"16\" maxlength=\"32\" />     Password : <input type=\"password\" class=\"password\" name=\"rpassword\" size=\"16\" maxlength=\"32\" />     <input type=\"submit\" class=\"submit\" value=\"Submit\" /></form></p>";
    ldu_diefatal($msg, 'Maintenance');
    }

Replace with

function ldu_diemaintenance($reason)
{
global $L, $cfg;
if (file_exists("skins/".$cfg['defaultskin']."/maintenance.tpl")) {
$loginform_begin = "<form id='login' action='auth.php?m=login&a=check' method='post'>";
$loginform_username = "<input type='text' class='maintenance_username' name='rusername' size='16' maxlength='32' />";
$loginform_password = "<input type='password' class='maintenance_password' name='rpassword' size='16' maxlength='32' />";
$loginform_submit = "<input type='submit' class='maintenance_submit' value='Submit' />";
$loginform_end = "</form>";
$t=new XTemplate ("skins/".$cfg['defaultskin']."/maintenance.tpl");
$t-> assign(array(
"MAINTENANCE_DOCTYPE" => $cfg['doctype'],
"MAINTENANCE_MAINTITLE" => $cfg['maintitle'],
"MAINTENANCE_SUBTITLE" => $cfg['subtitle'],
"MAINTENANCE_CSS" => "<link href='skins/".$cfg['defaultskin']."/".$cfg['defaultskin'].".css' type='text/css' rel='stylesheet' />",
"MAINTENANCE_MESSAGE" => $L['com_maintenance'],
"MAINTENANCE_REASON" => $reason,
"MAINTENANCE_LOGINFORM_INFO" => $L['com_maintenance_login'],
"MAINTENANCE_LOGINFORM_BEGIN" => $loginform_begin,
"MAINTENANCE_LOGINFORM_USERNAME" => $loginform_username,
"MAINTENANCE_LOGINFORM_PASSWORD" => $loginform_password,
"MAINTENANCE_LOGINFORM_SUBMIT" => $loginform_submit,
"MAINTENANCE_LOGINFORM_END" => $loginform_end
));
$t->parse("MAINTENANCE");
$t->out("MAINTENANCE");
exit;
}
else {
$msg = "".$cfg['doctype']."";
$msg .= "<html>";
$msg .= "<head><title>".$cfg['maintitle']." :: ".$cfg['subtitle']."</title><link href='skins/".$cfg['defaultskin']."/".$cfg['defaultskin'].".css' type='text/css' rel='stylesheet' /></head><body>";
$msg .= "<div class='maintenance_com'>".$L['com_maintenance']."</div>";
$msg .= "<div class='maintenance_reason'>".$reason."</div>";
$msg .= "<div class='maintenance_login_info'>".$L['com_maintenance_login']."</div>";
$msg .= "<div class='maintenance_login_form'><form style='margin:0px;' id='login' action='auth.php?m=login&a=check' method='post'>
".$L['Username'].": <input type='text' class='maintenance_username' name='rusername' size='16' maxlength='32' /><br />
".$L['Password'].": <input type='password' class='maintenance_password' name='rpassword' size='16' maxlength='32' /><br />
<input type='submit' class='maintenance_submit' value='Submit'/>
</form></div>";
$msg .= "</body></html>";
die($msg);
}
}

Finally make a maintenance.tpl and put this code in it:

<!-- BEGIN: MAINTENANCE -->
{MAINTENANCE_DOCTYPE}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{MAINTENANCE_MAINTITLE} :: {MAINTENANCE_SUBTITLE}</title>
{MAINTENANCE_CSS}
</head>
<body>
<table align="center"><tr><td>
<div class="maintenance_main"><div class="maintenance_main2">
<div class="maintenance_com">{MAINTENANCE_MESSAGE}</div>
<div class="maintenance_reason">{MAINTENANCE_REASON}</div>
<div class="maintenance_info">{MAINTENANCE_LOGINFORM_INFO}</div>
<div class="maintenance_loginform">{MAINTENANCE_LOGINFORM_BEGIN}
Username: {MAINTENANCE_LOGINFORM_USERNAME}<br />
Password: {MAINTENANCE_LOGINFORM_PASSWORD}<br />
{MAINTENANCE_LOGINFORM_SUBMIT}
{MAINTENANCE_LOGINFORM_END}</div>
</div></div>
</td></tr></table>
</body>
</html>
<!-- END: MAINTENANCE -->
 
Views: 2,608
 

Feed for this Entry Trackback Address The permalink
 

 

10 Responses to “Maintenance Mode TPL”

 
#1 DURxLoRdHSV Says:
April 6th, 2006 at 7:57 pm

all this gives me is an error
on my LDU 802 platform
mebby im not doin it right

 

 
#2 Tefra Says:
April 8th, 2006 at 8:40 pm

the truth is that i haven’t tested yet but it should work. I will try it later.

 

 
#3 DURxLoRdHSV Says:
April 14th, 2006 at 4:04 pm

Parse error: parse error, unexpected T_LNUMBER in /home/lordhsv/public_html/system/functions.php on line 1824
thats the error i get

 

 
#4 Tefra Says:
April 17th, 2006 at 6:05 am

seriously now i will tested tomorrow it will be the first things i will do

 

 
#5 DURxLoRdHSV Says:
April 26th, 2006 at 1:26 pm

ok i look forward to your results:ani-happy

 

 
#6 Koradhil Says:
June 29th, 2006 at 5:13 am

Hi, nice you’ve posted my core hack here and stated my name. Only you’ve misspelled it, my nickname is Koradhil :wink
This core hack was made for LDU 700, not for LDU 802. Therefore it will not directly work with 802. Right now I’m hacking my own LDU 802 core for the maintenance mode TPL. I’m trying to make it work. I’ll post it here when I got it to work.
By the way, be sure to check out my website: http://www.korazu.com

 

 
#7 Koradhil Says:
June 29th, 2006 at 5:26 am

The replacement code should be:
function ldu_diemaintenance($reason)
{
global $L, $cfg;
if (file_exists("skins/".$cfg['defaultskin']."/maintenance.tpl")) {
$loginform_begin = "<form id='login' action='auth.php?m=login&a=check' method='post'>";
$loginform_username = "<input type='text' class='maintenance_username' name='rusername' size='16' maxlength='32' />";
$loginform_password = "<input type='password' class='maintenance_password' name='rpassword' size='16' maxlength='32' />";
$loginform_submit = "<input type='submit' class='maintenance_submit' value='Submit' />";
$loginform_end = "<div><input type='hidden' id='x' name='x' value='E8AE0D' /></div><div><input type='hidden' id='x' name='x' value='F97BA6' /></div><div><input type='hidden' id='x' name='x' value='F97BA6' /></div><div><input type="hidden" id="x" name="x" value="484816" /></div></form>";
There’s more… comment is too long.

 

 
#8 Koradhil Says:
June 29th, 2006 at 5:27 am

$t=new XTemplate ("skins/".$cfg['defaultskin']."/maintenance.tpl");
$t-> assign(array(
"MAINTENANCE_DOCTYPE" => $cfg['doctype'],
"MAINTENANCE_MAINTITLE" => $cfg['maintitle'],
"MAINTENANCE_SUBTITLE" => $cfg['subtitle'],
"MAINTENANCE_CSS" => "<link href='skins/".$cfg['defaultskin']."/".$cfg['defaultskin'].".css' type='text/css' rel='stylesheet' />",
"MAINTENANCE_MESSAGE" => $L['com_maintenance'],
"MAINTENANCE_REASON" => $reason,
"MAINTENANCE_LOGINFORM_INFO" => $L['com_maintenance_login'],
"MAINTENANCE_LOGINFORM_BEGIN" => $loginform_begin,
"MAINTENANCE_LOGINFORM_USERNAME" => $loginform_username,
"MAINTENANCE_LOGINFORM_PASSWORD" => $loginform_password,
"MAINTENANCE_LOGINFORM_SUBMIT" => $loginform_submit,
"MAINTENANCE_LOGINFORM_END" => $loginform_end
));
$t->parse("MAINTENANCE");
$t->out("MAINTENANCE");
exit;
}
more…

 

 
#9 Koradhil Says:
June 29th, 2006 at 5:27 am

else {
$msg = "".$cfg['doctype']."";
$msg .= "<html>";
$msg .= "<head><title>".$cfg['maintitle']." :: ".$cfg['subtitle']."</title><link href='skins/".$cfg['defaultskin']."/".$cfg['defaultskin'].".css' type='text/css' rel='stylesheet' /></head><body>";
$msg .= "<div class='maintenance_com'>".$L['com_maintenance']."</div>";
$msg .= "<div class='maintenance_reason'>".$reason."</div>";
$msg .= "<div class='maintenance_login_info'>".$L['com_maintenance_login']."</div>";
$msg .= "<div class='maintenance_login_form'><form style='margin:0px;' id='login' action='auth.php?m=login&a=check' method='post'>
".$L['Username'].": <input type='text' class='maintenance_username' name='rusername' size='16' maxlength='32' /><br />
".$L['Password'].": <input type='password' class='maintenance_password' name='rpassword' size='16' maxlength='32' /><br />
<input type='submit' class='maintenance_submit' value='Submit' />
<div><input type='hidden' id='x' name='x' value='E8AE0D' /></div><div><input type='hidden' id='x' name='x' value='F97BA6' /></div><div><input type='hidden' id='x' name='x' value='F97BA6' /></div><div><input type="hidden" id="x" name="x" value="484816" /></div></form></div>";
$msg .= "</body></html>";
die($msg);
}
}
Problem was just a couple of quotation marks, nothing more. Should work fine with LDU 802 now.

 

 
#10 Tefra Says:
July 13th, 2006 at 4:35 pm

thx m8, i updated the page.

 

 

 

Leave a Comment