Jeremy Bates
Member
- Oct 20, 2011
- 31
- 0
iv been stuck on this client for awhile now
newclient.php
/*=======================================================================
| UberCMS - Advanced Website and Content Management System for uberEmu
| #######################################################################
| Copyright (c) 2010, Roy 'Meth0d'
|
| #######################################################################
| 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 uberTpl
{
private $outputData;
private $params = Array();
private $includeFiles = Array();
public function Init()
{
global $core, $users, $cdn;
$this->cdn = $cdn->AssignCDN();
$this->SetParam('cdn', $this->cdn);
$this->SetParam('hotel', '63_1dc60c6d6ea6e089c6893ab4e0541ee0/1193');
$this->SetParam('63_1dc60c6d6ea6e089c6893ab4e0541ee0/1193','zap');
// *************************************************************************************************
$this->SetParam('body_id', '');
$this->SetParam('page_title', ' ');
$this->SetParam('flash_build', '');
$this->SetParam('web_build_str', '');
$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', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/landing.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/frontpage.css', 'stylesheet'));
break;
case "register":
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/embeddedregistration.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/simpleregistration.js'));
break;
case "homes":
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/common.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/home.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '
$this->AddIncludeFile(new IncludeFile('text/css', '
$this->AddIncludeFile(new IncludeFile('text/css', '
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/homeview.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/lightwindow.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/homeauth.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/group.css', 'stylesheet'));
break;
case "process-template":
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/process.css', 'stylesheet'));
break;
case 'myhabbo':
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/myhabbo.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/skins.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/dialogs.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/control.textarea.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/myhabbo/styles/assets.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/homeview.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/lightwindow.css', 'stylesheet'));
break;
case 'default':
default:
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%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 . 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 . 'includes/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 . '" />';
}
}
}
?>
newclient.php
<?php
/*
|
. .|---.,---.,---.
| || ||---'| UberCMS 2.0
`---'`---'`---'`
UberCMS
Coded originally by Meth0d (2010-2011)
Continued by Jonty (2011-now)
Build 2.0.0 SS, Public
*/
require_once "global.php";
if (!LOGGED_IN)
{
header("Location: " . WWW. "/");
exit;
}
if(!isset($_SESSION["has_voted"]) || $_SESSION["has_voted"] == false) {
if ($voting['thehabbos_enabled'] == true) {
$hasVoted = true;
}
else {
$hasVoted = false;
}
}
else {
$hasVoted = true;
}
if($hasVoted == false) {
$_SESSION["has_voted"] = true;
header("Location:
You must be registered for see links
" . $voting['thehabbos_username'] . "&api=" . $voting['thehabbos_returnurl']);}
if($site['enable_pincodes'] == true && $users->GetUserVar(USER_ID, 'rank') >= $site['pincode_minrank']) {
if(!isset($_SESSION["staff_PassAuth"])) {
header ("Location: " . WWW . "/client_denied");
}
}
// **************************************************************************************************************
// **************************************************************************************************************
$users->CheckSSO(USER_ID);
$checkExists = dbquery("SELECT userid FROM user_tickets WHERE userid = '" . USER_ID . "'");
$userTicket = $users->GetUserVar(USER_ID, 'auth_ticket');
if($server['butterfly_sso'] == true) {
if(mysql_num_rows($checkExists)) {
dbquery("UPDATE user_tickets SET sessionticket = '" . $userTicket . "', ipaddress = '" . $_SERVER["REMOTE_ADDR"] . "' WHERE userid = '" . USER_ID . "'");
}
else {
dbquery("INSERT INTO user_tickets (userid,sessionticket,ipaddress) VALUES ('" . USER_ID . "', '" . $userTicket . "', '" . $_SERVER["REMOTE_ADDR"] . "')");
}
}
else if($server['phoenix_secure_sessions'] == true) {
dbquery("UPDATE `users` SET `auth_ticket` = '" . $users->GetUserVar(USER_ID, "auth_ticket") . "' WHERE id = '" . USER_ID . "'");
}
$forwardType = 0;
$forwardId = 0;
// Due to an issue with most servers, tags have been disabled in the CMS by default.
if (mysql_num_rows(dbquery("SELECT * FROM user_tags WHERE user_id = '" . USER_ID . "' LIMIT 1"))) {
dbquery("DELETE FROM user_tags WHERE user_id = '" . USER_ID . "'");
}
if ($users->getUserVar(USER_ID, 'newbie_status') == "2") {
// Run POST-REGISTRATION checks
dbquery("UPDATE `users` SET
`motto` = '" . $server['default_motto'] . "',
`credits` = '" . $server['default_credits'] . "',
`activity_points` = '" . $server['default_pixels'] . "',
`look` = '" . $server['default_look'] . "',
`home_room` = '" . $server['default_room'] . "',
`rank` = '" . $server['default_rank'] . "',
`newbie_status` = '3'
WHERE `id` = '" . USER_ID . "'");
}
dbquery("UPDATE users SET ip_last = '".$_SERVER['REMOTE_ADDR']."' WHERE username = '".USER_NAME."'");
$tpl->Init();
$client = new Template('page-client');
$client->SetParam('page_title', ' ');
$client->SetParam('sso_ticket', $users->GetUserVar(USER_ID, 'auth_ticket', false));
$client->SetParam('flash_base', '
You must be registered for see links
$client->SetParam('flash_client_url', '
You must be registered for see links
$client->SetParam('hotel_status', $core->GetUsersOnline() . ' users online now!');
$client->SetParam('forwardType', $forwardType);
$client->SetParam('forwardId', $forwardId);
$tpl->AddGeneric('head-init');
$tpl->AddIncludeSet('default');
$tpl->AddIncludeFile(new IncludeFile('text/css', '
You must be registered for see links
', 'stylesheet'));$tpl->AddIncludeFile(new IncludeFile('text/css', '
You must be registered for see links
', 'stylesheet'));$tpl->AddIncludeFile(new IncludeFile('text/javascript', '
You must be registered for see links
$tpl->WriteIncludeFiles();
$tpl->AddGeneric('head-bottom');
if (isset($_GET['forceTicket']) && $users->HasFuse(USER_ID, 'fuse_admin'))
{
$client->SetParam('sso_ticket', $_GET['forceTicket']);
}
$tpl->AddTemplate($client);
$tpl->Output();
?>
client.tpl.php
<?php/*=======================================================================
| UberCMS - Advanced Website and Content Management System for uberEmu
| #######################################################################
| Copyright (c) 2010, Roy 'Meth0d'
|
You must be registered for see links
| #######################################################################
| 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 uberTpl
{
private $outputData;
private $params = Array();
private $includeFiles = Array();
public function Init()
{
global $core, $users, $cdn;
$this->cdn = $cdn->AssignCDN();
$this->SetParam('cdn', $this->cdn);
$this->SetParam('hotel', '63_1dc60c6d6ea6e089c6893ab4e0541ee0/1193');
$this->SetParam('63_1dc60c6d6ea6e089c6893ab4e0541ee0/1193','zap');
// *************************************************************************************************
$this->SetParam('body_id', '');
$this->SetParam('page_title', ' ');
$this->SetParam('flash_build', '');
$this->SetParam('web_build_str', '');
$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', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/landing.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/frontpage.css', 'stylesheet'));
break;
case "register":
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/embeddedregistration.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/simpleregistration.js'));
break;
case "homes":
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/common.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/home.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '
You must be registered for see links
', 'stylesheet'));$this->AddIncludeFile(new IncludeFile('text/css', '
You must be registered for see links
', 'stylesheet'));$this->AddIncludeFile(new IncludeFile('text/css', '
You must be registered for see links
', 'stylesheet'));$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/homeview.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/lightwindow.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/homeauth.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/static/styles/group.css', 'stylesheet'));
break;
case "process-template":
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/process.css', 'stylesheet'));
break;
case 'myhabbo':
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/tooltips.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/myhabbo.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/skins.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/dialogs.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/control.textarea.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/myhabbo.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/myhabbo/styles/assets.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/homeview.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/lightwindow.css', 'stylesheet'));
break;
case 'default':
default:
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs2.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/visual.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/libs.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/common.js'));
$this->AddIncludeFile(new IncludeFile('text/javascript', '%web_gallery%/static/js/fullcontent.js'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/style.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/buttons.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%web_gallery%/styles/boxes.css', 'stylesheet'));
$this->AddIncludeFile(new IncludeFile('text/css', '%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 . 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 . 'includes/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 . '" />';
}
}
}
?>