• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[AUTOMATIC] WEB-BUILD UPDATER [R63A / B] [RevCMS]

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jan 11, 2013
Messages
18
Reaction score
3
Hello! :love:
Today im going to show how to get auto updater for Web-build :)
You need:
RevCMS​
Hotel
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:
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
I prefer this code for GetWebBuildFromHabbo

PHP:
$url = "https://www.habbo.com";
    $content = file_get_contents($url);    
    preg_match("/https:\/\/habboo-a.akamaihd.net\/habboweb\/([^>]+)\/web-gallery/", $content, $match);
    return $match[1];
 
Newbie Spellweaver
Joined
Jan 11, 2013
Messages
18
Reaction score
3
I prefer this code for GetWebBuildFromHabbo

PHP:
$url = "https://www.habbo.com";
    $content = file_get_contents($url);    
    preg_match("/https:\/\/habboo-a.akamaihd.net\/habboweb\/([^>]+)\/web-gallery/", $content, $match);
    return $match[1];
Nice, thats very importive.
 
Status
Not open for further replies.
Back
Top