﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Template Blocks - Support</title>
  <!-- Meta - Default Start -->
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta name="description" content="Template Blocks - Visual Template System" />
  <meta name="keywords" content="template, blocks" />
  <meta name="verify-v1" content="3XeId5Q68ZFCQdsm6yEm69iu1UOGQ1Yea9hJuSK3W2M=" />
  
  <!-- Meta - Default End -->
  <link rel="stylesheet" type="text/css" href="/template/assets/css/styles.css" />
  <!-- Styles - IE Start -->
  <!--[if lt IE 7]>
  <style>
  #index-right{ 
    background: none;
    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/template/assets/images/clipart-3d_blocks.png', sizingMethod='crop');
  }
  </style>
  <![endif]-->
  
  <!-- Styles - IE End -->
  <link rel="alternate" type="application/rss+xml" title="Template Blocks RSS Feed" href="/rss.xml" />
  <link rel="shortcut icon" href="/favicon.ico" />

</head>
<body>
<div id="container">
  <!-- Header Start -->

<div id="header">
  <h1><a href="/" id="logo"><span>Template Blocks</span></a></h1>
    <div id="top-banner">
      <script type="text/javascript"><!--
        google_ad_client = "pub-3434925172954132";
        /* Template Blocks - 728x90 */
        google_ad_slot = "8039796504";
        google_ad_width = 728;
        google_ad_height = 90;
        //-->
      </script>
      <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    </div>  <ul id="toplinks"><li><a href="/"><span>Home</span></a></li><li><a href="/features.html"><span>Features</span></a></li><li><a href="/demo.html"><span>Demo</span></a></li><li><a href="/download.html"><span>Download</span></a></li><li><a href="/support/"><span>Support</span></a></li><li><a href="/about.html"><span>About</span></a></li>  </ul></div>
  <!-- Header End -->
  <!-- Content Start -->
  <div id="content">
<?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"
	>

<channel>
	<title>Template Blocks - Support</title>
	<atom:link href="http://www.templateblocks.com/support/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.templateblocks.com/support</link>
	<description>Another Template Blocks wrapped around Wordpress</description>
	<pubDate>Wed, 01 Oct 2008 07:38:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Setting up Template Blocks for OFFLINE use</title>
		<link>http://www.templateblocks.com/support/tutorials/setting-up-template-blocks-for-offline-use/</link>
		<comments>http://www.templateblocks.com/support/tutorials/setting-up-template-blocks-for-offline-use/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 02:52:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=17</guid>
		<description><![CDATA[If you want to use Template Blocks on your local server as a web design/compiling tool, this is the guide for you. For users that don&#8217;t have a local server but want to work with the template engine offline, XAMPP is recommended as a light-weight and efficient solution. 
Some of this information may be different [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use Template Blocks on your local server as a web design/compiling tool, this is the guide for you. For users that don&#8217;t have a local server but want to work with the template engine offline, <a href="http://www.apachefriends.org/en/xampp.html" class="outside-link">XAMPP</a> is recommended as a light-weight and efficient solution. </p>
<p>Some of this information may be different depending on the platform you are working (Windows, <a href="http://blog.xmodx.com/2008/06/04/install-apache-and-enable-mod_rewrite-ubuntu-linux/" rel="selected resource">Linux</a>, Mac OS). In any case you will need <a href="http://en.wikipedia.org/wiki/Apache_HTTP_Server" class="outside-link">Apache</a> installed and running beforehand. </p>
<p>To access Template Blocks locally you will need to map a domain name to point to its location. That way you won&#8217;t have to install Template Blocks on the root of your server or fight with custom paths that may cause glitches to the engine. Instead you can work with Template Blocks on a top domain level, wherever it is on the local server. </p>
<h3>Setting up a VistualHost in Apache</h3>
<p>Go to where your Apache is installed and find to the &#8220;conf/extra&#8221; sub-folder. Open &#8220;httpd-vhosts.conf&#8221; in a text editor. You&#8217;ll find some commented examples how to setup a VirtualHost entry - write at the bottom of the file your own. These are the ones I use on my setup:</p>

<div class="wp_syntax"><div class="code"><pre class="apache"><span style="color: #00007f;">NameVirtualHost</span> <span style="color: #ff0000;">127.0</span><span style="color: #ff0000;">.0</span><span style="color: #ff0000;">.1</span>
&nbsp;
&lt;VirtualHost <span style="color: #ff0000;">127.0</span><span style="color: #ff0000;">.0</span><span style="color: #ff0000;">.1</span>&gt;
  <span style="color: #00007f;">DocumentRoot</span> <span style="color: #7f007f;">&quot;C:<span style="color: #000099; font-weight: bold;">\S</span>erver<span style="color: #000099; font-weight: bold;">\h</span>tdocs&quot;</span>
  <span style="color: #00007f;">ServerName</span> localhost
&lt;/VirtualHost&gt;
&nbsp;
&lt;VirtualHost <span style="color: #ff0000;">127.0</span><span style="color: #ff0000;">.0</span><span style="color: #ff0000;">.1</span>&gt;
  <span style="color: #00007f;">DocumentRoot</span> <span style="color: #7f007f;">&quot;C:<span style="color: #000099; font-weight: bold;">\S</span>erver<span style="color: #000099; font-weight: bold;">\h</span>tdocs<span style="color: #000099; font-weight: bold;">\t</span>emplateblocks&quot;</span>
  <span style="color: #00007f;">ServerName</span> templateblocks.dev
&lt;/VirtualHost&gt;</pre></div></div>

<p>Note that you should change the IP (127.0.0.1) if your server has another one and the document path and domain name as suited.</p>
<h3>For Windows users</h3>
<p>Additionally you&#8217;ll have to tell windows to redirect the domain name (templateblocks.dev) to the local server and not make a DNS look up for it online.</p>
<p>For this go to &#8220;C:\WINDOWS\system32\drivers\etc\&#8221; and open the &#8220;hosts&#8221; file in a text editor. There you will possibly find a line already redirecting yo your local server, mine is:</p>
<pre>
127.0.0.1       localhost
</pre>
<p>Under that line make a new line for your custom domain (templateblocks.dev)</p>
<pre>
127.0.0.1       templateblocks.dev
</pre>
<p>Save that file. Now when you enter &#8220;templateblocks.dev&#8221; from a browser windows knows to redirect it to your local server and your local server knows to redirect it to the appropriate folder.</p>
<p>Re-start Apache and load a web browser to you new a top level domain.</p>
<p>Enjoy working with <strong>Template Blocks</strong> offline. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/tutorials/setting-up-template-blocks-for-offline-use/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MODx class v1.0</title>
		<link>http://www.templateblocks.com/support/repository/modx-class/</link>
		<comments>http://www.templateblocks.com/support/repository/modx-class/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 10:35:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=15</guid>
		<description><![CDATA[This class connects a MODx installation with Template Blocks to draw useful information like the web page title or the bread crumb trail&#8230;

&#60;?php
/**
 * TEMPLATE BLOCKS
 * Copyright (C) 2008 Makis Tracend
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General [...]]]></description>
			<content:encoded><![CDATA[<p>This class connects a MODx installation with Template Blocks to draw useful information like the web page title or the bread crumb trail&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/**
 * TEMPLATE BLOCKS
 * Copyright (C) 2008 Makis Tracend
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * 
 * Class: MODx
 * 
*************************************************************************
	MODx Content Management System and PHP Application Framework 
	Managed and maintained by Raymond Irving, Ryan Thrash and the
	MODx community
*************************************************************************
* Known Limitations: 
* - This class only works on MODx setup with MySQL 
* - Only one MODx installation per website is supported 
* - You need to insert the database information to connect to MODx manually
*/</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">/* Variables (PLEASE CHANGE AS SUITED) */</span>
<span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'modx_root'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span> 
<span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_server'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_user'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'table_prefix'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> MODx<span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Define class varriables</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000033;">$dbhost</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000033;">$dbuser</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000033;">$dbpass</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000033;">$dbname</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000033;">$prefix</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000033;">$connection</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000033;">$settings</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Call constructor</span>
  <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">global</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbhost</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_server'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbname</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbuser</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_user'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbpass</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database_password'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'table_prefix'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">openConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">function</span> openConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connection</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbhost</span><span style="color: #339933;">,</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbuser</span><span style="color: #339933;">,</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbpass</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Could not connect: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">//Select the database connection for use</span>
	<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbname</span><span style="color: #339933;">,</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connection</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'could not select database'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">function</span> getSettings<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Run the query and store the results</span>
	<span style="color: #000033;">$data</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT * FROM '</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'system_settings'</span><span style="color: #009900;">&#41;</span>or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query failed'</span><span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000033;">$numrows</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$numrows</span><span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	  <span style="color: #666666; font-style: italic;">//Place all of the data into an array</span>
	  <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000033;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000033;">$numrows</span><span style="color: #339933;">;</span> <span style="color: #000033;">$i</span><span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	    <span style="color: #000033;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000033;">$returndata</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'setting_name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000033;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'setting_value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span>
	  <span style="color: #666666; font-style: italic;">//Return the results</span>
      <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">settings</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$returndata</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">function</span> findPage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">global</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// first parse the URL</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'friendly_urls'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	  <span style="color: #666666; font-style: italic;">// we have user friendly URLs</span>
	  <span style="color: #000033;">$urlparts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000033;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #000033;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$urlparts</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #666666; font-style: italic;">// for the case we are viewing a container of pages we need to go one level in</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$file</span><span style="color: #339933;">==</span><span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000033;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$urlparts</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
	  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'use_alias_path'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #000033;">$parent_alias</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$urlparts</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$parent_alias</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		  <span style="color: #666666; font-style: italic;">// now find the parent's id</span>
	      <span style="color: #000033;">$parent_data</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT id FROM &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;site_content WHERE alias='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$parent_alias</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span>or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query failed'</span><span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$parent_data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000033;">$parent_array</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$parent_data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
		  <span style="color: #000033;">$parent_id</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$parent_array</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	  <span style="color: #009900;">&#125;</span>
	  <span style="color: #000033;">$file_parts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'friendly_url_prefix'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'friendly_url_suffix'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'friendly_alias_urls'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000033;">$page_alias</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$file</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$file_parts</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000033;">$file</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'index'</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000033;">$page_id</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$file</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$file_parts</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000033;">$file</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	  <span style="color: #666666; font-style: italic;">// we simple have an id variable in the URL let's parse that...</span>
      <span style="color: #990000;">import_request_variables</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;gp&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;page_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #666666; font-style: italic;">// a precaution so that the query doesn't return an error</span>
	  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000033;">$page_id</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000033;">$page_id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// compile the query </span>
	<span style="color: #000033;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;site_content WHERE &quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$page_alias</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000033;">$query</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;alias='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$page_alias</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$page_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000033;">$query</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;id=&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$page_id</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$parent_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000033;">$query</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; AND parent=&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$parent_id</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000033;">$data</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$query</span> <span style="color: #009900;">&#41;</span>or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query failed'</span><span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	  <span style="color: #666666; font-style: italic;">// We only need one record so we won't loop through the $numrows</span>
	  <span style="color: #000033;">$returndata</span><span style="color: #339933;">=</span><span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #666666; font-style: italic;">//Return the results</span>
	  <span style="color: #b1b100;">return</span> <span style="color: #000033;">$returndata</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>	
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000033;">$modx</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MODx<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$modx</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSettings</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$modx_page</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$modx</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">findPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page-title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$modx_page</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'longtitle'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> ? <span style="color: #000033;">$modx_page</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'longtitle'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #000033;">$modx_page</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pagetitle'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$page</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$_TEMPLATE_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page-title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$modx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$modx_page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Instructions:</strong><br />
- Copy the above code and paste it in a text editor.<br />
- Edit the top $_TEMPLATE_VARS variables (6 total). The information refers to your MODx installation.<br />
- Save the text file as &#8220;MODx.php&#8221; and place it in the classes folder of your Template Blocks (default: &#8216;template/classes&#8217;)<br />
- To use it, select it for a section, in the available classes list (edit screen) or refer to it from a PHP block with an include command.</p>
<p><strong>Known Limitations:</strong><br />
- This class only works on MODx setup with MySQL.<br />
- Only one MODx installation per website is supported.<br />
- You need to insert the database information to connect to MODx manually.</p>
<p><strong>Changelog:</strong><br />
v1.0     Initial Release - Web page title automatically embedded in the functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/repository/modx-class/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Menu PHP block</title>
		<link>http://www.templateblocks.com/support/repository/menu-php-block/</link>
		<comments>http://www.templateblocks.com/support/repository/menu-php-block/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 08:36:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=16</guid>
		<description><![CDATA[This is a simple PHP block taken from the main Template Blocks website. A good feature is that is automatically defines the selected tab based on the URL the visitor is viewing:

&#60;?php
&#160;
$links = array&#40; 'Home' =&#62; '/',
                'Features' =&#62; '/features.html',
 [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple PHP block taken from the main Template Blocks website. A good feature is that is automatically defines the selected tab based on the URL the visitor is viewing:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000033;">$links</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Home'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'Features'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/features.html'</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'Demo'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/demo.html'</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'Download'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/download.html'</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'Support'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/support/'</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'About'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/about.html'</span>
               <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'  &lt;ul id=&quot;toplinks&quot;&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$links</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$value</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000033;">$selected</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000033;">$value</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">' class=&quot;selected&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$value</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$selected</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&gt;&lt;span&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$key</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'  &lt;/ul&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Just replace the array at the top the with your URL list and menu titles. You might also need to make some modifications in the markup that is generated&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/repository/menu-php-block/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Version 1.1</title>
		<link>http://www.templateblocks.com/support/changelog/version_1_1/</link>
		<comments>http://www.templateblocks.com/support/changelog/version_1_1/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 20:19:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Change Log]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=14</guid>
		<description><![CDATA[After a month and a half of gathering notes and fixing glitches, the updated engine is ready for you to use. Of course this was scheduled to be a bug-fix release over the previous version (as no program is bug-free from version 1.0) but in the process many new interesting features were added. Let’s outline [...]]]></description>
			<content:encoded><![CDATA[<p>After a month and a half of gathering notes and fixing glitches, the updated engine is ready for you to use. Of course this was scheduled to be a bug-fix release over the previous version (as no program is bug-free from version 1.0) but in the process many new interesting features were added. Let’s outline some of the things that changed: </p>
<p><strong>Bug fixes: </strong><br />
- Timed out sessions loaded the login screen within the admin pages.<br />
- JavaScript blocks were linked falsely (with a .javascript extension instead of a .js)<br />
- A section with static content could not be converted to a section of an external script.<br />
- Setup process didn&#8217;t stop when you entered the wrong database information.<br />
- In IE, blocks where loosing their coloring after some moving around in the template editing.<br />
- Version number was erased after editing the website settings.<br />
- Before loading a block for editing all the “\” characters where removed.</p>
<p><strong>Improvements: </strong><br />
- Introduced loading screen to cover the delay when navigating through the admin pages.<br />
- Moved classes folder outside the admin folder for a more logical structure.<br />
- Removed the assets sub-folder so it doesn&#8217;t get confused with the user assets folder. All its contents are directly available in the admin folder.<br />
- Moving the blocks around in the template layout used to have a few glitches. Now it&#8217;s more smooth and stable.<br />
- Homepage now loads faster with the remote call for latest version converted to an Ajax call.<br />
- The search engine friendly URLs are now parsed more properly. The parent element is considered to validate a URL. An ending slash with no filename redirects to the section with the same name as the folder.<br />
- Feedback messages when editing the template do not fade out if they request an action from the user.<br />
- Sections can be nested in more than two levels.</p>
<p><strong>New features: </strong><br />
- More dynamic elements are displayed in the homepage (comments, repository).<br />
- Now you can load custom classes for each external script you use, so you can connect to it for manipulating elements of the template like the page title.<br />
- There is now an exception list in the settings page to insert all the URLs you specifically don&#8217;t want the template engine to process.</p>
<p>These and other smaller improvements have made the template engine more stable (especially for IE that had the most problems), more clean and more logically structured. Some of the new features (ex. the custom classes) need  more explaining and you will find this information in the tutorial pages. </p>
<p>As always you can send in your comments and suggestions to make this a better engine than it is&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/changelog/version_1_1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Section Menu v1.2</title>
		<link>http://www.templateblocks.com/support/repository/section-menu/</link>
		<comments>http://www.templateblocks.com/support/repository/section-menu/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 05:30:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=3</guid>
		<description><![CDATA[This is the &#8220;topbar&#8221; block available in the dummy content of the latest release. It contains links to all sections, placed in a hierarchy list:

&#60;?php
&#160;
$items = $db-&#62;select&#40; '*', $config&#91;'Sections'&#93;, false, 'id'&#41;;
if&#40; is_array&#40;$items&#41; &#41;&#123;
  $children = array&#40;&#41;;
  foreach&#40; $items as $k =&#62; $v &#41;&#123;
    preg_match&#40;'/(.*)\((.*)\)/', $v&#91;'position'&#93;, $matches&#41;;
&#160;
    if&#40;$matches&#91;2&#93; [...]]]></description>
			<content:encoded><![CDATA[<p>This is the &#8220;topbar&#8221; block available in the dummy content of the latest release. It contains links to all sections, placed in a hierarchy list:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000033;">$items</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'*'</span><span style="color: #339933;">,</span> <span style="color: #000033;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Sections'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$items</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000033;">$children</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$items</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$v</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/(.*)<span style="color: #000099; font-weight: bold;">\(</span>(.*)<span style="color: #000099; font-weight: bold;">\)</span>/'</span><span style="color: #339933;">,</span> <span style="color: #000033;">$v</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'position'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000033;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'x'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$children</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000033;">$v</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000033;">$children</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$v</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000033;">$output</span> <span style="color: #339933;">=</span> createOrder<span style="color: #009900;">&#40;</span> <span style="color: #000033;">$items</span><span style="color: #339933;">,</span> <span style="color: #000033;">$children</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;div id=&quot;topbar&quot;&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #000033;">$output</span><span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> createOrder<span style="color: #009900;">&#40;</span> <span style="color: #000033;">$items</span><span style="color: #339933;">,</span> <span style="color: #000033;">$order</span><span style="color: #339933;">,</span> <span style="color: #000033;">$parent</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000033;">$path</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #990000;">ksort</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$order</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$parent</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
  <span style="color: #000033;">$listings</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;ul&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000033;">$middle</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;/span&gt;&lt;/a&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #000033;">$close</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$order</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$parent</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$v</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$items</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$l</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$w</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// now we can create the listings</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$w</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000033;">$v</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000033;">$open</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;/'</span><span style="color: #339933;">.</span> <span style="color: #000033;">$path</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$w</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'slug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'.html&quot;&gt;&lt;span&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// check for children in this branch</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$w</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000033;">$order</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		  <span style="color: #000033;">$new_path</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$path</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$w</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'slug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span>
	      <span style="color: #000033;">$children</span> <span style="color: #339933;">=</span> createOrder<span style="color: #009900;">&#40;</span> <span style="color: #000033;">$items</span><span style="color: #339933;">,</span> <span style="color: #000033;">$order</span><span style="color: #339933;">,</span> <span style="color: #000033;">$w</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000033;">$new_path</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	      <span style="color: #000033;">$children</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
	  <span style="color: #000033;">$listings</span> <span style="color: #339933;">.=</span> <span style="color: #000033;">$open</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$w</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$middle</span> <span style="color: #339933;">.</span>  <span style="color: #000033;">$children</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$close</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000033;">$listings</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/ul&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000033;">$listings</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Instructions:</strong><br />
- Copy/paste the following code and save it as a PHP block<br />
- Edit the $open , $close variables if needed for a custom layout&#8230;</p>
<p><strong>Change log:</strong><br />
- v1.2 : Better linking of children. Proper order restored.<br />
- v1.1 : Updated the &#8216;parent&#8217; field to the new &#8216;position&#8217; field. Additional tweaks.<br />
- v1.0 : Initial release</p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/repository/section-menu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The setup process</title>
		<link>http://www.templateblocks.com/support/tutorials/videos/the-setup-process/</link>
		<comments>http://www.templateblocks.com/support/tutorials/videos/the-setup-process/#comments</comments>
		<pubDate>Tue, 06 May 2008 07:55:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=12</guid>
		<description><![CDATA[A presentation of the basic setup process, recorded in real-time: 



Pop-up notes make up for the absence of a voice. Being a relatively easy process it doesn&#8217;t make that much of a difference anyway - in fact the text is better comprehended and memorized. Intended for first-time users and novice web developers. 
]]></description>
			<content:encoded><![CDATA[<p>A presentation of the basic setup process, recorded in real-time: </p>
<p class="align-center">
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/52nXik0yl9Y&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/52nXik0yl9Y&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
</p>
<p>Pop-up notes make up for the absence of a voice. Being a relatively easy process it doesn&#8217;t make that much of a difference anyway - in fact the text is better comprehended and memorized. Intended for first-time users and novice web developers. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/tutorials/videos/the-setup-process/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introductory Tour</title>
		<link>http://www.templateblocks.com/support/tutorials/videos/tour/</link>
		<comments>http://www.templateblocks.com/support/tutorials/videos/tour/#comments</comments>
		<pubDate>Tue, 06 May 2008 07:03:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=11</guid>
		<description><![CDATA[An brief introduction to the very basics of Template Blocks, presented in an ad form: 


]]></description>
			<content:encoded><![CDATA[<p>An brief introduction to the very basics of Template Blocks, presented in an ad form: </p>
<p class="align-center">
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/9QHQq6u3c9Q&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/9QHQq6u3c9Q&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/tutorials/videos/tour/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Redirection/Wrapping Issues</title>
		<link>http://www.templateblocks.com/support/tutorials/faqs/redirectionwrapping-issues/</link>
		<comments>http://www.templateblocks.com/support/tutorials/faqs/redirectionwrapping-issues/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 17:48:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[FAQs]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=10</guid>
		<description><![CDATA[- How does the redirection work?
To make the redirection work you&#8217;ll need the .htaccess file included in the archive and upload it at the root of your domain name along with the index.php file. Both need to be present for the redirection to work. 
- How does the &#8220;index.php&#8221; file in the root works?
The index.php [...]]]></description>
			<content:encoded><![CDATA[<p>- <strong>How does the redirection work?</strong><br />
To make the redirection work you&#8217;ll need the .htaccess file included in the archive and upload it at the root of your domain name along with the index.php file. Both need to be present for the redirection to work. </p>
<p>- <strong>How does the &#8220;index.php&#8221; file in the root works?</strong><br />
The index.php handles all the redirection after the request passes from the .htaccess file. Based on the URL the sctipt will find the section name and the parent section name (if any) and submit that information to the &#8220;template/index.php&#8221; which resources the actual data. Note that the script can only handle pages created though the template engine&#8217;s administration interface. If the engine doesn&#8217;t find a section assigned to that request it will redirect the visitor to the index page. </p>
<p>- <strong>What is the .htaccess commands mean?</strong><br />
This is the code included in the .htaccess file</p>

<div class="wp_syntax"><div class="code"><pre class="apache">&lt;IfModule mod_rewrite.c&gt;
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
&nbsp;
<span style="color: #00007f;">RewriteBase</span> /
<span style="color: #00007f;">RewriteCond</span> %<span style="color: #66cc66;">&#123;</span>REQUEST_FILENAME<span style="color: #66cc66;">&#125;</span> !-f
<span style="color: #00007f;">RewriteCond</span> %<span style="color: #66cc66;">&#123;</span>REQUEST_FILENAME<span style="color: #66cc66;">&#125;</span> !-d
<span style="color: #00007f;">RewriteRule</span> . /index.php <span style="color: #66cc66;">&#91;</span>L<span style="color: #66cc66;">&#93;</span>
&nbsp;
&lt;/IfModule&gt;</pre></div></div>

<p>Basically it says that if a file or directory from the URL requested is not actually there then redirect to the index.php on the same level to handle the request. It&#8217;s the same code that Wordpress uses for its search engine friendly URLs&#8230;</p>
<p>- <strong>I can&#8217;t get the redirection to work! I&#8217;m only seeing the index page.</strong><br />
Make sure that mod_rewrite is loaded for your server setup. That&#8217;s the module the .htaccess file uses for the redirection commands. Go to where your Apache is installed and move to the &#8220;conf/&#8221; sub-folder. Open &#8220;httpd.conf&#8221; in a text editor.<br />
Find the line</p>
<pre>
LoadModule rewrite_module modules/mod_rewrite.so
</pre>
<p>and make sure it&#8217;s uncommented (no # in front of it). Save the file. Re-start Apache. Now redirections should work. </p>
<p>- <strong>What information does the engine need for a redirection?</strong><br />
All information is passed through the URL, the section name and it&#8217;s parents in an hierarchical order. It will then compile all the right pieces and present the template automatically. </p>
<p>- <strong>Can I load the template manually?</strong><br />
To load a template from your script all you need to know is the section slug you have created in Template Blocks for that script. Then load it in the variable $GLOBALS[&#8217;section&#8217;] and include the &#8216;/template/index.php&#8217; file. Now you have the template in two variables:<br />
$GLOBALS[&#8217;template-pre&#8217;] - the template before the content<br />
$GLOBALS[&#8217;template-post&#8217;] - the template after the content<br />
It&#8217;s up to you to use the template however you want in your script. </p>
<p>- <strong>The variable $GLOBALS[&#8217;section&#8217;] is reserved by my script. What do I do?</strong><br />
In this case you can easily change it to anything else you want. Simply open &#8220;template/index.php&#8221; and replace the $GLOBALS[&#8217;section&#8217;] to $GLOBALS[&#8217;anything_you_want&#8217;]. Then assign to that variable the name of the slug for the section that is linked with the script. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/tutorials/faqs/redirectionwrapping-issues/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Version 1.0</title>
		<link>http://www.templateblocks.com/support/changelog/version_1_0/</link>
		<comments>http://www.templateblocks.com/support/changelog/version_1_0/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 13:31:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Change Log]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=1</guid>
		<description><![CDATA[Creating this template engine was an idea I had some time in my mind. I had already created another template engine in 2005 for my personal website at www.makis.info (now updated). 
I always intended to improve that engine as it lacked the basic user-friendly features (No SE-friendly URLs, no dynamic content and no AJAX administration) [...]]]></description>
			<content:encoded><![CDATA[<p>Creating this template engine was an idea I had some time in my mind. I had already created another template engine in 2005 for my personal website at www.makis.info (now updated). </p>
<p>I always intended to improve that engine as it lacked the basic user-friendly features (No SE-friendly URLs, no dynamic content and no AJAX administration) but never really found myself doing it, mostly because other work took up all my energy/time.</p>
<p>Fast forward to 2008 and after years of web designing the logic of a proper template engine matured in my head. To my surprise I didn&#8217;t find this logic implemented on any of the template engines I worked on till then. It finally hit me one day that this will never end. I would spend valuable hours of my life trying to work with inflexible engines unless I sit down and create what was in my head. </p>
<p>I wanted it primarily for my websites but thought I should release it to the open source since the goal to create a visual template engine is beyond my personal needs. At this point I have to <a href="/about.html">redirect you to the About page</a> for more info on the underlying ideas of this project. </p>
<p>Serious development begun on March 2008 and although the main parts where setup soon enough (within two weeks) I still managed to spend another month fine-tuning the administration interface and creating all the elements that would be appealing for the users: the official website, the setup procedure, the demo content&#8230;etc.</p>
<p>I&#8217;m releasing version 1.0 at this point so I can get some feedback from the users and according to that shape the direction I want to take for future releases of the engine. Above all this is a web designers tool and I feel that web designers should have the first word for improving it the way they like it. </p>
<p>There are a series of features and bugs already noted but left to be included on later versions (or not). In any case, one of my biggest concerns will be to optimize the back-end as well as the front-end, so you will always have a stable and user-friendly canvas to work on.</p>
<p>Even though it is the first release, it is a functional engine with many of the features advertised at perfect state. Your feedback and support will help it become a valuable tool for any web designer. </p>
<p><strong>You can download this version of Template Blocks from the following sources: </strong></p>
<p><a href="http://templateblocks.googlecode.com/files/Template_Blocks_v1.0.zip">Google Code</a></p>
<p><a href="http://downloads.sourceforge.net/templateblocks/Template_Blocks_v1.0.zip">SourceForge.net</a></p>
<p>Cheers,<br />
Makis</p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/changelog/version_1_0/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Other Issues</title>
		<link>http://www.templateblocks.com/support/tutorials/faqs/other-issues/</link>
		<comments>http://www.templateblocks.com/support/tutorials/faqs/other-issues/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 16:30:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[FAQs]]></category>

		<guid isPermaLink="false">http://www.templateblocks.com/support/?p=7</guid>
		<description><![CDATA[- Why use separate template engine when Wordpress for example has a perfectly functionable template system itself? 
If you are going to use only Wordpress on your site and are happy with all the features it offers then please be my guest - Is a wordpress template and that&#8217;s that. But what if one day [...]]]></description>
			<content:encoded><![CDATA[<p>- <strong>Why use separate template engine when Wordpress for example has a perfectly functionable template system itself? </strong><br />
If you are going to use only Wordpress on your site and are happy with all the features it offers then please be my guest - Is a wordpress template and that&#8217;s that. But what if one day you decide that you need a forum on your site. And then you add a wiki, and a download directory and so on. Are going to build the template again and again or will you leave it to what looks &#8220;close enough&#8221;? Repetition of code (even if it&#8217;s markup code) only means one thing: tedious updates. This is where Template Blocks comes. You can define the templates you want to use outside the scripts you are using so updating them will become less fustrating - almost joyful one might say&#8230;</p>
<p>- <strong>How am I going to use Template Blocks offline</strong>?<br />
Although Template Blocks can be used as a full-blown template engine - and many will prefer to use it as such, it was created with helping the web designer&#8217;s work in mind. In that regards t&#8217;s intended for use at the early stages of development where the user is forming the web templates from concept graphics. You&#8217;ll need to setup Linux with PHP and MySQL on your computer and setup a web server to work locally. Template blocks may not be a WYSIWYG editor and it&#8217;s certainly not a CMS but it can prove to be a valuable a web design tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.templateblocks.com/support/tutorials/faqs/other-issues/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

  </div>
  <!-- Content End -->

  <!-- Footer Start -->
  <div id="footer">
    <ul>
      <li><a href="/features.html">Features</a></li>
      <li><a href="/demo.html">Demo</a></li>
      <li><a href="/support/">Support</a></li>
      <li><a href="/about.html">About</a></li>
    </ul>
    <p>Distributed under the <a href="http://www.gnu.org/licenses/gpl-2.0.txt">GNU v2 license</a> - Yet another <a href="http://www.makesites.cc/">Make Sites</a> production</p>
    <p>Powered by Template Blocks, the visual template engine</p>
  </div>  
  
  
  <!-- Footer End -->
  <!-- Google Analytics Start -->
  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  var pageTracker = _gat._getTracker("UA-440009-11");
  pageTracker._initData();
  pageTracker._trackPageview();
  </script>
  
  <!-- Google Analytics End -->

</div>
</body>
</html>