• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

ZCMS, development of my CMS

I have rewritten a lot in the source now. I have also added another template engine to choose as well. That engine looks a lot like Smartys, this because there seems to be quite a bit of people who like it.
Ex:
Code:
{if $value == 50}
   <b>Value is 50</b>
{else}
   <b>Value is not 50</b>
{/if}
 
Will it be easy to change engine? if you release it, I want to use my own:

Code:
{% if $value == 50 %}
<b>Value is 50</b>
{% else %}
<b>Value is not 50 %}
{% end %}

Compiles to this:
Code:
if ( $GLOBALS['value'] == 50 ) {
?>
<b>Value is 50</b>
<?php } else { ?>
<b>Value is not 50</b>
<?php } ?>

I just think it would be nice to have the ability to quick change engines, that would require less recoding to use your CMS. And we all love less coding. ;)

But otherwise it's a nice work :)
 
I think it's pretty easy to change. The only thing I needed to change when creating a new engine using those tags was the display function:
(this is the default one)
PHP:
	/**
	 * @access public
	 * @return NULL
	**/
	public function display()
	{
		// Extract variables from our array
		extract($this->vars);

		$new_vars = array();
		// First lets check if there are any view files which should be parsed
		foreach($this->_action as $action)
		{
			// Check if it's another kind of path than the default
			if( strpos ( $action , '/' ) != false || strpos ( $action , '\\' ) != false ){
				$file = $action . '.php';
			}else{
				$file = VIEW_DIR . DS . $this->_controller . DS . $action . '.php';
			}

			// Try parsing it
			if( is_file($file) )
			{
				$this->parse_start();
				require($file);
				$parsed = $this->parse_end();

				// Name of view
				$name = $action;
				// Assign parsed data to a variable
				$new_vars[$name] = $parsed;
			}
		}

		// Now lets include the global template
		// Define the template path
		$new_vars['this_template_path'] = URL . '/' .TEMPLATE_DIR_i . '/' . config::$template;
		$file = $this->template_dir . DS . $this->file;

                // Extract variables from our array
		extract($new_vars);

		// Check if template file exists
		if( is_file($file) ){
			require($file);
		}
	}

You are free to come with suggestions and tips to improve it :p
 
I'm too lazy to assign stuff, I just use the $GLOBALS space directly. Faster and easier in my opinion.


A tiny example from the vapus core:
pages/test.php:
Code:
<?php
$myvar = "somevalue";
Artic::template('mytemplate');
?>

templates/default/mytemplate.html:
Code:
<b>Hello, the value of $myvar is: </b>{{ $myvar }}

Global space rocks ;)
 
I feel more comfortable assigning :p

Anyway, my new little templating is soon done.
I have the following functions/keywords so far:
Code:
{while $something > 5}
{/while}

{foreach $key as $value}
{/foreach}

{if $something > 5}
   {$lol}
{elseif $something < 5}
   {$lel}
{else}
   {$lal}
{/if}

{php}
echo 'lol';
{/php}

{include=header.php}

What stuff have I missed?

Edit: Lol, the new template system is 0.0010seconds faster than the default one. It has to be that I've made some optimization on the new one which I haven't done on the old one yet :s
 
Last edited:
Dont tell me you are using Joomla >.<

Your page:
2dtt6ba.png


Joomla Standart page (Users need to edit it)
joomla_1.jpg
 
Dont tell me you are using Joomla >.<
I said some pages back that the AdminCP design resembled Joomla's >.< But really, it's just the quick menu which does.
And if I was using Joomla how would this be my CMS?..

Edit: Cleaning up code now and fixing the template parser a bit
 
Last edited:
I've now fixed a fragment cache. Meaning that you can cache parts of the page only. I've also added so you can insert php code into the cached page so it becomes partial dynamic.
 
Wrote a little BBCode parser:
14c8wv5.png


The thing at the bottom is a quote
 
yeah he rox :p

Added some more bbcode.
Current available bbcode:

Code:
[noparse]
[B]
[I]
[U]
[S]
[COLOR]
[SIZE]
[URL]
[IMG]
[LEFT]
[RIGHT]
[youtube]
[gvideo]
[PHP]
[QUOTE]
[CODE]
[/noparse]
 
I am now fixing the ability to use different hashes and also so it automatically adds an unique salt to each hash.
 
I'm now fixing up the default installation setup. I will then create a demo page for testing and then I think I'll have a beta release.
 
I downloaded a layout I love and I'm now using that as the default in ZCMS.

Default page:
2wqqxit.png
 
I've now rewritten the controller class and some other things and now I'm working a bit on a hook system.
 
Pretty done with the hook system now.

Examples to use a hook:

Method call
PHP:
hook::register('output', array(
	'class' => 'foo',
	'function' => 'bar',
	'file' => '/foo.php', // If the class & function do not exist it will include this file
	'params' => array('a','b','c')
	)
);

Function call
PHP:
hook::register('output', array(
	'function' => 'foobar',
	'file' => '/foo.php', // If the class & function do not exist it will include this file
	'params' => array('a','b','c')
	)
);


Inject script
PHP:
hook::register('output', array(
	'file' => '/foo.php'
	)
);

The hook spot
PHP:
if(hook::registered('output'))
{
    hook::apply('output');
}
else
{
    echo 'normal execution';
}
 
Back
Top