DizzloEndrit
Member
- Sep 23, 2017
- 90
- 23
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:
class.core.php
class.template.php
class.html.php
Please help me if u can!
Screenshot:
You must be registered for see images 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);
}
}
?>
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);
}
}
?>
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);
}
}
?>
Please help me if u can!