• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Final CMS] BoostCMS - Dynamic Prepared Statements, Package System, Custom TPL Class

Status
Not open for further replies.
I don't even know
Loyal Member
Joined
Apr 7, 2010
Messages
1,699
Reaction score
420
The past few months I've slowly worked on a QuickTPL 2.0. Then at one moment I thought, this is all just rubbish and nobody is going to use this. So I started on a new CMS from scratch. I call it Boost because it really boosts you page-coding speed. I completed half the pages in an hour because how easy it is to create pages.

Let's talk about features:

Dynamic Prepared Statements: You don't have to call the bindparam functions anymore and you can just directly fetch rows if you supply the columns you want. Everything is handled by the MySqli Wrapper Class for you, without any possible exploits.

Custom Templating Class: This really speeds up your work. You don't need to write useless <html> tags anymore and <?php echo ?> is soooo deprecated. You can even set entire columns in one function without the need for any foreach.

Package System: Now this is something interesting. You know how on all CMSs in the Habbo Section people always release their total edits with just some added pages? Well I created a system like Modloader in Minecraft. You can just create a package with for example a VIP Shop, create 5 pages in it and just release that Package. You can just copy-paste that Package to your /Boost/Packages/ folder and the CMS does all the loading for you.

It is going to be entirely Habbo-Themed with a ripped web-gallery supplied with some extra CSS from me added in for the Housekeeping.

Snippets:

Router
PHP:
<?php
class Router
{
	public $Request;
	private $Maps = Array(), $CurrentMap;
	public $Navigation = Array();

	public function MapPackage($Package)
	{
		$MapLink = BOOST.'/Packages/'.$Package.'/Maps.php';

		if (file_exists($MapLink))
		{
			$this->CurrentMap = $Package;
			require $MapLink;
		}
	}

	private function Map($Url, $Page)
	{
		$this->Maps[$Url] = Array(
			'Package' => $this->CurrentMap,
			'Page' => $Page
		);
	}

	public function Load($Url)
	{
		$this->Request = new Request($Url);

		$i = 10;
		while (!isset($this->Maps[$this->Request->Url]))
		{
			$this->Request->PopSubUrl();
			if ($i-- == 0) exit; //security, can be removed
		}

		return $this->Maps[$this->Request->Url];
	}

	public function AddNav($Title, $Subs)
	{
		$this->Navigation[$Title] = $Subs;
	}
}
?>

Bootstrap
PHP:
<?php
error_reporting(E_ALL);
session_start();

define('BOOST', dirname(__FILE__));
define('HTDOCS', dirname(BOOST));

require BOOST.'/CMS.php';

CMS::DoSCheck();

CMS::LoadLibrary();
CMS::ParseConfigFiles();

CMS::$MySql = new MySql(CMS::$Config);
CMS::$Router = new Router();

Users::CheckLogin();

CMS::LoadPackages();

foreach (CMS::$Packages as $Package)
{
	CMS::$Router->MapPackage($Package);
}
?>

Index
PHP:
<?php
require './Boost/Bootstrap.php';

$Route = CMS::$Router->Load($_SERVER['REQUEST_URI']);

CMS::$Template = new Template($Route['Package']);

CMS::$Template->Title = substr($Route['Page'], 0, -4);

CMS::$Template->Define('Hotelname', CMS::$Config['cms.hotelname']);
CMS::$Template->Define('Online', Site::GetUsersOnline());

if (Users::$Session !== false)
{
	CMS::$Template->Define('Username', Users::$Session->Name);
	CMS::$Template->DefineArray('User', Users::$Session->Data);
}

CMS::$Template->SetFavicon('/web-gallery/v2/favicon.ico');

CMS::$Template->Output($Route['Page'], 'index.htm');
?>

Release is coming in one or two weeks, I'm working hard on it currently.

Pages Complete so far:
Login
Quickregister
Me
Account Settings
Community
Articles
Feedback
FAQ
About
Staff
R63A Client

