Newbie Spellweaver
- Joined
- Jan 11, 2013
- Messages
- 18
- Reaction score
- 3
Hello!
Today im going to show how to get auto updater for Web-build
You need:
Today im going to show how to get auto updater for Web-build
You need:
RevCMS
Hotel
Brains
Okay, lets start.
Webbuild.php:
Setup:
1. Save Webbuild.php to folder where is app, ase, global.php, etc)
2. Open global.php in Notepad++ texteditor)
3. Find;
4. Add under that ^:
5. Open file class.template.php in Notepad++ Texteditor
6. Find;
7. Replace that with;
Nice. You do it!
¤Credits: XenonS
Brains
Okay, lets start.
Webbuild.php:
PHP:
<?php
namespace Revolution;
class WebBuild
{
final public function GetWebBuild()
{
$currentbuild;
$webbuildfile;
if (file_exists('webbuild.txt'))
{
$webbuildfile = file('webbuild.txt');
}
if (str_replace("\n", "", $webbuildfile[0]) == "")
{
$webbuild = $this->GetWebBuildFromHabbo();
$currentbuild = $webbuild;
$data .= $webbuild . "\n" . time();
file_put_contents('webbuild.txt', $data);
}
else
{
$time = time();
$time -= 1800; //update timer (every 15 minute), if timer is too low your sites is slower =(
$time -= $webbuildfile[1];
if ($time >= 0)
{
$webbuild = $this->GetWebBuildFromHabbo();
$currentbuild = $webbuild;
$data .= $webbuild . "\n" . time();
file_put_contents('webbuild.txt', $data);
}
else
{
$currentbuild = str_replace("\n", "", $webbuildfile[0]);
}
}
return $currentbuild;
}
final public function GetWebBuildFromHabbo()
{
$webbuild = explode('var habboStaticFilePath = "' , file_get_contents('https://habbo.com'));
foreach($webbuild as $var)
{
$end = explode('";', $var);
}
$end = str_replace("/web-gallery", "", $end);
$end = str_replace("https://habboo-a.akamaihd.net/habboweb/", "", $end);
return $end[0];
}
}
?>
Setup:
1. Save Webbuild.php to folder where is app, ase, global.php, etc)
2. Open global.php in Notepad++ texteditor)
3. Find;
PHP:
use Revolution as Rev;
4. Add under that ^:
PHP:
require_once 'webbuild.php';
$webbuild = new Rev\webbuild();
5. Open file class.template.php in Notepad++ Texteditor
6. Find;
PHP:
$this->setParams('web_build', $_CONFIG['hotel']['web_build']);
7. Replace that with;
PHP:
$this->setParams('web_build', $webbuild->GetWebBuild());
Nice. You do it!
¤Credits: XenonS
Last edited: