<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vincent Reniers &#187; Nexus</title>
	<atom:link href="http://blog.vincentr.be/tag/nexus/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.vincentr.be</link>
	<description>From PHP Guru to Designer!</description>
	<lastBuildDate>Fri, 02 Jul 2010 17:59:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Internationalization in PHP</title>
		<link>http://blog.vincentr.be/2009/09/23/internationalization-in-php/</link>
		<comments>http://blog.vincentr.be/2009/09/23/internationalization-in-php/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 18:16:09 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Internationalization]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://vincentr.be/?p=242</guid>
		<description><![CDATA[Why have such a function?
While working at my CMS I was thinking on what would be the best way to manage the various languages and still make it easy to write the apps. After some thinking and taking the advice of a collegue into consideration I came to the conclusion that it would be best [...]]]></description>
			<content:encoded><![CDATA[<h3>Why have such a function?</h3>
<p>While working at my CMS I was thinking on what would be the best way to manage the various languages and still make it easy to write the apps. After some thinking and taking the advice of a collegue into consideration I came to the conclusion that it would be best to let all strings go through a function. The<strong> internationalization function __(&#8221;);</strong> why this function? Because it&#8217;s pretty much becoming a standard in other CMS. And I don&#8217;t want to make it hard for other devs if they need to understand my script.</p>
<h3>Now what exactly will this function do?</h3>
<p>First of all we want the string that we enter via this function to be translated into other languages. Now so we first need to know some information and ask yourself a few questions before programming. Like what languages has the user set? Are these languages active? Where do we find the translation? What if the translation is incorrect, how can the user change them?</p>
<p>So we could just make the translations hardcoded, but that wouldn&#8217;t be quite usable for a normal administrator to change these translations. Thats why we will also put them into the a DB Table. And of course this table will just be a reference for the backend since we do not want to go fetch a translation from the database all the time. Thats why you should store it in a file, this way it will be a lot faster. Ok yes you can cache it, but still if the cache is turned off retrieving them from files is a lot faster than running multiple queries. Now how to save them in files could be done in various ways. They could be stored in an .ini or .txt file and a line can be added each time there is a new translation. But storing them in a .php file would be a lot faster since the .ini, .txt files would have to be parsed each time. While when you would put the translations in an array the data is instantly available for use.</p>
<p>Now if there is a better way to store them in a PHP file then please let me know. But we&#8217;re just going to with this method. What the array could look like is this:</p>
<pre class="brush: php;">
array(
'english' =&gt; array(
'hello' =&gt; 'hello',
'how are you?' =&gt; 'how are you?',
),
'french' =&gt; array(
'hello' =&gt; 'bonjour',
'how are you?' =&gt; 'comment ça va?',
),
);</pre>
<p>Now when adding a new translation to the PHP file via fwrite it would be hard to put it on X amount of locations ( X = languages ) and than write it back again. Now that would be possible but it&#8217;s probably going to coss more load. Now a better (but temporary) way to do it I think could be by simply adding $lang[$language][$text] = $ translation; at the bottom. And then you could create a cronjob that will sort out these language files properly at the end of every day or make a script in the admin area for an administrator to do it. Now adding them directly to the array by finding the correct location could also work well.</p>
<p>Now how would you let the function create the translations for the other languages than the one you wrote it in? One way would be just duplicate the text and wait for an admin to change the values with the correct translations in the DB Table and then let it go to the file again. But a smart way would be to let it go through a Translator API and the generated translation would be ok 90% of the time.</p>
<h3>What if the function already found a translation?</h3>
<p>In this case you can just select the array of the language you&#8217;re currently working and than see if the string has been translated and go fetch it. Otherwise the function would have to do the steps described above.<br />
Anyways, these were my thoughts on how to create a good internationalization function. Now there could definitely be some easier ways to create it, and if you found one please let me know! I hope you learnt a bit on how to create it and I&#8217;m going to try and put this idea into code very soon =).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.vincentr.be/2009/09/23/internationalization-in-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nexus v 0.5</title>
		<link>http://blog.vincentr.be/2009/08/10/nexus-v-0-5/</link>
		<comments>http://blog.vincentr.be/2009/08/10/nexus-v-0-5/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 16:22:46 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Changelog]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://vincentr.be/?p=221</guid>
		<description><![CDATA[Since my last post about the Nexus CMS on July 17th there have been made soo many changes to the system that I thought it would be better to move on 0.3 more versions  .  First of all. The Main System, RSS system, Ajax Handler and Admin backend are fully operating!
Changelog:
- Added backend admin [...]]]></description>
			<content:encoded><![CDATA[<p>Since my last post about the Nexus CMS on July 17th there have been made soo many changes to the system that I thought it would be better to move on 0.3 more versions <img src='http://blog.vincentr.be/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .  First of all. The Main System, RSS system, Ajax Handler and Admin backend are fully operating!</p>
<p><strong>Changelog:</strong></p>
<p>- Added backend admin system<br />
- Added authorization (better roles etc.)<br />
- Added admin core modules (+ override feature)<br />
- Fixxed error handler with buffers activated (all systems: rss, ajax, main and backend)<br />
- Added several core modules ( dashboard, settings, &#8230;)<br />
- Base Paths for includes, requires, templates etc. (much more stable when moving the application)<br />
- Created seperation in templates ( private =&gt; backend, public =&gt; frontend)<br />
- Mod Rewrite feature implented</p>
<p>The admin core modules come standard in the Nexus CMS. But they can be overriden by user modules. They are pretty much the same as site modules but they do not have XML files, rss or ajax request handler which is pretty obvious why =). Also they live in a restricted area, unauthorized users have no access to anything related to the core. When the override feature is activated for a certain module the system will skip scanning for an admin core module but will instantly check if the site module has a control.php file to manage the administration from the site modules. The admin HTML documents are located between the frontend HTML. This override will allow a programmer to keep pretty much every operation of his site in the frontend modules. But if they like they can also create a seperate core module.</p>
<p>You can activate apache&#8217;s mod_rewrite from the admin backend (in a core module).  The mod rewrite isn&#8217;t actually deactivated so you can still manually type the URL&#8217;s more decently when it is turned off. The rewritten URL&#8217;s look like this: ?com=News  =&gt;<strong> /main/News/</strong> or  ?com=Portfolio&amp;offset=3  =&gt; <strong>/main/Portfolio/offset/3/ </strong>. The last rewrite with the variables still has to be implented, but the basic one is already working. You on&#8217;t have to define this when you write it in your template, I thought it would be a lot easier not to use some kind of syntax like {LINK=&#8221;?com=News&#8221; , &#8220;/main/News/&#8221;} . This syntax was never implented, instead I just created a function in the Template class that runs at the very end before we display. It rewrites all the <strong>?com=</strong> links to the correct rewritten links if mod rewrite is turned on.</p>
<p><strong>To do list:</strong></p>
<p>- Implement caching system<br />
- Change language constants and use an internationalisation function instead.<br />
=&gt; These language strings will be stored in the database. The default is hardcoded and in English.<br />
- Add more backend modules</p>
<p>So thats pretty much my latest changes at the Nexus CMS so far <img src='http://blog.vincentr.be/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . It has been smoothened up a lot, and runs a lot more stable.<br />
So far it&#8217;s looking very good and I might release an Alpha version soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.vincentr.be/2009/08/10/nexus-v-0-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nexus: TPL Update</title>
		<link>http://blog.vincentr.be/2009/06/30/nexus-tpl-update/</link>
		<comments>http://blog.vincentr.be/2009/06/30/nexus-tpl-update/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 23:07:27 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Template]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://vincentr.be/?p=203</guid>
		<description><![CDATA[Made some updates to my Nexus CMS  . I completely tested the template class with modules etc. Applied most of my templates I made to the system and it seems to work very well. From HTML layout to Nexus Template only toke me about 5 minutes to convert. But I might make some things [...]]]></description>
			<content:encoded><![CDATA[<p>Made some updates to my Nexus CMS <img src='http://blog.vincentr.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I completely tested the template class with modules etc. Applied most of my templates I made to the system and it seems to work very well. From HTML layout to Nexus Template only toke me about 5 minutes to convert. But I might make some things a bit more complex and dynamic by integrating widgets etc. Also one little aspect of the programming side of the modules to the html module needs a bit more pimping. But I&#8217;m sure it will look very nice. Just by the way it adapts the modules in any other layout and still maintains all of its functions will make this CMS very easy to use for new websites. Not to mention how easy it is to create your own modules and pages with debugging that points you exactly to the error.</p>
<p>Teasers might come soon so stay subscribed! <img src='http://blog.vincentr.be/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.vincentr.be/2009/06/30/nexus-tpl-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nexus version 0.2</title>
		<link>http://blog.vincentr.be/2009/06/17/nexus-version-2/</link>
		<comments>http://blog.vincentr.be/2009/06/17/nexus-version-2/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 13:28:43 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Nexus]]></category>

		<guid isPermaLink="false">http://vincentr.be/?p=171</guid>
		<description><![CDATA[I&#8217;ve started working on my cms again lately and many improvements have been made to the platform. The basic structure has now been set. One of the improvements made was the addition of an integrated error system which handles every PHP error that occurs inside the system (even non-PHP errors in e.g. DB class) and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started working on my cms again lately and many improvements have been made to the platform. The basic structure has now been set. One of the improvements made was the addition of an <strong>integrated error system </strong>which handles every PHP error that occurs inside the system (even non-PHP errors in e.g. DB class) and passes it onto an <strong>error handler</strong> which writes it safely to an error log just in case the Database has dropped out. Still might need to add a <strong>rollback</strong> feature to that and then it works like a charm. Also the <strong>modules </strong>work correctly now which is quiet a unique aspect. It works as follow: Modules are divided into two main groups, <strong>Passive </strong>and <strong>Active </strong>ones. The passive modules run in the background and won&#8217;t be displayed to the average user.</p>
<p>Passive modules are also again divided into critical and unnecessary ones. <strong>Passive modules</strong> that are critical for the system will terminate the program when they aren&#8217;t executed properly or when they just simply don&#8217;t exist but are listed. When the other type of passive module isn&#8217;t found the program will just simply continue because it forms no risk. However in both cases an administrator will be alerted.</p>
<p>The <strong>active </strong>modules are modules that do have <strong>displays</strong>, they often manage news, forums, users, etc. When these modules aren&#8217;t found the user will simply be redirected to the default one. There can only be one active module at a time but several passive. They can be turned on and off in the admin area. I don&#8217;t know if there is any system like this out there yet or if this is the best way to do it. But this is just how I do it. And I prefer beeing unique and creative than just simply copying off other people their code. Anyhow, now the coding of the modules can begin and this also means the actual content of the system!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.vincentr.be/2009/06/17/nexus-version-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nexus CMS</title>
		<link>http://blog.vincentr.be/2009/04/14/nexus-cms/</link>
		<comments>http://blog.vincentr.be/2009/04/14/nexus-cms/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 10:17:31 +0000</pubDate>
		<dc:creator>Vincent</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Nexus CMS]]></category>

		<guid isPermaLink="false">http://vincentr.be/?p=83</guid>
		<description><![CDATA[Hello lads, it´s been a while since my last post but of course I have a good reason to explain my absence ^^. Right now im writing this post in Tenerife ( Canarian Islands ).  And i´ve been working at my new CMS.
So far i´ve got the basic structure finished it has some nice features. I didn´t [...]]]></description>
			<content:encoded><![CDATA[<p>Hello lads, it´s been a while since my last post but of course I have a good reason to explain my absence ^^. Right now im writing this post in Tenerife ( Canarian Islands ).  And i´ve been working at my new CMS.</p>
<p>So far i´ve got the basic structure finished it has some nice features. I didn´t really base myself on some other system but I did try to create a template system. It works like this :</p>
<p>First action i define a <strong>Constant &#8220;In_Site&#8221;</strong>,  all my scripts are written in an IF statement to see if it is defined otherwise it wont run. Its to prevent messy errors when u go to the script directly. What happends next is I load in the <strong>config and functions wich are static</strong> and no operation occurs. Next we establish the <strong>database connection</strong> with the help of my DB class. Im still working on it tough and trying to figure out if there is a way to rollback DB events when an error occurs. I know this is possible with MySQLite so now I have to do some digging in the MySQL documentation because thats the DB im using. If the rollback function exists im going to let occur within <strong>custom error handling</strong>. The try and catch statement. After the DB class comes the settings wich require the DB connection to fetch the settings. And then we get to the templating part.</p>
<p>The template part loads in the default template if it exists and it then processs the variables it finds inside the tpl. Such as {SITETITLE}. Then the module gets processed for example ´News´ and while this happends u can still make changes to the template and at the end the entire part gets printed.</p>
<p>Or well that´s at least what I will be trying to achieve. Right now I have got the a part of the <strong>Template and Database class</strong> finished. Ill be figuring out the module part and how it loads into the template part out later.</p>
<p>But so far it already looks nice, I even made a custom layout for the CMS.<br />
Ill upload some screenies soon ^^.</p>
<p>Greets,<br />
Vincent</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.vincentr.be/2009/04/14/nexus-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