Working On:
Recoded Housekeeping from QuickTPL (I really liked that one, but code was messy so I'll have to recode the functions)
Finding and fixing bugs (Haven't found anything yet, someone like to try it out on a live hotel?)
Expanding Account Settings, and Community

Planned:
R63B Client
Maybe a VIP Shop?

For more snippets just ask, but I'd like to get your interests first :D:
 
I don't even know
Loyal Member
Joined
Apr 7, 2010
Messages
1,699
Reaction score
420
Your use of capital letters at the start of method names burns my eyes.

I got used to writing UpperCase after alot of C#. Now I can't switch back because I think this looks much cleaner IMO.

First interesting CMS I've seen in some time, good luck.

Thanks, this means alot to me from one of the best PHP Coders around here
 
topkek amirite??
Joined
May 16, 2009
Messages
751
Reaction score
696
So I was right, it should be in camelCase? I was wondering since I know Java uses camelCase and I thought PHP too. Besides the capital letters, it looks okay I think ;p

Yes, PHP is a camelCase language but it all boils down to preference I guess.
 
Junior Spellweaver
Joined
May 5, 2012
Messages
110
Reaction score
10
Good luck mate, I like it. Looking good so far. It's a pity that this is going to be your last CMS, I always liked your CMS's.
 
topkek amirite??
Joined
May 16, 2009
Messages
751
Reaction score
696
Planning on posting any screenshots? :p
 
I don't even know
Loyal Member
Joined
Apr 7, 2010
Messages
1,699
Reaction score
420


R63B Client
PHP:
<?php
$EmuData = Array(
	'Host' => (RemoteIp == '127.0.0.1' ? '127.0.0.1' : CMS::$Config['emulator.host']),
	'Port' => CMS::$Config['emulator.port']	
);

$ClientData = Array(
	'Host' => 	CMS::$Config['client.swfhost'],
	'SwfBase' => 	CMS::$Config['client.swfbase'],
	'HabboSwf' => 	CMS::$Config['client.habboswf'],
	'Vars' => 	CMS::$Config['client.variables'],
	'Texts' => 	CMS::$Config['client.flashtexts']
);

$SSO = Site::RandomMD5(32, serialize(Users::$Session->Data));

CMS::$MySql->Prepare('DELETE FROM user_tickets WHERE userid = ?');
CMS::$MySql->Execute(Users::$Session->Data['id']);

CMS::$MySql->Insert('user_tickets', Array(
 'userid' => Users::$Session->Data['id'],
 'sessionticket' => $SSO,
 'ipaddress' => RemoteIp));

$this->Define('SSO', $SSO);
$this->Define('Hash', '-');

$this->DefineArray('Emu', $EmuData);
$this->DefineArray('Client', $ClientData);

$this->Body['id'] = 'client';
$this->Body['class'] = 'flashclient';

$this->LoadTpl('Client-Body');
?>

Feedback Page
PHP:
<?php
$this->Title = 'Send Feedback';

$this->LoadTpl('FeedbackCSS');

$this->Write('<div id="column1" class="column">');

	$this->LoadTpl('FeedbackBox');

$this->Write('</div>');

$this->Write('<div id="column2" class="column">');

if (isset(CMS::$Router->Request->SubUrls[0]) && CMS::$Router->Request->SubUrls[0] == '/send')
{
	$FB = str_replace(Array("\r", "\n"), '', nl2br(htmlspecialchars($_POST['feedback'])));

	CMS::$MySql->Insert('cms_comments', Array(
		'story' => 0,
		'comment' => $FB,
		'date' => time(),
		'author' => Users::$Session->Data['id']
	));

	$this->Define('Feedback', $FB);
	$this->LoadTpl('Sent-Feedback');
}

$this->Write('</div>');
?>

Content looks a lot like QuickTPL, but the coding is 100% different :rolleyes:
For more snippets just ask, I'm working hard on completing the Housekeeping now. Just finished wordfilter and added the ExtendedStaff Package like QuickTPL's staff page

Ranks Port from QuickTPL in HK Completed

__

Beta 4:
QuickTPL HK 100% Ported
Some internal edits made
Showed Package System to Leon :):
 
Last edited:
Experienced Elementalist
Joined
Feb 19, 2012
Messages
287
Reaction score
23
very nice,but sadly this is your final cms. I always love your cms such as DeltaCMS,FrostCMS and QuickTPL. In my opinion,I didn't like Quick TPL's staff page
 
Banned
Banned
Joined
Dec 1, 2012
Messages
88
Reaction score
10
So far, this CMS is going good! Good luck mate!
 
Status
Not open for further replies.
Back
Top