- Joined
- Jun 16, 2010
- Messages
- 249
- Reaction score
- 76
Hotel Restart
Overview
This project was inspired by RastaLulz's PHP reboot application. This is designed to improve your hotels stability when it crashes (which will happen with almost every hotel). The project rely's heavily on your community, and whether or not they love your hotel (you'll find out sooner what I mean below).
The "Restart Hotel" box will ONLY appear if the server is offline. This will prevent users from massively restarting the hotel when it is not needed. There is another thing that you may add to improve this slightly, although I'll leave you guys to figuring it out.
Be sure to fill out the $reboot_app URL and the reboot_app.bat information correctly or else it will not work!
Third Party Applications
For this to work, you will need an executable restart application. I suggest using RastaLulz application. The download link is below:
Download Restart Application: [
You must be registered to see links
]Preview
Coming Shortly
Instructions
Step 1
Open me.php in the root directory. Find the following green highlighted text below;
Code:
[COLOR="SeaGreen"]//Column 1[/COLOR]
Add the following red highlighted code above it;
Code:
[COLOR="Red"]//Content
$reboot_app = 'C:\Users\sexonabeach\Desktop\reboot_app.bat';
$restart = @$_POST['restart'];
if (isset($restart))
{
if (!file_exists($reboot_app))
{
header("Location: ?action=reboot&result=failed&why=application_url_invalid");
}
else
{
exec($reboot_app);
header("Location: ?action=reboot&result=success");
}
}[/COLOR]
Result;
Code:
[COLOR="Red"]//Content
$reboot_app = 'C:\Users\sexonabeach\Desktop\reboot_app.bat';
$restart = @$_POST['restart'];
if (isset($restart))
{
if (!file_exists($reboot_app))
{
header("Location: ?action=reboot&result=failed&why=application_url_invalid");
}
else
{
exec($reboot_app);
header("Location: ?action=reboot&result=success");
}
}[/COLOR]
[COLOR="SeaGreen"]// Column 1[/COLOR]
Next look for the following green highlighted code;
Code:
[COLOR="SeaGreen"]// Column 3
$tpl->AddGeneric('generic-column3');[/COLOR]
Replace it ALL with the following red highlighted code;
Code:
[COLOR="Red"]switch (uberCore::getSystemStatus())
{
case (0):
case (2):
$hotelRestart = new Template('comp-restart');
$hotelRestart->SetParam('restart', $restart);
$tpl->AddTemplate($hotelRestart);
break;
default:
$tpl->AddGeneric('generic-column3');
break;
}[/COLOR]
Result;
Code:
[COLOR="Red"]switch (uberCore::getSystemStatus())
{
case (0):
case (2):
$hotelRestart = new Template('comp-restart');
$hotelRestart->SetParam('restart', $restart);
$tpl->AddTemplate($hotelRestart);
break;
default:
$tpl->AddGeneric('generic-column3');
break;
}[/COLOR]
Step 2
Make a file called "comp-restart.tpl" in the "inc/tpl/" directory. Paste all the following red highlighted code into the file;
Code:
[COLOR="red"]<div id="column3" class="column">
<div class="habblet-container ">
<div class="cbb clearfix red">
<h2 class="title">Restart Hotel</h2>
<div id="habboclub-info" class="box-content">
<img src="http://habbogallery.net/img/figures/habbos/Figure%20(97).gif" align="left">
<p>Oops, it appears the hotel is offline!</p>
<div align="center">
<form method="post" action="">
<p><input type="submit" name="restart" value="Restart Hotel"></p>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>[/COLOR]
Result;
Code:
[COLOR="red"]<div id="column3" class="column">
<div class="habblet-container ">
<div class="cbb clearfix red">
<h2 class="title">Restart Hotel</h2>
<div id="habboclub-info" class="box-content">
<img src="http://habbogallery.net/img/figures/habbos/Figure%20(97).gif" align="left">
<p>Oops, it appears the hotel is offline!</p>
<div align="center">
<form method="post" action="">
<p><input type="submit" name="restart" value="Restart Hotel"></p>
</form>
</div>
</div>
</div>
Credits
Code:
TheJacob
RastaLulz
Last edited: