<?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>Dazzle Software &#187; PHP</title>
	<atom:link href="http://blog.dazzlecms.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dazzlecms.com</link>
	<description>The net&#039;s largest script collection and resource web portal</description>
	<lastBuildDate>Sat, 26 Nov 2011 12:13:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Ultimate Backlink Software</title>
		<link>http://blog.dazzlecms.com/seo/ultimate-backlink-software/</link>
		<comments>http://blog.dazzlecms.com/seo/ultimate-backlink-software/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 01:02:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=58</guid>
		<description><![CDATA[Our team been busy on new backlink software called Ultimate Backlink our aims is to help rank your site by using social media and community&#8217;s as well as blogs and directory&#8217;s and so much more. What this system does&#8230; our system is an automated backlinking software, first it creates email address with gmail or other [...]]]></description>
			<content:encoded><![CDATA[<p>Our team been busy on new backlink software called Ultimate Backlink our aims is to help rank your site by using social media and community&#8217;s as well as blogs and directory&#8217;s and so much more.</p>
<p>What this system does&#8230;<br />
our system is an automated backlinking software, first it creates email address with gmail or other providers, automatically creates the email address, verifies the account.</p>
<p>our system uses major search engines like google, bing, yahoo etc to find results from forums, directory&#8217;s, blogs, video sites and so much more.</p>
<p>and will automatically sign-up for the forum, edit the user profile and show your url as the signature with custom links.</p>
<p>everything in the system is plug-in based so if you wish too add support for another directory, blog, forum etc you can just drop an plug-in into the system and will load automatically on next launch.</p>
<p>after searching for sites you wish to sign-up, sites page ranks, keywords are also taken into effect so you have more of an chance to have your site page rank improved</p>
<p>as this software still in development but we are seeking for anyone interested in using this software as we have nearly completed our automated forum sign-up &#038; profile system.</p>
<p>watch our blog as we are still working on this product, if you wish to be added too the beta group either send us an message at <a href="http://www.dazzlemods.com">www.dazzlemods.com</a> or email us at dazzle.cms@gmail.com</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/seo/ultimate-backlink-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dazzle CMS Registry System Completed</title>
		<link>http://blog.dazzlecms.com/programming/dazzle-cms/dazzle-cms-registry-system-completed/</link>
		<comments>http://blog.dazzlecms.com/programming/dazzle-cms/dazzle-cms-registry-system-completed/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 01:03:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dazzle CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-Nuke]]></category>
		<category><![CDATA[PHPBB]]></category>
		<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=36</guid>
		<description><![CDATA[Hello everyone, Dazzle cms team here and thought i post some updates as were near the completion of our framework stage, alot of major changes are in progress mostly everything we are creating right now is seperate from dazzle cms but we manage to come up with an registry system not only that php files, [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone,</p>
<p>Dazzle cms team here and thought i post some updates as were near the completion of our framework stage, alot of major changes are in progress mostly everything we are creating right now is seperate from dazzle cms</p>
<p>but we manage to come up with an registry system not only that php files, json, xml, ini even serialize functions has built in plugin baseed framework</p>
<p>atm we currently working on extending the framework with an ftp based framework, files and folders, chmod, chown using ftp, sftp or ssh2</p>
<p>so what does this all mean, you can store all settings in files, not only keeps less stored in the database but also makes everything perform faster and php will be able to handle more instances per database connection.</p>
<p>from using this framework from editing config files, to json encoding , xml, ini or even re-encode serialization strings. as soon as all our test cases are complete and functions on this next class  we begin implementing this into our Registry system and we will begin the first change over in the cms</p>
<p>try keep an eye on this blog as we update this regularly</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/dazzle-cms/dazzle-cms-registry-system-completed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dazzle CMS Updates</title>
		<link>http://blog.dazzlecms.com/programming/php-nuke/dazzle-cms-updates/</link>
		<comments>http://blog.dazzlecms.com/programming/php-nuke/dazzle-cms-updates/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 06:46:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-Nuke]]></category>
		<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=34</guid>
		<description><![CDATA[As we are near to the completion of our latest change over well lets first explain whats changed some of you may know this and others may not know this that recently we started implementing an file system so what does this mean to you that means your arrays that you load settings from your [...]]]></description>
			<content:encoded><![CDATA[<p>As we are near to the completion of our latest change over well lets first explain whats changed some of you may know this and others may not know this that recently we started implementing an file system so what does this mean to you</p>
<p>that means your arrays that you load settings from your json encoded strings, your ini, xml and even php classes can be read in our filesystem</p>
<p>we have completed the filesystem and we are just testing everything is working as we all know things may of worked when we started this framework but could stop working so we are puttign together some test cases but these are not just there for us to be able to test all the features without the cms</p>
<p>but also show you in simple terms how to use our framework when you start developing modules.</p>
<p>we did release 2 betas last year and i was unhappy with some of the system core for many reasons i did have alot of hardcoded functions until i had x feature i was looking for now i have some of the basic features working my main goal is to get everything that really should be in classes as i really dont like cloning the same function over and over or the system looking like phpnuke in its code so we are going to start code cleanup this will not be an long process at all as we will be building about 5 new frameworks over the next 2 weeks which we hope to be completed and we can ship public betas as i will feel after i changed this that nothing big or major going to change in the files or the database.</p>
<p>as this has been an long process to where i have everything now once the new framework is ready our job will be to rewrite all of the admin modules as alot of these were just backported from phpnuke as the system was inspired by phpnuke, i wanted to keep that feel about the system from an admin point of view so each of these modules will be rewritten complely using out classes for example , using our template engine, any design will go though our template engine, to there will be complete control of every aspect of the system.</p>
<p>even we don&#8217;t officially have any modules with the cms as soon as we have our few basic modules news, forums, downloads these were developed in the early beta but no longer work with our current beta so we will have to rewrite alot of these to make them work again and we need to implement some of our web2 features from ajax powered forms .</p>
<p>our goal is to have an cms that&#8217;s easy to use , thats built apon php5 easy to anyone to create modules and add new features with very little coding</p>
<p>we even do have plans for an module thats creates features for you with no coding just using our form classes position the forms, textareas we do plan to have the cms released and in the final versions by this summer and plan to enter the cms for google summer of code for 2010</p>
<p>we keep you updated on our progress so you can see whats going on at the dazzle cms development keep an eye on our blog as we will try update this more regularly</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/php-nuke/dazzle-cms-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Input Filter</title>
		<link>http://blog.dazzlecms.com/programming/php/php-input-filter/</link>
		<comments>http://blog.dazzlecms.com/programming/php/php-input-filter/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 03:34:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=32</guid>
		<description><![CDATA[We just released our version based on http://www.phpclasses.org/browse/package/2189.html almost an complete rewrite plus more filters for different types of data here an example of how to use our version //creates the object $filter =&#38; input::get_instance(); // some xss string $description = &#8216;&#60;A HREF=&#8221;http://www.gohttp://www.google.com/ogle.com/&#8221;&#62;XSS&#60;/A&#62;&#8217;; // strips the tags or converts them to plain text $description = [...]]]></description>
			<content:encoded><![CDATA[<p>We just released our version based on http://www.phpclasses.org/browse/package/2189.html</p>
<p>almost an complete rewrite plus more filters for different types of data</p>
<p>here an example of how to use our version</p>
<p>//creates the object</p>
<p>$filter =&amp; input::get_instance();</p>
<p>// some xss string</p>
<p>$description = &#8216;&lt;A HREF=&#8221;http://www.gohttp://www.google.com/ogle.com/&#8221;&gt;XSS&lt;/A&gt;&#8217;;</p>
<p>// strips the tags or converts them to plain text</p>
<p>$description = $filter-&gt;clean($description, &#8216;string&#8217;);</p>
<p>please note there is no docs for these scripts as they have been designed for dazzle cms but can work in your projects too.</p>
<p>docs will come later when we give our scripts there own home as this is just our development blog.</p>
<p>all we ask is you give us credit and link us too www.dazzlecms.com</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/php/php-input-filter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.2.12 Release Announcement</title>
		<link>http://blog.dazzlecms.com/programming/php/php-5-2-12-release-announcement/</link>
		<comments>http://blog.dazzlecms.com/programming/php/php-5-2-12-release-announcement/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 04:23:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=23</guid>
		<description><![CDATA[PHP 5.2.12 Release Announcement The PHP development team would like to announce the immediate availability of PHP 5.2.12. This release focuses on improving the stability of the PHP 5.2.x branch with over 60 bug fixes, some of which are security related. All users of PHP 5.2 are encouraged to upgrade to this release. Security Enhancements [...]]]></description>
			<content:encoded><![CDATA[<h1>PHP 5.2.12 Release Announcement</h1>
<p>The PHP development team would like to announce the immediate availability of PHP 5.2.12. This release focuses on improving the stability of the PHP 5.2.x branch with over 60 bug fixes, some of which are security related.  All users of PHP 5.2 are encouraged to upgrade to this release.</p>
<p><strong>Security Enhancements and Fixes in PHP 5.2.12:</strong></p>
<ul>
<li>Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak. (CVE-2009-3557, Rasmus)</li>
<li>Fixed a open_basedir bypass in posix_mkfifo() identified by Grzegorz Stachowiak. (CVE-2009-3558, Rasmus)</li>
<li>Added &#8220;max_file_uploads&#8221; INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion, identified by Bogdan Calin. (CVE-2009-4017, Ilia)</li>
<li>Added protection for $_SESSION from interrupt corruption and improved &#8220;session.save_path&#8221; check, identified by Stefan Esser. (CVE-2009-4143, Stas)</li>
<li>Fixed bug #49785 (insufficient input string validation of htmlspecialchars()). (CVE-2009-4142, Moriyoshi, hello at iwamot dot com)</li>
</ul>
<p><strong>Key enhancements in PHP 5.2.12 include:</strong></p>
<ul>
<li>Fixed unnecessary invocation of setitimer when timeouts have been disabled. (Arvind Srinivasan)</li>
<li>Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre)</li>
<li>Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery() when calling using Reflection. (Felipe)</li>
<li>Fixed crash when instantiating PDORow and PDOStatement through Reflection. (Felipe)</li>
<li>Fixed memory leak in openssl_pkcs12_export_to_file(). (Felipe)</li>
<li>Fixed bug #50207 (segmentation fault when concatenating very large strings on 64bit linux). (Ilia)</li>
<li>Fixed bug #50162 (Memory leak when fetching timestamp column from Oracle database). (Felipe)</li>
<li>Fixed bug #50006 (Segfault caused by uksort()). (Felipe)</li>
<li>Fixed bug #50005 (Throwing through Reflection modified Exception object makes segmentation fault). (Felipe)</li>
<li>Fixed bug #49174 (crash when extending PDOStatement and trying to set queryString property). (Felipe)</li>
<li>Fixed bug #49098 (mysqli segfault on error). (Rasmus)</li>
<li>Over 50 other bug fixes.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/php/php-5-2-12-release-announcement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.3.1 Released!</title>
		<link>http://blog.dazzlecms.com/programming/php-nuke/php-5-3-1-released/</link>
		<comments>http://blog.dazzlecms.com/programming/php-nuke/php-5-3-1-released/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 23:29:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-Nuke]]></category>
		<category><![CDATA[PHPBB]]></category>
		<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=20</guid>
		<description><![CDATA[The PHP development team is proud to announce the immediate release of PHP 5.3.1. This is a maintenance release in the 5.3 series, which includes a large number of bug fixes. Security Enhancements and Fixes in PHP 5.3.1: Added &#8220;max_file_uploads&#8221; INI directive, which can be set to limit the number of file uploads per-request to [...]]]></description>
			<content:encoded><![CDATA[<p>The PHP development team is proud to announce the immediate release of PHP 5.3.1. This is a maintenance release in the 5.3 series, which includes a large number of bug fixes.</p>
<p><strong>Security Enhancements and Fixes in PHP 5.3.1:</strong></p>
<ul>
<li>Added &#8220;max_file_uploads&#8221; INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion.</li>
<li>Added missing sanity checks around exif processing.</li>
<li>Fixed a safe_mode bypass in tempnam().</li>
<li>Fixed a open_basedir bypass in posix_mkfifo().</li>
<li>Fixed bug #50063 (safe_mode_include_dir fails).</li>
<li>Fixed bug #44683 (popen crashes when an invalid mode is passed).</li>
</ul>
<p><strong>Key Bug Fixes in PHP 5.3.1 include:</strong></p>
<ul>
<li>Fixed crash in com_print_typeinfo when an invalid typelib is given.</li>
<li>Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery() when calling using Reflection.</li>
<li>Fixed crash when instantiating PDORow and PDOStatement through Reflection.</li>
<li>Fixed bug #49910 (no support for ././@LongLink for long filenames in phar   tar support).</li>
<li>Fixed bug #49908 (throwing exception in __autoload crashes when interface is not defined).</li>
<li>Around 100 other bug fixes</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/php-nuke/php-5-3-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>smarty 3</title>
		<link>http://blog.dazzlecms.com/programming/dazzle-cms/smarty3/</link>
		<comments>http://blog.dazzlecms.com/programming/dazzle-cms/smarty3/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 21:14:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dazzle CMS]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[smarty]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=14</guid>
		<description><![CDATA[Intended Audience This article is intended for PHP programmers and HTML designers interested in applying a new technique for web development – PHP templating. Advanced knowledge of PHP programming and HTML is assumed. Smarty3 Overview The theoretical web development process is that: first the designer makes the interface, and breaks it down into HTML pieces [...]]]></description>
			<content:encoded><![CDATA[<p>Intended Audience</p>
<p>This article is intended for PHP programmers and HTML designers interested in applying a new technique for web development – PHP templating. Advanced knowledge of PHP programming and HTML is assumed.</p>
<p>Smarty3 Overview</p>
<p>The theoretical web development process is that: first the designer makes the interface, and breaks it down into HTML pieces for the programmer then the programmer implements the PHP business logic into the HTML.</p>
<p>That’s fine in theory, but in practice, from my experience, the client frequently comes with more requirements, or maybe more modifications to the design or to the business logic. When this happens , the HTML is modified (or words rebuilt ) programmer changes the code inside HTML.</p>
<p>The problem with this scenario is that the programmer needs to be on stand-by until the designer completes the layout and the HTML files. Another problem is that if there is a major design change then the programmer will change the code to fit in the new page. And that’s why I recommand Smarty. Smarty is a templating engine for PHP.</p>
<p>You can download it from http://www.smarty.net or svn checkout http://smarty-php.googlecode.com/svn/branches/Smarty3Alpha/</p>
<p>The installation process is very simple. Just read the documentation and follow up the instructions.</p>
<p>So what is Smarty ? Smarty is a set of PHP classes that compile the templates into PHP scripts. Smarty is a template engine and a very useful tool for designers and programmers.<br />
Smarty for Designers</p>
<p>Designers work with HTML files. To work with Smarty, you work with template files. These files are are made up of static content but combined with Smarty mark-up tags. All the template files have a .html or .tpl extension. The Smarty template tags are enclosed within { and } delimiters or custom delimiters which can be defined or bypassed in the class.</p>
<p>Let’s consider the basic structure of a web page. There is a header, a middle part, and a footer. A template file that includes the header and the footer looks like this:</p>
<blockquote><p>{include file=&#8221;header.tpl&#8221;}<br />
&lt;form name=&#8221;form1&#8243;&gt;<br />
Label1 &lt;input type=&#8221;text&#8221; name=&#8221;text1&#8243;&gt;<br />
&lt;input type=&#8221;submit&#8221; value=&#8221;submit&#8221;&gt;<br />
&lt;/form&gt;<br />
{include file=&#8221;footer.tpl&#8221;}</p></blockquote>
<p>All the templates should reside in a single template directory. After calling a template for the first time, the compiled template will reside in templates_c.</p>
<p>Smarty language is very poweful. All the variables that come from PHP are identified in Smarty with {$Variable_Name} (we precede them with a $ sign). So if we have a variable in PHP that is called $MyName, then to print it in Smarty you have to write something like:</p>
<blockquote><p>&lt;html&gt;<br />
&lt;body&gt;<br />
Welcome, {$MyName} &lt;br&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>The power of Smarty lies also in its flexibility. You can insert IFs and LOOPs into the template. The syntax for IF is:</p>
<blockquote><p>{if &lt;condition&gt; }<br />
html code<br />
{else}<br />
html code<br />
{/if}</p></blockquote>
<p>Let’s say you have a dynamic menu based on links. Depending on the link you click, you go to a specific page. So you get from PHP a variable $Menu with a integer value, depending on the page you are. The template looks like :</p>
<blockquote><p>{if ($Menu == 1) }<br />
Option 1<br />
{else}<br />
&lt;a href=&#8221;option1.php&#8221;&gt;Option 1&lt;/a&gt;<br />
{/if}<br />
{if ($Menu == 2)}<br />
Option 2<br />
{else}<br />
&lt;a href=&#8221;option2.php&#8221;&gt;Option 2&lt;/a&gt;<br />
{/if}</p></blockquote>
<p>For coding a loop let’s suppose you get an array like the following from PHP :</p>
<blockquote><p>&lt;table&gt;<br />
&lt;tr<br />
{section name=user loop=$userID}<br />
{if $smarty.section.user.iteration is odd}<br />
bgcolor=#efefef<br />
{else}<br />
bgcolor=#ffffff<br />
{/if}<br />
&gt;<br />
&lt;td&gt; ID = {$userID[user]}  &lt;/td&gt;<br />
&lt;td&gt; Name = {$name[user]}     &lt;/td&gt;<br />
&lt;td&gt; Address = {$address[user]} &lt;/td&gt;<br />
&lt;/tr&gt;<br />
{sectionelse}<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
There is no user.<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/section&gt;<br />
&lt;/table&gt;</p></blockquote>
<p>Iteration is an internal counter for Smarty. It helps us to know the current iteration of the section. I use this internal variable to make alternate row colors in the table by checking if current iteration value is odd or not.</p>
<p>An alternative for LOOPS is FOREACH which is used to loop over a single associative array.</p>
<blockquote><p>&lt;foreach from=$users item=current_user&gt;<br />
Name = {$current_user}<br />
&lt;foreachelse}<br />
No user available.<br />
&lt;/foreach&gt;</p></blockquote>
<p>The main difference between SECTION and FOREACH is that for SECTION you can start from a specific value, and can also set a step for the iteration, whereas for FOREACH you have to loop over all values.<br />
Smarty for Programmers</p>
<p>The advantage for programmers is that they write the code in a PHP file without having to mix the instructions with HTML. Furthermore, if the designer changes the layout of a page the programmer doesn’t have to change the code to suit the new layout since the functionalities won’t change. You do your work in your files, assign to the templates all the values needed to print on the site and go out for a beer. You won’t get phone calls asking you to change a bit of code because the designer changed the layout and now a set of internal errors cropped up.</p>
<p>In the PHP file you need to include the Smarty class require ‘Smarty.class.php&#8217;. After that you need to instantiate the smarty with $smarty = new Smarty.</p>
<p>To assign a variable to the template you need to $smarty-&gt;assign(&#8216;UserName&#8217;, ‘John Doe’). After everything is finished you call the method to display the template $smarty-&gt;display(&#8216;index.tpl&#8217;).</p>
<p>A sample code looks like this (index.php) :</p>
<blockquote><p>&lt;?php<br />
require &#8216;Smarty.class.php&#8217;;<br />
$smarty = new Smarty;</p>
<p>$smarty-&gt;assign(&#8216;Username&#8217;, &#8216;John Doe&#8217;);<br />
$smarty-&gt;display(&#8216;index.tpl&#8217;);<br />
?&gt;</p></blockquote>
<p>The template (index.tpl) looks like this:</p>
<blockquote><p>&lt;html&gt;<br />
&lt;body&gt;<br />
Welcome {$Username}<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>You can also create an array in PHP an pass it to the template:</p>
<blockquote><p>$tmp = array ( &#8216;UID&#8217;=&gt; &#8217;10&#8242;,  &amp;&#8217;Name&#8217; =&gt; &#8216;John Doe&#8217;, &#8216;Address&#8217;=&gt;&#8217;Home address&#8217;);<br />
$smarty-&gt;assign(&#8216;info&#8217;, $tmp);</p></blockquote>
<p>Sample Script</p>
<p>This script connects to a local database and select all the products from the ‘Products’ table. Then it passes all the values to the template, which prints them on the screen.</p>
<p>INDEX.PHP</p>
<blockquote><p>&lt;?php<br />
require &#8216;Smarty.class.php&#8217;;<br />
$smarty = new Smarty;</p>
<p>$hostname = &#8220;localhost&#8221;;<br />
$dbUser = &#8220;sqluser&#8221;;<br />
$dbPass = &#8220;sqlpass&#8221;;<br />
$dbName = &#8220;sqldb&#8221;;<br />
// connect to the database<br />
$conn = mysql_connect($hostname, $dbUser, $dbPass) or die(&#8220;Cannot connect to the database&#8221;);</p>
<p>mysql_select_db($dbName);</p>
<p>$sql = &#8220;SELECT product_id, info FROM products ORDER BY product_id ASC&#8221;;<br />
// get all the products from the table<br />
$res = mysql_query($sql);<br />
$results = array();<br />
$i=0;<br />
while ($row=mysql_fetch_array($res)) {<br />
$tmp = array(<br />
&#8216;product_id&#8217; =&gt; $r['product_id'],<br />
&#8216;info&#8217;=&gt; $r['info']<br />
);<br />
$results[$i++] = $tmp;<br />
}<br />
// pass the results to the template<br />
$smarty-&gt;assign(&#8216;results&#8217;, $results);<br />
// load the template<br />
$smarty-&gt;display(&#8216;index.tpl&#8217;);<br />
?&gt;</p></blockquote>
<p>INDEX.TPL</p>
<blockquote><p>&lt;html&gt;<br />
&lt;body&gt;<br />
Here&#8217;s a table with the results: &lt;br&gt;<br />
&lt;table cellpadding=1 cellspacing=0 border=0 width=100%&gt;<br />
{section name=nr loop=$results}<br />
&lt;tr {if $smarty.section.nr.iteration is odd} bgcolor=&#8221;#efefef&#8221;{/if}&gt;<br />
&lt;td width=15%&gt;<br />
&lt;nobr&gt;&lt;a href=&amp;#8221;show-product.php?id={$results[nr].product_id}&#8221;&gt;Press here&lt;/a&gt;</p>
<p>&lt;td width=29%&gt;&lt;a href=&#8221;show.php?id={$results[nr].prodID}&#8221;<br />
{popup inarray=$smarty.section.nr.iteration}<br />
&gt;{$results[nr].info}&lt;/a&gt;&lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p>{sectionelse}<br />
&lt;tr&gt;&lt;td align=&#8221;center&#8221;&gt;&lt;br&gt;&lt;b&gt;no product &lt;/b&gt; &lt;br&gt; &lt;/td&gt;&lt;/tr&gt;<br />
{/section}</p>
<p>&lt;/table&gt;</p>
<p>&lt;br&gt;</p></blockquote>
<blockquote><p>Here&#8217;s a select with the results: &lt;br&gt;<br />
&lt;select name=&#8221;mys&#8221;&gt;<br />
{section name=nr loop=$results}<br />
&lt;option value=&#8221;{$results[nr].product_id}&#8221;&gt;{$results[nr].info}&lt;/option&gt;<br />
{/section}<br />
&lt;/select&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;<br />
Summary</p></blockquote>
<p>Smarty is a great tool for both designers and developers. By using Smarty you can reduce the site development and maintenance times. If you are a developer you no longer need to mix PHP code with HTML code. Just take care of business logic and leave the HTML to the designer.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/dazzle-cms/smarty3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn + apache2</title>
		<link>http://blog.dazzlecms.com/servers/apache/svn-apache2/</link>
		<comments>http://blog.dazzlecms.com/servers/apache/svn-apache2/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 00:20:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Berkeley]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[Neon]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=12</guid>
		<description><![CDATA[Many of my developers work from windows including myself. Creating secure access over ssh and svn (svn+ssh://) using Zend studio and svn (subversion plugin for zend) was the initial idea, from a quick pass over subversion, but once svnserver was up and running and I tried it, this wasn’t as simple. There are several articles [...]]]></description>
			<content:encoded><![CDATA[<p>Many of my developers work from windows including myself. Creating secure access over ssh and svn (svn+ssh://)<br />
using Zend studio and svn (subversion plugin for zend) was the initial idea, from a quick pass over subversion, but once svnserver was up and running and I tried it, this wasn’t as simple. There are several articles on integrating subversion, ssh and windows. None of the solutions looked simple or elegant. And wide open unsecured traffic was not acceptable.</p>
<p>I determined best practice pointed us to subversion access through web_dav_svn -&gt; web_dav -&gt; apache2 (https://). This brought authentication away from centralized auth and allowed fine grained control over the access granted via htpasswd and .htaccess files. It allowed us to restrict unsecured access and redirect http to https, and encrypt using SSL. It kept us from having to work ssh onto windows for each developer, instead we could have a simple eclipse/subclipse plugin access demonstrated and from that point they were able to customize on their own.</p>
<p>What I wanted was:</p>
<p>* untar subversion-1.6.6 and subversion-deps-1.6.6 in /apps/src (they layer over each other)<br />
* first build and install the -deps apr and apr-util into /apps/local<br />
* then build apache2 against /usr/local/apr and /usr/local/apr-util<br />
* install apache2<br />
* build and install serf<br />
* remove serf, apr, and apr-util subdirectories and source code from within subversion-1.6.6<br />
* build 1.6.6 against apxs in apache, without Berkeley DB, without neon, and specifying /usr/local/apr, /usr/local/apr-util, and /usr/local/serf<br />
* install and test</p>
<p>process</p>
<p>* create subdirectory /apps/src, place all tarballs in this directory<br />
* untar subversion &amp; subversion-deps version 1.6.6 (these tar onto each other)<br />
* cd subversion-1.6.6/apr<br />
* ./configure &#8211;prefix=/usr/local/subversion/apr<br />
* make &amp;&amp; make install<br />
* cd ../apr-util<br />
* ./configure &#8211;prefix=/usr/local/subversion/apr-util &#8211;with-apr=/usr/local/subversion/apr<br />
* make &amp;&amp; make install<br />
* cd ../neon<br />
* ./configure &#8211;prefix=/usr/local/subversion/neon<br />
*<br />
* apache2: untar httpd-2.2.14<br />
* ./configure &#8211;prefix=/usr/local/subversion/apache &#8211;enable-dav &#8211;enable-dav-fs &#8211;enable-dav-lock &#8211;enable-expires &#8211;enable-headers &#8211;enable-info &#8211;enable-logio &#8211;enable-proxy &#8211;enable-rewrite &#8211;enable-unique-id &#8211;with-apr=/usr/local/subversion/apr &#8211;with-apr-util=/usr/local/subversion/apr-util &#8211;enable-so &#8211;enable-mods-shared=all<br />
* make &amp;&amp; make install</p>
<p>This way apache2 builds against apr and apr-util compatible with subversion 1.6.6<br />
and then build subversion against it as well..<br />
* ln -s /apps/apache2_2.2.14 /apps/apache2<br />
* compile and install serf<br />
* ./configure –-prefix=/usr/local/subversion/serf &#8211;with-apr=/usr/local/subversion/apr &#8211;with-apr-util=/usr/local/subversion/apr-util<br />
* make &amp;&amp; make install<br />
* remove serf, pr and apr-util from subversion</p>
<p>compile subversion</p>
<p>./configure –prefix=/apps/svn –with-ssl –with-libs=/usr/local/ssl –without-berkeley-db –with-apxs=/apps/apache2/bin/apxs –with-openssl=/usr/local/ssl –without-neon –with-serf=/usr/local/serf –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util</p>
<p>make &amp;&amp; make install</p>
<p>test:</p>
<p>/usr/local/subversion/svn/bin/svnadmin create /usr/local/subversion/repository</p>
<p>chown subversion:subversion /usr/local/subversion</p>
<p>chown -Rv subversion.subversion /usr/local/subversion</p>
<p>root@dedicated[/bin] $</p>
<p>no core dump…</p>
<p>ONWARD to configure and test apache2 and subversion…<br />
httpd.conf:</p>
<p>* change all references to apache2_2.2.14 to apache2 (makes the httpd.conf generic rather than subject to needing a migration after a point release upgrade…)<br />
* change port 80 to a non-priveliged port (8080)<br />
* check for<br />
o LoadModule dav_module modules/mod_dav.so<br />
o LoadModule dav_module modules/mod_dav.so<br />
o LoadModule ssl_module modules/mod_ssl.so<br />
* add in ServerName hostname.domain.com:8443 Some of the apache level sanity validation requires a statement of the local host.<br />
* add in SSL stuff (this IS httpd from source &#8211; the default httpd.conf had the ssl-module load statement, but no explicit SSL configuration</p>
<p>#<br />
# Note: The following must must be present to support<br />
# starting without SSL on platforms with no /dev/random equivalent<br />
# but a statically compiled-in mod_ssl.<br />
#</p>
<p>&lt;IfModule ssl_module&gt;<br />
SSLRandomSeed startup builtin<br />
SSLRandomSeed connect builtin<br />
&lt;/IfModule&gt;</p>
<p># =================================================<br />
# SSL/TLS settings<br />
# =================================================</p>
<p>Listen 0.0.0.0:8080<br />
Listen 0.0.0.0:8443</p>
<p>SSLEngine on<br />
#SSLOptions +StrictRequire</p>
<p>#&lt;Directory /&gt;<br />
# SSLRequireSSL<br />
#&lt;/Directory&gt;</p>
<p>SSLProtocol -all +TLSv1 +SSLv3<br />
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM</p>
<p>SSLMutex file:/apps/apache2/logs/ssl_mutex</p>
<p>SSLRandomSeed startup file:/dev/urandom 1024<br />
SSLRandomSeed connect file:/dev/urandom 1024</p>
<p>SSLSessionCache shm:/apps/apache2/logs/ssl_cache_shm<br />
SSLSessionCacheTimeout 600</p>
<p>SSLPassPhraseDialog builtin<br />
SSLCertificateFile /apps/apache2/conf/ssl.crt/server.crt<br />
SSLCertificateKeyFile /apps/apache2/conf/ssl.key/server.key</p>
<p>SSLVerifyClient none<br />
SSLProxyEngine off</p>
<p>&lt;IfModule mime.c&gt;<br />
AddType application/x-x509-ca-cert .crt<br />
AddType application/x-pkcs7-crl .crl<br />
&lt;/IfModule&gt;</p>
<p>* create ssl certificate (self-signed). I installed in /apps/apache2/conf/ssl.crt and ssl.key, naming the .crt and ,key files for the server hostname and then symbolically linking them to the generic “server.crt” and “server.key”.<br />
* restart apache2 and test https://host:8443/ &#8211; you should get the “It works!” apache test page, thus validating the SSL certificate and setup from a browser level<br />
*<br />
* parent directory for svn</p>
<p>&lt;Location /svn&gt;<br />
DAV svn<br />
SVNParentPath /apps/repos<br />
&lt;/Location&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/servers/apache/svn-apache2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preferred method to store PHP arrays (json_encode vs serialize)</title>
		<link>http://blog.dazzlecms.com/programming/php/preferred-method-to-store-php-arrays-json_encode-vs-serialize/</link>
		<comments>http://blog.dazzlecms.com/programming/php/preferred-method-to-store-php-arrays-json_encode-vs-serialize/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 00:12:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[associative]]></category>
		<category><![CDATA[decode]]></category>
		<category><![CDATA[Encoding]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[unserialize]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=7</guid>
		<description><![CDATA[I need to store a multi-dimensional associative array of data in a flat file for caching purposes. I might occasionally come across the need to convert it to JSON for use in my web app but the vast majority of the time I will be using the array directly in PHP. Would it be more [...]]]></description>
			<content:encoded><![CDATA[<p>I need to store a multi-dimensional associative array of data in a flat file for caching purposes. I might occasionally come across the need to convert it to JSON for use in my web app but the vast majority of the time I will be using the array directly in PHP.</p>
<p>Would it be more efficient to store the array as JSON or as a PHP serialized array in this text file? I&#8217;ve looked around and it seems that in the newest versions of PHP (5.3), <code>json_decode</code> is actually faster than <code>unserialize</code>.</p>
<p>I&#8217;m currently leaning towards storing the array as JSON as I feel its easier to read by a human if necessary, it can be used in both PHP and JavaScript with very little effort, and from what I&#8217;ve read, it might even be faster to decode (not sure about encoding, though).</p>
<p>Does anyone know of any pitfalls? Anyone have good benchmarks to show the performance benefits of either method?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/php/preferred-method-to-store-php-arrays-json_encode-vs-serialize/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Launch of Dazzle CMS Blog</title>
		<link>http://blog.dazzlecms.com/programming/dazzle-cms/dazzle-blog/</link>
		<comments>http://blog.dazzlecms.com/programming/dazzle-cms/dazzle-blog/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 22:50:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dazzle CMS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.dazzlecms.com/?p=1</guid>
		<description><![CDATA[First off i like to welcome you all to our new blog, so you get too see what been under development and how we have progressed, as we start looking at getting more developers working beside us im sure they post some of there status updates too. as up until now the project has been [...]]]></description>
			<content:encoded><![CDATA[<p>First off i like to welcome you all to our new blog, so you get too see what been under development and how we have progressed,</p>
<p>as we start looking at getting more developers working beside us im sure they post some of there status updates too.</p>
<p>as up until now the project has been off / on for some time</p>
<p>but now has been under constant development for a few months now</p>
<p>all our old code that we start back when we first started the project was when php 5 was released and now its been slowly updated and written how php 5 code should be and now does require php 5.3 but this could change to atleast 5.2 as im thinking of implementing some wrappers for the 5.3  code</p>
<p>the project itself has been alot inflused by phpnuke, &amp; nuke-evolution and the whole reason behind this is for a while i worked with phpnuke and even worked with the developer of phpnuke when phpnuke 7.7 was released</p>
<p>and so much i wanted to change about phpnuke but i had no control of major core changes which i really wanted todo with phpnuke for sometime</p>
<p>so what i did was to rewrite how phpnuke functions and make everythign better and easier to use</p>
<p>for example the biggest part of control of an CMS is design wanted to be able to design every aspect of the portal this means chaneg the looks and feel of the modules as well as the site</p>
<p>so smarty was used as our template engine so smarty is wrapped into our template engine but it goes behond templates almost every aspect is assigned into smarty from form elements , as for the form elements you can control the html type too as some elements only work under a particlar version of doctype for example xhtml / html 4.0.1 &amp; the new html5</p>
<p>every major class this includes sessions, users, database, templates, filesystem etc are all plugin based you can extend any of the classes just by writing an new class and dropping it right into the plugin folder or into the modules class folder for example if its only used by the module you created</p>
<p>as soon we tied up the core features and frozen the feature releases we will post full complete list but we will post up an summary shorly</p>
<p>~Dazzle Development Team~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dazzlecms.com/programming/dazzle-cms/dazzle-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

