here is a nice little update for UberCMS - AutoUpdate WebBuild
open class.core.php
look for
PHP Code:
add under it
PHP Code:
open global.php
search for
PHP Code:
add under it
PHP Code:
open class.tpl.php
change
PHP Code:
to
PHP Code:
create a php file named WebBuild.php and put this in it.
PHP Code:
save that file in inc/cron_scripts
open your database and look for table site_config and add a column called webbuild
now open table site_cron and add a row withe these values..
id = whatever is next (mine was 6)
prio = 6 (doesnt really matter)
enabled = 1
scriptfile = webbuild.php
last_exec = leave this blank
exec_every = 1200 (you can play with this value, i believe its in seconds)
open class.core.php
look for
PHP Code:
PHP:
public static function GetMaintenanceStatus()
{
return mysql_result(dbquery("SELECT maintenance FROM site_config LIMIT 1"), 0);
}
add under it
PHP Code:
PHP:
public static function GetWebBuild()
{
return mysql_result(dbquery("SELECT webbuild FROM site_config LIMIT 1"), 0);
}
open global.php
search for
PHP Code:
PHP:
define('FORCE_MAINTENANCE', ((uberCore::GetMaintenanceStatus() == "1") ? true : false));
add under it
PHP Code:
PHP:
define('WEBBUILD', uberCore::GetWebBuild());
open class.tpl.php
change
PHP Code:
PHP:
$this->SetParam('web_build', '50_e3801d20ad745cc86660598ea0c4bdf4/15'); (your build will be different)
to
PHP Code:
PHP:
$this->SetParam('web_build', WEBBUILD);
create a php file named WebBuild.php and put this in it.
PHP Code:
PHP:
<?php
if (!defined('UBER') || !UBER)
{
exit;
}
function get_between($input, $start, $end)
{
$substr = substr($input, strlen($start)+strpos($input, $start), (strlen($input) - strpos($input, $end))*(-1));
return $substr;
}
$content = file_get_contents('http://habbo.com/');
$webbuild = get_between($content, "http://images.habbo.com/habboweb/", "/web-gallery");
dbquery("UPDATE site_config SET webbuild = '$webbuild' ");
?>
save that file in inc/cron_scripts
open your database and look for table site_config and add a column called webbuild
now open table site_cron and add a row withe these values..
id = whatever is next (mine was 6)
prio = 6 (doesnt really matter)
enabled = 1
scriptfile = webbuild.php
last_exec = leave this blank
exec_every = 1200 (you can play with this value, i believe its in seconds)