PHP Code:
<?php
/* Start page */
define('START_LOAD', microtime(true));
/* Internal Information (version etc) */
define('VB', '1.0.0');
define('S', 'core/'); //Location where all system files are
define('P', 'plugins/'); //Where plugins are located (X . S . P)
define('B', 'storage/'); //Where cache, config and temp files are located (X . S . B)
define('C', 'system/'); //Where config files are located (X . S . B . C)
define('L', 'languages/'); //Where lanuages files are located (X . S . B . L)
define('E', 'servers/'); //Where server files are located (X . S . B . E)
define('H', 'purchases/'); //Where completed purchases logs are stored. (X . S . B . E)
define('F', 'errors/'); //Where CMS Error logs are stored (X . S . B . F)
define('K', 'skins/'); //Where all skins (tempalte) files are located (X . S . K)
if(!defined('X')) define('X', ''); //If global.php is called from a higher folder then X will be defined, if not call it ''
/*Check if the server is able to run HabboCMS */
if(ini_get('safe_mode')) die("For HabboCMS to work please turn PHP Safe-Mode to 'Off' read more here: <a href='http://php.net/manual/en/features.safe-mode.php'>PHP Safe mode Manual</a>");
if(!function_exists('curl_init')) die("Your web server does not have 'curl' extension installed. For HabboCMS to work you must install 'php-curl' (# yum install php-curl)");
if(!function_exists('mysql_connect')) die("Your web server does not have 'mysql' extension installed. For HabboCMS to work you must install 'php-mysql' (# yum install php-mysql)");
if(!function_exists('mcrypt_decrypt')) die("Your web server does not have 'mcrypt' extension installed. For HabboCMS to work you must install 'php-mcrypt' (# yum install php53-mcrypt)");
/* Check if all required exists */
if(!file_exists(X . S . B . C . 'general.php')) die("Could not find your HabboCMS Config file. Please re-install HabboCMS"); //General Config file
if(!file_exists(X . S . B . C . 'sql.php')) die("Could not find Database settings. Please re-install HabboCMS");
/* Include all required files */
require X . S . B . C . "general.php";
/* Check if all general variables are there */
if(!isset($_HabboCMS['website']['www'],
$_HabboCMS['website']['shortname'],
$_HabboCMS['website']['sitename'],
$_HabboCMS['website']['language'],
$_HabboCMS['website']['hash'],
$_HabboCMS['website']['plugins'],
$_HabboCMS['website']['webgallery'],
$_HabboCMS['website']['gallery_rev'],
$_HabboCMS['website']['skin'],
$_HabboCMS['client']['gordon'],
$_HabboCMS['client']['ip'],
$_HabboCMS['client']['direct_ip'],
$_HabboCMS['client']['port'],
$_HabboCMS['client']['variables'],
$_HabboCMS['client']['texts'],
$_HabboCMS['client']['productdata'],
$_HabboCMS['client']['furnidata'],
$_HabboCMS['MUS']['active'],
$_HabboCMS['MUS']['ip'],
$_HabboCMS['MUS']['port'],
$_HabboCMS['server']['type'],
$_HabboCMS['general']['newbiemotto'],
$_HabboCMS['general']['startcredits'],
$_HabboCMS['general']['startpixels'],
$_HabboCMS['mail']['supportmail'],
$_HabboCMS['mail']['replyto'],
$_HabboCMS['facebook']['enabled'],
$_HabboCMS['facebook']['app_id'],
$_HabboCMS['facebook']['app_id_secret'],
$_HabboCMS['facebook']['permissions'],
$_HabboCMS['twitter']['name'])) die("Missing variable from configuration file, please re-install HabboCMS");
/* Check if language and server files exists */
if(!file_exists(X . S . B . L . $_HabboCMS['website']['language'] . '.php')) die("Could not find your HabboCMS Config file. Please re-install HabboCMS"); //Check if language file exists
if(!file_exists(X . S . B . E . $_HabboCMS['server']['type'] . '.php')) die("Could not find Database settings. Please re-install HabboCMS"); //Check if server files exists
/* Get language file and server file */
//require X . S . B . L . $_HabboCMS['website']['language'] . '.php';
require X . S . B . E . $_HabboCMS['server']['type'] . '.php';
/* Check if data comes from CloudFlare and get real IP Adress */
if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
//define('USING_CLOUDFLARE', true);
}
/* Start Sessions */
session_start();
/* Check if banned */
if (!empty($_SESSION['website_banned'])) {
header("Location: /banned");
exit;
}
/* Check if domain is correct */
$website = ((isset($_SERVER["HTTPS"]))?"https://":"http://") . $_SERVER["SERVER_NAME"];
if($website != $_HabboCMS['website']['www'] && !defined('IGNORE_SUBDOMAIN')) {
header("Location: " . $_HabboCMS['website']['www'] . $_SERVER['REQUEST_URI']);
exit;
}
/* Define usefull variables */
define('WWW', $_HabboCMS['website']['www']);
define('SITE_NAME', $_HabboCMS['website']['shortname']);
define('FULL_NAME', $_HabboCMS['website']['sitename']);
define('URL', $website . $_SERVER["REQUEST_URI"]);
define('WEB', $website);
/* Check for session */
if (!empty($_SESSION['habbo_id']) && $_SESSION['habbo_id'] != 'null' && !empty($_SESSION['habbo_username']) && $_SESSION['habbo_username'] != 'null' && !empty($_SESSION['habbo_session_token'])) {
define('IDENTITY', $_SESSION['habbo_id']);
define('USERNAME', $_SESSION['habbo_username']);
define('SESSION_TOKEN', $_SESSION['habbo_session_token']);
} else {
define('IDENTITY', 'null');
define('USERNAME', 'Guest');
define('SESSION_TOKEN', 'null_token');
}
/* Get requested page */
$page = explode('?', $_SERVER["REQUEST_URI"]);
if(substr($page[0], 1) == '') $page = 'index'; else $page = substr($page[0], 1);
define('PAGE', $page);
/* Check if all class files exists */
if(!file_exists(X . S . "functions.habbocms.php")) die("Could not find class file <b>fucntions.habbocms.php</b>. Please re-install HabboCMS");
if(!file_exists(X . S . "translator.habbocms.php")) die("Could not find class file <b>translator.habbocms.php</b>. Please re-install HabboCMS");
if(!file_exists(X . S . "core.habbocms.php")) die("Could not find class file <b>core.habbocms.php</b>. Please re-install HabboCMS");
if(!file_exists(X . S . "sql.habbocms.php")) die("Could not find class file <b>sql.habbocms.php</b>. Please re-install HabboCMS");
if(!file_exists(X . S . "users.habbocms.php")) die("Could not find class file <b>users.habbocms.php</b>. Please re-install HabboCMS");
if(!file_exists(X . S . "template.habbocms.php")) die("Could not find class file <b>template.habbocms.php</b>. Please re-install HabboCMS");
if(!file_exists(X . S . "plugins.habbocms.php")) die("Could not find class file <b>plugins.habbocms.php</b>. Please re-install HabboCMS");
/* Include server files */
require X . S . "functions.habbocms.php";
require X . S . "translator.habbocms.php";
require X . S . "core.habbocms.php";
require X . S . "sql.habbocms.php";
require X . S . "users.habbocms.php";
require X . S . "template.habbocms.php";
require X . S . "plugins.habbocms.php";
/* Install and set variables for system class files */
$core = new HabboCMS;
$sql = new HabboSQL;
$users = new HabboUsers;
$plugins = new HabboPlugins;
$html = new HabboTemplate;
?>
PHP Code:
<?php
if(IDENTITY != 'null') {
header("Location: " . WWW . "/me");
exit;
}
$lang = new HabboTranslator('frontpage,lostpw');
$this->add_key('pagetitle', $lang->s['frontpage.page_name']);
$this->add_key('extra', " <style type='text/css'>
body {
background-color: #000;
}
#footer .footer-links { color: #666666; }
#footer .footer-links a { color: #ffffff; }
#footer .copyright { color: #666666; }
#footer #compact-tags-container span, #footer #compact-tags-container a { color: #333333; }
</style>\n", true);
$this->add_key('body_extra', ' id="frontpage"');
$this->styleset('frontpage');
$this->install_widget('header');
?>
<div id="overlay"></div>
<?php $this->install_widget('lostpw'); ?>
<div id="site-header">
<form id="loginformitem" name="loginformitem" action="{www}/security_check" method="post">
<?php
if (!empty($_SESSION['login_error_msg'])) {
echo "<div id=\"loginerrorfieldwrapper\">\n<div id=\"loginerrorfield\">\n<div>" . $_SESSION['login_error_msg'] . "</div>\n</div>\n</div>";
$_SESSION['login_error_msg'] = false;
}
?>
<div style="clear: both;"></div>
<div id="site-header-content">
<div id="habbo-logo"></div>
<div id="login-form">
<div id="login-form-email">
<label for="login-username" class="login-text"><?php echo $lang->s['frontpage.username']; ?></label>
<input tabindex="3" type="text" class="login-field" name="credentials.username" id="login-username" value="" maxlength="48"/>
<input tabindex="6" type="checkbox" name="_login_remember_me" id="login-remember-me" value="true"/>
<label for="login-remember-me"><?php echo $lang->s['frontpage.keeplogged']; ?></label>
<div id="landing-remember-me-notification" class="bottom-bubble" style="display:none;">
<div class="bottom-bubble-t"><div></div></div>
<div class="bottom-bubble-c"><?php echo $lang->s['frontpage.keeplogged_message']; ?></div>
<div class="bottom-bubble-b"><div></div></div>
</div>
</div>
<div id="login-form-password">
<label for="login-password" class="login-text"><?php echo $lang->s['frontpage.password']; ?></label>
<input tabindex="4" type="password" class="login-field" name="credentials.password" id="login-password" maxlength="32"/>
<div id="login-forgot-password">
<a href="#" id="forgot-password"><span><?php echo $lang->s['frontpage.forgot']; ?></span></a>
</div>
</div>
<div id="login-form-submit">
<input type="submit" value="Login" class="login-top-button" id="login-submit-button"/>
<a href="#" tabindex="5" id="login-submit-new-button"><span><?php echo $lang->s['frontpage.login']; ?></span></a>
</div>
</div>
<?php if ($_HabboCMS['facebook']['enabled']) { ?>
<div id="rpx-login">
<div>
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
Cookie.erase("fbsr_<?php echo $_HabboCMS['facebook']['app_id']; ?>");
FB.init({appId: '<?php echo $_HabboCMS['facebook']['app_id']; ?>', status: true, cookie: true, xfbml: true});
$(document).fire("fbevents:scriptLoaded");
};
window.assistedLogin = function(FBobject, optresponse) {
Cookie.erase("fbsr_<?php echo $_HabboCMS['facebook']['app_id']; ?>");
FBobject.init({appId: '<?php echo $_HabboCMS['facebook']['app_id']; ?>', status: true, cookie: true, xfbml: true});
permissions = '<?php echo $_HabboCMS['facebook']['permissions']; ?>';
defaultAction = function(response) {
if (response.authResponse) {
fbConnectUrl = "/facebook?connect=true";
Cookie.erase("fbhb_val_<?php echo $_HabboCMS['facebook']['app_id']; ?>");
Cookie.set("fbhb_val_<?php echo $_HabboCMS['facebook']['app_id']; ?>", response.authResponse.accessToken);
Cookie.erase("fbhb_expr_<?php echo $_HabboCMS['facebook']['app_id']; ?>");
Cookie.set("fbhb_expr_<?php echo $_HabboCMS['facebook']['app_id']; ?>", response.authResponse.expiresIn);
window.location.replace(fbConnectUrl);
}
};
if (typeof optresponse == 'undefined')
FBobject.login(defaultAction, {scope:permissions});
else
FBobject.login(optresponse, {scope:permissions});
};
(function() {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<a class="fb_button fb_button_large" onclick="assistedLogin(FB); return false;"><span class="fb_button_text"><?php echo $lang->s['frontpage.facebook_login']; ?></span></a>
</div>
<div>
</div>
</div>
<?php } ?>
</div>
</div>
PHP Code:
<?php
class HabboTranslator {
public $s = array();
function __construct($page) {
global $_HabboCMS;
$start = microtime(true);
$sections = explode(',', $page);
foreach ($sections as $page) {
require X . S . B . L . $_HabboCMS['website']['language'] . '.php';
$this->s = array_merge($this->s,$s);
}
$total_time = round(((microtime(true)) - $start), 4);
echo '<!-- language system installed in: ' . $total_time . ' secounds -->';
}
/*Removes cache that was generated when the class was called*/
public function clear_cache() {
unset($this->s);
$this->s = array();
return true;
}
public function s($key, $replace = array()) {
$key = $this->s[$key];
}
}
?>