[UberCMS]AutoUpdate WebBuild

jdude

New Member
Mar 1, 2011
1
1
here is a nice little update for UberCMS - AutoUpdate WebBuild

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)
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
You make this yourself? It's very useful, thanks for it, however people are moving on now, to Phoenix, but one again, thanks.
 

Stranger

Member
Apr 19, 2011
67
0
You make this yourself? It's very useful, thanks for it, however people are moving on now, to Phoenix, but one again, thanks.
People may be moving on to Phoenix but I'm not shelling out £20. I'll be sticking with rCMS. But thanks jdude, I'll be using this.
 

B3Nx

New Member
Apr 11, 2011
45
0
wheres global.php ... message me please

where d o we make the webbuid file?

and do u meanmy phpmy admin database?
 

Tydus

New Member
Jun 5, 2011
27
1
Awwww This Is Hard Cuz I Dont Basically bE sIMPLER with UNDER the code :S cuz wat u mean next to it? or press enter so its under make a tut vid?
 

Richie

New Member
Jul 19, 2011
10
0
This has just messed my site up compeltly? :/ all the images are now incorrect and everything has been moved, so it hasn't updated the webbuild.. :/
 

leener

New Member
Jul 30, 2011
6
0
maybe u guys use a different edit of uber? it worked fine when we used it on uber before we moved to phoenix......
 

vRory

Unemployed.
May 4, 2011
447
69
Also i found this code usefull for my site_config as i had to add the tables myself so here they are

PHP:
-- ----------------------------
-- Table structure for `site_config`
-- ----------------------------
DROP TABLE IF EXISTS `site_config`;
CREATE TABLE `site_config` (
  `maintenance` enum('0','1') NOT NULL DEFAULT '0',
  `msg` varchar(255) NOT NULL DEFAULT ' ',
  `webbuild` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of site_config
-- ----------------------------
INSERT INTO `site_config` VALUES ('0', 'Hotel shut down, due to security reasons.', '63_1dc60c6d6ea6e089c6893ab4e0541ee0/536');
 

Users who are viewing this thread

Top