<?php
$users = mysql_query("SELECT * FROM server_status");
$on = mysql_fetch_assoc($users);
$UsersOnline = $on['users_online'];
$online = $myrow['online'];
$diamonds = $myrow['vip_points'];
$userid = $myrow['id'];
$users = mysql_query("SELECT * FROM users WHERE username = '".$_SESSION['Username']."' AND password = '".$_SESSION['Password']."");
$user = mysql_fetch_array($users);
$H = date('H');
$i = date('i');
$s = date('s');
$m = date('m');
$d = date('d');
$Y = date('Y');
$j = date('j');
$n = date('n');
$today = $d;
$month = $m;
$year = $Y;
$getmoney_date = date('d/m/Y',mktime($m,$d,$Y));
$birthday_date = date('d/m', mktime($m,$d));
$date_normal = date('d/m/Y',mktime($m,$d,$Y));
$date_full = date('d/m/Y H:i:s',mktime($H,$i,$s,$m,$d,$Y));
/*
CONFIG GENERAL (OPCIONAL)
*/
$MINRANK = "5";
$MAXRANK = "10";
/*
FIN CONFIG GENERAL (OPCIONAL)
*/
function SacarIP() {
if($_SERVER) {
if($_SERVER["HTTP_X_FORWARDED_FOR"]) {
$realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} elseif ($_SERVER["HTTP_CLIENT_IP"]) {
$realip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$realip = $_SERVER["REMOTE_ADDR"];
}
} else {
if(getenv("HTTP_X_FORWARDED_FOR")) {
$realip = getenv("HTTP_X_FORWARDED_FOR");
} elseif(getenv("HTTP_CLIENT_IP")) {
$realip = getenv("HTTP_CLIENT_IP");
} else {
$realip = getenv("REMOTE_ADDR");
}
}
return $realip;
}
$ip = SacarIP();
function GenerateTicket(){
$data = "HABBO-";
for ($i=1; $i<=6; $i++){
$data = $data . rand(0,9);
}
$data = $data . "-";
for ($i=1; $i<=20; $i++){
$data = $data . rand(0,9);
}
$data = $data . "-HOLO-HOTEL";
$data = $data . rand(0,5);
return $data;
}
function addslashes__recursive($var){
if (!is_array($var))
return addslashes($var);
$new_var = array();
foreach ($var as $k => $v)$new_var[addslashes($k)]=addslashes__recursive($v);
return $new_var;
}
$_POST=addslashes__recursive($_POST);
$_GET=addslashes__recursive($_GET);
$_REQUEST=addslashes__recursive($_REQUEST);
$_SERVER=addslashes__recursive($_SERVER);
$_COOKIE=addslashes__recursive($_COOKIE);
function ProtectVars($str)
{
$str = addslashes($str);
$str = mysql_real_escape_string($str);
$str = htmlspecialchars($str);
return $str;
}
function FilterText($a){
$a = stripslashes(htmlspecialchars($a));
$a = trim($a);
$a = str_replace('"','"',$a);
$a = str_replace("'","'",$a);
$a = str_replace("<script","",$a);
$a = str_replace("(","",$a);
$a = str_replace(")","",$a);
return $a;
}
function FilterTextNews($a){
$a = htmlspecialchars_decode($a);
$a = stripslashes($a);
$a = str_replace('rn',' ',$a);
return $a;
}
function GenerateCode(){
$string = substr(md5(rand()*time()),0,50);
$string = strtoupper($string);
$string = str_replace("O","B", $string);
$string = str_replace("0","C", $string);
$_SESSION["code"] = strtoupper($string);
return $string;
}
function ComprobateExist($a){
$GetUser = mysql_query("SELECT * FROM users WHERE username = '$a' || mail = '$a'");
if(mysql_num_rows($GetUser) > 0)
{
return true;
}else{
return false;
}
}
foreach($_POST as $param => $value)
{
$_POST[$param] = ProtectVars($value);
}
foreach($GET as $param => $value)
{
$_GET[$param] = ProtectVars($value);
}if(isset($_SESSION['Username']) && isset($_SESSION['Password']))
{
$SU = $_SESSION['Username'];
$SP = $_SESSION['Password'];
$GetUser = mysql_query("SELECT * FROM users WHERE username = '$SU' AND password = '".md5($SP)."'");
if(mysql_num_rows($GetUser) > 0)
{
$myrow = mysql_fetch_assoc($GetUser);
define("User", true);
}
} else {
define("User", false);
}
?>