Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
RevCMS - New page is messing up.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="DizzloEndrit" data-source="post: 452719" data-attributes="member: 77737"><p>Hello! I got some issues with my news page, and the problem is at the class files. But more than that i dont know. I know that the classes are the problem cuz the page did work if i rename it to something else.</p><p></p><p></p><p>Screenshot: [ATTACH=full]9512[/ATTACH]</p><p></p><p>class.core.php</p><p>[CODE]<?php</p><p></p><p>namespace Revolution;</p><p>if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }</p><p>class core implements iCore</p><p>{</p><p></p><p> final public function getOnline()</p><p> {</p><p> global $engine;</p><p> return $engine->result("SELECT COUNT(*) as online FROM users WHERE online = '1';", "online");</p><p> }</p><p></p><p> final public function getStatus()</p><p> {</p><p> global $engine;</p><p> return "open";</p><p> //return $engine->result("SELECT status FROM server_status", "status");</p><p> }</p><p></p><p> final public function systemError($who, $txt)</p><p> {</p><p> die('<b>' . $who . ' - RevCMS: </b><br /> <center>' . $txt . '</center>');</p><p> }</p><p></p><p> final public function handleCall($k)</p><p> {</p><p> global $users, $template, $_CONFIG;</p><p></p><p> if($_CONFIG['hotel']['in_maint'] == false)</p><p> {</p><p> if(!isset($_SESSION['user']['id']))</p><p> {</p><p> switch($k)</p><p> {</p><p> case "index":</p><p> case null:</p><p> case "login":</p><p> $users->login();</p><p> break;</p><p></p><p> case "register":</p><p> $users->register();</p><p> break;</p><p></p><p> case "maintenance":</p><p> case "ToS":</p><p> //</p><p> break;</p><p></p><p> case "me":</p><p> case "account":</p><p> case "news":</p><p> header('Location: '.$_CONFIG['hotel']['url'].'/index');</p><p> exit;</p><p> break;</p><p></p><p> default:</p><p> //Nothing</p><p> break;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> if($_SESSION['user']['ip_current'] != $_SERVER['REMOTE_ADDR'])</p><p> {</p><p> header('Location: '.$_CONFIG['hotel']['url'].'/logout');</p><p> exit;</p><p> }</p><p></p><p> switch($k)</p><p> {</p><p> case "index":</p><p> case null:</p><p> header('Location: '.$_CONFIG['hotel']['url'].'/me');</p><p> exit;</p><p> break;</p><p></p><p> case "register":</p><p> header('Location: '.$_CONFIG['hotel']['url'].'/me');</p><p> exit;</p><p> break;</p><p></p><p> case "client":</p><p> $users->createSSO($_SESSION['user']['id']);</p><p> $users->updateUser($_SESSION['user']['id'], 'ip_current', $_SERVER['REMOTE_ADDR']);</p><p> $template->setParams('sso', $users->getInfo($_SESSION['user']['id'], 'auth_ticket'));</p><p> break;</p><p></p><p> case "help":</p><p> $users->help();</p><p> break;</p><p></p><p> case "account":</p><p> $users->updateAccount();</p><p> break;</p><p></p><p> default:</p><p> //nothing</p><p> break;</p><p> }</p><p> }</p><p> }</p><p> elseif($_GET['url'] != 'maintenance' && $_SESSION['user']['rank'] != 5)</p><p> {</p><p> header('Location: '.$_CONFIG['hotel']['url'].'/maintenance');</p><p> exit;</p><p> }</p><p> }</p><p></p><p> final public function handleCallHK($k)</p><p> {</p><p> global $users, $engine, $_CONFIG;</p><p></p><p> if($_SESSION["in_hk"] != true)</p><p> {</p><p> if(isset($_SESSION['user']['id']))</p><p> {</p><p> if($k == 'login')</p><p> {</p><p> $users->loginHK();</p><p> }</p><p> else</p><p> {</p><p> header("Location:".$_CONFIG['hotel']['url']."/ase/login");</p><p> exit;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> header("Location:".$_CONFIG['hotel']['url']."/index");</p><p> exit;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> if(!isset($k))</p><p> {</p><p> header("Location:".$_CONFIG['hotel']['url']."/ase/dash");</p><p> exit;</p><p> }</p><p> else</p><p> {</p><p> if($k == 'balist')</p><p> {</p><p></p><p> if(isset($_GET["unban"]))</p><p> {</p><p> $user = $engine->secure($_GET["unban"]);</p><p> $engine->query("DELETE FROM bans WHERE id = '" . $user . "'");</p><p> header("Location: ".$_CONFIG['hotel']['url']."/ase/banlist");</p><p> exit;</p><p> }</p><p> }</p><p> }</p><p> }</p><p> }</p><p></p><p> final public function hashed($password)</p><p> {</p><p> return md5($password);</p><p> }</p><p>}</p><p>?>[/CODE]</p><p></p><p>class.template.php</p><p>[CODE]<?php</p><p></p><p>namespace Revolution;</p><p>if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }</p><p>class template implements iTemplate</p><p>{</p><p></p><p> public $tpl;</p><p> </p><p> private $params = array();</p><p></p><p> final public function Initiate()</p><p> {</p><p> global $_CONFIG, $users, $engine, $core, $template;</p><p> $this->setParams('hotelName', $_CONFIG['hotel']['name']);</p><p> $this->setParams('hotelDesc', $_CONFIG['hotel']['desc']);</p><p> $this->setParams('url', $_CONFIG['hotel']['url']);</p><p> $this->setParams('online', $core->getOnline());</p><p> $this->setParams('status', $core->getStatus());</p><p> $this->setParams('web_build', $_CONFIG['hotel']['web_build']);</p><p> $this->setParams('external_vars', $_CONFIG['hotel']['external_vars']);</p><p> $this->setParams('external_texts', $_CONFIG['hotel']['external_texts']);</p><p> $this->setParams('swf_folder', $_CONFIG['hotel']['swf_folder']);</p><p> $this->setParams('furni_data', $_CONFIG['hotel']['furni_data']);</p><p> $this->SetParams('product_data', $_CONFIG['hotel']['product_data']);</p><p> $this->setParams('server_ip', $_CONFIG['hotel']['server_ip']);</p><p> </p><p> $this->setParams('mysql_host', $_CONFIG['mysql']['hostname']);</p><p> $this->setParams('mysql_port', $_CONFIG['mysql']['port']);</p><p> </p><p> $this->setParams('skin', $_CONFIG['template']['style']);</p><p> </p><p> if($users->isLogged())</p><p> { </p><p> $this->setParams('username', $users->getInfo($_SESSION['user']['id'], 'username'));</p><p> $this->setParams('rank', $users->getInfo($_SESSION['user']['id'], 'rank'));</p><p> $this->setParams('motto', $users->getInfo($_SESSION['user']['id'], 'motto'));</p><p> $this->setParams('email', $users->getInfo($_SESSION['user']['id'], 'mail'));</p><p> $this->setParams('coins', $users->getInfo($_SESSION['user']['id'] ,'credits'));</p><p> $this->setParams('activitypoints', $users->getInfo($_SESSION['user']['id'], 'pixels'));</p><p> $this->setParams('figure', $users->getInfo($_SESSION['user']['id'], 'look'));</p><p> $this->setParams('ip_last', $users->getInfo($_SESSION['user']['id'], 'ip_current'));</p><p> </p><p> if($this->params['rank'] > 3)</p><p> {</p><p> $this->setParams('housekeeping', '<li><a href="ase/">Housekeeping</a></li>');</p><p> }</p><p> else</p><p> {</p><p> $this->setParams('housekeeping', '');</p><p> }</p><p> </p><p> if($_GET['url'] == 'me' || $_GET['url'] == 'account' || $_GET['url'] == 'home' || $_GET['url'] == 'settings' || $_GET['url'] == 'community')</p><p> {</p><p> $template->form->getPageHome(); </p><p> }</p><p> </p><p> if($_GET['url'] == 'news' || $_GET['url'] == 'articles')</p><p> {</p><p> $template->form->getPageNews();</p><p> }</p><p> }</p><p> </p><p> }</p><p> </p><p> final public function setParams($key, $value)</p><p> { </p><p> $this->params[$key] .= $value;</p><p> }</p><p> </p><p> final public function filterParams($str)</p><p> {</p><p> foreach($this->params as $key => $value)</p><p> {</p><p> $str = str_ireplace('{' . $key . '}', $value, $str);</p><p> }</p><p></p><p> return $str;</p><p> }</p><p> </p><p> final public function write($str)</p><p> {</p><p> $this->tpl .= $str;</p><p> }</p><p> </p><p> final public function outputTPL()</p><p> {</p><p> echo $this->filterParams($this->tpl);</p><p> unset($this->tpl);</p><p> }</p><p>}</p><p>?>[/CODE]</p><p></p><p>class.html.php</p><p></p><p></p><p></p><p></p><p></p><p>[CODE]<?php</p><p></p><p>namespace Revolution;</p><p>if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }</p><p>class html implements iHTML</p><p>{</p><p></p><p> private $html;</p><p></p><p> final public function get($file)</p><p> {</p><p> global $engine, $template, $_CONFIG;</p><p></p><p> if($file != null && ctype_alnum($file))</p><p> {</p><p> if(file_exists('app/tpl/skins/'.$_CONFIG['template']['style'].'/' . $file . '.php'))</p><p> {</p><p> ob_start();</p><p> include('app/tpl/skins/'.$_CONFIG['template']['style'].'/' . $file . '.php');</p><p> $this->html .= ob_get_contents();</p><p> ob_end_clean();</p><p> </p><p> $this->setHTML();</p><p> }</p><p> else</p><p> {</p><p> $this->get('404');</p><p> }</p><p> }</p><p> else</p><p> {</p><p> header('Location: '.$_CONFIG['hotel']['url'].'/index');</p><p> exit;</p><p> }</p><p></p><p> }</p><p> </p><p> final public function getHK($file)</p><p> {</p><p> global $template, $_CONFIG;</p><p> </p><p> if($file != null)</p><p> {</p><p> if(file_exists('../app/tpl/skins/'.$_CONFIG['template']['style'].'/hk/' . $file . '.php'))</p><p> {</p><p> ob_start();</p><p> require_once('../app/tpl/skins/'.$_CONFIG['template']['style'].'/hk/' . $file . '.php');</p><p> $this->html .= ob_get_contents();</p><p> ob_end_clean();</p><p> </p><p> $this->setHTML();</p><p> }</p><p> else</p><p> {</p><p> $this->getHK('404');</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $this->getHK('dash');</p><p> }</p><p> }</p><p> </p><p> final public function setHTML()</p><p> {</p><p> global $template;</p><p> $template->tpl .= $this->html;</p><p> unset($this->html);</p><p> }</p><p></p><p></p><p>}</p><p>?>[/CODE]</p><p></p><p></p><p>Please help me if u can!</p></blockquote><p></p>
[QUOTE="DizzloEndrit, post: 452719, member: 77737"] Hello! I got some issues with my news page, and the problem is at the class files. But more than that i dont know. I know that the classes are the problem cuz the page did work if i rename it to something else. Screenshot: [ATTACH=full]9512[/ATTACH] class.core.php [CODE]<?php namespace Revolution; if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); } class core implements iCore { final public function getOnline() { global $engine; return $engine->result("SELECT COUNT(*) as online FROM users WHERE online = '1';", "online"); } final public function getStatus() { global $engine; return "open"; //return $engine->result("SELECT status FROM server_status", "status"); } final public function systemError($who, $txt) { die('<b>' . $who . ' - RevCMS: </b><br /> <center>' . $txt . '</center>'); } final public function handleCall($k) { global $users, $template, $_CONFIG; if($_CONFIG['hotel']['in_maint'] == false) { if(!isset($_SESSION['user']['id'])) { switch($k) { case "index": case null: case "login": $users->login(); break; case "register": $users->register(); break; case "maintenance": case "ToS": // break; case "me": case "account": case "news": header('Location: '.$_CONFIG['hotel']['url'].'/index'); exit; break; default: //Nothing break; } } else { if($_SESSION['user']['ip_current'] != $_SERVER['REMOTE_ADDR']) { header('Location: '.$_CONFIG['hotel']['url'].'/logout'); exit; } switch($k) { case "index": case null: header('Location: '.$_CONFIG['hotel']['url'].'/me'); exit; break; case "register": header('Location: '.$_CONFIG['hotel']['url'].'/me'); exit; break; case "client": $users->createSSO($_SESSION['user']['id']); $users->updateUser($_SESSION['user']['id'], 'ip_current', $_SERVER['REMOTE_ADDR']); $template->setParams('sso', $users->getInfo($_SESSION['user']['id'], 'auth_ticket')); break; case "help": $users->help(); break; case "account": $users->updateAccount(); break; default: //nothing break; } } } elseif($_GET['url'] != 'maintenance' && $_SESSION['user']['rank'] != 5) { header('Location: '.$_CONFIG['hotel']['url'].'/maintenance'); exit; } } final public function handleCallHK($k) { global $users, $engine, $_CONFIG; if($_SESSION["in_hk"] != true) { if(isset($_SESSION['user']['id'])) { if($k == 'login') { $users->loginHK(); } else { header("Location:".$_CONFIG['hotel']['url']."/ase/login"); exit; } } else { header("Location:".$_CONFIG['hotel']['url']."/index"); exit; } } else { if(!isset($k)) { header("Location:".$_CONFIG['hotel']['url']."/ase/dash"); exit; } else { if($k == 'balist') { if(isset($_GET["unban"])) { $user = $engine->secure($_GET["unban"]); $engine->query("DELETE FROM bans WHERE id = '" . $user . "'"); header("Location: ".$_CONFIG['hotel']['url']."/ase/banlist"); exit; } } } } } final public function hashed($password) { return md5($password); } } ?>[/CODE] class.template.php [CODE]<?php namespace Revolution; if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); } class template implements iTemplate { public $tpl; private $params = array(); final public function Initiate() { global $_CONFIG, $users, $engine, $core, $template; $this->setParams('hotelName', $_CONFIG['hotel']['name']); $this->setParams('hotelDesc', $_CONFIG['hotel']['desc']); $this->setParams('url', $_CONFIG['hotel']['url']); $this->setParams('online', $core->getOnline()); $this->setParams('status', $core->getStatus()); $this->setParams('web_build', $_CONFIG['hotel']['web_build']); $this->setParams('external_vars', $_CONFIG['hotel']['external_vars']); $this->setParams('external_texts', $_CONFIG['hotel']['external_texts']); $this->setParams('swf_folder', $_CONFIG['hotel']['swf_folder']); $this->setParams('furni_data', $_CONFIG['hotel']['furni_data']); $this->SetParams('product_data', $_CONFIG['hotel']['product_data']); $this->setParams('server_ip', $_CONFIG['hotel']['server_ip']); $this->setParams('mysql_host', $_CONFIG['mysql']['hostname']); $this->setParams('mysql_port', $_CONFIG['mysql']['port']); $this->setParams('skin', $_CONFIG['template']['style']); if($users->isLogged()) { $this->setParams('username', $users->getInfo($_SESSION['user']['id'], 'username')); $this->setParams('rank', $users->getInfo($_SESSION['user']['id'], 'rank')); $this->setParams('motto', $users->getInfo($_SESSION['user']['id'], 'motto')); $this->setParams('email', $users->getInfo($_SESSION['user']['id'], 'mail')); $this->setParams('coins', $users->getInfo($_SESSION['user']['id'] ,'credits')); $this->setParams('activitypoints', $users->getInfo($_SESSION['user']['id'], 'pixels')); $this->setParams('figure', $users->getInfo($_SESSION['user']['id'], 'look')); $this->setParams('ip_last', $users->getInfo($_SESSION['user']['id'], 'ip_current')); if($this->params['rank'] > 3) { $this->setParams('housekeeping', '<li><a href="ase/">Housekeeping</a></li>'); } else { $this->setParams('housekeeping', ''); } if($_GET['url'] == 'me' || $_GET['url'] == 'account' || $_GET['url'] == 'home' || $_GET['url'] == 'settings' || $_GET['url'] == 'community') { $template->form->getPageHome(); } if($_GET['url'] == 'news' || $_GET['url'] == 'articles') { $template->form->getPageNews(); } } } final public function setParams($key, $value) { $this->params[$key] .= $value; } final public function filterParams($str) { foreach($this->params as $key => $value) { $str = str_ireplace('{' . $key . '}', $value, $str); } return $str; } final public function write($str) { $this->tpl .= $str; } final public function outputTPL() { echo $this->filterParams($this->tpl); unset($this->tpl); } } ?>[/CODE] class.html.php [CODE]<?php namespace Revolution; if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); } class html implements iHTML { private $html; final public function get($file) { global $engine, $template, $_CONFIG; if($file != null && ctype_alnum($file)) { if(file_exists('app/tpl/skins/'.$_CONFIG['template']['style'].'/' . $file . '.php')) { ob_start(); include('app/tpl/skins/'.$_CONFIG['template']['style'].'/' . $file . '.php'); $this->html .= ob_get_contents(); ob_end_clean(); $this->setHTML(); } else { $this->get('404'); } } else { header('Location: '.$_CONFIG['hotel']['url'].'/index'); exit; } } final public function getHK($file) { global $template, $_CONFIG; if($file != null) { if(file_exists('../app/tpl/skins/'.$_CONFIG['template']['style'].'/hk/' . $file . '.php')) { ob_start(); require_once('../app/tpl/skins/'.$_CONFIG['template']['style'].'/hk/' . $file . '.php'); $this->html .= ob_get_contents(); ob_end_clean(); $this->setHTML(); } else { $this->getHK('404'); } } else { $this->getHK('dash'); } } final public function setHTML() { global $template; $template->tpl .= $this->html; unset($this->html); } } ?>[/CODE] Please help me if u can! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
RevCMS - New page is messing up.
Top