AJUDA TA APARECENDO UM ERRO NO GLOBAL.PHP
3 participantes
Página 1 de 1
AJUDA TA APARECENDO UM ERRO NO GLOBAL.PHP
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\Program Files\VertrigoServ\www\global.php on line 29
Call Stack
# Time Memory Function Location
1 0.0010 360360 {main}( ) ..\index.php:0
2 0.0018 410200 require_once( 'C:\Program Files\VertrigoServ\www\global.php' ) ..\index.php:18.
Alguem me ajuda?
Call Stack
# Time Memory Function Location
1 0.0010 360360 {main}( ) ..\index.php:0
2 0.0018 410200 require_once( 'C:\Program Files\VertrigoServ\www\global.php' ) ..\index.php:18.
Alguem me ajuda?
xroxerax- Iniciante
- Mensagens : 1
Reputação : 0
Data de inscrição : 19/04/2011
Re: AJUDA TA APARECENDO UM ERRO NO GLOBAL.PHP
Instala outra CMS
Recomendo: Sky R3
Mas se quiser o meu global.php
e arquivos que requerem para o funcionamento do hotel
Pega ai
global.php
inc/class.core.php
inc/class.cron.php
inc/class.users.php( Essa é própria ou seja se alguem se registrar no hotel vai entrar só com 500 Moedas )
inc/class.tpl.php( Configure de acordo com seu hotel! Se não, não ira funcionar! )
Configure essa clas.tpl.php assim:
NOME DO SEU HOTEL=Você coloca o nome do seu hotel!
SENHA DO PHPMYADMIN=Senha do seu PHPMyAdmin a padrão é vertrigo
DATABASE A DB=Sua DB do PHPMyAdmin, Ex.: HoloDB
SEU EMAIL=Seu Email o Email de contato, Ex.: [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
SEU TWITTER=Seu Twitter para mais coisas né? tipo o meu @gabrielsinhohc ai põe so gabrielsinhohc, Ex.:
$this->SetParam('twitter', 'gabrielsinhohc');
OBS:Coloquei nas cores do PHP Editor para ajudar a galera!
Créditos:
Eu
Stage CMS
Sky CMS
Recomendo: Sky R3
Mas se quiser o meu global.php
e arquivos que requerem para o funcionamento do hotel
Pega ai
global.php
- Spoiler:
- <?php
/*=======================================================================
| HabbleCMS R1 - Sistema avançado de Administração de CMS
| #######################################################################
| Copyright (c) 2011, TopGun
| #######################################################################
| Este programa é um Free Software aonde você pode editar os conteúdos
| com os direitos autorais do editor.
| #######################################################################
| Contato: Divirta-se com a CMS ;D
| [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
\======================================================================*/
// ############################################################################
// Prepare the local environment
define('UBER', true);
define('DS', DIRECTORY_SEPARATOR);
define('LB', chr(13));
define('CWD', str_replace('manage' . DS, '', dirname(__FILE__) . DS));
define('INCLUDES', CWD . 'inc' . DS);
define('USER_IP', $_SERVER['REMOTE_ADDR']);
set_magic_quotes_runtime('0');
error_reporting(E_ALL);
session_start();
// ############################################################################
// Initialize core classes
require_once INCLUDES . "class.core.php";
require_once INCLUDES . "class.db.mysql.php";
require_once INCLUDES . "class.cron.php";
require_once INCLUDES . "class.users.php";
require_once INCLUDES . "class.tpl.php";
$core = new uberCore();
$cron = new uberCron();
$users = new uberUsers();
$tpl = new uberTpl();
// ############################################################################
// Execute some required core functionality
$core->ParseConfig();
$db = new MySQL($core->config['MySQL']['hostname'], $core->config['MySQL']['username'],
$core->config['MySQL']['password'], $core->config['MySQL']['database']);
$db->Connect();
$cron->Execute();
// ############################################################################
// Session handling
if (isset($_SESSION['UBER_USER_N']) && isset($_SESSION['UBER_USER_H']))
{
$userN = $_SESSION['UBER_USER_N'];
$userH = $_SESSION['UBER_USER_H'];
if ($users->ValidateUser($userN, $userH))
{
define('LOGGED_IN', true);
define('USER_NAME', $userN);
define('USER_ID', $users->name2id($userN));
define('USER_HASH', $userH);
$users->CacheUser(USER_ID);
}
else
{
@session_destroy();
header('Location: ./index.html');
exit;
}
}
else
{
define('LOGGED_IN', false);
define('USER_NAME', 'Guest');
define('USER_ID', -1);
define('USER_HASH', null);
}
define('FORCE_MAINTENANCE', ((uberCore::GetMaintenanceStatus() == "1") ? true : false));
if (FORCE_MAINTENANCE && !defined('IN_MAINTENANCE'))
{
if (!LOGGED_IN || !$users->HasFuse(USER_ID, 'fuse_ignore_maintenance'))
{
header("Location: " . WWW . "/maintenance.html");
exit;
}
}
if ((!defined('BAN_PAGE') || !BAN_PAGE) && ($users->IsIpBanned(USER_IP) || (LOGGED_IN && $users->IsUserBanned(USER_NAME))))
{
header("Location: " . WWW . "/banned.php");
exit;
}
$core->CheckCookies();
// ############################################################################
// Some commonly used functions for easy access
function dbquery($strQuery = '')
{
global $db;
if($db->IsConnected())
{
return $db->DoQuery($strQuery);
}
return $db->Error('Não foi possível fazer esse processo, parece que não há conexão com a database.');
}
function filter($strInput = '')
{
global $core;
return $core->FilterInputString($strInput);
}
function clean($strInput = '', $ignoreHtml = false, $nl2br = false)
{
global $core;
return $core->CleanStringForOutput($strInput, $ignoreHtml, $nl2br);
}
function shuffle_assoc(&$array)
{
$keys = array_keys($array);
shuffle($keys);
foreach($keys as $key)
{
$new[$key] = $array[$key];
}
$array = $new;
return true;
}
?>
inc/class.core.php
- Spoiler:
- <?php
/*=======================================================================
| StageCMS - Sistema avançado de Administração de CMS
| #######################################################################
| Copyright (c) 2010, Geek and Meth0d
| #######################################################################
| Este programa é um Free Software aonde você pode editar os conteúdos
| com os direitos autorais do editor.
| #######################################################################
| Contato: Divirta-se com a CMS ;D
| [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
\======================================================================*/
class uberCore
{
public $config;
public $execStart;
public function getpath()
{
$url = file_get_contents("http://habbo.com.br/");
$getpath = @explode('web/', $url);
$getpath = @explode('/web', $getpath[1]);
$getpath = trim($getpath[0]);
if(empty($getpath))
{
$url = file_get_contents("http://www.habbo.com.br/");
$getpath = explode('web/', $url);
$getpath = explode('/web', $getpath[1]);
$getpath = trim($getpath[0]);
}
return $getpath;
}
public function __construct()
{
$this->execStart = microtime(true);
}
public static function CheckBetaKey($keyCode)
{
return (mysql_num_rows(dbquery("SELECT null FROM betakeys WHERE keyc = '" . filter($keyCode) . "' AND qty > 0 LIMIT 1")) > 0) ? true : false;
}
public static function EatBetaKey($keyCode)
{
dbquery("UPDATE betakeys SET qty = qty - 1 WHERE keyc = '" . filter($keyCode) . "' LIMIT 1");
}
public static function CheckCookies()
{
if (LOGGED_IN)
{
return;
}
if (isset($_COOKIE['rememberme']) && $_COOKIE['rememberme'] == "true" && isset($_COOKIE['rememberme_token']) && isset($_COOKIE['rememberme_name']))
{
$name = filter($_COOKIE['rememberme_name']);
$token = filter($_COOKIE['rememberme_token']);
$find = dbquery("SELECT id,username FROM users WHERE username = '" . $name . "' AND password = '" . $token . "' LIMIT 1");
if (mysql_num_rows($find) > 0)
{
$data = mysql_fetch_assoc($find);
$_SESSION['UBER_USER_N'] = $data['username'];
$_SESSION['UBER_USER_H'] = $token;
$_SESSION['set_cookies'] = true; // renew cookies
header("Location: " . WWW . "/security_check");
exit;
}
}
}
public static function FormatDate()
{
return date('j F Y, h:i:s A');
}
public function UberHash($input = '')
{
return sha1($input . $this->config['Site']['hash_secret']);
}
public static function GenerateTicket($seed = '')
{
$ticket = "ST-";
$ticket .= sha1($seed . 'Uber' . rand(118,283));
$ticket .= '-' . rand(100, 255);
$ticket .= '-uber-fe' . rand(0, 5);
return $ticket;
}
public static function FilterInputString($strInput = '')
{
return mysql_real_escape_string(stripslashes(trim($strInput)));
}
public static function FilterSpecialChars($strInput, $allowLB = false)
{
$strInput = str_replace(chr(1), ' ', $strInput);
$strInput = str_replace(chr(2), ' ', $strInput);
$strInput = str_replace(chr(3), ' ', $strInput);
$strInput = str_replace(chr(9), ' ', $strInput);
if (!$allowLB)
{
$strInput = str_replace(chr(13), ' ', $strInput);
}
return $strInput;
}
public static function CleanStringForOutput($strInput = '', $ignoreHtml = false, $nl2br = false)
{
$strInput = stripslashes(trim($strInput));
if (!$ignoreHtml)
{
$strInput = htmlentities($strInput);
}
if ($nl2br)
{
$strInput = nl2br($strInput);
}
return $strInput;
}
public static function SystemError($title, $text)
{
echo '<div style="width: 80%; padding: 15px 15px 15px 15px; margin: 50px auto; background-color: #F6CECE; font-family: arial; font-size: 12px; color: #000000; border: 1px solid #FF0000;">';
echo '<img src="' . WWW . '/images/error.png" style="float: left;" title="Error"> ';
echo '<b>' . $title. '</b><br />';
echo ' ' . $text;
echo '<hr size="1" style="width: 100%; margin: 15px 0px 15px 0px;" />';
echo 'A execução do script foi cancelada. Nós pedimos desculpas para o inconveniente. Se o problema for persistente, entre em contato com um Administrador.';
echo '</div><center style="font-family: arial; font-size: 10px;">UpCms, Copyright 2011 ©</center>';
exit;
}
public function ParseConfig()
{
$configPath = INCLUDES . 'inc.config.php';
if (!file_exists($configPath))
{
$this->systemError('Erro de configuração', 'A configuração do arquivo está redirecionada para ' . $configPath);
}
require_once $configPath;
if (!isset($config) || count($config) < 2)
{
$this->systemError('Erro de configuração', 'A configuração do arquivo está em formato errado ou em lugar errado.');
}
$this->config = $config;
define('WWW', $this->config['Site']['www']);
}
public static function GetSystemStatusString($statsFig)
{
switch (uberCore::getSystemStatus())
{
case 2:
case 0:
return "Hotel Offline";
case 1:
if (!$statsFig)
{
return uberCore::GetUsersOnline() . ' user(s) onlines.';
}
else
{
return '<span class="stats-fig">' . uberCore::GetUsersOnline() . '</span> Habbos onlines!';
}
default:
return "Unknown";
}
}
public static function GetSystemStatus()
{
return intval(mysql_result(dbquery("SELECT status FROM server_status LIMIT 1"), 0));
}
public static function GetUsersOnline()
{
return intval(mysql_result(dbquery("SELECT users_online FROM server_status LIMIT 1"), 0));
}
public static function GetMaintenanceStatus()
{
return mysql_result(dbquery("SELECT maintenance FROM site_config LIMIT 1"), 0);
}
public function Mus($header, $data = '')
{
if ($this->config['MUS']['enabled'] == false || $this->getSystemStatus() == "0")
{
return;
}
$musData = $header . chr(1) . $data;
$sock = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
@socket_connect($sock, $this->config['MUS']['ip'], intval($this->config['MUS']['port']));
@socket_send($sock, $musData, strlen($musData), MSG_DONTROUTE);
@socket_close($sock);
}
public static function AddBan($type, $value, $reason, $expireTime, $addedBy, $blockAppeal)
{
dbquery("INSERT INTO bans (id,bantype,value,reason,expire,added_by,added_date,appeal_state) VALUES (NULL,'" . $type . "','" . $value . "','" . $reason . "','" . $expireTime . "','" . $addedBy . "','" . date('d/m/Y H:i') . "','" . (($blockAppeal) ? '0' : '1') . "')");
}
}
?>
inc/class.cron.php
- Spoiler:
- <?php
/*=======================================================================
| StageCMS - Sistema avançado de Administração de CMS
| #######################################################################
| Copyright (c) 2010, Geek and Meth0d
| #######################################################################
| Este programa é um Free Software aonde você pode editar os conteúdos
| com os direitos autorais do editor.
| #######################################################################
| Contato: Divirta-se com a CMS ;D
| [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
\======================================================================*/
class uberCron
{
function Execute()
{
$query = dbquery("SELECT id FROM site_cron WHERE enabled = '1' ORDER BY prio ASC");
while ($job = mysql_fetch_assoc($query))
{
if ($this->GetNextExec($job['id']) <= time())
{
$this->RunJob($job['id']);
}
}
}
function RunJob($jobId)
{
global $core;
$script = mysql_result(dbquery("SELECT scriptfile FROM site_cron WHERE id = '" . $jobId . "' LIMIT 1"), 0);
if (!$this->CheckScript($script))
{
$core->SystemError('Cron Error', 'Could not execute cron job \'' . $script . '\': could not locate script file.');
return;
}
require_once INCLUDES . 'cron_scripts' . DS . $script;
dbquery("UPDATE site_cron SET last_exec = '" . time() . "' WHERE id = '" . $jobId . "' LIMIT 1");
}
function CheckScript($script)
{
if (file_exists(INCLUDES . 'cron_scripts' . DS . $script))
{
return true;
}
return false;
}
function GetNextExec($jobId)
{
$query = dbquery("SELECT last_exec,exec_every FROM site_cron WHERE id = '" . $jobId . "' LIMIT 1");
if (mysql_num_rows($query) == 1)
{
$data = mysql_fetch_assoc($query);
return $data['last_exec'] + $data['exec_every'];
}
return -1;
}
}
?>
inc/class.users.php( Essa é própria ou seja se alguem se registrar no hotel vai entrar só com 500 Moedas )
- Spoiler:
- <?php
/*=======================================================================
| UberCMS - Advanced Website and Content Management System for uberEmu
| #######################################################################
| Copyright (c) 2010, Roy 'Meth0d' and updates by Matthew 'MDK'
| [Tens de ter uma conta e sessão iniciada para poderes visualizar este link] & [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
| #######################################################################
| This program is free software: you can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation, either version 3 of the License, or
| (at your option) any later version.
| #######################################################################
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
\======================================================================*/
class uberUsers
{
/**************************************************************************************************/
private $userCache = Array();
/**************************************************************************************************/
private $blockedNames = Array('roy', 'meth0d', 'method', 'graph1x', 'graphix', 'admin', 'administrator',
'mod', 'moderator', 'guest', 'undefined');
private $blockedNameParts = Array('moderate', 'staff', 'manage', 'system', 'admin', 'uber');
/**************************************************************************************************/
public function IsValidEmail($email = '')
{
if (mysql_num_rows(dbquery("SELECT null FROM users WHERE mail = '" . $email . "' LIMIT 1")))
return true;
return preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i", $email);
}
public function IsEmailTaken($email = '')
{
if (mysql_num_rows(dbquery("SELECT null FROM users WHERE mail = '" . $email . "' LIMIT 1")))
return false;
return true;
}
public function IsValidName($nm = '')
{
if (preg_match('/^[a-z0-9]+$/i', $nm) && strlen($nm) >= 1 && strlen($nm) <= 32)
{
return true;
}
return false;
}
public function IsNameTaken($nm = '')
{
return ((mysql_num_rows(dbquery("SELECT null FROM users WHERE username = '" . $nm . "' LIMIT 1")) > 0) ? true : false);
}
public function IdExists($id = 0)
{
return ((mysql_num_rows(dbquery("SELECT null FROM users WHERE id = '" . $id . "' LIMIT 1")) > 0) ? true : false);
}
public function IsNameBlocked($nm = '')
{
foreach ($this->blockedNames as $bl)
{
if (strtolower($nm) == strtolower($bl))
{
return true;
}
}
foreach ($this->blockedNameParts as $bl)
{
if (strpos(strtolower($nm), strtolower($bl)) !== false)
{
return true;
}
}
return false;
}
/**************************************************************************************************/
function Add($username = '', $passwordHash = '', $email = 'default@localhost', $rank = 1, $figure = '', $sex = 'M')
{
dbquery("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','500','100','','" . date('d-M-Y') . "')");
$id = intval(mysql_result(dbquery("SELECT id FROM users WHERE username = '" . $username . "' ORDER BY id DESC LIMIT 1"), 0));
dbquery("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')");
return $id;
}
function Delete($id)
{
dbquery("DELETE FROM messenger_friendships WHERE user_one_id = '" . $id . "' OR user_two_id = '" . $id . "'");
dbquery("DELETE FROM messenger_requests WHERE to_id = '" . $id . "' OR from_id = '" . $id . "'");
dbquery("DELETE FROM users WHERE id = '" . $id . "' LIMIT 1");
dbquery("DELETE FROM user_subscriptions WHERE user_id = '" . $id . "'");
dbquery("DELETE FROM user_info WHERE user_id = '" . $id . "' LIMIT 1");
dbquery("DELETE FROM user_items WHERE user_id = '" . $id . "'");
}
/**************************************************************************************************/
function ValidateUser($username, $password)
{
return mysql_num_rows(dbquery("SELECT null FROM users WHERE username = '" . $username . "' AND password = '" . $password. "' LIMIT 1"));
}
function ValidateUserByEmail($email, $password)
{
if ($rows = mysql_num_rows(dbquery("SELECT null FROM users WHERE mail = '" . $email . "' AND password = '" . $password. "' LIMIT 1")))
return mysql_num_rows(dbquery("SELECT null FROM users WHERE mail = '" . $email . "'"));
else
return $rows;
}
function ValidateLogin($user_mail, $password)
{
if ($user = $this->ValidateUser($user_mail, $password))
return array(1, 0, 1);
else if ($emails = $this->ValidateUserByEmail($user_mail, $password))
return array(1, 1, $emails);
else
return array(0, null, null);
}
/**************************************************************************************************/
function Name2id($username = '')
{
return @intval(mysql_result(dbquery("SELECT id FROM users WHERE username = '" . $username . "' LIMIT 1"), 0));
}
function Id2name($id = -1)
{
if (isset($this->userCache[$id]['username']))
{
return $this->userCache[$id]['username'];
}
$name = mysql_result(dbquery("SELECT username FROM users WHERE id = '" . $id . "' LIMIT 1"), 0);
$this->userCache[$id]['username'] = $name;
return $name;
}
function Email2id($email = '')
{
return @intval(mysql_result(dbquery("SELECT id FROM users WHERE mail = '" . $email . "' LIMIT 1"), 0));
}
/**************************************************************************************************/
function CacheUser($id)
{
$data = mysql_fetch_assoc(dbquery("SELECT * FROM users WHERE id = '" . $id . "' LIMIT 1"));
foreach ($data as $key => $value)
{
$this->userCache[$id][$key] = $value;
}
}
function GetUserVar($id, $var, $allowCache = true)
{
if ($allowCache && isset($this->userCache[$id][$var]))
{
return $this->userCache[$id][$var];
}
$val = @mysql_result(dbquery("SELECT " . $var . " FROM users WHERE id = '" . $id . "' LIMIT 1"), 0);
$this->userCache[$id][$var] = $val;
return $val;
}
// do not remove - still used in hk
function formatUsername($id, $link = true, $styles = true)
{
$datas = dbquery("SELECT id,rank,username FROM users WHERE id = '" . $id . "' LIMIT 1");
if (mysql_num_rows($datas) == 0)
{
return '<s>Unknown User</s>';
}
$data = mysql_fetch_assoc($datas);
$prefix = '';
$name = $data['username'];
$suffix = '';
if ($link)
{
$prefix .= '<a href="/user/' . clean($data['username']) . '">';
$suffix .= '</a>';
}
if ($styles)
{
$rank = $this->getRank($id);
$rankData = dbquery("SELECT prefix,suffix FROM ranks WHERE id = '" . $rank . "' LIMIT 1");
if (mysql_num_rows($rankData) == 1)
{
$rankData = mysql_fetch_assoc($rankData);
$prefix .= $rankData['prefix'];
$suffix .= $rankData['suffix'];
}
}
return clean($prefix . $name . $suffix, true);
}
// do not remove - still used in hk
/**************************************************************************************************/
function getRank($id)
{
if (isset($this->userCache[$id]['rank']))
{
return $this->userCache[$id]['rank'];
}
$rankId = @intval(mysql_result(dbquery("SELECT rank FROM users WHERE id = '" . intval($id) . "' LIMIT 1"), 0));
$this->userCache[$id]['rank'] = $rankId;
return $rankId;
}
function getRankVar($rankId, $var)
{
return mysql_result(dbquery("SELECT " . $var . " FROM ranks WHERE id = '" . intval($rankId) . "' LIMIT 1"), 0);
}
function getRankName($rankId)
{
return $this->getRankVar($rankId, 'name');
}
function hasFuse($id, $fuse)
{
if (mysql_num_rows(dbquery("SELECT null FROM fuserights WHERE rank <= '" . $this->getRank($id) . "' AND fuse = '" . $fuse . "' LIMIT 1")) == 1)
{
return true;
}
return false;
}
/**************************************************************************************************/
function GetFriendCount($id, $onlineOnly = false)
{
$i = 0;
$q = dbquery("SELECT user_two FROM friendships WHERE user_one = '" . $id . "'");
while ($friend = mysql_fetch_assoc($q))
{
if (!$onlineOnly)
{
$i++;
}
else
{
$isOnline = mysql_result(dbquery("SELECT online FROM users WHERE id = '" . $friend['user_two'] . "' LIMIT 1"), 0);
if ($isOnline == "1")
{
$i++;
}
}
}
return $i;
}
/**************************************************************************************************/
function CheckSSO($id)
{
global $core;
if (strlen($this->getUserVar($id, 'auth_ticket')) <= 3)
{
dbquery("UPDATE users SET auth_ticket = '" . $core->generateTicket($this->getUserVar($id, 'username')) . "' WHERE id = '" . $id . "' LIMIT 1");
}
}
/**************************************************************************************************/
function getCredits($id)
{
return $this->getUserVar($id, 'credits');
}
function setCredits($id, $newAmount)
{
global $core;
dbquery("UPDATE users SET credits = '" . $newAmount. "' WHERE id = '" . $id . "' LIMIT 1");
$core->Mus('updateCredits:' . $id);
}
function giveCredits($id, $amount)
{
global $core;
return $this->setCredits($id, ($this->getCredits($id) + $amount));
$core->Mus('updateCredits:' . $id);
}
function takeCredits($id, $amount)
{
global $core;
return $this->setCredits($id, ($this->getCredits($id) - $amount));
$core->Mus('updateCredits:' . $id);
}
function renderHabboImage($id, $size = 'b', $dir = 2, $head_dir = 3, $action = 'wlk', $gesture = 'sml')
{
$look = $this->getUserVar($id, 'look');
return 'http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=' . $look . '&size=' . $size . '&action=' . $action . ',&gesture=' . $gesture . '&direction=' . $dir . '&head_direction=' . $head_dir;
}
function getClubDays($id)
{
$sql = dbquery("SELECT timestamp_activated, timestamp_expire FROM user_subscriptions WHERE subscription_id = 'habbo_club' AND user_id = '" . $id . "' LIMIT 1");
if (mysql_num_rows($sql) == 0)
{
return 0;
}
$data = mysql_fetch_assoc($sql);
$diff = $data['timestamp_expire'] - time();
if ($diff <= 0)
{
return 0;
}
return ceil($diff / 86400);
}
function hasClub($id)
{
return ($this->getClubDays($id) > 0) ? true : false;
}
/**************************************************************************************************/
public static function IsUserBanned($name)
{
if (uberUsers::GetBan('user', $name, true) != null)
{
return true;
}
return false;
}
public static function IsIpBanned($ip)
{
if (uberUsers::GetBan('ip', $ip, true) != null)
{
return true;
}
return false;
}
public static function GetBan($type, $value, $mustNotBeExpired = false)
{
$q = "SELECT * FROM bans WHERE bantype = '" . $type . "' AND value = '" . $value . "' ";
if ($mustNotBeExpired)
{
$q .= "AND expire > " . time() . " ";
}
$q .= "LIMIT 1";
$get = dbquery($q);
if (mysql_num_rows($get) > 0)
{
return mysql_fetch_assoc($get);
}
return null;
}
/**************************************************************************************************/
public static function GetUserTags($userId)
{
$tagsArray = Array();
$data = dbquery("SELECT id,tag FROM user_tags WHERE user_id = '" . $userId . "'");
while ($tag = mysql_fetch_assoc($data))
{
$tagsArray[$tag['id']] = $tag['tag'];
}
return $tagsArray;
}
/**************************************************************************************************/
public static function Is_Online($userId)
{
$result = dbquery("SELECT `online` FROM `users` WHERE `id` = '".$userId."' LIMIT 1");
$row = mysql_fetch_assoc($result);
return $row['online'];
}
}
?>
inc/class.tpl.php( Configure de acordo com seu hotel! Se não, não ira funcionar! )
- Spoiler:
- <?php
/*=======================================================================
| StageCMS - Sistema avançado de Administração de CMS
| #######################################################################
| Copyright (c) 2010, Geek and Meth0d
| #######################################################################
| Este programa é um Free Software aonde você pode editar os conteúdos
| com os direitos autorais do editor.
| #######################################################################
| Contato: Divirta-se com a CMS ;D
| [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
\======================================================================*/
class uberTpl
{
private $outputData;
private $params = Array();
private $includeFiles = Array();
public function Init()
{
global $core, $users;
$this->SetParam('hotelName', 'NOME DO SEU HOTEL');
$this->SetParam('page_title', 'NOME DO SEU HOTEL');
$this->SetParam('body_id', '');
$this->SetParam('password', 'SENHA DO PHPMYADMIN');
$this->SetParam('database', 'DATABASE A DB');
$this->SetParam('HabboID', '<b><img src="' . WWW . '/images/id.png" style="vertical-align: middle;"> ' . $users->GetUserVar(USER_ID, 'mail') . '</b>');
$this->SetParam('vipimage', '<img src="' . WWW . '/images/vipcoin.gif" style="vertical-align: middle;">');
$this->SetParam('StaffEmail', 'SEU EMAIL');
$this->SetParam('twitter', 'SEU TWITTER');
$this->SetParam('', 'Holo');
$this->SetParam('body_id', '');
$this->SetParam('page_title', ' ');
$this->SetParam('flash_build', 'flash_63_9');
$this->SetParam('web_build', $core->GetPath());
$this->SetParam('web_build_str', '63-BUILD?? - ?? - Novic - J.J.P.');
$this->SetParam('req_path', WWW);
$this->SetParam('www', WWW);
$this->SetParam('hotel_status_fig', uberCore::GetSystemStatusString(true));
$this->SetParam('hotel_status', uberCore::GetSystemStatusString(false));
if (LOGGED_IN)
{
$this->SetParam('habboLoggedIn', 'true');
$this->SetParam('habboName', USER_NAME);
$this->SetParam('vipbalance', '<b>' . $users->GetUserVar(USER_ID, 'vip_points') . ' <img src="' . WWW . '/images/vipcoin.gif" style="vertical-align: middle;"></b>');
}
else
{
$this->SetParam('habboLoggedIn', 'false');
$this->SetParam('habboName', 'null');
}
}
public function AddIncludeSet($set)
{
switch (strtolower($set))
{
case "frontpage":
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/landing.js'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/frontpage.css', 'stylesheet'));
break;
case "register":
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/changepassword.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/forcedemaillogin.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/quickregister.css', 'stylesheet'));
break;
case "process-template":
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/process.css', 'stylesheet'));
break;
case 'myhabbo':
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/myhabbo/myhabbo.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/myhabbo/skins.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/myhabbo/dialogs.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/myhabbo/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/myhabbo/control.textarea.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/myhabbo/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/myhabbo.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://www.habbo.co.uk/myhabbo/styles/assets.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/homeview.js'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/lightwindow.css', 'stylesheet'));
break;
case 'identity':
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/tooltips.css', 'stylesheet'));
break;
case 'default':
default:
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', 'http://images.habbo.com/habboweb/%web_build%/web-gallery/styles/tooltips.css', 'stylesheet'));
break;
}
}
public function AddGeneric($tplName)
{
$tpl = new Template($tplName);
$this->outputData .= $tpl->GetHtml();
}
public function AddTemplate($tpl)
{
$this->outputData .= $tpl->GetHtml();
}
public function SetParam($param, $value)
{
$this->params[$param] = is_object($value) ? $value->fetch() : $value;
}
public function UnsetParam($param)
{
unset($this->params[$param]);
}
public function AddIncludeFile($incFile)
{
$this->includeFiles[] = $incFile;
}
public function WriteIncludeFiles()
{
foreach ($this->includeFiles as $f)
{
$this->Write($f->GetHtml() . LB);
}
}
public function Write($str)
{
$this->outputData .= $str;
}
public function FilterParams($str)
{
foreach ($this->params as $param => $value)
{
$str = str_ireplace('%' . $param . '%', $value, $str);
}
return $str;
}
public function Output()
{
global $core;
$this->Write(LB . LB . '<!-- uberCMS: Took ' . (microtime(true) - $core->execStart) . ' to output this page -->' . LB . LB);
echo $this->FilterParams($this->outputData);
}
}
class Template
{
private $params = Array();
private $tplName = '';
public function Template($tplName)
{
$this->tplName = $tplName;
}
public function GetHtml()
{
global $users;
extract($this->params);
$file = CWD . 'inc/tpl/' . $this->tplName . '.tpl';
if (!file_exists($file))
{
uberCore::SystemError('Template system error', 'Could not load template: ' . $this->tplName);
}
ob_start();
include($file);
$data = ob_get_contents();
ob_end_clean();
return $this->FilterParams($data);
}
public function FilterParams($str)
{
foreach ($this->params as $param => $value)
{
if (is_object($value))
{
continue;
}
$str = str_ireplace('%' . $param . '%', $value, $str);
}
return $str;
}
public function SetParam($param, $value)
{
$this->params[$param] = $value;
}
public function UnsetParam($param)
{
unset($this->params[$param]);
}
}
class IncludeFile
{
private $type;
private $src;
private $rel;
private $name;
public function IncludeFile($type, $src, $rel = '', $name = '')
{
global $tpl;
$this->type = $type;
$this->src = $src;
$this->rel = $rel;
$this->name = $name;
}
public function GetHtml()
{
switch ($this->type)
{
case 'application/rss+xml':
return '<link rel="' . $this->rel . '" type="' . $this->type . '" title="' . $this->name . '" href="' . $this->src . '" />';
case 'text/javascript':
return '<script src="' . $this->src . '" type="text/javascript"></script>';
case 'text/css':
default:
return '<link rel="' . $this->rel . '" href="' . $this->src . '" type="' . $this->type . '" />';
}
}
}
?>
Configure essa clas.tpl.php assim:
NOME DO SEU HOTEL=Você coloca o nome do seu hotel!
SENHA DO PHPMYADMIN=Senha do seu PHPMyAdmin a padrão é vertrigo
DATABASE A DB=Sua DB do PHPMyAdmin, Ex.: HoloDB
SEU EMAIL=Seu Email o Email de contato, Ex.: [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
SEU TWITTER=Seu Twitter para mais coisas né? tipo o meu @gabrielsinhohc ai põe so gabrielsinhohc, Ex.:
$this->SetParam('twitter', 'gabrielsinhohc');
OBS:Coloquei nas cores do PHP Editor para ajudar a galera!
Créditos:
Eu
Stage CMS
Sky CMS
Demorei e foi dificílimo de fazer todo o tópico!
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos