Index: inc/public/class.dc.template.php
===================================================================
--- inc/public/class.dc.template.php	(revision 3965)
+++ inc/public/class.dc.template.php	(revision 0)
@@ -1,3119 +1,3270 @@
 <?php
-/**
- * @package Dotclear
- * @subpackage Public
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
+if (!defined('DC_RC_PATH')) { return; }
 
 class dcTemplate extends template
 {
-    private $core;
-    private $current_tag;
+	private $core;
+	private $current_tag;
+	
+	protected $unknown_value_handler = null;
+	protected $unknown_block_handler = null;
+	
+	function __construct($cache_dir,$self_name,$core)
+	{
+		parent::__construct($cache_dir,$self_name);
+		
+		$this->remove_php = !$core->blog->settings->system->tpl_allow_php;
+		$this->use_cache = $core->blog->settings->system->tpl_use_cache;
+		
+		$this->tag_block = '<tpl:(\w+)(?:(\s+.*?)>|>)((?:[^<]|<(?!/?tpl:\1)|(?R))*)</tpl:\1>';
+		$this->tag_value = '{{tpl:(\w+)(\s(.*?))?}}';
+		
+		$this->core =& $core;
+		
+		# Transitional tags
+		$this->addValue('EntryTrackbackCount',array($this,'EntryPingCount'));
+		$this->addValue('EntryTrackbackData',array($this,'EntryPingData'));
+		$this->addValue('EntryTrackbackLink',array($this,'EntryPingLink'));
+		
+		# l10n
+		$this->addValue('lang',array($this,'l10n'));
+		
+		# Loops test tags
+		$this->addBlock('LoopPosition',array($this,'LoopPosition'));
+		
+		# Archives
+		$this->addBlock('Archives',array($this,'Archives'));
+		$this->addBlock('ArchivesHeader',array($this,'ArchivesHeader'));
+		$this->addBlock('ArchivesFooter',array($this,'ArchivesFooter'));
+		$this->addBlock('ArchivesYearHeader',array($this,'ArchivesYearHeader'));
+		$this->addBlock('ArchivesYearFooter',array($this,'ArchivesYearFooter'));
+		$this->addValue('ArchiveDate',array($this,'ArchiveDate'));
+		$this->addBlock('ArchiveNext',array($this,'ArchiveNext'));
+		$this->addBlock('ArchivePrevious',array($this,'ArchivePrevious'));
+		$this->addValue('ArchiveEntriesCount',array($this,'ArchiveEntriesCount'));
+		$this->addValue('ArchiveURL',array($this,'ArchiveURL'));
+		
+		# Attachments
+		$this->addBlock('Attachments',array($this,'Attachments'));
+		$this->addBlock('AttachmentsHeader',array($this,'AttachmentsHeader'));
+		$this->addBlock('AttachmentsFooter',array($this,'AttachmentsFooter'));
+		$this->addValue('AttachmentMimeType',array($this,'AttachmentMimeType'));
+		$this->addValue('AttachmentType',array($this,'AttachmentType'));
+		$this->addValue('AttachmentFileName',array($this,'AttachmentFileName'));
+		$this->addValue('AttachmentSize',array($this,'AttachmentSize'));
+		$this->addValue('AttachmentTitle',array($this,'AttachmentTitle'));
+		$this->addValue('AttachmentThumbnailURL',array($this,'AttachmentThumbnailURL'));
+		$this->addValue('AttachmentURL',array($this,'AttachmentURL'));
+		$this->addBlock('AttachmentIf',array($this,'AttachmentIf'));
+		$this->addValue('MediaURL',array($this,'MediaURL'));
+		
+		# Blog
+		$this->addValue('BlogArchiveURL',array($this,'BlogArchiveURL'));
+		$this->addValue('BlogCopyrightNotice',array($this,'BlogCopyrightNotice'));
+		$this->addValue('BlogDescription',array($this,'BlogDescription'));
+		$this->addValue('BlogEditor',array($this,'BlogEditor'));
+		$this->addValue('BlogFeedID',array($this,'BlogFeedID'));
+		$this->addValue('BlogFeedURL',array($this,'BlogFeedURL'));
+		$this->addValue('BlogRSDURL',array($this,'BlogRSDURL'));
+		$this->addValue('BlogName',array($this,'BlogName'));
+		$this->addValue('BlogLanguage',array($this,'BlogLanguage'));
+		$this->addValue('BlogThemeURL',array($this,'BlogThemeURL'));
+		$this->addValue('BlogUpdateDate',array($this,'BlogUpdateDate'));
+		$this->addValue('BlogID',array($this,'BlogID'));
+		$this->addValue('BlogURL',array($this,'BlogURL'));
+		$this->addValue('BlogPublicURL',array($this,'BlogPublicURL'));
+		$this->addValue('BlogQmarkURL',array($this,'BlogQmarkURL'));
+		$this->addValue('BlogMetaRobots',array($this,'BlogMetaRobots'));
+		
+		# Categories
+		$this->addBlock('Categories',array($this,'Categories'));
+		$this->addBlock('CategoriesHeader',array($this,'CategoriesHeader'));
+		$this->addBlock('CategoriesFooter',array($this,'CategoriesFooter'));
+		$this->addBlock('CategoryIf',array($this,'CategoryIf'));
+		$this->addBlock('CategoryFirstChildren',array($this,'CategoryFirstChildren'));
+		$this->addBlock('CategoryParents',array($this,'CategoryParents'));
+		$this->addValue('CategoryFeedURL',array($this,'CategoryFeedURL'));
+		$this->addValue('CategoryURL',array($this,'CategoryURL'));
+		$this->addValue('CategoryShortURL',array($this,'CategoryShortURL'));
+		$this->addValue('CategoryDescription',array($this,'CategoryDescription'));
+		$this->addValue('CategoryTitle',array($this,'CategoryTitle'));
+		
+		# Comments
+		$this->addBlock('Comments',array($this,'Comments'));
+		$this->addValue('CommentAuthor',array($this,'CommentAuthor'));
+		$this->addValue('CommentAuthorDomain',array($this,'CommentAuthorDomain'));
+		$this->addValue('CommentAuthorLink',array($this,'CommentAuthorLink'));
+		$this->addValue('CommentAuthorMailMD5',array($this,'CommentAuthorMailMD5'));
+		$this->addValue('CommentAuthorURL',array($this,'CommentAuthorURL'));
+		$this->addValue('CommentContent',array($this,'CommentContent'));
+		$this->addValue('CommentDate',array($this,'CommentDate'));
+		$this->addValue('CommentTime',array($this,'CommentTime'));
+		$this->addValue('CommentEmail',array($this,'CommentEmail'));
+		$this->addValue('CommentEntryTitle',array($this,'CommentEntryTitle'));
+		$this->addValue('CommentFeedID',array($this,'CommentFeedID'));
+		$this->addValue('CommentID',array($this,'CommentID'));
+		$this->addBlock('CommentIf',array($this,'CommentIf'));
+		$this->addValue('CommentIfFirst',array($this,'CommentIfFirst'));
+		$this->addValue('CommentIfMe',array($this,'CommentIfMe'));
+		$this->addValue('CommentIfOdd',array($this,'CommentIfOdd'));
+		$this->addValue('CommentIP',array($this,'CommentIP'));
+		$this->addValue('CommentOrderNumber',array($this,'CommentOrderNumber'));
+		$this->addBlock('CommentsFooter',array($this,'CommentsFooter'));
+		$this->addBlock('CommentsHeader',array($this,'CommentsHeader'));
+		$this->addValue('CommentPostURL',array($this,'CommentPostURL'));
+		$this->addBlock('IfCommentAuthorEmail',array($this,'IfCommentAuthorEmail'));
+		$this->addValue('CommentHelp',array($this,'CommentHelp'));
+		
+		# Comment preview
+		$this->addBlock('IfCommentPreview',array($this,'IfCommentPreview'));
+		$this->addValue('CommentPreviewName',array($this,'CommentPreviewName'));
+		$this->addValue('CommentPreviewEmail',array($this,'CommentPreviewEmail'));
+		$this->addValue('CommentPreviewSite',array($this,'CommentPreviewSite'));
+		$this->addValue('CommentPreviewContent',array($this,'CommentPreviewContent'));
+		$this->addValue('CommentPreviewCheckRemember',array($this,'CommentPreviewCheckRemember'));
+		
+		# Entries
+		$this->addBlock('DateFooter',array($this,'DateFooter'));
+		$this->addBlock('DateHeader',array($this,'DateHeader'));
+		$this->addBlock('Entries',array($this,'Entries'));
+		$this->addBlock('EntriesFooter',array($this,'EntriesFooter'));
+		$this->addBlock('EntriesHeader',array($this,'EntriesHeader'));
+		$this->addValue('EntryExcerpt',array($this,'EntryExcerpt'));
+		$this->addValue('EntryAttachmentCount',array($this,'EntryAttachmentCount'));
+		$this->addValue('EntryAuthorCommonName',array($this,'EntryAuthorCommonName'));
+		$this->addValue('EntryAuthorDisplayName',array($this,'EntryAuthorDisplayName'));
+		$this->addValue('EntryAuthorEmail',array($this,'EntryAuthorEmail'));
+		$this->addValue('EntryAuthorID',array($this,'EntryAuthorID'));
+		$this->addValue('EntryAuthorLink',array($this,'EntryAuthorLink'));
+		$this->addValue('EntryAuthorURL',array($this,'EntryAuthorURL'));
+		$this->addValue('EntryBasename',array($this,'EntryBasename'));
+		$this->addValue('EntryCategory',array($this,'EntryCategory'));
+		$this->addBlock('EntryCategoriesBreadcrumb',array($this,'EntryCategoriesBreadcrumb'));
+		$this->addValue('EntryCategoryID',array($this,'EntryCategoryID'));
+		$this->addValue('EntryCategoryURL',array($this,'EntryCategoryURL'));
+		$this->addValue('EntryCategoryShortURL',array($this,'EntryCategoryShortURL'));
+		$this->addValue('EntryCommentCount',array($this,'EntryCommentCount'));
+		$this->addValue('EntryContent',array($this,'EntryContent'));
+		$this->addValue('EntryDate',array($this,'EntryDate'));
+		$this->addValue('EntryFeedID',array($this,'EntryFeedID'));
+		$this->addValue('EntryFirstImage',array($this,'EntryFirstImage'));
+		$this->addValue('EntryID',array($this,'EntryID'));
+		$this->addBlock('EntryIf',array($this,'EntryIf'));
+		$this->addValue('EntryIfFirst',array($this,'EntryIfFirst'));
+		$this->addValue('EntryIfOdd',array($this,'EntryIfOdd'));
+		$this->addValue('EntryIfSelected',array($this,'EntryIfSelected'));
+		$this->addValue('EntryLang',array($this,'EntryLang'));
+		$this->addBlock('EntryNext',array($this,'EntryNext'));
+		$this->addValue('EntryPingCount',array($this,'EntryPingCount'));
+		$this->addValue('EntryPingData',array($this,'EntryPingData'));
+		$this->addValue('EntryPingLink',array($this,'EntryPingLink'));
+		$this->addBlock('EntryPrevious',array($this,'EntryPrevious'));
+		$this->addValue('EntryTitle',array($this,'EntryTitle'));
+		$this->addValue('EntryTime',array($this,'EntryTime'));
+		$this->addValue('EntryURL',array($this,'EntryURL'));
+		
+		# Languages
+		$this->addBlock('Languages',array($this,'Languages'));
+		$this->addBlock('LanguagesHeader',array($this,'LanguagesHeader'));
+		$this->addBlock('LanguagesFooter',array($this,'LanguagesFooter'));
+		$this->addValue('LanguageCode',array($this,'LanguageCode'));
+		$this->addBlock('LanguageIfCurrent',array($this,'LanguageIfCurrent'));
+		$this->addValue('LanguageURL',array($this,'LanguageURL'));
+		
+		# Pagination
+		$this->addBlock('Pagination',array($this,'Pagination'));
+		$this->addValue('PaginationCounter',array($this,'PaginationCounter'));
+		$this->addValue('PaginationCurrent',array($this,'PaginationCurrent'));
+		$this->addBlock('PaginationIf',array($this,'PaginationIf'));
+		$this->addValue('PaginationURL',array($this,'PaginationURL'));
+		
+		# Trackbacks
+		$this->addValue('PingBlogName',array($this,'PingBlogName'));
+		$this->addValue('PingContent',array($this,'PingContent'));
+		$this->addValue('PingDate',array($this,'PingDate'));
+		$this->addValue('PingEntryTitle',array($this,'PingEntryTitle'));
+		$this->addValue('PingFeedID',array($this,'PingFeedID'));
+		$this->addValue('PingID',array($this,'PingID'));
+		$this->addValue('PingIfFirst',array($this,'PingIfFirst'));
+		$this->addValue('PingIfOdd',array($this,'PingIfOdd'));
+		$this->addValue('PingIP',array($this,'PingIP'));
+		$this->addValue('PingNoFollow',array($this,'PingNoFollow'));
+		$this->addValue('PingOrderNumber',array($this,'PingOrderNumber'));
+		$this->addValue('PingPostURL',array($this,'PingPostURL'));
+		$this->addBlock('Pings',array($this,'Pings'));
+		$this->addBlock('PingsFooter',array($this,'PingsFooter'));
+		$this->addBlock('PingsHeader',array($this,'PingsHeader'));
+		$this->addValue('PingTime',array($this,'PingTime'));
+		$this->addValue('PingTitle',array($this,'PingTitle'));
+		$this->addValue('PingAuthorURL',array($this,'PingAuthorURL'));
+		
+		# System
+		$this->addValue('SysBehavior',array($this,'SysBehavior'));
+		$this->addBlock('SysIf',array($this,'SysIf'));
+		$this->addBlock('SysIfCommentPublished',array($this,'SysIfCommentPublished'));
+		$this->addBlock('SysIfCommentPending',array($this,'SysIfCommentPending'));
+		$this->addBlock('SysIfFormError',array($this,'SysIfFormError'));
+		$this->addValue('SysFeedSubtitle',array($this,'SysFeedSubtitle'));
+		$this->addValue('SysFormError',array($this,'SysFormError'));
+		$this->addValue('SysPoweredBy',array($this,'SysPoweredBy'));
+		$this->addValue('SysSearchString',array($this,'SysSearchString'));
+		$this->addValue('SysSelfURI',array($this,'SysSelfURI'));
+	}
+	
+	public function getData($________)
+	{
+		# --BEHAVIOR-- tplBeforeData
+		if ($this->core->hasBehavior('tplBeforeData'))
+		{
+			self::$_r = $this->core->callBehavior('tplBeforeData',$this->core);
+			if (self::$_r) {
+				return self::$_r;
+			}
+		}
+		
+		parent::getData($________);
+		
+		# --BEHAVIOR-- tplAfterData
+		if ($this->core->hasBehavior('tplAfterData')) {
+			$this->core->callBehavior('tplAfterData',$this->core,self::$_r);
+		}
+		
+		return self::$_r;
+	}
+	
+	protected function compileFile($file)
+	{
+		$fc = file_get_contents($file);
+		
+		$this->compile_stack[] = $file;
+		
+		# Remove every PHP tags
+		if ($this->remove_php)
+		{
+			$fc = preg_replace('/<\?(?=php|=|\s).*?\?>/ms','',$fc);
+		}
+		
+		# Transform what could be considered as PHP short tags
+		$fc = preg_replace('/(<\?(?!php|=|\s))(.*?)(\?>)/ms',
+		'<?php echo "$1"; ?>$2<?php echo "$3"; ?>',$fc);
+		
+		# Remove template comments <!-- #... -->
+		$fc = preg_replace('/(^\s*)?<!-- #(.*?)-->/ms','',$fc);
+		
+		# Lexer part : split file into small pieces
+		# each array entry will be either a tag or plain text
+		$blocks = preg_split(
+			'#(<tpl:\w+[^>]*>)|(</tpl:\w+>)|({{tpl:\w+[^}]*}})#msu',$fc,-1,
+			PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
+		
+		# Next : build semantic tree from tokens.
+		$rootNode = new tplNode();
+		$node = $rootNode;
+		$errors = array();
+		foreach ($blocks as $id => $block) {
+			$isblock = preg_match('#<tpl:(\w+)(?:(\s+.*?)>|>)|</tpl:(\w+)>|{{tpl:(\w+)(\s(.*?))?}}#ms',$block,$match);
+			if ($isblock == 1) {
+				if (substr($match[0],1,1) == '/') {
+					// Closing tag, check if it matches current opened node
+					$tag = $match[3];
+					if (($node instanceof tplNodeBlock) && $node->getTag() == $tag) {
+						$node->setClosing();
+						$node = $node->getParent();
+					} else {
+						// Closing tag does not match opening tag
+						// Search if it closes a parent tag
+						$search = $node;
+						while($search->getTag() != 'ROOT' && $search->getTag() != $tag) {
+							$search = $search->getParent();
+						}
+						if ($search->getTag() == $tag) {
+							$errors[] = sprintf(
+								__('Did not find closing tag for block <tpl:%s>. Content has been ignored.'),
+								html::escapeHTML($node->getTag()));
+							$search->setClosing();
+							$node = $search->getParent();
+						} else {
+							$errors[]=sprintf(
+								__('Unexpected closing tag </tpl:%s> found.'),
+								$tag);;
+						}
+					}
+				} elseif (substr($match[0],0,1) == '{') {
+					// Value tag
+					$tag = $match[4];
+					$str_attr = '';
+					$attr = array();
+					if (isset($match[6])) {
+						$str_attr = $match[6];
+						$attr = $this->getAttrs($match[6]);
+					}
+					$node->addChild(new tplNodeValue($tag,$attr,$str_attr));
+				} else {
+					// Opening tag, create new node and dive into it
+					$tag = $match[1];
+					$newnode = new tplNodeBlock($tag,isset($match[2])?$this->getAttrs($match[2]):array());
+					$node->addChild($newnode);
+					$node = $newnode;
+				}
+			} else {
+				// Simple text
+				$node->addChild(new tplNodeText($block));
+			}
+		}
+		
+		$err = "";
+		if (count($errors) > 0) {
+			$err = "\n\n<!-- \n".
+				__('WARNING: the following errors have been found while parsing template file :').
+				"\n * ".
+				join("\n * ",$errors).
+				"\n -->\n";
+		}
+		
+		return $rootNode->compile($this).$err;
+	}
+    
+	public function compileBlockNode($tag,$attr,$content)
+	{
+		$this->current_tag = $tag;
+		$attr = new ArrayObject($attr);
+		# --BEHAVIOR-- templateBeforeBlock
+		$res = $this->core->callBehavior('templateBeforeBlock',$this->core,$this->current_tag,$attr);
+		
+		if (isset($this->blocks[$this->current_tag])) {
+			$res .= call_user_func($this->blocks[$this->current_tag],$attr,$content);
+		} elseif ($this->unknown_block_handler != null) {
+			$res .= call_user_func($this->unknown_block_handler,$this->current_tag,$attr,$content);
+		}
+		
+		# --BEHAVIOR-- templateAfterBlock
+		$res .= $this->core->callBehavior('templateAfterBlock',$this->core,$this->current_tag,$attr);
+		
+		return $res;
+	}
+	
+	public function compileValueNode($tag,$attr,$str_attr)
+	{
+		$this->current_tag = $tag;
+		
+		$attr = new ArrayObject($attr);
+		# --BEHAVIOR-- templateBeforeValue
+		$res = $this->core->callBehavior('templateBeforeValue',$this->core,$this->current_tag,$attr);
+		
+		if (isset($this->values[$this->current_tag])) {
+			$res .= call_user_func($this->values[$this->current_tag],$attr,ltrim($str_attr));
+		} elseif ($this->unknown_value_handler != null) {
+			$res .= call_user_func($this->unknown_value_handler,$this->current_tag,$attr,$str_attr);
+		}
+        
+		# --BEHAVIOR-- templateAfterValue
+		$res .= $this->core->callBehavior('templateAfterValue',$this->core,$this->current_tag,$attr);
+		
+		return $res;
+	}
+    
+	public function setUnknownValueHandler($callback)
+	{
+		if (is_callable($callback)) {
+			$this->unknown_value_handler = $callback;
+		}
+	}
+    
+	public function setUnknownBlockHandler($callback)
+	{
+		if (is_callable($callback)) {
+			$this->unknown_block_handler = $callback;
+		}
+	}
+    
+	public function getFilters($attr)
+	{
+		$p[0] = '0';	# encode_xml
+		$p[1] = '0';	# remove_html
+		$p[2] = '0';	# cut_string
+		$p[3] = '0';	# lower_case
+		$p[4] = '0';	# upper_case
+		
+		$p[0] = (integer) (!empty($attr['encode_xml']) || !empty($attr['encode_html']));
+		$p[1] = (integer) !empty($attr['remove_html']);
+		
+		if (!empty($attr['cut_string']) && (integer) $attr['cut_string'] > 0) {
+			$p[2] = (integer) $attr['cut_string'];
+		}
+		
+		$p[3] = (integer) !empty($attr['lower_case']);
+		$p[4] = (integer) !empty($attr['upper_case']);
+		
+		return "context::global_filter(%s,".implode(",",$p).",'".addslashes($this->current_tag)."')";
+	}
+	
+	public static function getOperator($op)
+	{
+		switch (strtolower($op))
+		{
+			case 'or':
+			case '||':
+				return '||';
+			case 'and':
+			case '&&':
+			default:
+				return '&&';
+		}
+	}
+	
+	public function getSortByStr($attr,$table = null)
+	{
+		$res = array();
+		
+		$default_order = 'desc';
+		
+		$default_alias = array(
+			'post' => array(
+				'title' => 'post_title',
+				'selected' => 'post_selected',
+				'author' => 'user_id',
+				'date' => 'post_dt',
+				'id' => 'post_id',
+				'comment' => 'nb_comment',
+				'trackback' => 'nb_trackback'
+			),
+			'comment' => array(
+				'author' => 'comment_author',
+				'date' => 'comment_dt',
+				'id' => 'comment_id'
+			)
+		);
+		
+		$alias = new ArrayObject();
+		
+		# --BEHAVIOR-- templateCustomSortByAlias
+		$this->core->callBehavior('templateCustomSortByAlias',$alias);
+		
+		$alias = $alias->getArrayCopy();
+		
+		if (is_array($alias)) {
+			foreach ($alias as $k => $v) {
+				if (!is_array($v)) {
+					$alias[$k] = array();
+				}
+				if (!is_array($v)) {
+					$default_alias[$k] = array();
+				}
+				$default_alias[$k] = array_merge($default_alias[$k],$alias[$k]);
+			}
+		}
+		
+		if (!array_key_exists($table,$default_alias)) {
+			return implode(', ',$res);
+		}
+		
+		if (isset($attr['order']) && preg_match('/^(desc|asc)$/i',$attr['order'])) {
+			$default_order = $attr['order'];
+		}
+		if (isset($attr['sortby'])) {
+			$sorts = explode(',',$attr['sortby']);
+			foreach ($sorts as $k => $sort) {
+				$order = $default_order;
+				if (preg_match('/([a-z]*)\s*\?(desc|asc)$/i',$sort,$matches)) {
+					$sort = $matches[1];
+					$order = $matches[2];
+				}
+				if (array_key_exists($sort,$default_alias[$table])) {
+					array_push($res,$default_alias[$table][$sort].' '.$order);
+				}
+			}
+		}
+		
+		if (count($res) === 0) {
+			array_push($res,$default_alias[$table]['date'].' '.$default_order);
+		}
+		
+		return implode(', ',$res);
+	}
+	
+	public function getAge($attr)
+	{
+		if (isset($attr['age']) && preg_match('/^(\-[0-9]+|last).*$/i',$attr['age'])) {
+			if (($ts = strtotime($attr['age'])) !== false) {
+				return dt::str('%Y-%m-%d %H:%m:%S',$ts);
+			}
+		}
+		return '';
+	}
+	
+	/* TEMPLATE FUNCTIONS
+	------------------------------------------------------- */
+	
+	public function l10n($attr,$str_attr)
+	{
+		# Normalize content
+		$str_attr = preg_replace('/\s+/x',' ',$str_attr);
+		
+		return "<?php echo __('".str_replace("'","\\'",$str_attr)."'); ?>";
+	}
+	
+	public function LoopPosition($attr,$content)
+	{
+		$start = isset($attr['start']) ? (integer) $attr['start'] : '0';
+		$length = isset($attr['length']) ? (integer) $attr['length'] : 'null';
+		$even = isset($attr['even']) ? (integer) (boolean) $attr['even'] : 'null';
+		
+		if ($start > 0) {
+			$start--;
+		}
+		
+		return
+		'<?php if ($_ctx->loopPosition('.$start.','.$length.','.$even.')) : ?>'.
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	
+	/* Archives ------------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:Archives - - -- Archives dates loop -->
+	<!ATTLIST tpl:Archives
+	type		(day|month|year)	#IMPLIED	-- Get days, months or years, default to month --
+	category	CDATA			#IMPLIED  -- Get dates of given category --
+	no_context (1|0)			#IMPLIED  -- Override context information
+	order	(asc|desc)		#IMPLIED  -- Sort asc or desc --
+	post_type	CDATA			#IMPLIED  -- Get dates of given type of entries, default to post --
+	post_lang	CDATA		#IMPLIED  -- Filter on the given language
+	>
+	*/
+	public function Archives($attr,$content)
+	{
+		$p = "if (!isset(\$params)) \$params = array();\n";
+		$p .= "\$params['type'] = 'month';\n";
+		if (isset($attr['type'])) {
+			$p .= "\$params['type'] = '".addslashes($attr['type'])."';\n";
+		}
+		
+		if (isset($attr['category'])) {
+			$p .= "\$params['cat_url'] = '".addslashes($attr['category'])."';\n";
+		}
+        
+		if (isset($attr['post_type'])) {
+			$p .= "\$params['post_type'] = '".addslashes($attr['post_type'])."';\n";
+		}
+        
+		if (isset($attr['post_lang'])) {
+			$p .= "\$params['post_lang'] = '".addslashes($attr['post_lang'])."';\n";
+		}
+		
+		if (empty($attr['no_context']))
+		{
+			$p .=
+			'if ($_ctx->exists("categories")) { '.
+				"\$params['cat_id'] = \$_ctx->categories->cat_id; ".
+			"}\n";
+		}
+		
+		$order = 'desc';
+		if (isset($attr['order']) && preg_match('/^(desc|asc)$/i',$attr['order'])) {
+			$p .= "\$params['order'] = '".$attr['order']."';\n ";
+		}
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);'."\n";
+		$res .= "?>\n";
+		
+		$res .=
+		'<?php while ($_ctx->archives->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->archives = null; ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchivesHeader - - -- First archives result container -->
+	*/
+	public function ArchivesHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->archives->isStart()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchivesFooter - - -- Last archives result container -->
+	*/
+	public function ArchivesFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->archives->isEnd()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchivesYearHeader - - -- First result of year in archives container -->
+	*/
+	public function ArchivesYearHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->archives->yearHeader()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchivesYearFooter - - -- Last result of year in archives container -->
+	*/
+	public function ArchivesYearFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->archives->yearFooter()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchiveDate - O -- Archive result date -->
+	<!ATTLIST tpl:ArchiveDate
+	format	CDATA	#IMPLIED  -- Date format (Default %B %Y) --
+	>
+	*/
+	public function ArchiveDate($attr)
+	{
+		$format = '%B %Y';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"dt::dt2str('".$format."',\$_ctx->archives->dt)").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchiveEntriesCount - O -- Current archive result number of entries -->
+	*/
+	public function ArchiveEntriesCount($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->archives->nb_post').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchiveNext - - -- Next archive result container -->
+	<!ATTLIST tpl:ArchiveNext
+	type		(day|month|year)	#IMPLIED	-- Get days, months or years, default to month --
+	post_type	CDATA			#IMPLIED  -- Get dates of given type of entries, default to post --
+	post_lang	CDATA		#IMPLIED  -- Filter on the given language
+	>
+	*/
+	public function ArchiveNext($attr,$content)
+	{
+		$p = "if (!isset(\$params)) \$params = array();\n";
+		$p .= "\$params['type'] = 'month';\n";
+		if (isset($attr['type'])) {
+			$p .= "\$params['type'] = '".addslashes($attr['type'])."';\n";
+		}
+		
+		if (isset($attr['post_type'])) {
+			$p .= "\$params['post_type'] = '".addslashes($attr['post_type'])."';\n";
+		}
+		
+		if (isset($attr['post_lang'])) {
+			$p .= "\$params['post_lang'] = '".addslashes($attr['post_lang'])."';\n";
+		}
+        
+		$p .= "\$params['next'] = \$_ctx->archives->dt;";
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);'."\n";
+		$res .= "?>\n";
+		
+		$res .=
+		'<?php while ($_ctx->archives->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->archives = null; ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchivePrevious - - -- Previous archive result container -->
+	<!ATTLIST tpl:ArchivePrevious
+	type		(day|month|year)	#IMPLIED	-- Get days, months or years, default to month --
+	post_type	CDATA			#IMPLIED  -- Get dates of given type of entries, default to post --
+	post_lang	CDATA		#IMPLIED  -- Filter on the given language
+	>
+	*/
+	public function ArchivePrevious($attr,$content)
+	{
+		$p = 'if (!isset($params)) $params = array();';
+		$p .= "\$params['type'] = 'month';\n";
+		if (isset($attr['type'])) {
+			$p .= "\$params['type'] = '".addslashes($attr['type'])."';\n";
+		}
+		
+		if (isset($attr['post_type'])) {
+			$p .= "\$params['post_type'] = '".addslashes($attr['post_type'])."';\n";
+		}
+        
+		if (isset($attr['post_lang'])) {
+			$p .= "\$params['post_lang'] = '".addslashes($attr['post_lang'])."';\n";
+		}
+        
+		$p .= "\$params['previous'] = \$_ctx->archives->dt;";
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);'."\n";
+		$res .= "?>\n";
+		
+		$res .=
+		'<?php while ($_ctx->archives->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->archives = null; ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:ArchiveURL - O -- Current archive result URL -->
+	*/
+	public function ArchiveURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->archives->url($core)').'; ?>';
+	}
+	
+	/* Attachments ---------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:Attachments - - -- Post Attachments loop -->
+	*/
+	public function Attachments($attr,$content)
+	{
+		$res =
+		"<?php\n".
+		'if ($_ctx->posts !== null && $core->media) {'."\n".
+			'$_ctx->attachments = new ArrayObject($core->media->getPostMedia($_ctx->posts->post_id));'."\n".
+		"?>\n".
+		
+		'<?php foreach ($_ctx->attachments as $attach_i => $attach_f) : '.
+		'$GLOBALS[\'attach_i\'] = $attach_i; $GLOBALS[\'attach_f\'] = $attach_f;'.
+		'$_ctx->file_url = $attach_f->file_url; ?>'.
+		$content.
+		'<?php endforeach; $_ctx->attachments = null; unset($attach_i,$attach_f,$_ctx->file_url); ?>'.
+		
+		"<?php } ?>\n";
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentsHeader - - -- First attachments result container -->
+	*/
+	public function AttachmentsHeader($attr,$content)
+	{
+		return
+		"<?php if (\$attach_i == 0) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentsFooter - - -- Last attachments result container -->
+	*/
+	public function AttachmentsFooter($attr,$content)
+	{
+		return
+		"<?php if (\$attach_i+1 == count(\$_ctx->attachments)) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentsIf - - -- Test on attachment fields -->
+	<!ATTLIST tpl:AttachmentIf
+	is_image	(0|1)	#IMPLIED	-- test if attachment is an image (value : 1) or not (value : 0)
+	has_thumb	(0|1)	#IMPLIED	-- test if attachment has a square thumnail (value : 1) or not (value : 0)
+	is_mp3	(0|1)	#IMPLIED	-- test if attachment is a mp3 file (value : 1) or not (value : 0)
+	is_flv	(0|1)	#IMPLIED	-- test if attachment is a flv file (value : 1) or not (value : 0)
+	>
+	*/
+	public function AttachmentIf($attr,$content)
+	{
+		$if = array();
+		
+		$operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
+		
+		if (isset($attr['is_image'])) {
+			$sign = (boolean) $attr['is_image'] ? '' : '!';
+			$if[] = $sign.'$attach_f->media_image';
+		}
+		
+		if (isset($attr['has_thumb'])) {
+			$sign = (boolean) $attr['has_thumb'] ? '' : '!';
+			$if[] = $sign.'isset($attach_f->media_thumb[\'sq\'])';
+		}
+		
+		if (isset($attr['is_mp3'])) {
+			$sign = (boolean) $attr['is_mp3'] ? '==' : '!=';
+			$if[] = '$attach_f->type '.$sign.' "audio/mpeg3"';
+		}
+		
+		if (isset($attr['is_flv'])) {
+			$sign = (boolean) $attr['is_flv'] ? '' : '!';
+			$if[] = $sign.
+				'($attach_f->type == "video/x-flv" || '.
+				'$attach_f->type == "video/mp4" || '.
+				'$attach_f->type == "video/x-m4v")';
+		}
+		
+		if (!empty($if)) {
+			return '<?php if('.implode(' '.$operator.' ',$if).') : ?>'.$content.'<?php endif; ?>';
+		} else {
+			return $content;
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentMimeType - O -- Attachment MIME Type -->
+	*/
+	public function AttachmentMimeType($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$attach_f->type').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentType - O -- Attachment type -->
+	*/
+	public function AttachmentType($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$attach_f->media_type').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentFileName - O -- Attachment file name -->
+	*/
+	public function AttachmentFileName($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$attach_f->basename').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentSize - O -- Attachment size -->
+	<!ATTLIST tpl:AttachmentSize
+	full	CDATA	#IMPLIED	-- if set, size is rounded to a human-readable value (in KB, MB, GB, TB)
+	>
+	*/
+	public function AttachmentSize($attr)
+	{
+		$f = $this->getFilters($attr);
+		if (!empty($attr['full'])) {
+			return '<?php echo '.sprintf($f,'$attach_f->size').'; ?>';
+		}
+		return '<?php echo '.sprintf($f,'files::size($attach_f->size)').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentTitle - O -- Attachment title -->
+	*/
+	public function AttachmentTitle($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$attach_f->media_title').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentThumbnailURL - O -- Attachment square thumbnail URL -->
+	*/
+	public function AttachmentThumbnailURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return
+		'<?php '.
+		'if (isset($attach_f->media_thumb[\'sq\'])) {'.
+			'echo '.sprintf($f,'$attach_f->media_thumb[\'sq\']').';'.
+		'}'.
+		'?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:AttachmentURL - O -- Attachment URL -->
+	*/
+	public function AttachmentURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$attach_f->file_url').'; ?>';
+	}
+	
+	public function MediaURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->file_url').'; ?>';
+	}
+	
+	/* Blog ----------------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:BlogArchiveURL - O -- Blog Archives URL -->
+	*/
+	public function BlogArchiveURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("archive")').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogCopyrightNotice - O -- Blog copyrght notices -->
+	*/
+	public function BlogCopyrightNotice($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->settings->system->copyright_notice').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogDescription - O -- Blog Description -->
+	*/
+	public function BlogDescription($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->desc').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogEditor - O -- Blog Editor -->
+	*/
+	public function BlogEditor($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->settings->system->editor').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogFeedID - O -- Blog Feed ID -->
+	*/
+	public function BlogFeedID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'"urn:md5:".$core->blog->uid').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogFeedURL - O -- Blog Feed URL -->
+	<!ATTLIST tpl:BlogFeedURL
+	type	(rss2|atom)	#IMPLIED	-- feed type (default : rss2)
+	>
+	*/
+	public function BlogFeedURL($attr)
+	{
+		$type = !empty($attr['type']) ? $attr['type'] : 'atom';
+		
+		if (!preg_match('#^(rss2|atom)$#',$type)) {
+			$type = 'atom';
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("feed")."/'.$type.'"').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogName - O -- Blog Name -->
+	*/
+	public function BlogName($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->name').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogLanguage - O -- Blog Language -->
+	*/
+	public function BlogLanguage($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->settings->system->lang').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogThemeURL - O -- Blog's current Themei URL -->
+	*/
+	public function BlogThemeURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->settings->system->themes_url."/".$core->blog->settings->system->theme').'; ?>';
+	}
+    
+	/*dtd
+	<!ELEMENT tpl:BlogPublicURL - O -- Blog Public directory URL -->
+	*/
+	public function BlogPublicURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->settings->system->public_url').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogUpdateDate - O -- Blog last update date -->
+	<!ATTLIST tpl:BlogUpdateDate
+	format	CDATA	#IMPLIED	-- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
+	iso8601	CDATA	#IMPLIED	-- if set, tells that date format is ISO 8601
+	rfc822	CDATA	#IMPLIED	-- if set, tells that date format is RFC 822
+	>
+	*/
+	public function BlogUpdateDate($attr)
+	{
+		$format = '';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		} else {
+			$format = '%Y-%m-%d %H:%M:%S';
+		}
+		
+		$iso8601 = !empty($attr['iso8601']);
+		$rfc822 = !empty($attr['rfc822']);
+		
+		$f = $this->getFilters($attr);
+		
+		if ($rfc822) {
+			return '<?php echo '.sprintf($f,"dt::rfc822(\$core->blog->upddt,\$core->blog->settings->system->blog_timezone)").'; ?>';
+		} elseif ($iso8601) {
+			return '<?php echo '.sprintf($f,"dt::iso8601(\$core->blog->upddt,\$core->blog->settings->system->blog_timezone)").'; ?>';
+		} else {
+			return '<?php echo '.sprintf($f,"dt::str('".$format."',\$core->blog->upddt)").'; ?>';
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogID - 0 -- Blog ID -->
+	*/
+	public function BlogID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->id').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogRSDURL - O -- Blog RSD URL -->
+	*/
+	public function BlogRSDURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase(\'rsd\')').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogURL - O -- Blog URL -->
+	*/
+	public function BlogURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->url').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogQmarkURL - O -- Blog URL, ending with a question mark -->
+	*/
+	public function BlogQmarkURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->getQmarkURL()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:BlogMetaRobots - O -- Blog meta robots tag definition, overrides robots_policy setting -->
+	<!ATTLIST tpl:BlogMetaRobots
+	robots	CDATA	#IMPLIED	-- can be INDEX,FOLLOW,NOINDEX,NOFOLLOW,ARCHIVE,NOARCHIVE
+	>
+	*/
+	public function BlogMetaRobots($attr)
+	{
+		$robots = isset($attr['robots']) ? addslashes($attr['robots']) : '';
+		return "<?php echo context::robotsPolicy(\$core->blog->settings->system->robots_policy,'".$robots."'); ?>";
+	}
+	
+	/* Categories ----------------------------------------- */
+	
+	/*dtd
+	<!ELEMENT tpl:Categories - - -- Categories loop -->
+	*/
+	public function Categories($attr,$content)
+	{
+		$p = "if (!isset(\$params)) \$params = array();\n";
+		
+		if (isset($attr['url'])) {
+			$p .= "\$params['cat_url'] = '".addslashes($attr['url'])."';\n";
+		}
+		
+		if (!empty($attr['post_type'])) {
+			$p .= "\$params['post_type'] = '".addslashes($attr['post_type'])."';\n";
+		}
+		
+		if (!empty($attr['level'])) {
+			$p .= "\$params['level'] = ".(integer) $attr['level'].";\n";
+		}
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->categories = $core->blog->getCategories($params);'."\n";
+		$res .= "?>\n";
+		$res .= '<?php while ($_ctx->categories->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->categories = null; unset($params); ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoriesHeader - - -- First Categories result container -->
+	*/
+	public function CategoriesHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->categories->isStart()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoriesFooter - - -- Last Categories result container -->
+	*/
+	public function CategoriesFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->categories->isEnd()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryIf - - -- tests on current entry -->
+	<!ATTLIST tpl:CategoryIf
+	url		CDATA	#IMPLIED	-- category has given url
+	has_entries	(0|1)	#IMPLIED	-- post is the first post from list (value : 1) or not (value : 0)
+	has_description     (0|1)     #IMPLIED  -- category has description (value : 1) or not (value : 0) 
+	>
+	*/
+	public function CategoryIf($attr,$content)
+	{
+		$if = array();
+		$operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
+		
+		if (isset($attr['url'])) {
+			$url = addslashes(trim($attr['url']));
+			if (substr($url,0,1) == '!') {
+				$url = substr($url,1);
+				$if[] = '($_ctx->categories->cat_url != "'.$url.'")';
+			} else {
+				$if[] = '($_ctx->categories->cat_url == "'.$url.'")';
+			}
+		}
+		
+		if (isset($attr['has_entries'])) {
+			$sign = (boolean) $attr['has_entries'] ? '>' : '==';
+			$if[] = '$_ctx->categories->nb_post '.$sign.' 0';
+		}
+		
+		if (isset($attr['has_description'])) { 
+			$sign = (boolean) $attr['has_description'] ? '!=' : '=='; 
+			$if[] = '$_ctx->categories->cat_desc '.$sign.' ""'; 
+		} 
+		
+		if (!empty($if)) {
+			return '<?php if('.implode(' '.$operator.' ',$if).') : ?>'.$content.'<?php endif; ?>';
+		} else {
+			return $content;
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryFirstChildren - - -- Current category first children loop -->
+	*/
+	public function CategoryFirstChildren($attr,$content)
+	{
+		return
+		"<?php\n".
+		'$_ctx->categories = $core->blog->getCategoryFirstChildren($_ctx->categories->cat_id);'."\n".
+		'while ($_ctx->categories->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->categories = null; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryParents - - -- Current category parents loop -->
+	*/
+	public function CategoryParents($attr,$content)
+	{
+		return
+		"<?php\n".
+		'$_ctx->categories = $core->blog->getCategoryParents($_ctx->categories->cat_id);'."\n".
+		'while ($_ctx->categories->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->categories = null; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryFeedURL - O -- Category feed URL -->
+	<!ATTLIST tpl:CategoryFeedURL
+	type	(rss2|atom)	#IMPLIED	-- feed type (default : rss2)
+	>
+	*/
+	public function CategoryFeedURL($attr)
+	{
+		$type = !empty($attr['type']) ? $attr['type'] : 'atom';
+		
+		if (!preg_match('#^(rss2|atom)$#',$type)) {
+			$type = 'atom';
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("feed")."/category/".'.
+		'$_ctx->categories->cat_url."/'.$type.'"').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryURL - O -- Category URL (complete iabsolute URL, including blog URL) -->
+	*/
+	public function CategoryURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("category")."/".$_ctx->categories->cat_url').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryShortURL - O -- Category short URL (relative URL, from /category/) -->
+	*/
+	public function CategoryShortURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->categories->cat_url').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryDescription - O -- Category description -->
+	*/
+	public function CategoryDescription($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->categories->cat_desc').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CategoryTitle - O -- Category title -->
+	*/
+	public function CategoryTitle($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->categories->cat_title').'; ?>';
+	}
+	
+	/* Entries -------------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:Entries - - -- Blog Entries loop -->
+	<!ATTLIST tpl:Entries
+	lastn	CDATA	#IMPLIED	-- limit number of results to specified value
+	author	CDATA	#IMPLIED	-- get entries for a given user id
+	category	CDATA	#IMPLIED	-- get entries for specific categories only (multiple comma-separated categories can be specified. Use "!" as prefix to exclude a category)
+	no_category	CDATA	#IMPLIED	-- get entries without category
+	no_context (1|0)	#IMPLIED  -- Override context information
+	sortby	(title|selected|author|date|id)	#IMPLIED	-- specify entries sort criteria (default : date) (multiple comma-separated sortby can be specified. Use "?asc" or "?desc" as suffix to provide an order for each sorby)
+	order	(desc|asc)	#IMPLIED	-- specify entries order (default : desc)
+	no_content	(0|1)	#IMPLIED	-- do not retrieve entries content
+	selected	(0|1)	#IMPLIED	-- retrieve posts marked as selected only (value: 1) or not selected only (value: 0)
+	url		CDATA	#IMPLIED	-- retrieve post by its url
+	type		CDATA	#IMPLIED	-- retrieve post with given post_type (there can be many ones separated by comma)
+	age		CDATA	#IMPLIED	-- retrieve posts by maximum age (ex: -2 days, last month, last week)
+	ignore_pagination	(0|1)	#IMPLIED	-- ignore page number provided in URL (useful when using multiple tpl:Entries on the same page)
+	>
+	*/
+	public function Entries($attr,$content)
+	{
+		$lastn = -1;
+		if (isset($attr['lastn'])) {
+			$lastn = abs((integer) $attr['lastn'])+0;
+		}
+		
+		$p = 'if (!isset($_page_number)) { $_page_number = 1; }'."\n";
+		
+		if ($lastn != 0) {
+			if ($lastn > 0) {
+				$p .= "\$params['limit'] = ".$lastn.";\n";
+			} else {
+				$p .= "\$params['limit'] = \$_ctx->nb_entry_per_page;\n";
+			}
+			
+			if (!isset($attr['ignore_pagination']) || $attr['ignore_pagination'] == "0") {
+				$p .= "\$params['limit'] = array(((\$_page_number-1)*\$params['limit']),\$params['limit']);\n";
+			} else {
+				$p .= "\$params['limit'] = array(0, \$params['limit']);\n";
+			}
+		}
+		
+		if (isset($attr['author'])) {
+			$p .= "\$params['user_id'] = '".addslashes($attr['author'])."';\n";
+		}
+		
+		if (isset($attr['category'])) {
+			$p .= "\$params['cat_url'] = '".addslashes($attr['category'])."';\n";
+			$p .= "context::categoryPostParam(\$params);\n";
+		}
+		
+		if (isset($attr['no_category']) && $attr['no_category']) {
+			$p .= "@\$params['sql'] .= ' AND P.cat_id IS NULL ';\n";
+			$p .= "unset(\$params['cat_url']);\n";
+		}
+		
+		if (!empty($attr['type'])) {
+			$p .= "\$params['post_type'] = preg_split('/\s*,\s*/','".addslashes($attr['type'])."',-1,PREG_SPLIT_NO_EMPTY);\n";
+		}
+		
+		if (!empty($attr['url'])) {
+			$p .= "\$params['post_url'] = '".addslashes($attr['url'])."';\n";
+		}
+		
+		if (empty($attr['no_context']))
+		{
+			$p .=
+			'if ($_ctx->exists("users")) { '.
+				"\$params['user_id'] = \$_ctx->users->user_id; ".
+			"}\n";
+			
+			$p .=
+			'if ($_ctx->exists("categories")) { '.
+				"\$params['cat_id'] = \$_ctx->categories->cat_id; ".
+			"}\n";
+			
+			$p .=
+			'if ($_ctx->exists("archives")) { '.
+				"\$params['post_year'] = \$_ctx->archives->year(); ".
+				"\$params['post_month'] = \$_ctx->archives->month(); ";
+			if (!isset($attr['lastn'])) {
+				$p .= "unset(\$params['limit']); ";
+			}
+			$p .=
+			"}\n";
+			
+			$p .=
+			'if ($_ctx->exists("langs")) { '.
+				"\$params['post_lang'] = \$_ctx->langs->post_lang; ".
+			"}\n";
+			
+			$p .=
+			'if (isset($_search)) { '.
+				"\$params['search'] = \$_search; ".
+			"}\n";
+		}
+		
+		$p .= "\$params['order'] = '".$this->getSortByStr($attr,'post')."';\n";
+		
+		if (isset($attr['no_content']) && $attr['no_content']) {
+			$p .= "\$params['no_content'] = true;\n";
+		}
+		
+		if (isset($attr['selected'])) {
+			$p .= "\$params['post_selected'] = ".(integer) (boolean) $attr['selected'].";";
+		}
+		
+		if (isset($attr['age'])) {
+			$age = $this->getAge($attr);
+			$p .= !empty($age) ? "@\$params['sql'] .= ' AND P.post_dt > \'".$age."\'';\n" : '';
+		}
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->post_params = $params;'."\n";
+		$res .= '$_ctx->posts = $core->blog->getPosts($params); unset($params);'."\n";
+		$res .= "?>\n";
+		
+		$res .=
+		'<?php while ($_ctx->posts->fetch()) : ?>'.$content.'<?php endwhile; '.
+		'$_ctx->posts = null; $_ctx->post_params = null; ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:DateHeader - O -- Displays date, if post is the first post of the given day -->
+	*/
+	public function DateHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->posts->firstPostOfDay()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:DateFooter - O -- Displays date,  if post is the last post of the given day -->
+	*/
+	public function DateFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->posts->lastPostOfDay()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryIf - - -- tests on current entry -->
+	<!ATTLIST tpl:EntryIf
+	type	CDATA	#IMPLIED	-- post has a given type (default: "post")
+	category	CDATA	#IMPLIED	-- post has a given category
+	first	(0|1)	#IMPLIED	-- post is the first post from list (value : 1) or not (value : 0)
+	odd	(0|1)	#IMPLIED	-- post is in an odd position (value : 1) or not (value : 0)
+	even	(0|1)	#IMPLIED	-- post is in an even position (value : 1) or not (value : 0)
+	extended	(0|1)	#IMPLIED	-- post has an excerpt (value : 1) or not (value : 0)
+	selected	(0|1)	#IMPLIED	-- post is selected (value : 1) or not (value : 0)
+	has_category	(0|1)	#IMPLIED	-- post has a category (value : 1) or not (value : 0)
+	has_attachment	(0|1)	#IMPLIED	-- post has attachments (value : 1) or not (value : 0)
+	comments_active	(0|1)	#IMPLIED	-- comments are active for this post (value : 1) or not (value : 0)
+	pings_active	(0|1)	#IMPLIED	-- trackbacks are active for this post (value : 1) or not (value : 0)
+	show_comments	(0|1)	#IMPLIED	-- there are comments for this post (value : 1) or not (value : 0)
+	show_pings	(0|1)	#IMPLIED	-- there are trackbacks for this post (value : 1) or not (value : 0)
+	operator	(and|or)	#IMPLIED	-- combination of conditions, if more than 1 specifiec (default: and)
+	url		CDATA	#IMPLIED	-- post has given url
+	>
+	*/
+	public function EntryIf($attr,$content)
+	{
+		$if = array();
+		$extended = null;
+		$hascategory = null;
+		
+		$operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
+        
+		if (isset($attr['type'])) {
+			$type = trim($attr['type']);
+			$type = !empty($type)?$type:'post';
+			$if[] = '$_ctx->posts->post_type == "'.addslashes($type).'"';
+		}
+		
+		if (isset($attr['url'])) {
+			$url = trim($attr['url']);
+			if (substr($url,0,1) == '!') {
+				$url = substr($url,1);
+				$if[] = '$_ctx->posts->post_url != "'.addslashes($url).'"';
+			} else {
+				$if[] = '$_ctx->posts->post_url == "'.addslashes($url).'"';
+			}
+		}
+		
+		if (isset($attr['category'])) {
+			$category = addslashes(trim($attr['category']));
+			if (substr($category,0,1) == '!') {
+				$category = substr($category,1);
+				$if[] = '($_ctx->posts->cat_url != "'.$category.'")';
+			} else {
+				$if[] = '($_ctx->posts->cat_url == "'.$category.'")';
+			}
+		}
+		
+		if (isset($attr['first'])) {
+			$sign = (boolean) $attr['first'] ? '=' : '!';
+			$if[] = '$_ctx->posts->index() '.$sign.'= 0';
+		}
+		
+		if (isset($attr['odd'])) {
+			$sign = (boolean) $attr['odd'] ? '=' : '!';
+			$if[] = '($_ctx->posts->index()+1)%2 '.$sign.'= 1';
+		}
+		
+		if (isset($attr['extended'])) {
+			$sign = (boolean) $attr['extended'] ? '' : '!';
+			$if[] = $sign.'$_ctx->posts->isExtended()';
+		}
+		
+		if (isset($attr['selected'])) {
+			$sign = (boolean) $attr['selected'] ? '' : '!';
+			$if[] = $sign.'(boolean)$_ctx->posts->post_selected';
+		}
+		
+		if (isset($attr['has_category'])) {
+			$sign = (boolean) $attr['has_category'] ? '' : '!';
+			$if[] = $sign.'$_ctx->posts->cat_id';
+		}
+		
+		if (isset($attr['has_attachment'])) {
+			$sign = (boolean) $attr['has_attachment'] ? '' : '!';
+			$if[] = $sign.'$_ctx->posts->countMedia()';
+		}
+		
+		if (isset($attr['comments_active'])) {
+			$sign = (boolean) $attr['comments_active'] ? '' : '!';
+			$if[] = $sign.'$_ctx->posts->commentsActive()';
+		}
+		
+		if (isset($attr['pings_active'])) {
+			$sign = (boolean) $attr['pings_active'] ? '' : '!';
+			$if[] = $sign.'$_ctx->posts->trackbacksActive()';
+		}
+		
+		if (isset($attr['has_comment'])) {
+			$sign = (boolean) $attr['has_comment'] ? '' : '!';
+			$if[] = $sign.'$_ctx->posts->hasComments()';
+		}
+		
+		if (isset($attr['has_ping'])) {
+			$sign = (boolean) $attr['has_ping'] ? '' : '!';
+			$if[] = $sign.'$_ctx->posts->hasTrackbacks()';
+		}
+		
+		if (isset($attr['show_comments'])) {
+			if ((boolean) $attr['show_comments']) {
+				$if[] = '($_ctx->posts->hasComments() || $_ctx->posts->commentsActive())';
+			} else {
+				$if[] = '(!$_ctx->posts->hasComments() && !$_ctx->posts->commentsActive())';
+			}
+		}
+		
+		if (isset($attr['show_pings'])) {
+			if ((boolean) $attr['show_pings']) {
+				$if[] = '($_ctx->posts->hasTrackbacks() || $_ctx->posts->trackbacksActive())';
+			} else {
+				$if[] = '(!$_ctx->posts->hasTrackbacks() && !$_ctx->posts->trackbacksActive())';
+			}
+		}
+		
+		if (!empty($if)) {
+			return '<?php if('.implode(' '.$operator.' ',$if).') : ?>'.$content.'<?php endif; ?>';
+		} else {
+			return $content;
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryIfFirst - O -- displays value if entry is the first one -->
+	<!ATTLIST tpl:EntryIfFirst
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: first)
+	>
+	*/
+	public function EntryIfFirst($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'first';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if ($_ctx->posts->index() == 0) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryIfOdd - O -- displays value if entry is in an odd position -->
+	<!ATTLIST tpl:EntryIfOdd
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: odd)
+	>
+	*/
+	public function EntryIfOdd($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'odd';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if (($_ctx->posts->index()+1)%2 == 1) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryIfSelected - O -- displays value if entry is selected -->
+	<!ATTLIST tpl:EntryIfSelected
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: selected)
+	>
+	*/
+	public function EntryIfSelected($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'selected';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if ($_ctx->posts->post_selected) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryContent - O -- Entry content -->
+	<!ATTLIST tpl:EntryContent
+	absolute_urls	CDATA	#IMPLIED -- transforms local URLs to absolute one
+	full			(1|0)	#IMPLIED -- returns full content with excerpt
+	>
+	*/
+	public function EntryContent($attr)
+	{
+		$urls = '0';
+		if (!empty($attr['absolute_urls'])) {
+			$urls = '1';
+		}
+		
+		$f = $this->getFilters($attr);
+		
+		if (!empty($attr['full'])) {
+			return '<?php echo '.sprintf($f,
+				'$_ctx->posts->getExcerpt('.$urls.')." ".$_ctx->posts->getContent('.$urls.')').'; ?>';
+		} else {
+			return '<?php echo '.sprintf($f,'$_ctx->posts->getContent('.$urls.')').'; ?>';
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryExcerpt - O -- Entry excerpt -->
+	<!ATTLIST tpl:EntryExcerpt
+	absolute_urls	CDATA	#IMPLIED -- transforms local URLs to absolute one
+	>
+	*/
+	public function EntryExcerpt($attr)
+	{
+		$urls = '0';
+		if (!empty($attr['absolute_urls'])) {
+			$urls = '1';
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->getExcerpt('.$urls.')').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryAttachmentCount - O -- Number of attachments for entry -->
+	<!ATTLIST tpl:EntryAttachmentCount
+	none	CDATA	#IMPLIED	-- text to display for "no attachment" (default: no attachment)
+	one	CDATA	#IMPLIED	-- text to display for "one attachment" (default: one attachment)
+	more	CDATA	#IMPLIED	-- text to display for "more attachment" (default: %s attachment, %s is replaced by the number of attachments)
+	>
+	*/
+	public function EntryAttachmentCount($attr)
+	{
+		$none = 'no attachment';
+		$one = 'one attachment';
+		$more = '%d attachments';
+		
+		if (isset($attr['none'])) {
+			$none = addslashes($attr['none']);
+		}
+		if (isset($attr['one'])) {
+			$one = addslashes($attr['one']);
+		}
+		if (isset($attr['more'])) {
+			$more = addslashes($attr['more']);
+		}
+		
+		return
+		"<?php if (\$_ctx->posts->countMedia() == 0) {\n".
+		"  printf(__('".$none."'),(integer) \$_ctx->posts->countMedia());\n".
+		"} elseif (\$_ctx->posts->countMedia() == 1) {\n".
+		"  printf(__('".$one."'),(integer) \$_ctx->posts->countMedia());\n".
+		"} else {\n".
+		"  printf(__('".$more."'),(integer) \$_ctx->posts->countMedia());\n".
+		"} ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryAuthorCommonName - O -- Entry author common name -->
+	*/
+	public function EntryAuthorCommonName($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->getAuthorCN()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryAuthorDisplayName - O -- Entry author display name -->
+	*/
+	public function EntryAuthorDisplayName($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->user_displayname').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryAuthorID - O -- Entry author ID -->
+	*/
+	public function EntryAuthorID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->user_id').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryAuthorEmail - O -- Entry author email -->
+	<!ATTLIST tpl:EntryAuthorEmail
+	spam_protected	(0|1)	#IMPLIED	-- protect email from spam (default: 1)
+	>
+	*/
+	public function EntryAuthorEmail($attr)
+	{
+		$p = 'true';
+		if (isset($attr['spam_protected']) && !$attr['spam_protected']) {
+			$p = 'false';
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"\$_ctx->posts->getAuthorEmail(".$p.")").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryAuthorLink - O -- Entry author link -->
+	*/
+	public function EntryAuthorLink($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->getAuthorLink()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryAuthorURL - O -- Entry author URL -->
+	*/
+	public function EntryAuthorURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->user_url').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryBasename - O -- Entry short URL (relative to /post) -->
+	*/
+	public function EntryBasename($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->post_url').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryCategory - O -- Entry category (full name) -->
+	*/
+	public function EntryCategory($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->cat_title').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryCategoriesBreadcrumb - - -- Current entry parents loop (without last one) -->
+	*/
+	public function EntryCategoriesBreadcrumb($attr,$content)
+	{
+		return
+		"<?php\n".
+		'$_ctx->categories = $core->blog->getCategoryParents($_ctx->posts->cat_id);'."\n".
+		'while ($_ctx->categories->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->categories = null; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryCategoryID - O -- Entry category ID -->
+	*/
+	public function EntryCategoryID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->cat_id').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryCategoryURL - O -- Entry category URL -->
+	*/
+	public function EntryCategoryURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->getCategoryURL()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryCategoryShortURL - O -- Entry category short URL (relative URL, from /category/) -->
+	*/
+	public function EntryCategoryShortURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->cat_url').'; ?>';
+	}
+	
+	
+	/*dtd
+	<!ELEMENT tpl:EntryFeedID - O -- Entry feed ID -->
+	*/
+	public function EntryFeedID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->getFeedID()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryFirstImage - O -- Extracts entry first image if exists -->
+	<!ATTLIST tpl:EntryAuthorEmail
+	size			(sq|t|s|m|o)	#IMPLIED	-- Image size to extract
+	class		CDATA		#IMPLIED	-- Class to add on image tag
+	with_category	(1|0)		#IMPLIED	-- Search in entry category description if present (default 0)
+	>
+	*/
+	public function EntryFirstImage($attr)
+	{
+		$size = !empty($attr['size']) ? $attr['size'] : '';
+		$class = !empty($attr['class']) ? $attr['class'] : '';
+		$with_category = !empty($attr['with_category']) ? 'true' : 'false';
+		
+		return "<?php echo context::EntryFirstImageHelper('".addslashes($size)."',".$with_category.",'".addslashes($class)."'); ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryID - O -- Entry ID -->
+	*/
+	public function EntryID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->post_id').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryLang - O --  Entry language or blog lang if not defined -->
+	*/
+	public function EntryLang($attr)
+	{
+		$f = $this->getFilters($attr);
+		return
+		'<?php if ($_ctx->posts->post_lang) { '.
+			'echo '.sprintf($f,'$_ctx->posts->post_lang').'; '.
+		'} else {'.
+			'echo '.sprintf($f,'$core->blog->settings->system->lang').'; '.
+		'} ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryNext - - -- Next entry block -->
+	<!ATTLIST tpl:EntryNext
+	restrict_to_category	(0|1)	#IMPLIED	-- find next post in the same category (default: 0)
+	restrict_to_lang		(0|1)	#IMPLIED	-- find next post in the same language (default: 0)
+	>
+	*/
+	public function EntryNext($attr,$content)
+	{
+		$restrict_to_category = !empty($attr['restrict_to_category']) ? '1' : '0';
+		$restrict_to_lang = !empty($attr['restrict_to_lang']) ? '1' : '0';
+		
+		return
+		'<?php $next_post = $core->blog->getNextPost($_ctx->posts,1,'.$restrict_to_category.','.$restrict_to_lang.'); ?>'."\n".
+		'<?php if ($next_post !== null) : ?>'.
+			
+			'<?php $_ctx->posts = $next_post; unset($next_post);'."\n".
+			'while ($_ctx->posts->fetch()) : ?>'.
+			$content.
+			'<?php endwhile; $_ctx->posts = null; ?>'.
+		"<?php endif; ?>\n";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryPrevious - - -- Previous entry block -->
+	<!ATTLIST tpl:EntryPrevious
+	restrict_to_category	(0|1)	#IMPLIED	-- find previous post in the same category (default: 0)
+	restrict_to_lang		(0|1)	#IMPLIED	-- find next post in the same language (default: 0)
+	>
+	*/
+	public function EntryPrevious($attr,$content)
+	{
+		$restrict_to_category = !empty($attr['restrict_to_category']) ? '1' : '0';
+		$restrict_to_lang = !empty($attr['restrict_to_lang']) ? '1' : '0';
+		
+		return
+		'<?php $prev_post = $core->blog->getNextPost($_ctx->posts,-1,'.$restrict_to_category.','.$restrict_to_lang.'); ?>'."\n".
+		'<?php if ($prev_post !== null) : ?>'.
+			
+			'<?php $_ctx->posts = $prev_post; unset($prev_post);'."\n".
+			'while ($_ctx->posts->fetch()) : ?>'.
+			$content.
+			'<?php endwhile; $_ctx->posts = null; ?>'.
+		"<?php endif; ?>\n";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryTitle - O -- Entry title -->
+	*/
+	public function EntryTitle($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->post_title').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryURL - O -- Entry URL -->
+	*/
+	public function EntryURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->posts->getURL()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryDate - O -- Entry date -->
+	<!ATTLIST tpl:EntryDate
+	format	CDATA	#IMPLIED	-- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
+	iso8601	CDATA	#IMPLIED	-- if set, tells that date format is ISO 8601
+	rfc822	CDATA	#IMPLIED	-- if set, tells that date format is RFC 822
+	upddt	CDATA	#IMPLIED	-- if set, uses the post update time
+	creadt	CDATA	#IMPLIED	-- if set, uses the post creation time
+	>
+	*/
+	public function EntryDate($attr)
+	{
+		$format = '';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		}
+		
+		$iso8601 = !empty($attr['iso8601']);
+		$rfc822 = !empty($attr['rfc822']);
+		$type = (!empty($attr['creadt']) ? 'creadt' : '');
+		$type = (!empty($attr['upddt']) ? 'upddt' : '');
+		
+		$f = $this->getFilters($attr);
+		
+		if ($rfc822) {
+			return '<?php echo '.sprintf($f,"\$_ctx->posts->getRFC822Date('".$type."')").'; ?>';
+		} elseif ($iso8601) {
+			return '<?php echo '.sprintf($f,"\$_ctx->posts->getISO8601Date('".$type."')").'; ?>';
+		} else {
+			return '<?php echo '.sprintf($f,"\$_ctx->posts->getDate('".$format."','".$type."')").'; ?>';
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryTime - O -- Entry date -->
+	<!ATTLIST tpl:EntryTime
+	format	CDATA	#IMPLIED	-- time format 
+	upddt	CDATA	#IMPLIED	-- if set, uses the post update time
+	creadt	CDATA	#IMPLIED	-- if set, uses the post creation time
+	>
+	*/
+	public function EntryTime($attr)
+	{
+		$format = '';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		}
+		
+		$type = (!empty($attr['creadt']) ? 'creadt' : '');
+		$type = (!empty($attr['upddt']) ? 'upddt' : '');
+        
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"\$_ctx->posts->getTime('".$format."','".$type."')").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntriesHeader - - -- First entries result container -->
+	*/
+	public function EntriesHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->posts->isStart()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntriesFooter - - -- Last entries result container -->
+	*/
+	public function EntriesFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->posts->isEnd()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryCommentCount - O -- Number of comments for entry -->
+	<!ATTLIST tpl:EntryCommentCount
+	none		CDATA	#IMPLIED	-- text to display for "no comment" (default: no comment)
+	one		CDATA	#IMPLIED	-- text to display for "one comment" (default: one comment)
+	more		CDATA	#IMPLIED	-- text to display for "more comments" (default: %s comments, %s is replaced by the number of comment)
+	count_all	CDATA	#IMPLIED	-- count comments and trackbacks
+	>
+	*/
+	public function EntryCommentCount($attr)
+	{
+		$none = 'no comment';
+		$one = 'one comment';
+		$more = '%d comments';
+		
+		if (isset($attr['none'])) {
+			$none = addslashes($attr['none']);
+		}
+		if (isset($attr['one'])) {
+			$one = addslashes($attr['one']);
+		}
+		if (isset($attr['more'])) {
+			$more = addslashes($attr['more']);
+		}
+		
+		if (empty($attr['count_all'])) {
+			$operation = '$_ctx->posts->nb_comment';
+		} else {
+			$operation = '($_ctx->posts->nb_comment + $_ctx->posts->nb_trackback)';
+		}
+		
+		return
+		"<?php if (".$operation." == 0) {\n".
+		"  printf(__('".$none."'),".$operation.");\n".
+		"} elseif (".$operation." == 1) {\n".
+		"  printf(__('".$one."'),".$operation.");\n".
+		"} else {\n".
+		"  printf(__('".$more."'),".$operation.");\n".
+		"} ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryPingCount - O -- Number of trackbacks for entry -->
+	<!ATTLIST tpl:EntryPingCount
+	none	CDATA	#IMPLIED	-- text to display for "no ping" (default: no ping)
+	one	CDATA	#IMPLIED	-- text to display for "one ping" (default: one ping)
+	more	CDATA	#IMPLIED	-- text to display for "more pings" (default: %s trackbacks, %s is replaced by the number of pings)
+	>
+	*/
+	public function EntryPingCount($attr)
+	{
+		$none = 'no trackback';
+		$one = 'one trackback';
+		$more = '%d trackbacks';
+		
+		if (isset($attr['none'])) {
+			$none = addslashes($attr['none']);
+		}
+		if (isset($attr['one'])) {
+			$one = addslashes($attr['one']);
+		}
+		if (isset($attr['more'])) {
+			$more = addslashes($attr['more']);
+		}
+		
+		return
+		"<?php if (\$_ctx->posts->nb_trackback == 0) {\n".
+		"  printf(__('".$none."'),(integer) \$_ctx->posts->nb_trackback);\n".
+		"} elseif (\$_ctx->posts->nb_trackback == 1) {\n".
+		"  printf(__('".$one."'),(integer) \$_ctx->posts->nb_trackback);\n".
+		"} else {\n".
+		"  printf(__('".$more."'),(integer) \$_ctx->posts->nb_trackback);\n".
+		"} ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryPingData - O -- Display trackback RDF information -->
+	*/
+	public function EntryPingData($attr)
+	{
+		return "<?php if (\$_ctx->posts->trackbacksActive()) { echo \$_ctx->posts->getTrackbackData(); } ?>\n";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:EntryPingLink - O -- Entry trackback link -->
+	*/
+	public function EntryPingLink($attr)
+	{
+		return "<?php if (\$_ctx->posts->trackbacksActive()) { echo \$_ctx->posts->getTrackbackLink(); } ?>\n";
+	}
+	
+	/* Languages -------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:Languages - - -- Languages loop -->
+	<!ATTLIST tpl:Languages
+	lang	CDATA	#IMPLIED	-- restrict loop on given lang
+	order	(desc|asc)	#IMPLIED	-- languages ordering (default: desc)
+	>
+	*/
+	public function Languages($attr,$content)
+	{
+		$p = "if (!isset(\$params)) \$params = array();\n";
+		
+		if (isset($attr['lang'])) {
+			$p = "\$params['lang'] = '".addslashes($attr['lang'])."';\n";
+		}
+		
+		$order = 'desc';
+		if (isset($attr['order']) && preg_match('/^(desc|asc)$/i',$attr['order'])) {
+			$p .= "\$params['order'] = '".$attr['order']."';\n ";
+		}
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->langs = $core->blog->getLangs($params); unset($params);'."\n";
+		$res .= "?>\n";
+		
+		$res .=
+		'<?php if ($_ctx->langs->count() > 1) : '.
+		'while ($_ctx->langs->fetch()) : ?>'.$content.
+		'<?php endwhile; $_ctx->langs = null; endif; ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:LanguagesHeader - - -- First languages result container -->
+	*/
+	public function LanguagesHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->langs->isStart()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:LanguagesFooter - - -- Last languages result container -->
+	*/
+	public function LanguagesFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->langs->isEnd()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:LanguageCode - O -- Language code -->
+	*/
+	public function LanguageCode($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->langs->post_lang').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:LanguageIfCurrent - - -- tests if post language is current language -->
+	*/
+	public function LanguageIfCurrent($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->cur_lang == \$_ctx->langs->post_lang) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:LanguageURL - O -- Language URL -->
+	*/
+	public function LanguageURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("lang").$_ctx->langs->post_lang').'; ?>';
+	}
+	
+	/* Pagination ------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:Pagination - - -- Pagination container -->
+	<!ATTLIST tpl:Pagination
+	no_context	(0|1)	#IMPLIED	-- override test on posts count vs number of posts per page
+	>
+	*/
+	public function Pagination($attr,$content)
+	{
+		$p = "<?php\n";
+		$p .= '$params = $_ctx->post_params;'."\n";
+		$p .= '$_ctx->pagination = $core->blog->getPosts($params,true); unset($params);'."\n";
+		$p .= "?>\n";
+		
+		if (isset($attr['no_context']) && $attr['no_context']) {
+			return $p.$content;
+		}
+        
+		return
+		$p.
+		'<?php if ($_ctx->pagination->f(0) > $_ctx->posts->count()) : ?>'.
+		$content.
+		'<?php endif; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PaginationCounter - O -- Number of pages -->
+	*/
+	public function PaginationCounter($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"context::PaginationNbPages()").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PaginationCurrent - O -- current page -->
+	*/
+	public function PaginationCurrent($attr)
+	{
+		$offset = 0;
+		if (isset($attr['offset'])) {
+			$offset = (integer) $attr['offset'];
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"context::PaginationPosition(".$offset.")").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PaginationIf - - -- pages tests -->
+	<!ATTLIST tpl:PaginationIf
+	start	(0|1)	#IMPLIED	-- test if we are at first page (value : 1) or not (value : 0)
+	end	(0|1)	#IMPLIED	-- test if we are at last page (value : 1) or not (value : 0)
+	>
+	*/
+	public function PaginationIf($attr,$content)
+	{
+		$if = array();
+		
+		if (isset($attr['start'])) {
+			$sign = (boolean) $attr['start'] ? '' : '!';
+			$if[] = $sign.'context::PaginationStart()';
+		}
+		
+		if (isset($attr['end'])) {
+			$sign = (boolean) $attr['end'] ? '' : '!';
+			$if[] = $sign.'context::PaginationEnd()';
+		}
+		
+		if (!empty($if)) {
+			return '<?php if('.implode(' && ',$if).') : ?>'.$content.'<?php endif; ?>';
+		} else {
+			return $content;
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PaginationURL - O -- link to previoux/next page -->
+	<!ATTLIST tpl:PaginationURL
+	offset	CDATA	#IMPLIED	-- page offset (negative for previous pages), default: 0
+	>
+	*/
+	public function PaginationURL($attr)
+	{
+		$offset = 0;
+		if (isset($attr['offset'])) {
+			$offset = (integer) $attr['offset'];
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"context::PaginationURL(".$offset.")").'; ?>';
+	}
+	
+	/* Comments --------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:Comments - - -- Comments container -->
+	<!ATTLIST tpl:Comments
+	with_pings	(0|1)	#IMPLIED	-- include trackbacks in request
+	lastn	CDATA	#IMPLIED	-- restrict the number of entries 
+	no_context (1|0)		#IMPLIED  -- Override context information
+	sortby	(title|selected|author|date|id)	#IMPLIED	-- specify comments sort criteria (default : date) (multiple comma-separated sortby can be specified. Use "?asc" or "?desc" as suffix to provide an order for each sorby)
+	order	(desc|asc)	#IMPLIED	-- result ordering (default: asc)
+	age		CDATA	#IMPLIED	-- retrieve comments by maximum age (ex: -2 days, last month, last week)
+	>
+	*/
+	public function Comments($attr,$content)
+	{
+		$p = "";
+		if (empty($attr['with_pings'])) {
+			$p .= "\$params['comment_trackback'] = false;\n";
+		}
+		
+		$lastn = 0;
+		if (isset($attr['lastn'])) {
+			$lastn = abs((integer) $attr['lastn'])+0;
+		}
+		
+		if ($lastn > 0) {
+			$p .= "\$params['limit'] = ".$lastn.";\n";
+		} else {
+			$p .= "if (\$_ctx->nb_comment_per_page !== null) { \$params['limit'] = \$_ctx->nb_comment_per_page; }\n";
+		}
+		
+		if (empty($attr['no_context']))
+		{
+			$p .=
+			"if (\$_ctx->posts !== null) { ".
+				"\$params['post_id'] = \$_ctx->posts->post_id; ".
+				"\$core->blog->withoutPassword(false);\n".
+			"}\n";
+			$p .=
+			'if ($_ctx->exists("categories")) { '.
+				"\$params['cat_id'] = \$_ctx->categories->cat_id; ".
+			"}\n";
+			
+			$p .=
+			'if ($_ctx->exists("langs")) { '.
+				"\$params['sql'] = \"AND P.post_lang = '\".\$core->blog->con->escape(\$_ctx->langs->post_lang).\"' \"; ".
+			"}\n";
+		}
+		
+		if (!isset($attr['order'])) {
+			$attr['order'] = 'asc';
+		}
+		
+		$p .= "\$params['order'] = '".$this->getSortByStr($attr,'comment')."';\n";
+		
+		if (isset($attr['no_content']) && $attr['no_content']) {
+			$p .= "\$params['no_content'] = true;\n";
+		}
+		
+		if (isset($attr['age'])) {
+			$age = $this->getAge($attr);
+			$p .= !empty($age) ? "@\$params['sql'] .= ' AND P.post_dt > \'".$age."\'';\n" : '';
+		}
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->comments = $core->blog->getComments($params); unset($params);'."\n";
+		$res .= "if (\$_ctx->posts !== null) { \$core->blog->withoutPassword(true);}\n";
+		
+		if (!empty($attr['with_pings'])) {
+			$res .= '$_ctx->pings = $_ctx->comments;'."\n";
+		}
+		
+		$res .= "?>\n";
+		
+		$res .=
+		'<?php while ($_ctx->comments->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->comments = null; ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentAuthor - O -- Comment author -->
+	*/
+	public function CommentAuthor($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"\$_ctx->comments->comment_author").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentAuthorDomain - O -- Comment author website domain -->
+	*/
+	public function CommentAuthorDomain($attr)
+	{
+		return '<?php echo preg_replace("#^http(?:s?)://(.+?)/.*$#msu",\'$1\',$_ctx->comments->comment_site); ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentAuthorLink - O -- Comment author link -->
+	*/
+	public function CommentAuthorLink($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comments->getAuthorLink()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentAuthorMailMD5 - O -- Comment author email MD5 sum -->
+	*/
+	public function CommentAuthorMailMD5($attr)
+	{
+		return '<?php echo md5($_ctx->comments->comment_email) ; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentAuthorURL - O -- Comment author URL -->
+	*/
+	public function CommentAuthorURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comments->getAuthorURL()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentContent - O --  Comment content -->
+	<!ATTLIST tpl:CommentContent
+	absolute_urls	(0|1)	#IMPLIED	-- convert URLS to absolute urls
+	>
+	*/
+	public function CommentContent($attr)
+	{
+		$urls = '0';
+		if (!empty($attr['absolute_urls'])) {
+			$urls = '1';
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comments->getContent('.$urls.')').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentDate - O -- Comment date -->
+	<!ATTLIST tpl:CommentDate
+	format	CDATA	#IMPLIED	-- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
+	iso8601	CDATA	#IMPLIED	-- if set, tells that date format is ISO 8601
+	rfc822	CDATA	#IMPLIED	-- if set, tells that date format is RFC 822
+	upddt	CDATA	#IMPLIED	-- if set, uses the comment update time
+	>
+	*/
+	public function CommentDate($attr)
+	{
+		$format = '';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		}
+		
+		$iso8601 = !empty($attr['iso8601']);
+		$rfc822 = !empty($attr['rfc822']);
+		$type = (!empty($attr['upddt']) ? 'upddt' : '');
+		
+		$f = $this->getFilters($attr);
+		
+		if ($rfc822) {
+			return '<?php echo '.sprintf($f,"\$_ctx->comments->getRFC822Date('".$type."')").'; ?>';
+		} elseif ($iso8601) {
+			return '<?php echo '.sprintf($f,"\$_ctx->comments->getISO8601Date('".$type."')").'; ?>';
+		} else {
+			return '<?php echo '.sprintf($f,"\$_ctx->comments->getDate('".$format."','".$type."')").'; ?>';
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentTime - O -- Comment date -->
+	<!ATTLIST tpl:CommentTime
+	format	CDATA	#IMPLIED	-- time format 
+	upddt	CDATA	#IMPLIED	-- if set, uses the comment update time
+	>
+	*/
+	public function CommentTime($attr)
+	{
+		$format = '';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		}
+		$type = (!empty($attr['upddt']) ? 'upddt' : '');
+        
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"\$_ctx->comments->getTime('".$format."','".$type."')").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentEmail - O -- Comment author email -->
+	<!ATTLIST tpl:CommentEmail
+	spam_protected	(0|1)	#IMPLIED	-- protect email from spam (default: 1)
+	>
+	*/
+	public function CommentEmail($attr)
+	{
+		$p = 'true';
+		if (isset($attr['spam_protected']) && !$attr['spam_protected']) {
+			$p = 'false';
+		}
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"\$_ctx->comments->getEmail(".$p.")").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentEntryTitle - O -- Title of the comment entry -->
+	*/
+	public function CommentEntryTitle($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comments->post_title').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentFeedID - O -- Comment feed ID -->
+	*/
+	public function CommentFeedID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comments->getFeedID()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentID - O -- Comment ID -->
+	*/
+	public function CommentID($attr)
+	{
+		return '<?php echo $_ctx->comments->comment_id; ?>';
+	}
+    
+	/*dtd
+	<!ELEMENT tpl:CommentIf - - -- test container for comments -->
+	<!ATTLIST tpl:CommentIf
+	is_ping	(0|1)	#IMPLIED	-- test if comment is a trackback (value : 1) or not (value : 0)
+	>
+	*/
+	public function CommentIf($attr,$content)
+	{
+		$if = array();
+		$is_ping = null;
+		
+		if (isset($attr['is_ping'])) {
+			$sign = (boolean) $attr['is_ping'] ? '' : '!';
+			$if[] = $sign.'$_ctx->comments->comment_trackback';
+		}
+		
+		if (!empty($if)) {
+			return '<?php if('.implode(' && ',$if).') : ?>'.$content.'<?php endif; ?>';
+		} else {
+			return $content;
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentIfFirst - O -- displays value if comment is the first one -->
+	<!ATTLIST tpl:CommentIfFirst
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: first)
+	>
+	*/
+	public function CommentIfFirst($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'first';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if ($_ctx->comments->index() == 0) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentIfMe - O -- displays value if comment is the from the entry author -->
+	<!ATTLIST tpl:CommentIfMe
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: me)
+	>
+	*/
+	public function CommentIfMe($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'me';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if ($_ctx->comments->isMe()) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentIfOdd - O -- displays value if comment is  at an odd position -->
+	<!ATTLIST tpl:CommentIfOdd
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: odd)
+	>
+	*/
+	public function CommentIfOdd($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'odd';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if (($_ctx->comments->index()+1)%2) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentIP - O -- Comment author IP -->
+	*/
+	public function CommentIP($attr)
+	{
+		return '<?php echo $_ctx->comments->comment_ip; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentOrderNumber - O -- Comment order in page -->
+	*/
+	public function CommentOrderNumber($attr)
+	{
+		return '<?php echo $_ctx->comments->index()+1; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentsFooter - - -- Last comments result container -->
+	*/
+	public function CommentsFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->comments->isEnd()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentsHeader - - -- First comments result container -->
+	*/
+	public function CommentsHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->comments->isStart()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentPostURL - O -- Comment Entry URL -->
+	*/
+	public function CommentPostURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comments->getPostURL()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:IfCommentAuthorEmail - - -- Container displayed if comment author email is set -->
+	*/
+	public function IfCommentAuthorEmail($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->comments->comment_email) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentHelp - 0 -- Comment syntax mini help -->
+	*/
+	public function CommentHelp($attr,$content)
+	{
+		return
+		"<?php if (\$core->blog->settings->system->wiki_comments) {\n".
+		"  echo __('Comments can be formatted using a simple wiki syntax.');\n".
+		"} else {\n".
+		"  echo __('HTML code is displayed as text and web addresses are automatically converted.');\n".
+		"} ?>";
+	}
+	
+	/* Comment preview -------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:IfCommentPreview - - -- Container displayed if comment is being previewed -->
+	*/
+	public function IfCommentPreview($attr,$content)
+	{
+		return
+		'<?php if ($_ctx->comment_preview !== null && $_ctx->comment_preview["preview"]) : ?>'.
+		$content.
+		'<?php endif; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentPreviewName - O -- Author name for the previewed comment -->
+	*/
+	public function CommentPreviewName($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comment_preview["name"]').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentPreviewEmail - O -- Author email for the previewed comment -->
+	*/
+	public function CommentPreviewEmail($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comment_preview["mail"]').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentPreviewSite - O -- Author site for the previewed comment -->
+	*/
+	public function CommentPreviewSite($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->comment_preview["site"]').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentPreviewContent - O -- Content of the previewed comment -->
+	<!ATTLIST tpl:CommentPreviewContent
+	raw	(0|1)	#IMPLIED	-- display comment in raw content
+	>
+	*/
+	public function CommentPreviewContent($attr)
+	{
+		$f = $this->getFilters($attr);
+		
+		if (!empty($attr['raw'])) {
+			$co = '$_ctx->comment_preview["rawcontent"]';
+		} else {
+			$co = '$_ctx->comment_preview["content"]';
+		}
+		
+		return '<?php echo '.sprintf($f,$co).'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:CommentPreviewCheckRemember - O -- checkbox attribute for "remember me" (same value as before preview) -->
+	*/
+	public function CommentPreviewCheckRemember($attr)
+	{
+		return
+		"<?php if (\$_ctx->comment_preview['remember']) { echo ' checked=\"checked\"'; } ?>";
+	}
+	
+	/* Trackbacks ------------------------------------- */
+	/*dtd
+	<!ELEMENT tpl:PingBlogName - O -- Trackback blog name -->
+	*/
+	public function PingBlogName($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->pings->comment_author').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingContent - O -- Trackback content -->
+	*/
+	public function PingContent($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->pings->getTrackbackContent()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingDate - O -- Trackback date -->
+	<!ATTLIST tpl:PingDate
+	format	CDATA	#IMPLIED	-- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
+	iso8601	CDATA	#IMPLIED	-- if set, tells that date format is ISO 8601
+	rfc822	CDATA	#IMPLIED	-- if set, tells that date format is RFC 822
+	upddt	CDATA	#IMPLIED	-- if set, uses the comment update time
+	>
+	*/
+	public function PingDate($attr,$type='')
+	{
+		$format = '';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		}
+		
+		$iso8601 = !empty($attr['iso8601']);
+		$rfc822 = !empty($attr['rfc822']);
+		$type = (!empty($attr['upddt']) ? 'upddt' : '');
+		
+		$f = $this->getFilters($attr);
+		
+		if ($rfc822) {
+			return '<?php echo '.sprintf($f,"\$_ctx->pings->getRFC822Date('".$type."')").'; ?>';
+		} elseif ($iso8601) {
+			return '<?php echo '.sprintf($f,"\$_ctx->pings->getISO8601Date('".$type."')").'; ?>';
+		} else {
+			return '<?php echo '.sprintf($f,"\$_ctx->pings->getDate('".$format."','".$type."')").'; ?>';
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingTime - O -- Trackback date -->
+	<!ATTLIST tpl:PingTime
+	format	CDATA	#IMPLIED	-- time format 
+	upddt	CDATA	#IMPLIED	-- if set, uses the comment update time
+	>
+	*/
+	public function PingTime($attr)
+	{
+		$format = '';
+		if (!empty($attr['format'])) {
+			$format = addslashes($attr['format']);
+		}
+		$type = (!empty($attr['upddt']) ? 'upddt' : '');
+		
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,"\$_ctx->pings->getTime('".$format."','".$type."')").'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingEntryTitle - O -- Trackback entry title -->
+	*/
+	public function PingEntryTitle($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->pings->post_title').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingFeedID - O -- Trackback feed ID -->
+	*/
+	public function PingFeedID($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->pings->getFeedID()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingID - O -- Trackback ID -->
+	*/
+	public function PingID($attr)
+	{
+		return '<?php echo $_ctx->pings->comment_id; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingIfFirst - O -- displays value if trackback is the first one -->
+	<!ATTLIST tpl:PingIfFirst
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: first)
+	>
+	*/
+	public function PingIfFirst($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'first';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if ($_ctx->pings->index() == 0) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingIfOdd - O -- displays value if trackback is  at an odd position -->
+	<!ATTLIST tpl:PingIfOdd
+	return	CDATA	#IMPLIED	-- value to display in case of success (default: odd)
+	>
+	*/
+	public function PingIfOdd($attr)
+	{
+		$ret = isset($attr['return']) ? $attr['return'] : 'odd';
+		$ret = html::escapeHTML($ret);
+		
+		return
+		'<?php if (($_ctx->pings->index()+1)%2) { '.
+		"echo '".addslashes($ret)."'; } ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingIP - O -- Trackback author IP -->
+	*/
+	public function PingIP($attr)
+	{
+		return '<?php echo $_ctx->pings->comment_ip; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingNoFollow - O -- displays 'rel="nofollow"' if set in blog -->
+	*/
+	public function PingNoFollow($attr)
+	{
+		return
+		'<?php if($core->blog->settings->system->comments_nofollow) { '.
+		'echo \' rel="nofollow"\';'.
+		'} ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingOrderNumber - O -- Trackback order in page -->
+	*/
+	public function PingOrderNumber($attr)
+	{
+		return '<?php echo $_ctx->pings->index()+1; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingPostURL - O -- Trackback Entry URL -->
+	*/
+	public function PingPostURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->pings->getPostURL()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:Pings - - -- Trackbacks container -->
+	<!ATTLIST tpl:Pings
+	with_pings	(0|1)	#IMPLIED	-- include trackbacks in request
+	lastn	CDATA		#IMPLIED	-- restrict the number of entries 
+	no_context (1|0)		#IMPLIED  -- Override context information
+	order	(desc|asc)	#IMPLIED	-- result ordering (default: asc)
+	>
+	*/
+	public function Pings($attr,$content)
+	{
+		$p =
+		"if (\$_ctx->posts !== null) { ".
+			"\$params['post_id'] = \$_ctx->posts->post_id; ".
+			"\$core->blog->withoutPassword(false);\n".
+		"}\n";
+		
+		$p .= "\$params['comment_trackback'] = true;\n";
+		
+		$lastn = 0;
+		if (isset($attr['lastn'])) {
+			$lastn = abs((integer) $attr['lastn'])+0;
+		}
+		
+		if ($lastn > 0) {
+			$p .= "\$params['limit'] = ".$lastn.";\n";
+		} else {
+			$p .= "if (\$_ctx->nb_comment_per_page !== null) { \$params['limit'] = \$_ctx->nb_comment_per_page; }\n";
+		}
+		
+		if (empty($attr['no_context']))
+		{
+			$p .=
+			'if ($_ctx->exists("categories")) { '.
+				"\$params['cat_id'] = \$_ctx->categories->cat_id; ".
+			"}\n";
+			
+			$p .=
+			'if ($_ctx->exists("langs")) { '.
+				"\$params['sql'] = \"AND P.post_lang = '\".\$core->blog->con->escape(\$_ctx->langs->post_lang).\"' \"; ".
+			"}\n";
+		}
+		
+		$order = 'asc';
+		if (isset($attr['order']) && preg_match('/^(desc|asc)$/i',$attr['order'])) {
+			$order = $attr['order'];
+		}
+		
+		$p .= "\$params['order'] = 'comment_dt ".$order."';\n";
+		
+		if (isset($attr['no_content']) && $attr['no_content']) {
+			$p .= "\$params['no_content'] = true;\n";
+		}
+		
+		$res = "<?php\n";
+		$res .= $p;
+		$res .= '$_ctx->pings = $core->blog->getComments($params); unset($params);'."\n";
+		$res .= "if (\$_ctx->posts !== null) { \$core->blog->withoutPassword(true);}\n";
+		$res .= "?>\n";
+		
+		$res .=
+		'<?php while ($_ctx->pings->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->pings = null; ?>';
+		
+		return $res;
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingsFooter - - -- Last trackbacks result container -->
+	*/
+	public function PingsFooter($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->pings->isEnd()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingsHeader - - -- First trackbacks result container -->
+	*/
+	public function PingsHeader($attr,$content)
+	{
+		return
+		"<?php if (\$_ctx->pings->isStart()) : ?>".
+		$content.
+		"<?php endif; ?>";
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingTitle - O -- Trackback title -->
+	*/
+	public function PingTitle($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->pings->getTrackbackTitle()').'; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:PingAuthorURL - O -- Trackback author URL -->
+	*/
+	public function PingAuthorURL($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'$_ctx->pings->getAuthorURL()').'; ?>';
+	}
+	
+	# System
+	/*dtd
+	<!ELEMENT tpl:SysBehavior - O -- Call a given behavior -->
+	<!ATTLIST tpl:SysBehavior
+	behavior	CDATA	#IMPLIED	-- behavior to call
+	>
+	*/
+	public function SysBehavior($attr,$raw)
+	{
+		if (!isset($attr['behavior'])) {
+			return;
+		}
+		
+		$b = addslashes($attr['behavior']);
+		return
+		'<?php if ($core->hasBehavior(\''.$b.'\')) { '.
+			'$core->callBehavior(\''.$b.'\',$core,$_ctx);'.
+		'} ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:SysIf - - -- System settings tester container -->
+	<!ATTLIST tpl:SysIf
+	categories		(0|1)	#IMPLIED	-- test if categories are set in current context (value : 1) or not (value : 0)
+	posts			(0|1)	#IMPLIED	-- test if posts are set in current context (value : 1) or not (value : 0)
+	blog_lang			CDATA	#IMPLIED	-- tests if blog language is the one given in parameter
+	current_tpl		CDATA	#IMPLIED	-- tests if current template is the one given in paramater
+	current_mode		CDATA	#IMPLIED	-- tests if current URL mode is the one given in parameter
+	has_tpl			CDATA     #IMPLIED  -- tests if a named template exists
+	has_tag			CDATA     #IMPLIED  -- tests if a named template tag exists
+	blog_id			CDATA     #IMPLIED  -- tests if current blog ID is the one given in parameter
+	comments_active	(0|1)	#IMPLIED	-- test if comments are enabled blog-wide 
+	pings_active		(0|1)	#IMPLIED	-- test if trackbacks are enabled blog-wide 
+	wiki_comments		(0|1)	#IMPLIED	-- test if wiki syntax is enabled for comments
+	operator			(and|or)	#IMPLIED	-- combination of conditions, if more than 1 specifiec (default: and)
+	>
+	*/
+	public function SysIf($attr,$content)
+	{
+		$if = array();
+		$is_ping = null;
+		
+		$operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
+		
+		if (isset($attr['categories'])) {
+			$sign = (boolean) $attr['categories'] ? '!' : '=';
+			$if[] = '$_ctx->categories '.$sign.'== null';
+		}
+		
+		if (isset($attr['posts'])) {
+			$sign = (boolean) $attr['posts'] ? '!' : '=';
+			$if[] = '$_ctx->posts '.$sign.'== null';
+		}
+		
+		if (isset($attr['blog_lang'])) {
+			$if[] = "\$core->blog->settings->system->lang == '".addslashes($attr['blog_lang'])."'";
+		}
+		
+		if (isset($attr['current_tpl'])) {
+			$sign = '=';
+			if (substr($attr['current_tpl'],0,1) == '!') {
+				$sign = '!';
+				$attr['current_tpl'] = substr($attr['current_tpl'],1);
+			}
+			$if[] = "\$_ctx->current_tpl ".$sign."= '".addslashes($attr['current_tpl'])."'";
+		}
+		
+		if (isset($attr['current_mode'])) {
+			$sign = '=';
+			if (substr($attr['current_mode'],0,1) == '!') {
+				$sign = '!';
+				$attr['current_mode'] = substr($attr['current_mode'],1);
+			}
+			$if[] = "\$core->url->type ".$sign."= '".addslashes($attr['current_mode'])."'";
+		}
+		
+		if (isset($attr['has_tpl'])) {
+			$sign = '';
+			if (substr($attr['has_tpl'],0,1) == '!') {
+				$sign = '!';
+				$attr['has_tpl'] = substr($attr['has_tpl'],1);
+			}
+			$if[] = $sign."\$core->tpl->getFilePath('".addslashes($attr['has_tpl'])."') !== false";
+		}
+		
+		if (isset($attr['has_tag'])) {
+			$sign = '';
+			if (substr($attr['has_tag'],0,1) == '!') {
+				$sign = '!';
+				$attr['has_tag'] = substr($attr['has_tag'],1);
+			}
+			$if[] =  $sign."(\$core->tpl->tagExists('".addslashes($attr['has_tag'])."') )";
+		}
+		
+		if (isset($attr['blog_id'])) {
+			$sign = '';
+			if (substr($attr['blog_id'],0,1) == '!') {
+				$sign = '!';
+				$attr['blog_id'] = substr($attr['blog_id'],1);
+			}
+			$if[] = $sign."(\$core->blog->id == '".addslashes($attr['blog_id'])."')";
+		}
+		
+		if (isset($attr['comments_active'])) {
+			$sign = (boolean) $attr['comments_active'] ? '' : '!';
+			$if[] = $sign.'$core->blog->settings->system->allow_comments';
+		}
+		
+		if (isset($attr['pings_active'])) {
+			$sign = (boolean) $attr['pings_active'] ? '' : '!';
+			$if[] = $sign.'$core->blog->settings->system->allow_trackbacks';
+		}
+        
+		if (isset($attr['wiki_comments'])) {
+			$sign = (boolean) $attr['wiki_comments'] ? '' : '!';
+			$if[] = $sign.'$core->blog->settings->system->wiki_comments';
+		}
+		
+		if (isset($attr['search_count']) &&
+			preg_match('/^((=|!|&gt;|&lt;)=|(&gt;|&lt;))\s*[0-9]+$/',trim($attr['search_count']))) {
+			$if[] = '(isset($_search_count) && $_search_count '.html::decodeEntities($attr['search_count']).')';
+		}
+		
+		if (!empty($if)) {
+			return '<?php if('.implode(' '.$operator.' ',$if).') : ?>'.$content.'<?php endif; ?>';
+		} else {
+			return $content;
+		}
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:SysIfCommentPublished - - -- Container displayed if comment has been published -->
+	*/
+	public function SysIfCommentPublished($attr,$content)
+	{
+		return
+		'<?php if (!empty($_GET[\'pub\'])) : ?>'.
+		$content.
+		'<?php endif; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:SysIfCommentPending - - -- Container displayed if comment is pending after submission -->
+	*/
+	public function SysIfCommentPending($attr,$content)
+	{
+		return
+		'<?php if (isset($_GET[\'pub\']) && $_GET[\'pub\'] == 0) : ?>'.
+		$content.
+		'<?php endif; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:SysFeedSubtitle - O -- Feed subtitle -->
+	*/
+	public function SysFeedSubtitle($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php if ($_ctx->feed_subtitle !== null) { echo '.sprintf($f,'$_ctx->feed_subtitle').';} ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:SysIfFormError - O -- Container displayed if an error has been detected after form submission -->
+	*/
+	public function SysIfFormError($attr,$content)
+	{
+		return
+		'<?php if ($_ctx->form_error !== null) : ?>'.
+		$content.
+		'<?php endif; ?>';
+	}
+	
+	/*dtd
+	<!ELEMENT tpl:SysIfFormError - O -- Form error -->
+	*/
+	public function SysFormError($attr)
+	{
+		return
+		'<?php if ($_ctx->form_error !== null) { echo $_ctx->form_error; } ?>';
+	}
+	
+	public function SysPoweredBy($attr)
+	{
+		return
+		'<?php printf(__("Powered by %s"),"<a href=\"http://dotclear.org/\">Dotclear</a>"); ?>';
+	}
+	
+	public function SysSearchString($attr)
+	{
+		$s = isset($attr['string']) ? $attr['string'] : '%1$s';
+		
+		$f = $this->getFilters($attr);
+		return '<?php if (isset($_search)) { echo sprintf(__(\''.$s.'\'),'.sprintf($f,'$_search').',$_search_count);} ?>';
+	}
+	
+	public function SysSelfURI($attr)
+	{
+		$f = $this->getFilters($attr);
+		return '<?php echo '.sprintf($f,'http::getSelfURI()').'; ?>';
+	}
+}
 
-    protected $unknown_value_handler = null;
-    protected $unknown_block_handler = null;
+# Template nodes, for parsing purposes
 
-    public function __construct($cache_dir, $self_name, $core)
-    {
-        parent::__construct($cache_dir, $self_name);
+# Generic list node, this one may only be instanciated 
+# once for root element
+class tplNode 
+{
+	# Basic tree structure : links to parent, children forrest
+	protected $parentNode;
+	protected $children;
+	
+	public function __construct() {
+		$this->children = array();
+		$this->parentNode = null;
+	}
+	
+	// Returns compiled block
+	public function compile($tpl) {
+		$res='';
+		foreach ($this->children as $child) {
+			$res .= $child->compile($tpl);
+		}
+		return $res;
+	}
+	
+	# Add a children to current node
+	public function addChild ($child) {
+		$this->children[] = $child;
+		$child->setParent($this);
+	}
+	
+	# Defines parent for current node
+	protected function setParent($parent) {
+		$this->parentNode = $parent;
+	}
+	
+	# Retrieves current node parent.
+	# If parent is root node, null is returned
+	public function getParent() {
+		return $this->parentNode;
+	}
+	
+	# Current node tag
+	public function getTag() {
+		return "ROOT";
+	}
+}
 
-        $this->remove_php = !$core->blog->settings->system->tpl_allow_php;
-        $this->use_cache  = $core->blog->settings->system->tpl_use_cache;
+// Text node, for any non-tpl content
+class tplNodeText extends tplNode 
+{
+	// Simple text node, only holds its content
+	protected $content;
+	
+	public function __construct($text) {
+		parent::__construct();
+		$this->content=$text;
+	}
+	
+	public function compile($tpl) {
+		return $this->content;
+	}
+	
+	public function getTag() {
+		return "TEXT";
+	}
+}
 
-        $this->tag_block = '<tpl:(\w+)(?:(\s+.*?)>|>)((?:[^<]|<(?!/?tpl:\1)|(?R))*)</tpl:\1>';
-        $this->tag_value = '{{tpl:(\w+)(\s(.*?))?}}';
+// Block node, for all <tpl:Tag>...</tpl:Tag>
+class tplNodeBlock extends tplNode 
+{
+	protected $attr;
+	protected $tag;
+	protected $closed;
+    
+	public function __construct($tag,$attr) {
+		parent::__construct();
+		$this->content='';
+		$this->tag = $tag;
+		$this->attr = $attr;
+		$this->closed=false;
+	}
+	public function setClosing() {
+		$this->closed = true;
+	}
+	public function compile($tpl) {
+		if ($this->closed) {
+			$content = parent::compile($tpl);
+			return $tpl->compileBlockNode($this->tag,$this->attr,$content);
+		} else {
+			// if tag has not been closed, silently ignore its content...
+			return '';
+		}
+	}
+	public function getTag() {
+		return $this->tag;
+	}
+}
 
-        $this->core = &$core;
+// Value node, for all {{tpl:Tag}}
+class tplNodeValue extends tplNode 
+{
+	protected $attr;
+	protected $str_attr;
+	protected $tag;
+	
+	public function __construct($tag,$attr,$str_attr) {
+		parent::__construct();
+		$this->content='';
+		$this->tag = $tag;
+		$this->attr = $attr;
+		$this->str_attr = $str_attr;
+	}
+	
+	public function compile($tpl) {
+		return $tpl->compileValueNode($this->tag,$this->attr,$this->str_attr);
+	}
+	
+	public function getTag() {
+		return $this->tag;
+	}
+}
 
-        # Transitional tags
-        $this->addValue('EntryTrackbackCount', [$this, 'EntryPingCount']);
-        $this->addValue('EntryTrackbackData', [$this, 'EntryPingData']);
-        $this->addValue('EntryTrackbackLink', [$this, 'EntryPingLink']);
-
-        # l10n
-        $this->addValue('lang', [$this, 'l10n']);
-
-        # Loops test tags
-        $this->addBlock('LoopPosition', [$this, 'LoopPosition']);
-        $this->addValue('LoopIndex', [$this, 'LoopIndex']);
-
-        # Archives
-        $this->addBlock('Archives', [$this, 'Archives']);
-        $this->addBlock('ArchivesHeader', [$this, 'ArchivesHeader']);
-        $this->addBlock('ArchivesFooter', [$this, 'ArchivesFooter']);
-        $this->addBlock('ArchivesYearHeader', [$this, 'ArchivesYearHeader']);
-        $this->addBlock('ArchivesYearFooter', [$this, 'ArchivesYearFooter']);
-        $this->addValue('ArchiveDate', [$this, 'ArchiveDate']);
-        $this->addBlock('ArchiveNext', [$this, 'ArchiveNext']);
-        $this->addBlock('ArchivePrevious', [$this, 'ArchivePrevious']);
-        $this->addValue('ArchiveEntriesCount', [$this, 'ArchiveEntriesCount']);
-        $this->addValue('ArchiveURL', [$this, 'ArchiveURL']);
-
-        # Blog
-        $this->addValue('BlogArchiveURL', [$this, 'BlogArchiveURL']);
-        $this->addValue('BlogCopyrightNotice', [$this, 'BlogCopyrightNotice']);
-        $this->addValue('BlogDescription', [$this, 'BlogDescription']);
-        $this->addValue('BlogEditor', [$this, 'BlogEditor']);
-        $this->addValue('BlogFeedID', [$this, 'BlogFeedID']);
-        $this->addValue('BlogFeedURL', [$this, 'BlogFeedURL']);
-        $this->addValue('BlogRSDURL', [$this, 'BlogRSDURL']);
-        $this->addValue('BlogName', [$this, 'BlogName']);
-        $this->addValue('BlogLanguage', [$this, 'BlogLanguage']);
-        $this->addValue('BlogThemeURL', [$this, 'BlogThemeURL']);
-        $this->addValue('BlogParentThemeURL', [$this, 'BlogParentThemeURL']);
-        $this->addValue('BlogUpdateDate', [$this, 'BlogUpdateDate']);
-        $this->addValue('BlogID', [$this, 'BlogID']);
-        $this->addValue('BlogURL', [$this, 'BlogURL']);
-        $this->addValue('BlogXMLRPCURL', [$this, 'BlogXMLRPCURL']);
-        $this->addValue('BlogPublicURL', [$this, 'BlogPublicURL']);
-        $this->addValue('BlogQmarkURL', [$this, 'BlogQmarkURL']);
-        $this->addValue('BlogMetaRobots', [$this, 'BlogMetaRobots']);
-        $this->addValue('BlogJsJQuery', [$this, 'BlogJsJQuery']);
-
-        # Categories
-        $this->addBlock('Categories', [$this, 'Categories']);
-        $this->addBlock('CategoriesHeader', [$this, 'CategoriesHeader']);
-        $this->addBlock('CategoriesFooter', [$this, 'CategoriesFooter']);
-        $this->addBlock('CategoryIf', [$this, 'CategoryIf']);
-        $this->addBlock('CategoryFirstChildren', [$this, 'CategoryFirstChildren']);
-        $this->addBlock('CategoryParents', [$this, 'CategoryParents']);
-        $this->addValue('CategoryFeedURL', [$this, 'CategoryFeedURL']);
-        $this->addValue('CategoryURL', [$this, 'CategoryURL']);
-        $this->addValue('CategoryShortURL', [$this, 'CategoryShortURL']);
-        $this->addValue('CategoryDescription', [$this, 'CategoryDescription']);
-        $this->addValue('CategoryTitle', [$this, 'CategoryTitle']);
-        $this->addValue('CategoryEntriesCount', [$this, 'CategoryEntriesCount']);
-
-        # Comments
-        $this->addBlock('Comments', [$this, 'Comments']);
-        $this->addValue('CommentAuthor', [$this, 'CommentAuthor']);
-        $this->addValue('CommentAuthorDomain', [$this, 'CommentAuthorDomain']);
-        $this->addValue('CommentAuthorLink', [$this, 'CommentAuthorLink']);
-        $this->addValue('CommentAuthorMailMD5', [$this, 'CommentAuthorMailMD5']);
-        $this->addValue('CommentAuthorURL', [$this, 'CommentAuthorURL']);
-        $this->addValue('CommentContent', [$this, 'CommentContent']);
-        $this->addValue('CommentDate', [$this, 'CommentDate']);
-        $this->addValue('CommentTime', [$this, 'CommentTime']);
-        $this->addValue('CommentEmail', [$this, 'CommentEmail']);
-        $this->addValue('CommentEntryTitle', [$this, 'CommentEntryTitle']);
-        $this->addValue('CommentFeedID', [$this, 'CommentFeedID']);
-        $this->addValue('CommentID', [$this, 'CommentID']);
-        $this->addBlock('CommentIf', [$this, 'CommentIf']);
-        $this->addValue('CommentIfFirst', [$this, 'CommentIfFirst']);
-        $this->addValue('CommentIfMe', [$this, 'CommentIfMe']);
-        $this->addValue('CommentIfOdd', [$this, 'CommentIfOdd']);
-        $this->addValue('CommentIP', [$this, 'CommentIP']);
-        $this->addValue('CommentOrderNumber', [$this, 'CommentOrderNumber']);
-        $this->addBlock('CommentsFooter', [$this, 'CommentsFooter']);
-        $this->addBlock('CommentsHeader', [$this, 'CommentsHeader']);
-        $this->addValue('CommentPostURL', [$this, 'CommentPostURL']);
-        $this->addBlock('IfCommentAuthorEmail', [$this, 'IfCommentAuthorEmail']);
-        $this->addValue('CommentHelp', [$this, 'CommentHelp']);
-
-        # Comment preview
-        $this->addBlock('IfCommentPreview', [$this, 'IfCommentPreview']);
-        $this->addBlock('IfCommentPreviewOptional', [$this, 'IfCommentPreviewOptional']);
-        $this->addValue('CommentPreviewName', [$this, 'CommentPreviewName']);
-        $this->addValue('CommentPreviewEmail', [$this, 'CommentPreviewEmail']);
-        $this->addValue('CommentPreviewSite', [$this, 'CommentPreviewSite']);
-        $this->addValue('CommentPreviewContent', [$this, 'CommentPreviewContent']);
-        $this->addValue('CommentPreviewCheckRemember', [$this, 'CommentPreviewCheckRemember']);
-
-        # Entries
-        $this->addBlock('DateFooter', [$this, 'DateFooter']);
-        $this->addBlock('DateHeader', [$this, 'DateHeader']);
-        $this->addBlock('Entries', [$this, 'Entries']);
-        $this->addBlock('EntriesFooter', [$this, 'EntriesFooter']);
-        $this->addBlock('EntriesHeader', [$this, 'EntriesHeader']);
-        $this->addValue('EntryAuthorCommonName', [$this, 'EntryAuthorCommonName']);
-        $this->addValue('EntryAuthorDisplayName', [$this, 'EntryAuthorDisplayName']);
-        $this->addValue('EntryAuthorEmail', [$this, 'EntryAuthorEmail']);
-        $this->addValue('EntryAuthorEmailMD5', [$this, 'EntryAuthorEmailMD5']);
-        $this->addValue('EntryAuthorID', [$this, 'EntryAuthorID']);
-        $this->addValue('EntryAuthorLink', [$this, 'EntryAuthorLink']);
-        $this->addValue('EntryAuthorURL', [$this, 'EntryAuthorURL']);
-        $this->addValue('EntryBasename', [$this, 'EntryBasename']);
-        $this->addValue('EntryCategory', [$this, 'EntryCategory']);
-        $this->addValue('EntryCategoryDescription', [$this, 'EntryCategoryDescription']);
-        $this->addBlock('EntryCategoriesBreadcrumb', [$this, 'EntryCategoriesBreadcrumb']);
-        $this->addValue('EntryCategoryID', [$this, 'EntryCategoryID']);
-        $this->addValue('EntryCategoryURL', [$this, 'EntryCategoryURL']);
-        $this->addValue('EntryCategoryShortURL', [$this, 'EntryCategoryShortURL']);
-        $this->addValue('EntryCommentCount', [$this, 'EntryCommentCount']);
-        $this->addValue('EntryContent', [$this, 'EntryContent']);
-        $this->addValue('EntryDate', [$this, 'EntryDate']);
-        $this->addValue('EntryExcerpt', [$this, 'EntryExcerpt']);
-        $this->addValue('EntryFeedID', [$this, 'EntryFeedID']);
-        $this->addValue('EntryFirstImage', [$this, 'EntryFirstImage']);
-        $this->addValue('EntryID', [$this, 'EntryID']);
-        $this->addBlock('EntryIf', [$this, 'EntryIf']);
-        $this->addBlock('EntryIfContentCut', [$this, 'EntryIfContentCut']);
-        $this->addValue('EntryIfFirst', [$this, 'EntryIfFirst']);
-        $this->addValue('EntryIfOdd', [$this, 'EntryIfOdd']);
-        $this->addValue('EntryIfSelected', [$this, 'EntryIfSelected']);
-        $this->addValue('EntryLang', [$this, 'EntryLang']);
-        $this->addBlock('EntryNext', [$this, 'EntryNext']);
-        $this->addValue('EntryPingCount', [$this, 'EntryPingCount']);
-        $this->addValue('EntryPingData', [$this, 'EntryPingData']);
-        $this->addValue('EntryPingLink', [$this, 'EntryPingLink']);
-        $this->addBlock('EntryPrevious', [$this, 'EntryPrevious']);
-        $this->addValue('EntryTitle', [$this, 'EntryTitle']);
-        $this->addValue('EntryTime', [$this, 'EntryTime']);
-        $this->addValue('EntryURL', [$this, 'EntryURL']);
-
-        # Languages
-        $this->addBlock('Languages', [$this, 'Languages']);
-        $this->addBlock('LanguagesHeader', [$this, 'LanguagesHeader']);
-        $this->addBlock('LanguagesFooter', [$this, 'LanguagesFooter']);
-        $this->addValue('LanguageCode', [$this, 'LanguageCode']);
-        $this->addBlock('LanguageIfCurrent', [$this, 'LanguageIfCurrent']);
-        $this->addValue('LanguageURL', [$this, 'LanguageURL']);
-
-        # Pagination
-        $this->addBlock('Pagination', [$this, 'Pagination']);
-        $this->addValue('PaginationCounter', [$this, 'PaginationCounter']);
-        $this->addValue('PaginationCurrent', [$this, 'PaginationCurrent']);
-        $this->addBlock('PaginationIf', [$this, 'PaginationIf']);
-        $this->addValue('PaginationURL', [$this, 'PaginationURL']);
-
-        # Trackbacks
-        $this->addValue('PingBlogName', [$this, 'PingBlogName']);
-        $this->addValue('PingContent', [$this, 'PingContent']);
-        $this->addValue('PingDate', [$this, 'PingDate']);
-        $this->addValue('PingEntryTitle', [$this, 'PingEntryTitle']);
-        $this->addValue('PingFeedID', [$this, 'PingFeedID']);
-        $this->addValue('PingID', [$this, 'PingID']);
-        $this->addValue('PingIfFirst', [$this, 'PingIfFirst']);
-        $this->addValue('PingIfOdd', [$this, 'PingIfOdd']);
-        $this->addValue('PingIP', [$this, 'PingIP']);
-        $this->addValue('PingNoFollow', [$this, 'PingNoFollow']);
-        $this->addValue('PingOrderNumber', [$this, 'PingOrderNumber']);
-        $this->addValue('PingPostURL', [$this, 'PingPostURL']);
-        $this->addBlock('Pings', [$this, 'Pings']);
-        $this->addBlock('PingsFooter', [$this, 'PingsFooter']);
-        $this->addBlock('PingsHeader', [$this, 'PingsHeader']);
-        $this->addValue('PingTime', [$this, 'PingTime']);
-        $this->addValue('PingTitle', [$this, 'PingTitle']);
-        $this->addValue('PingAuthorURL', [$this, 'PingAuthorURL']);
-
-        # System
-        $this->addValue('SysBehavior', [$this, 'SysBehavior']);
-        $this->addBlock('SysIf', [$this, 'SysIf']);
-        $this->addBlock('SysIfCommentPublished', [$this, 'SysIfCommentPublished']);
-        $this->addBlock('SysIfCommentPending', [$this, 'SysIfCommentPending']);
-        $this->addBlock('SysIfFormError', [$this, 'SysIfFormError']);
-        $this->addValue('SysFeedSubtitle', [$this, 'SysFeedSubtitle']);
-        $this->addValue('SysFormError', [$this, 'SysFormError']);
-        $this->addValue('SysPoweredBy', [$this, 'SysPoweredBy']);
-        $this->addValue('SysSearchString', [$this, 'SysSearchString']);
-        $this->addValue('SysSelfURI', [$this, 'SysSelfURI']);
-
-        # Generic
-        $this->addValue('else', [$this, 'GenericElse']);
-    }
-
-    public function getData($________)
-    {
-        # --BEHAVIOR-- tplBeforeData
-        if ($this->core->hasBehavior('tplBeforeData')) {
-            self::$_r = $this->core->callBehavior('tplBeforeData', $this->core);
-            if (self::$_r) {
-                return self::$_r;
-            }
-        }
-
-        parent::getData($________);
-
-        # --BEHAVIOR-- tplAfterData
-        if ($this->core->hasBehavior('tplAfterData')) {
-            $this->core->callBehavior('tplAfterData', $this->core, self::$_r);
-        }
-
-        return self::$_r;
-    }
-
-    public function compileBlockNode($tag, $attr, $content)
-    {
-        $this->current_tag = $tag;
-        $attr              = new ArrayObject($attr);
-        # --BEHAVIOR-- templateBeforeBlock
-        $res = $this->core->callBehavior('templateBeforeBlock', $this->core, $this->current_tag, $attr);
-
-        # --BEHAVIOR-- templateInsideBlock
-        $this->core->callBehavior('templateInsideBlock', $this->core, $this->current_tag, $attr, [ & $content]);
-
-        $res .= parent::compileBlockNode($this->current_tag, $attr, $content);
-
-        # --BEHAVIOR-- templateAfterBlock
-        $res .= $this->core->callBehavior('templateAfterBlock', $this->core, $this->current_tag, $attr);
-
-        return $res;
-    }
-
-    public function compileValueNode($tag, $attr, $str_attr)
-    {
-        $this->current_tag = $tag;
-
-        $attr = new ArrayObject($attr);
-        # --BEHAVIOR-- templateBeforeValue
-        $res = $this->core->callBehavior('templateBeforeValue', $this->core, $this->current_tag, $attr);
-
-        $res .= parent::compileValueNode($this->current_tag, $attr, $str_attr);
-
-        # --BEHAVIOR-- templateAfterValue
-        $res .= $this->core->callBehavior('templateAfterValue', $this->core, $this->current_tag, $attr);
-
-        return $res;
-    }
-
-    public function getFilters($attr, $default = [])
-    {
-        if (!is_array($attr) && !($attr instanceof arrayObject)) {
-            $attr = [];
-        }
-
-        $p = array_merge(
-            [
-                0             => null,
-                'encode_xml'  => 0,
-                'encode_html' => 0,
-                'cut_string'  => 0,
-                'lower_case'  => 0,
-                'upper_case'  => 0,
-                'encode_url'  => 0,
-                'remove_html' => 0,
-                'capitalize'  => 0,
-                'strip_tags'  => 0
-            ],
-            $default
-        );
-
-        foreach ($attr as $k => $v) {
-            // attributes names must follow this rule
-            $k = preg_filter('/[a-zA-Z0-9_]/', '$0', $k);
-            if ($k) {
-                // addslashes protect var_export, str_replace protect sprintf;
-                $p[$k] = str_replace('%', '%%', addslashes($v));
-            }
-        }
-
-        return "context::global_filters(%s," . var_export($p, true) . ",'" . addslashes($this->current_tag) . "')";
-    }
-
-    public static function getOperator($op)
-    {
-        switch (strtolower($op)) {
-            case 'or':
-            case '||':
-                return '||';
-            case 'and':
-            case '&&':
-            default:
-                return '&&';
-        }
-    }
-
-    public function getSortByStr($attr, $table = null)
-    {
-        $res = [];
-
-        $default_order = 'desc';
-
-        $default_alias = [
-            'post'    => [
-                'title'     => 'post_title',
-                'selected'  => 'post_selected',
-                'author'    => 'user_id',
-                'date'      => 'post_dt',
-                'id'        => 'post_id',
-                'comment'   => 'nb_comment',
-                'trackback' => 'nb_trackback'
-            ],
-            'comment' => [
-                'author' => 'comment_author',
-                'date'   => 'comment_dt',
-                'id'     => 'comment_id'
-            ]
-        ];
-
-        $alias = new ArrayObject();
-
-        # --BEHAVIOR-- templateCustomSortByAlias
-        $this->core->callBehavior('templateCustomSortByAlias', $alias);
-
-        $alias = $alias->getArrayCopy();
-
-        if (is_array($alias)) {
-            foreach ($alias as $k => $v) {
-                if (!is_array($v)) {
-                    $alias[$k] = [];
-                }
-                if (!isset($default_alias[$k]) || !is_array($default_alias[$k])) {
-                    $default_alias[$k] = [];
-                }
-                $default_alias[$k] = array_merge($default_alias[$k], $alias[$k]);
-            }
-        }
-
-        if (!array_key_exists($table, $default_alias)) {
-            return implode(', ', $res);
-        }
-
-        if (isset($attr['order']) && preg_match('/^(desc|asc)$/i', $attr['order'])) {
-            $default_order = $attr['order'];
-        }
-        if (isset($attr['sortby'])) {
-            $sorts = explode(',', $attr['sortby']);
-            foreach ($sorts as $k => $sort) {
-                $order = $default_order;
-                if (preg_match('/([a-z]*)\s*\?(desc|asc)$/i', $sort, $matches)) {
-                    $sort  = $matches[1];
-                    $order = $matches[2];
-                }
-                if (array_key_exists($sort, $default_alias[$table])) {
-                    array_push($res, $default_alias[$table][$sort] . ' ' . $order);
-                }
-            }
-        }
-
-        if (count($res) === 0) {
-            array_push($res, $default_alias[$table]['date'] . ' ' . $default_order);
-        }
-
-        return implode(', ', $res);
-    }
-
-    public static function getAge($attr)
-    {
-        if (isset($attr['age']) && preg_match('/^(\-[0-9]+|last).*$/i', $attr['age'])) {
-            if (($ts = strtotime($attr['age'])) !== false) {
-                return dt::str('%Y-%m-%d %H:%m:%S', $ts);
-            }
-        }
-        return '';
-    }
-
-    public function displayCounter($variable, $values, $attr, $count_only_by_default = false)
-    {
-        if (isset($attr['count_only'])) {
-            $count_only = ($attr['count_only'] == 1);
-        } else {
-            $count_only = $count_only_by_default;
-        }
-        if ($count_only) {
-            return "<?php echo " . $variable . "; ?>";
-        } else {
-            $v = $values;
-            if (isset($attr['none'])) {
-                $v['none'] = addslashes($attr['none']);
-            }
-            if (isset($attr['one'])) {
-                $v['one'] = addslashes($attr['one']);
-            }
-            if (isset($attr['more'])) {
-                $v['more'] = addslashes($attr['more']);
-            }
-            return
-                "<?php if (" . $variable . " == 0) {\n" .
-                "  printf(__('" . $v['none'] . "')," . $variable . ");\n" .
-                "} elseif (" . $variable . " == 1) {\n" .
-                "  printf(__('" . $v['one'] . "')," . $variable . ");\n" .
-                "} else {\n" .
-                "  printf(__('" . $v['more'] . "')," . $variable . ");\n" .
-                "} ?>";
-        }
-    }
-    /* TEMPLATE FUNCTIONS
-    ------------------------------------------------------- */
-
-    public function l10n($attr, $str_attr)
-    {
-        # Normalize content
-        $str_attr = preg_replace('/\s+/x', ' ', $str_attr);
-
-        return "<?php echo __('" . str_replace("'", "\\'", $str_attr) . "'); ?>";
-    }
-
-    public function LoopPosition($attr, $content)
-    {
-        $start  = isset($attr['start']) ? (integer) $attr['start'] : '0';
-        $length = isset($attr['length']) ? (integer) $attr['length'] : 'null';
-        $even   = isset($attr['even']) ? (integer) (boolean) $attr['even'] : 'null';
-        $modulo = isset($attr['modulo']) ? (integer) $attr['modulo'] : 'null';
-
-        if ($start > 0) {
-            $start--;
-        }
-
-        return
-            '<?php if ($_ctx->loopPosition(' . $start . ',' . $length . ',' . $even . ',' . $modulo . ')) : ?>' .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    public function LoopIndex($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '(!$_ctx->cur_loop ? 0 : $_ctx->cur_loop->index() + 1)') . '; ?>';
-    }
-
-    /* Archives ------------------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:Archives - - -- Archives dates loop -->
-    <!ATTLIST tpl:Archives
-    type        (day|month|year)    #IMPLIED    -- Get days, months or years, default to month --
-    category    CDATA            #IMPLIED  -- Get dates of given category --
-    no_context (1|0)            #IMPLIED  -- Override context information
-    order    (asc|desc)        #IMPLIED  -- Sort asc or desc --
-    post_type    CDATA            #IMPLIED  -- Get dates of given type of entries, default to post --
-    post_lang    CDATA        #IMPLIED  -- Filter on the given language
-    >
-     */
-    public function Archives($attr, $content)
-    {
-        $p = "if (!isset(\$params)) \$params = [];\n";
-        $p .= "\$params['type'] = 'month';\n";
-        if (isset($attr['type'])) {
-            $p .= "\$params['type'] = '" . addslashes($attr['type']) . "';\n";
-        }
-
-        if (isset($attr['category'])) {
-            $p .= "\$params['cat_url'] = '" . addslashes($attr['category']) . "';\n";
-        }
-
-        if (isset($attr['post_type'])) {
-            $p .= "\$params['post_type'] = '" . addslashes($attr['post_type']) . "';\n";
-        }
-
-        if (isset($attr['post_lang'])) {
-            $p .= "\$params['post_lang'] = '" . addslashes($attr['post_lang']) . "';\n";
-        }
-
-        if (empty($attr['no_context']) && !isset($attr['category'])) {
-            $p .=
-                'if ($_ctx->exists("categories")) { ' .
-                "\$params['cat_id'] = \$_ctx->categories->cat_id; " .
-                "}\n";
-        }
-
-        $order = 'desc';
-        if (isset($attr['order']) && preg_match('/^(desc|asc)$/i', $attr['order'])) {
-            $p .= "\$params['order'] = '" . $attr['order'] . "';\n ";
-        }
-
-        $res = "<?php\n";
-        $res .= $p;
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "Archives", "method" => "blog::getDates"],
-            $attr, $content);
-        $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);' . "\n";
-        $res .= "?>\n";
-
-        $res .=
-            '<?php while ($_ctx->archives->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->archives = null; ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchivesHeader - - -- First archives result container -->
-     */
-    public function ArchivesHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->archives->isStart()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchivesFooter - - -- Last archives result container -->
-     */
-    public function ArchivesFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->archives->isEnd()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchivesYearHeader - - -- First result of year in archives container -->
-     */
-    public function ArchivesYearHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->archives->yearHeader()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchivesYearFooter - - -- Last result of year in archives container -->
-     */
-    public function ArchivesYearFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->archives->yearFooter()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchiveDate - O -- Archive result date -->
-    <!ATTLIST tpl:ArchiveDate
-    format    CDATA    #IMPLIED  -- Date format (Default %B %Y) --
-    >
-     */
-    public function ArchiveDate($attr)
-    {
-        $format = '%B %Y';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "dt::dt2str('" . $format . "',\$_ctx->archives->dt)") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchiveEntriesCount - O -- Current archive result number of entries -->
-     */
-    public function ArchiveEntriesCount($attr)
-    {
-        $f = $this->getFilters($attr);
-        return $this->displayCounter(
-            sprintf($f, '$_ctx->archives->nb_post'),
-            [
-                'none' => 'no archive',
-                'one'  => 'one archive',
-                'more' => '%d archives'
-            ],
-            $attr,
-            true
-        );
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchiveNext - - -- Next archive result container -->
-    <!ATTLIST tpl:ArchiveNext
-    type        (day|month|year)    #IMPLIED    -- Get days, months or years, default to month --
-    post_type    CDATA            #IMPLIED  -- Get dates of given type of entries, default to post --
-    post_lang    CDATA        #IMPLIED  -- Filter on the given language
-    >
-     */
-    public function ArchiveNext($attr, $content)
-    {
-        $p = "if (!isset(\$params)) \$params = [];\n";
-        $p .= "\$params['type'] = 'month';\n";
-        if (isset($attr['type'])) {
-            $p .= "\$params['type'] = '" . addslashes($attr['type']) . "';\n";
-        }
-
-        if (isset($attr['post_type'])) {
-            $p .= "\$params['post_type'] = '" . addslashes($attr['post_type']) . "';\n";
-        }
-
-        if (isset($attr['post_lang'])) {
-            $p .= "\$params['post_lang'] = '" . addslashes($attr['post_lang']) . "';\n";
-        }
-
-        $p .= "\$params['next'] = \$_ctx->archives->dt;";
-
-        $res = "<?php\n";
-        $res .= $p;
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "ArchiveNext", "method" => "blog::getDates"],
-            $attr, $content);
-        $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);' . "\n";
-        $res .= "?>\n";
-
-        $res .=
-            '<?php while ($_ctx->archives->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->archives = null; ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchivePrevious - - -- Previous archive result container -->
-    <!ATTLIST tpl:ArchivePrevious
-    type        (day|month|year)    #IMPLIED    -- Get days, months or years, default to month --
-    post_type    CDATA            #IMPLIED  -- Get dates of given type of entries, default to post --
-    post_lang    CDATA        #IMPLIED  -- Filter on the given language
-    >
-     */
-    public function ArchivePrevious($attr, $content)
-    {
-        $p = 'if (!isset($params)) $params = [];';
-        $p .= "\$params['type'] = 'month';\n";
-        if (isset($attr['type'])) {
-            $p .= "\$params['type'] = '" . addslashes($attr['type']) . "';\n";
-        }
-
-        if (isset($attr['post_type'])) {
-            $p .= "\$params['post_type'] = '" . addslashes($attr['post_type']) . "';\n";
-        }
-
-        if (isset($attr['post_lang'])) {
-            $p .= "\$params['post_lang'] = '" . addslashes($attr['post_lang']) . "';\n";
-        }
-
-        $p .= "\$params['previous'] = \$_ctx->archives->dt;";
-
-        $res = "<?php\n";
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "ArchivePrevious", "method" => "blog::getDates"],
-            $attr, $content);
-        $res .= $p;
-        $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);' . "\n";
-        $res .= "?>\n";
-
-        $res .=
-            '<?php while ($_ctx->archives->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->archives = null; ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:ArchiveURL - O -- Current archive result URL -->
-     */
-    public function ArchiveURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->archives->url($core)') . '; ?>';
-    }
-
-    /* Blog ----------------------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:BlogArchiveURL - O -- Blog Archives URL -->
-     */
-    public function BlogArchiveURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url.$core->url->getURLFor("archive")') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogCopyrightNotice - O -- Blog copyrght notices -->
-     */
-    public function BlogCopyrightNotice($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->settings->system->copyright_notice') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogDescription - O -- Blog Description -->
-     */
-    public function BlogDescription($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->desc') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogEditor - O -- Blog Editor -->
-     */
-    public function BlogEditor($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->settings->system->editor') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogFeedID - O -- Blog Feed ID -->
-     */
-    public function BlogFeedID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '"urn:md5:".$core->blog->uid') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogFeedURL - O -- Blog Feed URL -->
-    <!ATTLIST tpl:BlogFeedURL
-    type    (rss2|atom)    #IMPLIED    -- feed type (default : rss2)
-    >
-     */
-    public function BlogFeedURL($attr)
-    {
-        $type = !empty($attr['type']) ? $attr['type'] : 'atom';
-
-        if (!preg_match('#^(rss2|atom)$#', $type)) {
-            $type = 'atom';
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url.$core->url->getURLFor("feed","' . $type . '")') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogName - O -- Blog Name -->
-     */
-    public function BlogName($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->name') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogLanguage - O -- Blog Language -->
-     */
-    public function BlogLanguage($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->settings->system->lang') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogThemeURL - O -- Blog's current Theme URL -->
-     */
-    public function BlogThemeURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->settings->system->themes_url."/".$core->blog->settings->system->theme') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogParentThemeURL - O -- Blog's current Theme's parent URL -->
-     */
-    public function BlogParentThemeURL($attr)
-    {
-        $f      = $this->getFilters($attr);
-        $parent = '$core->themes->moduleInfo($core->blog->settings->system->theme,\'parent\')';
-        return '<?php echo ' . sprintf($f, '$core->blog->settings->system->themes_url."/".(' . "$parent" . ' ? ' . "$parent" . ' : $core->blog->settings->system->theme)') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogPublicURL - O -- Blog Public directory URL -->
-     */
-    public function BlogPublicURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->settings->system->public_url') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogUpdateDate - O -- Blog last update date -->
-    <!ATTLIST tpl:BlogUpdateDate
-    format    CDATA    #IMPLIED    -- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
-    iso8601    CDATA    #IMPLIED    -- if set, tells that date format is ISO 8601
-    rfc822    CDATA    #IMPLIED    -- if set, tells that date format is RFC 822
-    >
-     */
-    public function BlogUpdateDate($attr)
-    {
-        $format = '';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        } else {
-            $format = '%Y-%m-%d %H:%M:%S';
-        }
-
-        $iso8601 = !empty($attr['iso8601']);
-        $rfc822  = !empty($attr['rfc822']);
-
-        $f = $this->getFilters($attr);
-
-        if ($rfc822) {
-            return '<?php echo ' . sprintf($f, "dt::rfc822(\$core->blog->upddt,\$core->blog->settings->system->blog_timezone)") . '; ?>';
-        } elseif ($iso8601) {
-            return '<?php echo ' . sprintf($f, "dt::iso8601(\$core->blog->upddt,\$core->blog->settings->system->blog_timezone)") . '; ?>';
-        } else {
-            return '<?php echo ' . sprintf($f, "dt::str('" . $format . "',\$core->blog->upddt)") . '; ?>';
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogID - 0 -- Blog ID -->
-     */
-    public function BlogID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->id') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogRSDURL - O -- Blog RSD URL -->
-     */
-    public function BlogRSDURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url.$core->url->getURLFor(\'rsd\')') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogXMLRPCURL - O -- Blog XML-RPC URL -->
-     */
-    public function BlogXMLRPCURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url.$core->url->getURLFor(\'xmlrpc\',$core->blog->id)') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogURL - O -- Blog URL -->
-     */
-    public function BlogURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogQmarkURL - O -- Blog URL, ending with a question mark -->
-     */
-    public function BlogQmarkURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->getQmarkURL()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:BlogMetaRobots - O -- Blog meta robots tag definition, overrides robots_policy setting -->
-    <!ATTLIST tpl:BlogMetaRobots
-    robots    CDATA    #IMPLIED    -- can be INDEX,FOLLOW,NOINDEX,NOFOLLOW,ARCHIVE,NOARCHIVE
-    >
-     */
-    public function BlogMetaRobots($attr)
-    {
-        $robots = isset($attr['robots']) ? addslashes($attr['robots']) : '';
-        return "<?php echo context::robotsPolicy(\$core->blog->settings->system->robots_policy,'" . $robots . "'); ?>";
-    }
-
-    /*dtd
-    <!ELEMENT gpl:BlogJsJQuery - 0 -- Blog Js jQuery version selected -->
-     */
-    public function BlogJsJQuery($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->getJsJQuery()') . '; ?>';
-    }
-
-    /* Categories ----------------------------------------- */
-
-    /*dtd
-    <!ELEMENT tpl:Categories - - -- Categories loop -->
-     */
-    public function Categories($attr, $content)
-    {
-        $p = "if (!isset(\$params)) \$params = [];\n";
-
-        if (isset($attr['url'])) {
-            $p .= "\$params['cat_url'] = '" . addslashes($attr['url']) . "';\n";
-        }
-
-        if (!empty($attr['post_type'])) {
-            $p .= "\$params['post_type'] = '" . addslashes($attr['post_type']) . "';\n";
-        }
-
-        if (!empty($attr['level'])) {
-            $p .= "\$params['level'] = " . (integer) $attr['level'] . ";\n";
-        }
-
-        if (isset($attr['with_empty']) && ((boolean) $attr['with_empty'] == true)) {
-            $p .= '$params[\'without_empty\'] = false;';
-        }
-
-        $res = "<?php\n";
-        $res .= $p;
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "Categories", "method" => "blog::getCategories"],
-            $attr, $content);
-        $res .= '$_ctx->categories = $core->blog->getCategories($params);' . "\n";
-        $res .= "?>\n";
-        $res .= '<?php while ($_ctx->categories->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->categories = null; unset($params); ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoriesHeader - - -- First Categories result container -->
-     */
-    public function CategoriesHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->categories->isStart()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoriesFooter - - -- Last Categories result container -->
-     */
-    public function CategoriesFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->categories->isEnd()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryIf - - -- tests on current entry -->
-    <!ATTLIST tpl:CategoryIf
-    url        CDATA    #IMPLIED    -- category has given url
-    urls    CDATA    #IMPLIED    -- category has one of given urls
-    has_entries    (0|1)    #IMPLIED    -- post is the first post from list (value : 1) or not (value : 0)
-    has_description     (0|1)     #IMPLIED  -- category has description (value : 1) or not (value : 0)
-    >
-     */
-    public function CategoryIf($attr, $content)
-    {
-        $if       = new ArrayObject();
-        $operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
-
-        if (isset($attr['url'])) {
-            $url  = addslashes(trim($attr['url']));
-            $args = preg_split('/\s*[?]\s*/', $url, -1, PREG_SPLIT_NO_EMPTY);
-            $url  = array_shift($args);
-            $args = array_flip($args);
-            if (substr($url, 0, 1) == '!') {
-                $url = substr($url, 1);
-                if (isset($args['sub'])) {
-                    $if[] = '(!$core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))';
-                } else {
-                    $if[] = '($_ctx->categories->cat_url != "' . $url . '")';
-                }
-            } else {
-                if (isset($args['sub'])) {
-                    $if[] = '($core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))';
-                } else {
-                    $if[] = '($_ctx->categories->cat_url == "' . $url . '")';
-                }
-            }
-        }
-
-        if (isset($attr['urls'])) {
-            $urls = explode(',', addslashes(trim($attr['urls'])));
-            if (is_array($urls) && count($urls)) {
-                foreach ($urls as $url) {
-                    $args = preg_split('/\s*[?]\s*/', trim($url), -1, PREG_SPLIT_NO_EMPTY);
-                    $url  = array_shift($args);
-                    $args = array_flip($args);
-                    if (substr($url, 0, 1) == '!') {
-                        $url = substr($url, 1);
-                        if (isset($args['sub'])) {
-                            $if[] = '(!$core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))';
-                        } else {
-                            $if[] = '($_ctx->categories->cat_url != "' . $url . '")';
-                        }
-                    } else {
-                        if (isset($args['sub'])) {
-                            $if[] = '($core->blog->IsInCatSubtree($_ctx->categories->cat_url, "' . $url . '"))';
-                        } else {
-                            $if[] = '($_ctx->categories->cat_url == "' . $url . '")';
-                        }
-                    }
-                }
-            }
-        }
-
-        if (isset($attr['has_entries'])) {
-            $sign = (boolean) $attr['has_entries'] ? '>' : '==';
-            $if[] = '$_ctx->categories->nb_post ' . $sign . ' 0';
-        }
-
-        if (isset($attr['has_description'])) {
-            $sign = (boolean) $attr['has_description'] ? '!=' : '==';
-            $if[] = '$_ctx->categories->cat_desc ' . $sign . ' ""';
-        }
-
-        $this->core->callBehavior('tplIfConditions', 'CategoryIf', $attr, $content, $if);
-
-        if (count($if) != 0) {
-            return '<?php if(' . implode(' ' . $operator . ' ', (array) $if) . ') : ?>' . $content . '<?php endif; ?>';
-        } else {
-            return $content;
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryFirstChildren - - -- Current category first children loop -->
-     */
-    public function CategoryFirstChildren($attr, $content)
-    {
-        return
-            "<?php\n" .
-            '$_ctx->categories = $core->blog->getCategoryFirstChildren($_ctx->categories->cat_id);' . "\n" .
-            'while ($_ctx->categories->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->categories = null; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryParents - - -- Current category parents loop -->
-     */
-    public function CategoryParents($attr, $content)
-    {
-        return
-            "<?php\n" .
-            '$_ctx->categories = $core->blog->getCategoryParents($_ctx->categories->cat_id);' . "\n" .
-            'while ($_ctx->categories->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->categories = null; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryFeedURL - O -- Category feed URL -->
-    <!ATTLIST tpl:CategoryFeedURL
-    type    (rss2|atom)    #IMPLIED    -- feed type (default : rss2)
-    >
-     */
-    public function CategoryFeedURL($attr)
-    {
-        $type = !empty($attr['type']) ? $attr['type'] : 'atom';
-
-        if (!preg_match('#^(rss2|atom)$#', $type)) {
-            $type = 'atom';
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url.$core->url->getURLFor("feed","category/".' .
-            '$_ctx->categories->cat_url."/' . $type . '")') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryURL - O -- Category URL (complete iabsolute URL, including blog URL) -->
-     */
-    public function CategoryURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url.$core->url->getURLFor("category",' .
-            '$_ctx->categories->cat_url)') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryShortURL - O -- Category short URL (relative URL, from /category/) -->
-     */
-    public function CategoryShortURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->categories->cat_url') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryDescription - O -- Category description -->
-     */
-    public function CategoryDescription($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->categories->cat_desc') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryTitle - O -- Category title -->
-     */
-    public function CategoryTitle($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->categories->cat_title') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CategoryEntriesCount - O -- Category number of entries -->
-     */
-    public function CategoryEntriesCount($attr)
-    {
-        $f = $this->getFilters($attr);
-        return $this->displayCounter(
-            sprintf($f, '$_ctx->categories->nb_post'),
-            [
-                'none' => 'No post',
-                'one'  => 'One post',
-                'more' => '%d posts'
-            ],
-            $attr,
-            true
-        );
-    }
-
-    /* Entries -------------------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:Entries - - -- Blog Entries loop -->
-    <!ATTLIST tpl:Entries
-    lastn    CDATA    #IMPLIED    -- limit number of results to specified value
-    author    CDATA    #IMPLIED    -- get entries for a given user id
-    category    CDATA    #IMPLIED    -- get entries for specific categories only (multiple comma-separated categories can be specified. Use "!" as prefix to exclude a category)
-    no_category    CDATA    #IMPLIED    -- get entries without category
-    with_category    CDATA    #IMPLIED    -- get entries with category
-    no_context (1|0)    #IMPLIED  -- Override context information
-    sortby    (title|selected|author|date|id)    #IMPLIED    -- specify entries sort criteria (default : date) (multiple comma-separated sortby can be specified. Use "?asc" or "?desc" as suffix to provide an order for each sorby)
-    order    (desc|asc)    #IMPLIED    -- specify entries order (default : desc)
-    no_content    (0|1)    #IMPLIED    -- do not retrieve entries content
-    selected    (0|1)    #IMPLIED    -- retrieve posts marked as selected only (value: 1) or not selected only (value: 0)
-    url        CDATA    #IMPLIED    -- retrieve post by its url
-    type        CDATA    #IMPLIED    -- retrieve post with given post_type (there can be many ones separated by comma)
-    age        CDATA    #IMPLIED    -- retrieve posts by maximum age (ex: -2 days, last month, last week)
-    ignore_pagination    (0|1)    #IMPLIED    -- ignore page number provided in URL (useful when using multiple tpl:Entries on the same page)
-    >
-     */
-    public function Entries($attr, $content)
-    {
-        $lastn = -1;
-        if (isset($attr['lastn'])) {
-            $lastn = abs((integer) $attr['lastn']) + 0;
-        }
-
-        $p = 'if (!isset($_page_number)) { $_page_number = 1; }' . "\n";
-
-        if ($lastn != 0) {
-            // Set limit (aka nb of entries needed)
-            if ($lastn > 0) {
-                // nb of entries per page specified in template -> regular pagination
-                $p .= "\$params['limit'] = " . $lastn . ";\n";
-                $p .= "\$nb_entry_first_page = \$nb_entry_per_page = " . $lastn . ";\n";
-            } else {
-                // nb of entries per page not specified -> use ctx settings
-                $p .= "\$nb_entry_first_page=\$_ctx->nb_entry_first_page; \$nb_entry_per_page = \$_ctx->nb_entry_per_page;\n";
-                $p .= "if ((\$core->url->type == 'default') || (\$core->url->type == 'default-page')) {\n";
-                $p .= "    \$params['limit'] = (\$_page_number == 1 ? \$nb_entry_first_page : \$nb_entry_per_page);\n";
-                $p .= "} else {\n";
-                $p .= "    \$params['limit'] = \$nb_entry_per_page;\n";
-                $p .= "}\n";
-            }
-            // Set offset (aka index of first entry)
-            if (!isset($attr['ignore_pagination']) || $attr['ignore_pagination'] == "0") {
-                // standard pagination, set offset
-                $p .= "if ((\$core->url->type == 'default') || (\$core->url->type == 'default-page')) {\n";
-                $p .= "    \$params['limit'] = [(\$_page_number == 1 ? 0 : (\$_page_number - 2) * \$nb_entry_per_page + \$nb_entry_first_page),\$params['limit']];\n";
-                $p .= "} else {\n";
-                $p .= "    \$params['limit'] = [(\$_page_number - 1) * \$nb_entry_per_page,\$params['limit']];\n";
-                $p .= "}\n";
-            } else {
-                // no pagination, get all posts from 0 to limit
-                $p .= "\$params['limit'] = [0, \$params['limit']];\n";
-            }
-        }
-
-        if (isset($attr['author'])) {
-            $p .= "\$params['user_id'] = '" . addslashes($attr['author']) . "';\n";
-        }
-
-        if (isset($attr['category'])) {
-            $p .= "\$params['cat_url'] = '" . addslashes($attr['category']) . "';\n";
-            $p .= "context::categoryPostParam(\$params);\n";
-        }
-
-        if (isset($attr['with_category']) && $attr['with_category']) {
-            $p .= "@\$params['sql'] .= ' AND P.cat_id IS NOT NULL ';\n";
-        }
-
-        if (isset($attr['no_category']) && $attr['no_category']) {
-            $p .= "@\$params['sql'] .= ' AND P.cat_id IS NULL ';\n";
-            $p .= "unset(\$params['cat_url']);\n";
-        }
-
-        if (!empty($attr['type'])) {
-            $p .= "\$params['post_type'] = preg_split('/\s*,\s*/','" . addslashes($attr['type']) . "',-1,PREG_SPLIT_NO_EMPTY);\n";
-        }
-
-        if (!empty($attr['url'])) {
-            $p .= "\$params['post_url'] = '" . addslashes($attr['url']) . "';\n";
-        }
-
-        if (empty($attr['no_context'])) {
-            if (!isset($attr['author'])) {
-                $p .=
-                    'if ($_ctx->exists("users")) { ' .
-                    "\$params['user_id'] = \$_ctx->users->user_id; " .
-                    "}\n";
-            }
-
-            if (!isset($attr['category']) && (!isset($attr['no_category']) || !$attr['no_category'])) {
-                $p .=
-                    'if ($_ctx->exists("categories")) { ' .
-                    "\$params['cat_id'] = \$_ctx->categories->cat_id.(\$core->blog->settings->system->inc_subcats?' ?sub':'');" .
-                    "}\n";
-            }
-
-            $p .=
-                'if ($_ctx->exists("archives")) { ' .
-                "\$params['post_year'] = \$_ctx->archives->year(); " .
-                "\$params['post_month'] = \$_ctx->archives->month(); ";
-            if (!isset($attr['lastn'])) {
-                $p .= "unset(\$params['limit']); ";
-            }
-            $p .=
-                "}\n";
-
-            $p .=
-                'if ($_ctx->exists("langs")) { ' .
-                "\$params['post_lang'] = \$_ctx->langs->post_lang; " .
-                "}\n";
-
-            $p .=
-                'if (isset($_search)) { ' .
-                "\$params['search'] = \$_search; " .
-                "}\n";
-        }
-
-        $p .= "\$params['order'] = '" . $this->getSortByStr($attr, 'post') . "';\n";
-
-        if (isset($attr['no_content']) && $attr['no_content']) {
-            $p .= "\$params['no_content'] = true;\n";
-        }
-
-        if (isset($attr['selected'])) {
-            $p .= "\$params['post_selected'] = " . (integer) (boolean) $attr['selected'] . ";";
-        }
-
-        if (isset($attr['age'])) {
-            $age = $this->getAge($attr);
-            $p .= !empty($age) ? "@\$params['sql'] .= ' AND P.post_dt > \'" . $age . "\'';\n" : '';
-        }
-
-        $res = "<?php\n";
-        $res .= $p;
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "Entries", "method" => "blog::getPosts"],
-            $attr, $content);
-        $res .= '$_ctx->post_params = $params;' . "\n";
-        $res .= '$_ctx->posts = $core->blog->getPosts($params); unset($params);' . "\n";
-        $res .= "?>\n";
-        $res .=
-            '<?php while ($_ctx->posts->fetch()) : ?>' . $content . '<?php endwhile; ' .
-            '$_ctx->posts = null; $_ctx->post_params = null; ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:DateHeader - O -- Displays date, if post is the first post of the given day -->
-     */
-    public function DateHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->posts->firstPostOfDay()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:DateFooter - O -- Displays date,  if post is the last post of the given day -->
-     */
-    public function DateFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->posts->lastPostOfDay()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryIf - - -- tests on current entry -->
-    <!ATTLIST tpl:EntryIf
-    type    CDATA    #IMPLIED    -- post has a given type (default: "post")
-    category    CDATA    #IMPLIED    -- post has a given category
-    categories    CDATA    #IMPLIED    -- post has a one of given categories
-    first    (0|1)    #IMPLIED    -- post is the first post from list (value : 1) or not (value : 0)
-    odd    (0|1)    #IMPLIED    -- post is in an odd position (value : 1) or not (value : 0)
-    even    (0|1)    #IMPLIED    -- post is in an even position (value : 1) or not (value : 0)
-    extended    (0|1)    #IMPLIED    -- post has an excerpt (value : 1) or not (value : 0)
-    selected    (0|1)    #IMPLIED    -- post is selected (value : 1) or not (value : 0)
-    has_category    (0|1)    #IMPLIED    -- post has a category (value : 1) or not (value : 0)
-    has_attachment    (0|1)    #IMPLIED    -- post has attachments (value : 1) or not (value : 0) (see Attachment plugin for code)
-    comments_active    (0|1)    #IMPLIED    -- comments are active for this post (value : 1) or not (value : 0)
-    pings_active    (0|1)    #IMPLIED    -- trackbacks are active for this post (value : 1) or not (value : 0)
-    show_comments    (0|1)    #IMPLIED    -- there are comments for this post (value : 1) or not (value : 0)
-    show_pings    (0|1)    #IMPLIED    -- there are trackbacks for this post (value : 1) or not (value : 0)
-    republished    (0|1)    #IMPLIED    -- post has been updated since publication (value : 1) or not (value : 0)
-    operator    (and|or)    #IMPLIED    -- combination of conditions, if more than 1 specifiec (default: and)
-    url        CDATA    #IMPLIED    -- post has given url
-    >
-     */
-    public function EntryIf($attr, $content)
-    {
-        $if          = new ArrayObject();
-        $extended    = null;
-        $hascategory = null;
-
-        $operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
-
-        if (isset($attr['type'])) {
-            $type = trim($attr['type']);
-            $type = !empty($type) ? $type : 'post';
-            $if[] = '$_ctx->posts->post_type == "' . addslashes($type) . '"';
-        }
-
-        if (isset($attr['url'])) {
-            $url = trim($attr['url']);
-            if (substr($url, 0, 1) == '!') {
-                $url  = substr($url, 1);
-                $if[] = '$_ctx->posts->post_url != "' . addslashes($url) . '"';
-            } else {
-                $if[] = '$_ctx->posts->post_url == "' . addslashes($url) . '"';
-            }
-        }
-
-        if (isset($attr['category'])) {
-            $category = addslashes(trim($attr['category']));
-            $args     = preg_split('/\s*[?]\s*/', $category, -1, PREG_SPLIT_NO_EMPTY);
-            $category = array_shift($args);
-            $args     = array_flip($args);
-            if (substr($category, 0, 1) == '!') {
-                $category = substr($category, 1);
-                if (isset($args['sub'])) {
-                    $if[] = '(!$_ctx->posts->underCat("' . $category . '"))';
-                } else {
-                    $if[] = '($_ctx->posts->cat_url != "' . $category . '")';
-                }
-            } else {
-                if (isset($args['sub'])) {
-                    $if[] = '($_ctx->posts->underCat("' . $category . '"))';
-                } else {
-                    $if[] = '($_ctx->posts->cat_url == "' . $category . '")';
-                }
-            }
-        }
-
-        if (isset($attr['categories'])) {
-            $categories = explode(',', addslashes(trim($attr['categories'])));
-            if (is_array($categories) && count($categories)) {
-                foreach ($categories as $category) {
-                    $args     = preg_split('/\s*[?]\s*/', trim($category), -1, PREG_SPLIT_NO_EMPTY);
-                    $category = array_shift($args);
-                    $args     = array_flip($args);
-                    if (substr($category, 0, 1) == '!') {
-                        $category = substr($category, 1);
-                        if (isset($args['sub'])) {
-                            $if[] = '(!$_ctx->posts->underCat("' . $category . '"))';
-                        } else {
-                            $if[] = '($_ctx->posts->cat_url != "' . $category . '")';
-                        }
-                    } else {
-                        if (isset($args['sub'])) {
-                            $if[] = '($_ctx->posts->underCat("' . $category . '"))';
-                        } else {
-                            $if[] = '($_ctx->posts->cat_url == "' . $category . '")';
-                        }
-                    }
-                }
-            }
-        }
-
-        if (isset($attr['first'])) {
-            $sign = (boolean) $attr['first'] ? '=' : '!';
-            $if[] = '$_ctx->posts->index() ' . $sign . '= 0';
-        }
-
-        if (isset($attr['odd'])) {
-            $sign = (boolean) $attr['odd'] ? '=' : '!';
-            $if[] = '($_ctx->posts->index()+1)%2 ' . $sign . '= 1';
-        }
-
-        if (isset($attr['extended'])) {
-            $sign = (boolean) $attr['extended'] ? '' : '!';
-            $if[] = $sign . '$_ctx->posts->isExtended()';
-        }
-
-        if (isset($attr['selected'])) {
-            $sign = (boolean) $attr['selected'] ? '' : '!';
-            $if[] = $sign . '(boolean)$_ctx->posts->post_selected';
-        }
-
-        if (isset($attr['has_category'])) {
-            $sign = (boolean) $attr['has_category'] ? '' : '!';
-            $if[] = $sign . '$_ctx->posts->cat_id';
-        }
-
-        if (isset($attr['comments_active'])) {
-            $sign = (boolean) $attr['comments_active'] ? '' : '!';
-            $if[] = $sign . '$_ctx->posts->commentsActive()';
-        }
-
-        if (isset($attr['pings_active'])) {
-            $sign = (boolean) $attr['pings_active'] ? '' : '!';
-            $if[] = $sign . '$_ctx->posts->trackbacksActive()';
-        }
-
-        if (isset($attr['has_comment'])) {
-            $sign = (boolean) $attr['has_comment'] ? '' : '!';
-            $if[] = $sign . '$_ctx->posts->hasComments()';
-        }
-
-        if (isset($attr['has_ping'])) {
-            $sign = (boolean) $attr['has_ping'] ? '' : '!';
-            $if[] = $sign . '$_ctx->posts->hasTrackbacks()';
-        }
-
-        if (isset($attr['show_comments'])) {
-            if ((boolean) $attr['show_comments']) {
-                $if[] = '($_ctx->posts->hasComments() || $_ctx->posts->commentsActive())';
-            } else {
-                $if[] = '(!$_ctx->posts->hasComments() && !$_ctx->posts->commentsActive())';
-            }
-        }
-
-        if (isset($attr['show_pings'])) {
-            if ((boolean) $attr['show_pings']) {
-                $if[] = '($_ctx->posts->hasTrackbacks() || $_ctx->posts->trackbacksActive())';
-            } else {
-                $if[] = '(!$_ctx->posts->hasTrackbacks() && !$_ctx->posts->trackbacksActive())';
-            }
-        }
-
-        if (isset($attr['republished'])) {
-            $sign = (boolean) $attr['republished'] ? '' : '!';
-            $if[] = $sign . '(boolean)$_ctx->posts->isRepublished()';
-        }
-
-        $this->core->callBehavior('tplIfConditions', 'EntryIf', $attr, $content, $if);
-
-        if (count($if) != 0) {
-            return '<?php if(' . implode(' ' . $operator . ' ', (array) $if) . ') : ?>' . $content . '<?php endif; ?>';
-        } else {
-            return $content;
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryIfFirst - O -- displays value if entry is the first one -->
-    <!ATTLIST tpl:EntryIfFirst
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: first)
-    >
-     */
-    public function EntryIfFirst($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'first';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if ($_ctx->posts->index() == 0) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryIfOdd - O -- displays value if entry is in an odd position -->
-    <!ATTLIST tpl:EntryIfOdd
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: odd)
-    >
-     */
-    public function EntryIfOdd($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'odd';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if (($_ctx->posts->index()+1)%2 == 1) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryIfSelected - O -- displays value if entry is selected -->
-    <!ATTLIST tpl:EntryIfSelected
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: selected)
-    >
-     */
-    public function EntryIfSelected($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'selected';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if ($_ctx->posts->post_selected) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryContent -  -- Entry content -->
-    <!ATTLIST tpl:EntryContent
-    absolute_urls    CDATA    #IMPLIED -- transforms local URLs to absolute one
-    full            (1|0)    #IMPLIED -- returns full content with excerpt
-    >
-     */
-    public function EntryContent($attr)
-    {
-        $urls = '0';
-        if (!empty($attr['absolute_urls'])) {
-            $urls = '1';
-        }
-
-        $f = $this->getFilters($attr);
-
-        if (!empty($attr['full'])) {
-            return '<?php echo ' . sprintf($f,
-                '$_ctx->posts->getExcerpt(' . $urls . ')." ".$_ctx->posts->getContent(' . $urls . ')') . '; ?>';
-        } else {
-            return '<?php echo ' . sprintf($f, '$_ctx->posts->getContent(' . $urls . ')') . '; ?>';
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryIfContentCut - - -- Test if Entry content has been cut -->
-    <!ATTLIST tpl:EntryIfContentCut
-    absolute_urls    CDATA    #IMPLIED -- transforms local URLs to absolute one
-    full            (1|0)    #IMPLIED -- test with full content and excerpt
-    >
-     */
-    public function EntryIfContentCut($attr, $content)
-    {
-        if (empty($attr['cut_string']) || !empty($attr['full'])) {
-            return '';
-        }
-
-        $urls = '0';
-        if (!empty($attr['absolute_urls'])) {
-            $urls = '1';
-        }
-
-        $short              = $this->getFilters($attr);
-        $cut                = $attr['cut_string'];
-        $attr['cut_string'] = 0;
-        $full               = $this->getFilters($attr);
-        $attr['cut_string'] = $cut;
-
-        return '<?php if (strlen(' . sprintf($full, '$_ctx->posts->getContent(' . $urls . ')') . ') > ' .
-        'strlen(' . sprintf($short, '$_ctx->posts->getContent(' . $urls . ')') . ')) : ?>' .
-            $content .
-            '<?php endif; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryExcerpt - O -- Entry excerpt -->
-    <!ATTLIST tpl:EntryExcerpt
-    absolute_urls    CDATA    #IMPLIED -- transforms local URLs to absolute one
-    >
-     */
-    public function EntryExcerpt($attr)
-    {
-        $urls = '0';
-        if (!empty($attr['absolute_urls'])) {
-            $urls = '1';
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->getExcerpt(' . $urls . ')') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryAuthorCommonName - O -- Entry author common name -->
-     */
-    public function EntryAuthorCommonName($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->getAuthorCN()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryAuthorDisplayName - O -- Entry author display name -->
-     */
-    public function EntryAuthorDisplayName($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->user_displayname') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryAuthorID - O -- Entry author ID -->
-     */
-    public function EntryAuthorID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->user_id') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryAuthorEmail - O -- Entry author email -->
-    <!ATTLIST tpl:EntryAuthorEmail
-    spam_protected    (0|1)    #IMPLIED    -- protect email from spam (default: 1)
-    >
-     */
-    public function EntryAuthorEmail($attr)
-    {
-        $p = 'true';
-        if (isset($attr['spam_protected']) && !$attr['spam_protected']) {
-            $p = 'false';
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "\$_ctx->posts->getAuthorEmail(" . $p . ")") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryAuthorEmailMD5 - O -- Entry author email MD5 sum -->
-    >
-     */
-    public function EntryAuthorEmailMD5($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, 'md5($_ctx->posts->getAuthorEmail(false))') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryAuthorLink - O -- Entry author link -->
-     */
-    public function EntryAuthorLink($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->getAuthorLink()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryAuthorURL - O -- Entry author URL -->
-     */
-    public function EntryAuthorURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->user_url') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryBasename - O -- Entry short URL (relative to /post) -->
-     */
-    public function EntryBasename($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->post_url') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryCategory - O -- Entry category (full name) -->
-     */
-    public function EntryCategory($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->cat_title') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryCategoryDescription - O -- Entry category description -->
-     */
-    public function EntryCategoryDescription($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->cat_desc') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryCategoriesBreadcrumb - - -- Current entry parents loop (without last one) -->
-     */
-    public function EntryCategoriesBreadcrumb($attr, $content)
-    {
-        return
-            "<?php\n" .
-            '$_ctx->categories = $core->blog->getCategoryParents($_ctx->posts->cat_id);' . "\n" .
-            'while ($_ctx->categories->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->categories = null; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryCategoryID - O -- Entry category ID -->
-     */
-    public function EntryCategoryID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->cat_id') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryCategoryURL - O -- Entry category URL -->
-     */
-    public function EntryCategoryURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->getCategoryURL()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryCategoryShortURL - O -- Entry category short URL (relative URL, from /category/) -->
-     */
-    public function EntryCategoryShortURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->cat_url') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryFeedID - O -- Entry feed ID -->
-     */
-    public function EntryFeedID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->getFeedID()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryFirstImage - O -- Extracts entry first image if exists -->
-    <!ATTLIST tpl:EntryAuthorEmail
-    size            (sq|t|s|m|o)    #IMPLIED    -- Image size to extract
-    class        CDATA        #IMPLIED    -- Class to add on image tag
-    with_category    (1|0)        #IMPLIED    -- Search in entry category description if present (default 0)
-    no_tag    (1|0)    #IMPLIED    -- Return image URL without HTML tag (default 0)
-    content_only    (1|0)        #IMPLIED    -- Search in content entry only, not in excerpt (default 0)
-    cat_only    (1|0)        #IMPLIED    -- Search in category description only (default 0)
-    >
-     */
-    public function EntryFirstImage($attr)
-    {
-        $size          = !empty($attr['size']) ? $attr['size'] : '';
-        $class         = !empty($attr['class']) ? $attr['class'] : '';
-        $with_category = !empty($attr['with_category']) ? 1 : 0;
-        $no_tag        = !empty($attr['no_tag']) ? 1 : 0;
-        $content_only  = !empty($attr['content_only']) ? 1 : 0;
-        $cat_only      = !empty($attr['cat_only']) ? 1 : 0;
-
-        return "<?php echo context::EntryFirstImageHelper('" . addslashes($size) . "'," . $with_category . ",'" . addslashes($class) . "'," .
-            $no_tag . "," . $content_only . "," . $cat_only . "); ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryID - O -- Entry ID -->
-     */
-    public function EntryID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->post_id') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryLang - O --  Entry language or blog lang if not defined -->
-     */
-    public function EntryLang($attr)
-    {
-        $f = $this->getFilters($attr);
-        return
-        '<?php if ($_ctx->posts->post_lang) { ' .
-        'echo ' . sprintf($f, '$_ctx->posts->post_lang') . '; ' .
-        '} else {' .
-        'echo ' . sprintf($f, '$core->blog->settings->system->lang') . '; ' .
-            '} ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryNext - - -- Next entry block -->
-    <!ATTLIST tpl:EntryNext
-    restrict_to_category    (0|1)    #IMPLIED    -- find next post in the same category (default: 0)
-    restrict_to_lang        (0|1)    #IMPLIED    -- find next post in the same language (default: 0)
-    >
-     */
-    public function EntryNext($attr, $content)
-    {
-        $restrict_to_category = !empty($attr['restrict_to_category']) ? '1' : '0';
-        $restrict_to_lang     = !empty($attr['restrict_to_lang']) ? '1' : '0';
-
-        return
-            '<?php $next_post = $core->blog->getNextPost($_ctx->posts,1,' . $restrict_to_category . ',' . $restrict_to_lang . '); ?>' . "\n" .
-            '<?php if ($next_post !== null) : ?>' .
-
-            '<?php $_ctx->posts = $next_post; unset($next_post);' . "\n" .
-            'while ($_ctx->posts->fetch()) : ?>' .
-            $content .
-            '<?php endwhile; $_ctx->posts = null; ?>' .
-            "<?php endif; ?>\n";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryPrevious - - -- Previous entry block -->
-    <!ATTLIST tpl:EntryPrevious
-    restrict_to_category    (0|1)    #IMPLIED    -- find previous post in the same category (default: 0)
-    restrict_to_lang        (0|1)    #IMPLIED    -- find next post in the same language (default: 0)
-    >
-     */
-    public function EntryPrevious($attr, $content)
-    {
-        $restrict_to_category = !empty($attr['restrict_to_category']) ? '1' : '0';
-        $restrict_to_lang     = !empty($attr['restrict_to_lang']) ? '1' : '0';
-
-        return
-            '<?php $prev_post = $core->blog->getNextPost($_ctx->posts,-1,' . $restrict_to_category . ',' . $restrict_to_lang . '); ?>' . "\n" .
-            '<?php if ($prev_post !== null) : ?>' .
-
-            '<?php $_ctx->posts = $prev_post; unset($prev_post);' . "\n" .
-            'while ($_ctx->posts->fetch()) : ?>' .
-            $content .
-            '<?php endwhile; $_ctx->posts = null; ?>' .
-            "<?php endif; ?>\n";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryTitle - O -- Entry title -->
-     */
-    public function EntryTitle($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->post_title') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryURL - O -- Entry URL -->
-     */
-    public function EntryURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->posts->getURL()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryDate - O -- Entry date -->
-    <!ATTLIST tpl:EntryDate
-    format    CDATA    #IMPLIED    -- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
-    iso8601    CDATA    #IMPLIED    -- if set, tells that date format is ISO 8601
-    rfc822    CDATA    #IMPLIED    -- if set, tells that date format is RFC 822
-    upddt    CDATA    #IMPLIED    -- if set, uses the post update time
-    creadt    CDATA    #IMPLIED    -- if set, uses the post creation time
-    >
-     */
-    public function EntryDate($attr)
-    {
-        $format = '';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        }
-
-        $iso8601 = !empty($attr['iso8601']);
-        $rfc822  = !empty($attr['rfc822']);
-        $type    = (!empty($attr['creadt']) ? 'creadt' : '');
-        $type    = (!empty($attr['upddt']) ? 'upddt' : $type);
-
-        $f = $this->getFilters($attr);
-
-        if ($rfc822) {
-            return '<?php echo ' . sprintf($f, "\$_ctx->posts->getRFC822Date('" . $type . "')") . '; ?>';
-        } elseif ($iso8601) {
-            return '<?php echo ' . sprintf($f, "\$_ctx->posts->getISO8601Date('" . $type . "')") . '; ?>';
-        } else {
-            return '<?php echo ' . sprintf($f, "\$_ctx->posts->getDate('" . $format . "','" . $type . "')") . '; ?>';
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryTime - O -- Entry date -->
-    <!ATTLIST tpl:EntryTime
-    format    CDATA    #IMPLIED    -- time format
-    upddt    CDATA    #IMPLIED    -- if set, uses the post update time
-    creadt    CDATA    #IMPLIED    -- if set, uses the post creation time
-    >
-     */
-    public function EntryTime($attr)
-    {
-        $format = '';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        }
-
-        $type = (!empty($attr['creadt']) ? 'creadt' : '');
-        $type = (!empty($attr['upddt']) ? 'upddt' : $type);
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "\$_ctx->posts->getTime('" . $format . "','" . $type . "')") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntriesHeader - - -- First entries result container -->
-     */
-    public function EntriesHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->posts->isStart()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntriesFooter - - -- Last entries result container -->
-     */
-    public function EntriesFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->posts->isEnd()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryCommentCount - O -- Number of comments for entry -->
-    <!ATTLIST tpl:EntryCommentCount
-    none        CDATA    #IMPLIED    -- text to display for "no comments" (default: no comments)
-    one        CDATA    #IMPLIED    -- text to display for "one comment" (default: one comment)
-    more        CDATA    #IMPLIED    -- text to display for "more comments" (default: %s comments, %s is replaced by the number of comment)
-    count_all    CDATA    #IMPLIED    -- count comments and trackbacks
-    >
-     */
-    public function EntryCommentCount($attr)
-    {
-        if (empty($attr['count_all'])) {
-            $operation = '$_ctx->posts->nb_comment';
-        } else {
-            $operation = '($_ctx->posts->nb_comment + $_ctx->posts->nb_trackback)';
-        }
-
-        return $this->displayCounter(
-            $operation,
-            [
-                'none' => 'no comments',
-                'one'  => 'one comment',
-                'more' => '%d comments'
-            ],
-            $attr,
-            false
-        );
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryPingCount - O -- Number of trackbacks for entry -->
-    <!ATTLIST tpl:EntryPingCount
-    none    CDATA    #IMPLIED    -- text to display for "no pings" (default: no pings)
-    one    CDATA    #IMPLIED    -- text to display for "one ping" (default: one ping)
-    more    CDATA    #IMPLIED    -- text to display for "more pings" (default: %s trackbacks, %s is replaced by the number of pings)
-    >
-     */
-    public function EntryPingCount($attr)
-    {
-        return $this->displayCounter(
-            '$_ctx->posts->nb_trackback',
-            [
-                'none' => 'no trackbacks',
-                'one'  => 'one trackback',
-                'more' => '%d trackbacks'
-            ],
-            $attr,
-            false
-        );
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryPingData - O -- Display trackback RDF information -->
-     */
-    public function EntryPingData($attr)
-    {
-        $format = !empty($attr['format']) && $attr['format'] == 'xml' ? 'xml' : 'html';
-        return "<?php if (\$_ctx->posts->trackbacksActive()) { echo \$_ctx->posts->getTrackbackData('" . $format . "'); } ?>\n";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:EntryPingLink - O -- Entry trackback link -->
-     */
-    public function EntryPingLink($attr)
-    {
-        return "<?php if (\$_ctx->posts->trackbacksActive()) { echo \$_ctx->posts->getTrackbackLink(); } ?>\n";
-    }
-
-    /* Languages -------------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:Languages - - -- Languages loop -->
-    <!ATTLIST tpl:Languages
-    lang    CDATA    #IMPLIED    -- restrict loop on given lang
-    order    (desc|asc)    #IMPLIED    -- languages ordering (default: desc)
-    >
-     */
-    public function Languages($attr, $content)
-    {
-        $p = "if (!isset(\$params)) \$params = [];\n";
-
-        if (isset($attr['lang'])) {
-            $p = "\$params['lang'] = '" . addslashes($attr['lang']) . "';\n";
-        }
-
-        $order = 'desc';
-        if (isset($attr['order']) && preg_match('/^(desc|asc)$/i', $attr['order'])) {
-            $p .= "\$params['order'] = '" . $attr['order'] . "';\n ";
-        }
-
-        $res = "<?php\n";
-        $res .= $p;
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "Languages", "method" => "blog::getLangs"],
-            $attr, $content);
-        $res .= '$_ctx->langs = $core->blog->getLangs($params); unset($params);' . "\n";
-        $res .= "?>\n";
-
-        $res .=
-            '<?php if ($_ctx->langs->count() > 1) : ' .
-            'while ($_ctx->langs->fetch()) : ?>' . $content .
-            '<?php endwhile; $_ctx->langs = null; endif; ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:LanguagesHeader - - -- First languages result container -->
-     */
-    public function LanguagesHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->langs->isStart()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:LanguagesFooter - - -- Last languages result container -->
-     */
-    public function LanguagesFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->langs->isEnd()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:LanguageCode - O -- Language code -->
-     */
-    public function LanguageCode($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->langs->post_lang') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:LanguageIfCurrent - - -- tests if post language is current language -->
-     */
-    public function LanguageIfCurrent($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->cur_lang == \$_ctx->langs->post_lang) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:LanguageURL - O -- Language URL -->
-     */
-    public function LanguageURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$core->blog->url.$core->url->getURLFor("lang",' .
-            '$_ctx->langs->post_lang)') . '; ?>';
-    }
-
-    /* Pagination ------------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:Pagination - - -- Pagination container -->
-    <!ATTLIST tpl:Pagination
-    no_context    (0|1)    #IMPLIED    -- override test on posts count vs number of posts per page
-    >
-     */
-    public function Pagination($attr, $content)
-    {
-        $p = "<?php\n";
-        $p .= '$params = $_ctx->post_params;' . "\n";
-        $p .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "Pagination", "method" => "blog::getPosts"],
-            $attr, $content);
-        $p .= '$_ctx->pagination = $core->blog->getPosts($params,true); unset($params);' . "\n";
-        $p .= "?>\n";
-
-        if (isset($attr['no_context']) && $attr['no_context']) {
-            return $p . $content;
-        }
-
-        return
-            $p .
-            '<?php if ($_ctx->pagination->f(0) > $_ctx->posts->count()) : ?>' .
-            $content .
-            '<?php endif; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PaginationCounter - O -- Number of pages -->
-     */
-    public function PaginationCounter($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "context::PaginationNbPages()") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PaginationCurrent - O -- current page -->
-     */
-    public function PaginationCurrent($attr)
-    {
-        $offset = 0;
-        if (isset($attr['offset'])) {
-            $offset = (integer) $attr['offset'];
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "context::PaginationPosition(" . $offset . ")") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PaginationIf - - -- pages tests -->
-    <!ATTLIST tpl:PaginationIf
-    start    (0|1)    #IMPLIED    -- test if we are at first page (value : 1) or not (value : 0)
-    end    (0|1)    #IMPLIED    -- test if we are at last page (value : 1) or not (value : 0)
-    >
-     */
-    public function PaginationIf($attr, $content)
-    {
-        $if = [];
-
-        if (isset($attr['start'])) {
-            $sign = (boolean) $attr['start'] ? '' : '!';
-            $if[] = $sign . 'context::PaginationStart()';
-        }
-
-        if (isset($attr['end'])) {
-            $sign = (boolean) $attr['end'] ? '' : '!';
-            $if[] = $sign . 'context::PaginationEnd()';
-        }
-
-        $this->core->callBehavior('tplIfConditions', 'PaginationIf', $attr, $content, $if);
-
-        if (count($if) != 0) {
-            return '<?php if(' . implode(' && ', (array) $if) . ') : ?>' . $content . '<?php endif; ?>';
-        } else {
-            return $content;
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PaginationURL - O -- link to previoux/next page -->
-    <!ATTLIST tpl:PaginationURL
-    offset    CDATA    #IMPLIED    -- page offset (negative for previous pages), default: 0
-    >
-     */
-    public function PaginationURL($attr)
-    {
-        $offset = 0;
-        if (isset($attr['offset'])) {
-            $offset = (integer) $attr['offset'];
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "context::PaginationURL(" . $offset . ")") . '; ?>';
-    }
-
-    /* Comments --------------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:Comments - - -- Comments container -->
-    <!ATTLIST tpl:Comments
-    with_pings    (0|1)    #IMPLIED    -- include trackbacks in request
-    lastn    CDATA    #IMPLIED    -- restrict the number of entries
-    no_context (1|0)        #IMPLIED  -- Override context information
-    sortby    (title|selected|author|date|id)    #IMPLIED    -- specify comments sort criteria (default : date) (multiple comma-separated sortby can be specified. Use "?asc" or "?desc" as suffix to provide an order for each sorby)
-    order    (desc|asc)    #IMPLIED    -- result ordering (default: asc)
-    age        CDATA    #IMPLIED    -- retrieve comments by maximum age (ex: -2 days, last month, last week)
-    >
-     */
-    public function Comments($attr, $content)
-    {
-        $p = "";
-        if (empty($attr['with_pings'])) {
-            $p .= "\$params['comment_trackback'] = false;\n";
-        }
-
-        $lastn = 0;
-        if (isset($attr['lastn'])) {
-            $lastn = abs((integer) $attr['lastn']) + 0;
-        }
-
-        if ($lastn > 0) {
-            $p .= "\$params['limit'] = " . $lastn . ";\n";
-        } else {
-            $p .= "if (\$_ctx->nb_comment_per_page !== null) { \$params['limit'] = \$_ctx->nb_comment_per_page; }\n";
-        }
-
-        if (empty($attr['no_context'])) {
-            $p .=
-                "if (\$_ctx->posts !== null) { " .
-                "\$params['post_id'] = \$_ctx->posts->post_id; " .
-                "\$core->blog->withoutPassword(false);\n" .
-                "}\n";
-            $p .=
-                'if ($_ctx->exists("categories")) { ' .
-                "\$params['cat_id'] = \$_ctx->categories->cat_id; " .
-                "}\n";
-
-            $p .=
-                'if ($_ctx->exists("langs")) { ' .
-                "\$params['sql'] = \"AND P.post_lang = '\".\$core->blog->con->escape(\$_ctx->langs->post_lang).\"' \"; " .
-                "}\n";
-        }
-
-        if (!isset($attr['order'])) {
-            $attr['order'] = 'asc';
-        }
-
-        $p .= "\$params['order'] = '" . $this->getSortByStr($attr, 'comment') . "';\n";
-
-        if (isset($attr['no_content']) && $attr['no_content']) {
-            $p .= "\$params['no_content'] = true;\n";
-        }
-
-        if (isset($attr['age'])) {
-            $age = $this->getAge($attr);
-            $p .= !empty($age) ? "@\$params['sql'] .= ' AND P.post_dt > \'" . $age . "\'';\n" : '';
-        }
-
-        $res = "<?php\n";
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "Comments", "method" => "blog::getComments"],
-            $attr, $content);
-        $res .= $p;
-        $res .= '$_ctx->comments = $core->blog->getComments($params); unset($params);' . "\n";
-        $res .= "if (\$_ctx->posts !== null) { \$core->blog->withoutPassword(true);}\n";
-
-        if (!empty($attr['with_pings'])) {
-            $res .= '$_ctx->pings = $_ctx->comments;' . "\n";
-        }
-
-        $res .= "?>\n";
-
-        $res .=
-            '<?php while ($_ctx->comments->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->comments = null; ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentAuthor - O -- Comment author -->
-     */
-    public function CommentAuthor($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "\$_ctx->comments->comment_author") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentAuthorDomain - O -- Comment author website domain -->
-     */
-    public function CommentAuthorDomain($attr)
-    {
-        return '<?php echo preg_replace("#^http(?:s?)://(.+?)/.*$#msu",\'$1\',$_ctx->comments->comment_site); ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentAuthorLink - O -- Comment author link -->
-     */
-    public function CommentAuthorLink($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comments->getAuthorLink()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentAuthorMailMD5 - O -- Comment author email MD5 sum -->
-     */
-    public function CommentAuthorMailMD5($attr)
-    {
-        return '<?php echo md5($_ctx->comments->comment_email) ; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentAuthorURL - O -- Comment author URL -->
-     */
-    public function CommentAuthorURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comments->getAuthorURL()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentContent - O --  Comment content -->
-    <!ATTLIST tpl:CommentContent
-    absolute_urls    (0|1)    #IMPLIED    -- convert URLS to absolute urls
-    >
-     */
-    public function CommentContent($attr)
-    {
-        $urls = '0';
-        if (!empty($attr['absolute_urls'])) {
-            $urls = '1';
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comments->getContent(' . $urls . ')') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentDate - O -- Comment date -->
-    <!ATTLIST tpl:CommentDate
-    format    CDATA    #IMPLIED    -- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
-    iso8601    CDATA    #IMPLIED    -- if set, tells that date format is ISO 8601
-    rfc822    CDATA    #IMPLIED    -- if set, tells that date format is RFC 822
-    upddt    CDATA    #IMPLIED    -- if set, uses the comment update time
-    >
-     */
-    public function CommentDate($attr)
-    {
-        $format = '';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        }
-
-        $iso8601 = !empty($attr['iso8601']);
-        $rfc822  = !empty($attr['rfc822']);
-        $type    = (!empty($attr['upddt']) ? 'upddt' : '');
-
-        $f = $this->getFilters($attr);
-
-        if ($rfc822) {
-            return '<?php echo ' . sprintf($f, "\$_ctx->comments->getRFC822Date('" . $type . "')") . '; ?>';
-        } elseif ($iso8601) {
-            return '<?php echo ' . sprintf($f, "\$_ctx->comments->getISO8601Date('" . $type . "')") . '; ?>';
-        } else {
-            return '<?php echo ' . sprintf($f, "\$_ctx->comments->getDate('" . $format . "','" . $type . "')") . '; ?>';
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentTime - O -- Comment date -->
-    <!ATTLIST tpl:CommentTime
-    format    CDATA    #IMPLIED    -- time format
-    upddt    CDATA    #IMPLIED    -- if set, uses the comment update time
-    >
-     */
-    public function CommentTime($attr)
-    {
-        $format = '';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        }
-        $type = (!empty($attr['upddt']) ? 'upddt' : '');
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "\$_ctx->comments->getTime('" . $format . "','" . $type . "')") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentEmail - O -- Comment author email -->
-    <!ATTLIST tpl:CommentEmail
-    spam_protected    (0|1)    #IMPLIED    -- protect email from spam (default: 1)
-    >
-     */
-    public function CommentEmail($attr)
-    {
-        $p = 'true';
-        if (isset($attr['spam_protected']) && !$attr['spam_protected']) {
-            $p = 'false';
-        }
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "\$_ctx->comments->getEmail(" . $p . ")") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentEntryTitle - O -- Title of the comment entry -->
-     */
-    public function CommentEntryTitle($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comments->post_title') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentFeedID - O -- Comment feed ID -->
-     */
-    public function CommentFeedID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comments->getFeedID()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentID - O -- Comment ID -->
-     */
-    public function CommentID($attr)
-    {
-        return '<?php echo $_ctx->comments->comment_id; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentIf - - -- test container for comments -->
-    <!ATTLIST tpl:CommentIf
-    is_ping    (0|1)    #IMPLIED    -- test if comment is a trackback (value : 1) or not (value : 0)
-    >
-     */
-    public function CommentIf($attr, $content)
-    {
-        $if      = [];
-        $is_ping = null;
-
-        if (isset($attr['is_ping'])) {
-            $sign = (boolean) $attr['is_ping'] ? '' : '!';
-            $if[] = $sign . '$_ctx->comments->comment_trackback';
-        }
-
-        $this->core->callBehavior('tplIfConditions', 'CommentIf', $attr, $content, $if);
-
-        if (count($if) != 0) {
-            return '<?php if(' . implode(' && ', (array) $if) . ') : ?>' . $content . '<?php endif; ?>';
-        } else {
-            return $content;
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentIfFirst - O -- displays value if comment is the first one -->
-    <!ATTLIST tpl:CommentIfFirst
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: first)
-    >
-     */
-    public function CommentIfFirst($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'first';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if ($_ctx->comments->index() == 0) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentIfMe - O -- displays value if comment is the from the entry author -->
-    <!ATTLIST tpl:CommentIfMe
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: me)
-    >
-     */
-    public function CommentIfMe($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'me';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if ($_ctx->comments->isMe()) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentIfOdd - O -- displays value if comment is  at an odd position -->
-    <!ATTLIST tpl:CommentIfOdd
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: odd)
-    >
-     */
-    public function CommentIfOdd($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'odd';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if (($_ctx->comments->index()+1)%2) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentIP - O -- Comment author IP -->
-     */
-    public function CommentIP($attr)
-    {
-        return '<?php echo $_ctx->comments->comment_ip; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentOrderNumber - O -- Comment order in page -->
-     */
-    public function CommentOrderNumber($attr)
-    {
-        return '<?php echo $_ctx->comments->index()+1; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentsFooter - - -- Last comments result container -->
-     */
-    public function CommentsFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->comments->isEnd()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentsHeader - - -- First comments result container -->
-     */
-    public function CommentsHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->comments->isStart()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentPostURL - O -- Comment Entry URL -->
-     */
-    public function CommentPostURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comments->getPostURL()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:IfCommentAuthorEmail - - -- Container displayed if comment author email is set -->
-     */
-    public function IfCommentAuthorEmail($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->comments->comment_email) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentHelp - 0 -- Comment syntax mini help -->
-     */
-    public function CommentHelp($attr, $content)
-    {
-        return
-            "<?php if (\$core->blog->settings->system->wiki_comments) {\n" .
-            "  echo __('Comments can be formatted using a simple wiki syntax.');\n" .
-            "} else {\n" .
-            "  echo __('HTML code is displayed as text and web addresses are automatically converted.');\n" .
-            "} ?>";
-    }
-
-    /* Comment preview -------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:IfCommentPreviewOptional - - -- Container displayed if comment preview is optional or currently previewed -->
-     */
-    public function IfCommentPreviewOptional($attr, $content)
-    {
-        return
-            '<?php if ($core->blog->settings->system->comment_preview_optional || ($_ctx->comment_preview !== null && $_ctx->comment_preview["preview"])) : ?>' .
-            $content .
-            '<?php endif; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:IfCommentPreview - - -- Container displayed if comment is being previewed -->
-     */
-    public function IfCommentPreview($attr, $content)
-    {
-        return
-            '<?php if ($_ctx->comment_preview !== null && $_ctx->comment_preview["preview"]) : ?>' .
-            $content .
-            '<?php endif; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentPreviewName - O -- Author name for the previewed comment -->
-     */
-    public function CommentPreviewName($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comment_preview["name"]') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentPreviewEmail - O -- Author email for the previewed comment -->
-     */
-    public function CommentPreviewEmail($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comment_preview["mail"]') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentPreviewSite - O -- Author site for the previewed comment -->
-     */
-    public function CommentPreviewSite($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->comment_preview["site"]') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentPreviewContent - O -- Content of the previewed comment -->
-    <!ATTLIST tpl:CommentPreviewContent
-    raw    (0|1)    #IMPLIED    -- display comment in raw content
-    >
-     */
-    public function CommentPreviewContent($attr)
-    {
-        $f = $this->getFilters($attr);
-
-        if (!empty($attr['raw'])) {
-            $co = '$_ctx->comment_preview["rawcontent"]';
-        } else {
-            $co = '$_ctx->comment_preview["content"]';
-        }
-
-        return '<?php echo ' . sprintf($f, $co) . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:CommentPreviewCheckRemember - O -- checkbox attribute for "remember me" (same value as before preview) -->
-     */
-    public function CommentPreviewCheckRemember($attr)
-    {
-        return
-            "<?php if (\$_ctx->comment_preview['remember']) { echo ' checked=\"checked\"'; } ?>";
-    }
-
-    /* Trackbacks ------------------------------------- */
-    /*dtd
-    <!ELEMENT tpl:PingBlogName - O -- Trackback blog name -->
-     */
-    public function PingBlogName($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->pings->comment_author') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingContent - O -- Trackback content -->
-     */
-    public function PingContent($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->pings->getTrackbackContent()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingDate - O -- Trackback date -->
-    <!ATTLIST tpl:PingDate
-    format    CDATA    #IMPLIED    -- date format (encoded in dc:str by default if iso8601 or rfc822 not specified)
-    iso8601    CDATA    #IMPLIED    -- if set, tells that date format is ISO 8601
-    rfc822    CDATA    #IMPLIED    -- if set, tells that date format is RFC 822
-    upddt    CDATA    #IMPLIED    -- if set, uses the comment update time
-    >
-     */
-    public function PingDate($attr, $type = '')
-    {
-        $format = '';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        }
-
-        $iso8601 = !empty($attr['iso8601']);
-        $rfc822  = !empty($attr['rfc822']);
-        $type    = (!empty($attr['upddt']) ? 'upddt' : '');
-
-        $f = $this->getFilters($attr);
-
-        if ($rfc822) {
-            return '<?php echo ' . sprintf($f, "\$_ctx->pings->getRFC822Date('" . $type . "')") . '; ?>';
-        } elseif ($iso8601) {
-            return '<?php echo ' . sprintf($f, "\$_ctx->pings->getISO8601Date('" . $type . "')") . '; ?>';
-        } else {
-            return '<?php echo ' . sprintf($f, "\$_ctx->pings->getDate('" . $format . "','" . $type . "')") . '; ?>';
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingTime - O -- Trackback date -->
-    <!ATTLIST tpl:PingTime
-    format    CDATA    #IMPLIED    -- time format
-    upddt    CDATA    #IMPLIED    -- if set, uses the comment update time
-    >
-     */
-    public function PingTime($attr)
-    {
-        $format = '';
-        if (!empty($attr['format'])) {
-            $format = addslashes($attr['format']);
-        }
-        $type = (!empty($attr['upddt']) ? 'upddt' : '');
-
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, "\$_ctx->pings->getTime('" . $format . "','" . $type . "')") . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingEntryTitle - O -- Trackback entry title -->
-     */
-    public function PingEntryTitle($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->pings->post_title') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingFeedID - O -- Trackback feed ID -->
-     */
-    public function PingFeedID($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->pings->getFeedID()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingID - O -- Trackback ID -->
-     */
-    public function PingID($attr)
-    {
-        return '<?php echo $_ctx->pings->comment_id; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingIfFirst - O -- displays value if trackback is the first one -->
-    <!ATTLIST tpl:PingIfFirst
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: first)
-    >
-     */
-    public function PingIfFirst($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'first';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if ($_ctx->pings->index() == 0) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingIfOdd - O -- displays value if trackback is  at an odd position -->
-    <!ATTLIST tpl:PingIfOdd
-    return    CDATA    #IMPLIED    -- value to display in case of success (default: odd)
-    >
-     */
-    public function PingIfOdd($attr)
-    {
-        $ret = isset($attr['return']) ? $attr['return'] : 'odd';
-        $ret = html::escapeHTML($ret);
-
-        return
-        '<?php if (($_ctx->pings->index()+1)%2) { ' .
-        "echo '" . addslashes($ret) . "'; } ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingIP - O -- Trackback author IP -->
-     */
-    public function PingIP($attr)
-    {
-        return '<?php echo $_ctx->pings->comment_ip; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingNoFollow - O -- displays 'rel="nofollow"' if set in blog -->
-     */
-    public function PingNoFollow($attr)
-    {
-        return
-            '<?php if($core->blog->settings->system->comments_nofollow) { ' .
-            'echo \' rel="nofollow"\';' .
-            '} ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingOrderNumber - O -- Trackback order in page -->
-     */
-    public function PingOrderNumber($attr)
-    {
-        return '<?php echo $_ctx->pings->index()+1; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingPostURL - O -- Trackback Entry URL -->
-     */
-    public function PingPostURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->pings->getPostURL()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:Pings - - -- Trackbacks container -->
-    <!ATTLIST tpl:Pings
-    with_pings    (0|1)    #IMPLIED    -- include trackbacks in request
-    lastn    CDATA        #IMPLIED    -- restrict the number of entries
-    no_context (1|0)        #IMPLIED  -- Override context information
-    order    (desc|asc)    #IMPLIED    -- result ordering (default: asc)
-    >
-     */
-    public function Pings($attr, $content)
-    {
-        $p =
-            "if (\$_ctx->posts !== null) { " .
-            "\$params['post_id'] = \$_ctx->posts->post_id; " .
-            "\$core->blog->withoutPassword(false);\n" .
-            "}\n";
-
-        $p .= "\$params['comment_trackback'] = true;\n";
-
-        $lastn = 0;
-        if (isset($attr['lastn'])) {
-            $lastn = abs((integer) $attr['lastn']) + 0;
-        }
-
-        if ($lastn > 0) {
-            $p .= "\$params['limit'] = " . $lastn . ";\n";
-        } else {
-            $p .= "if (\$_ctx->nb_comment_per_page !== null) { \$params['limit'] = \$_ctx->nb_comment_per_page; }\n";
-        }
-
-        if (empty($attr['no_context'])) {
-            $p .=
-                'if ($_ctx->exists("categories")) { ' .
-                "\$params['cat_id'] = \$_ctx->categories->cat_id; " .
-                "}\n";
-
-            $p .=
-                'if ($_ctx->exists("langs")) { ' .
-                "\$params['sql'] = \"AND P.post_lang = '\".\$core->blog->con->escape(\$_ctx->langs->post_lang).\"' \"; " .
-                "}\n";
-        }
-
-        $order = 'asc';
-        if (isset($attr['order']) && preg_match('/^(desc|asc)$/i', $attr['order'])) {
-            $order = $attr['order'];
-        }
-
-        $p .= "\$params['order'] = 'comment_dt " . $order . "';\n";
-
-        if (isset($attr['no_content']) && $attr['no_content']) {
-            $p .= "\$params['no_content'] = true;\n";
-        }
-
-        $res = "<?php\n";
-        $res .= $p;
-        $res .= $this->core->callBehavior("templatePrepareParams",
-            ["tag" => "Pings", "method" => "blog::getComments"],
-            $attr, $content);
-        $res .= '$_ctx->pings = $core->blog->getComments($params); unset($params);' . "\n";
-        $res .= "if (\$_ctx->posts !== null) { \$core->blog->withoutPassword(true);}\n";
-        $res .= "?>\n";
-
-        $res .=
-            '<?php while ($_ctx->pings->fetch()) : ?>' . $content . '<?php endwhile; $_ctx->pings = null; ?>';
-
-        return $res;
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingsFooter - - -- Last trackbacks result container -->
-     */
-    public function PingsFooter($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->pings->isEnd()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingsHeader - - -- First trackbacks result container -->
-     */
-    public function PingsHeader($attr, $content)
-    {
-        return
-            "<?php if (\$_ctx->pings->isStart()) : ?>" .
-            $content .
-            "<?php endif; ?>";
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingTitle - O -- Trackback title -->
-     */
-    public function PingTitle($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->pings->getTrackbackTitle()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:PingAuthorURL - O -- Trackback author URL -->
-     */
-    public function PingAuthorURL($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, '$_ctx->pings->getAuthorURL()') . '; ?>';
-    }
-
-    # System
-    /*dtd
-    <!ELEMENT tpl:SysBehavior - O -- Call a given behavior -->
-    <!ATTLIST tpl:SysBehavior
-    behavior    CDATA    #IMPLIED    -- behavior to call
-    >
-     */
-    public function SysBehavior($attr, $raw)
-    {
-        if (!isset($attr['behavior'])) {
-            return;
-        }
-
-        $b = addslashes($attr['behavior']);
-        return
-            '<?php if ($core->hasBehavior(\'' . $b . '\')) { ' .
-            '$core->callBehavior(\'' . $b . '\',$core,$_ctx);' .
-            '} ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:SysIf - - -- System settings tester container -->
-    <!ATTLIST tpl:SysIf
-    categories        (0|1)    #IMPLIED    -- test if categories are set in current context (value : 1) or not (value : 0)
-    posts            (0|1)    #IMPLIED    -- test if posts are set in current context (value : 1) or not (value : 0)
-    blog_lang            CDATA    #IMPLIED    -- tests if blog language is the one given in parameter
-    current_tpl        CDATA    #IMPLIED    -- tests if current template is the one given in paramater
-    current_mode        CDATA    #IMPLIED    -- tests if current URL mode is the one given in parameter
-    has_tpl            CDATA     #IMPLIED  -- tests if a named template exists
-    has_tag            CDATA     #IMPLIED  -- tests if a named template block or value exists
-    blog_id            CDATA     #IMPLIED  -- tests if current blog ID is the one given in parameter
-    comments_active    (0|1)    #IMPLIED    -- test if comments are enabled blog-wide
-    pings_active        (0|1)    #IMPLIED    -- test if trackbacks are enabled blog-wide
-    wiki_comments        (0|1)    #IMPLIED    -- test if wiki syntax is enabled for comments
-    operator            (and|or)    #IMPLIED    -- combination of conditions, if more than 1 specifiec (default: and)
-    >
-     */
-    public function SysIf($attr, $content)
-    {
-        $if      = new ArrayObject();
-        $is_ping = null;
-
-        $operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
-
-        if (isset($attr['categories'])) {
-            $sign = (boolean) $attr['categories'] ? '!' : '=';
-            $if[] = '$_ctx->categories ' . $sign . '== null';
-        }
-
-        if (isset($attr['posts'])) {
-            $sign = (boolean) $attr['posts'] ? '!' : '=';
-            $if[] = '$_ctx->posts ' . $sign . '== null';
-        }
-
-        if (isset($attr['blog_lang'])) {
-            $sign = '=';
-            if (substr($attr['blog_lang'], 0, 1) == '!') {
-                $sign              = '!';
-                $attr['blog_lang'] = substr($attr['blog_lang'], 1);
-            }
-            $if[] = "\$core->blog->settings->system->lang " . $sign . "= '" . addslashes($attr['blog_lang']) . "'";
-        }
-
-        if (isset($attr['current_tpl'])) {
-            $sign = '=';
-            if (substr($attr['current_tpl'], 0, 1) == '!') {
-                $sign                = '!';
-                $attr['current_tpl'] = substr($attr['current_tpl'], 1);
-            }
-            $if[] = "\$_ctx->current_tpl " . $sign . "= '" . addslashes($attr['current_tpl']) . "'";
-        }
-
-        if (isset($attr['current_mode'])) {
-            $sign = '=';
-            if (substr($attr['current_mode'], 0, 1) == '!') {
-                $sign                 = '!';
-                $attr['current_mode'] = substr($attr['current_mode'], 1);
-            }
-            $if[] = "\$core->url->type " . $sign . "= '" . addslashes($attr['current_mode']) . "'";
-        }
-
-        if (isset($attr['has_tpl'])) {
-            $sign = '';
-            if (substr($attr['has_tpl'], 0, 1) == '!') {
-                $sign            = '!';
-                $attr['has_tpl'] = substr($attr['has_tpl'], 1);
-            }
-            $if[] = $sign . "\$core->tpl->getFilePath('" . addslashes($attr['has_tpl']) . "') !== false";
-        }
-
-        if (isset($attr['has_tag'])) {
-            $sign = 'true';
-            if (substr($attr['has_tag'], 0, 1) == '!') {
-                $sign            = 'false';
-                $attr['has_tag'] = substr($attr['has_tag'], 1);
-            }
-            $if[] = "\$core->tpl->tagExists('" . addslashes($attr['has_tag']) . "') === " . $sign;
-        }
-
-        if (isset($attr['blog_id'])) {
-            $sign = '';
-            if (substr($attr['blog_id'], 0, 1) == '!') {
-                $sign            = '!';
-                $attr['blog_id'] = substr($attr['blog_id'], 1);
-            }
-            $if[] = $sign . "(\$core->blog->id == '" . addslashes($attr['blog_id']) . "')";
-        }
-
-        if (isset($attr['comments_active'])) {
-            $sign = (boolean) $attr['comments_active'] ? '' : '!';
-            $if[] = $sign . '$core->blog->settings->system->allow_comments';
-        }
-
-        if (isset($attr['pings_active'])) {
-            $sign = (boolean) $attr['pings_active'] ? '' : '!';
-            $if[] = $sign . '$core->blog->settings->system->allow_trackbacks';
-        }
-
-        if (isset($attr['wiki_comments'])) {
-            $sign = (boolean) $attr['wiki_comments'] ? '' : '!';
-            $if[] = $sign . '$core->blog->settings->system->wiki_comments';
-        }
-
-        if (isset($attr['search_count']) &&
-            preg_match('/^((=|!|&gt;|&lt;)=|(&gt;|&lt;))\s*[0-9]+$/', trim($attr['search_count']))) {
-            $if[] = '(isset($_search_count) && $_search_count ' . html::decodeEntities($attr['search_count']) . ')';
-        }
-
-        $this->core->callBehavior('tplIfConditions', 'SysIf', $attr, $content, $if);
-
-        if (count($if) != 0) {
-            return '<?php if(' . implode(' ' . $operator . ' ', (array) $if) . ') : ?>' . $content . '<?php endif; ?>';
-        } else {
-            return $content;
-        }
-    }
-
-    /*dtd
-    <!ELEMENT tpl:SysIfCommentPublished - - -- Container displayed if comment has been published -->
-     */
-    public function SysIfCommentPublished($attr, $content)
-    {
-        return
-            '<?php if (!empty($_GET[\'pub\'])) : ?>' .
-            $content .
-            '<?php endif; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:SysIfCommentPending - - -- Container displayed if comment is pending after submission -->
-     */
-    public function SysIfCommentPending($attr, $content)
-    {
-        return
-            '<?php if (isset($_GET[\'pub\']) && $_GET[\'pub\'] == 0) : ?>' .
-            $content .
-            '<?php endif; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:SysFeedSubtitle - O -- Feed subtitle -->
-     */
-    public function SysFeedSubtitle($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php if ($_ctx->feed_subtitle !== null) { echo ' . sprintf($f, '$_ctx->feed_subtitle') . ';} ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:SysIfFormError - O -- Container displayed if an error has been detected after form submission -->
-     */
-    public function SysIfFormError($attr, $content)
-    {
-        return
-            '<?php if ($_ctx->form_error !== null) : ?>' .
-            $content .
-            '<?php endif; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:SysFormError - O -- Form error -->
-     */
-    public function SysFormError($attr)
-    {
-        return
-            '<?php if ($_ctx->form_error !== null) { echo $_ctx->form_error; } ?>';
-    }
-
-    public function SysPoweredBy($attr)
-    {
-        return
-            '<?php printf(__("Powered by %s"),"<a href=\"http://dotclear.org/\">Dotclear</a>"); ?>';
-    }
-
-    public function SysSearchString($attr)
-    {
-        $s = isset($attr['string']) ? $attr['string'] : '%1$s';
-
-        $f = $this->getFilters($attr);
-        return '<?php if (isset($_search)) { echo sprintf(__(\'' . $s . '\'),' . sprintf($f, '$_search') . ',$_search_count);} ?>';
-    }
-
-    public function SysSelfURI($attr)
-    {
-        $f = $this->getFilters($attr);
-        return '<?php echo ' . sprintf($f, 'http::getSelfURI()') . '; ?>';
-    }
-
-    /*dtd
-    <!ELEMENT tpl:else - O -- else: statement -->
-     */
-    public function GenericElse($attr)
-    {
-        return '<?php else: ?>';
-    }
-}
+?>
Index: inc/public/default-templates/404.html
===================================================================
--- inc/public/default-templates/404.html	(revision 0)
+++ inc/public/default-templates/404.html	(revision 0)
@@ -0,0 +1,63 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
+  
+  <title>{{tpl:lang Document not found}} - {{tpl:BlogName encode_html="1"}}</title>
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Document not found}} - {{tpl:BlogName encode_html="1"}}" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  <link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
+  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-404">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  
+  <div id="content-info">
+    <h2>{{tpl:lang Document not found}}</h2>
+  </div>
+  
+  <div class="content-inner">
+    <p>{{tpl:lang The document you are looking for does not exist.}}</p>
+  </div>
+  
+  </div>
+</div>
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/_flv_player.html
===================================================================
--- inc/public/default-templates/_flv_player.html	(revision 0)
+++ inc/public/default-templates/_flv_player.html	(revision 0)
@@ -0,0 +1,8 @@
+<object type="application/x-shockwave-flash" data="{{tpl:BlogQmarkURL}}pf=player_flv.swf"
+width="400" height="300">
+<param name="movie" value="{{tpl:BlogQmarkURL}}pf=player_flv.swf" />
+<param name="wmode" value="transparent" />
+<param name="allowFullScreen" value="true" />
+<param name="FlashVars" value="flv={{tpl:MediaURL}}&amp;width=400&amp;height=300&amp;margin=1&amp;showfullscreen=1&amp;showvolume=1&amp;showtime=1" />
+{{tpl:lang Embedded Audio Player}}
+</object>
Index: inc/public/default-templates/_footer.html
===================================================================
--- inc/public/default-templates/_footer.html	(revision 0)
+++ inc/public/default-templates/_footer.html	(revision 0)
@@ -0,0 +1,5 @@
+<div id="footer">
+  <p>{{tpl:SysPoweredBy}}</p>
+</div>
+
+{{tpl:SysBehavior behavior="publicFooterContent"}}
Index: inc/public/default-templates/_head.html
===================================================================
--- inc/public/default-templates/_head.html	(revision 0)
+++ inc/public/default-templates/_head.html	(revision 0)
@@ -0,0 +1,12 @@
+<style type="text/css" media="screen">
+@import url({{tpl:BlogThemeURL}}/style.css);
+</style>
+<style type="text/css" media="print">
+@import url({{tpl:BlogThemeURL}}/../default/print.css);
+</style>
+
+<script type="text/javascript" src="{{tpl:BlogThemeURL}}/../default/js/jquery.js"></script>
+<script type="text/javascript" src="{{tpl:BlogThemeURL}}/../default/js/jquery.cookie.js"></script>
+
+{{tpl:include src="user_head.html"}}
+{{tpl:SysBehavior behavior="publicHeadContent"}}
Index: inc/public/default-templates/_mp3_player.html
===================================================================
--- inc/public/default-templates/_mp3_player.html	(revision 0)
+++ inc/public/default-templates/_mp3_player.html	(revision 0)
@@ -0,0 +1,6 @@
+<object type="application/x-shockwave-flash" data="{{tpl:BlogQmarkURL}}pf=player_mp3.swf" width="200" height="20">
+<param name="movie" value="{{tpl:BlogQmarkURL}}pf=player_mp3.swf" />
+<param name="wmode" value="transparent" />
+<param name="FlashVars" value="mp3={{tpl:MediaURL}}&amp;showvolume=1&amp;loadingcolor=ff9900&amp;bgcolor1=eeeeee&amp;bgcolor2=cccccc&amp;buttoncolor=0066cc&amp;buttonovercolor=ff9900&amp;slidercolor1=cccccc&amp;slidercolor2=999999&amp;sliderovercolor=0066cc" />
+{{tpl:lang Embedded Audio Player}}
+</object>
Index: inc/public/default-templates/_top.html
===================================================================
--- inc/public/default-templates/_top.html	(revision 0)
+++ inc/public/default-templates/_top.html	(revision 0)
@@ -0,0 +1,10 @@
+<div id="top">
+  <h1><span><a href="{{tpl:BlogURL}}">{{tpl:BlogName encode_html="1"}}</a></span></h1>
+  
+  <!-- # --BEHAVIOR-- publicTopAfterContent -->
+  {{tpl:SysBehavior behavior="publicTopAfterContent"}}
+</div>
+
+<p id="prelude"><a href="#main">{{tpl:lang To content}}</a> |
+<a href="#blognav">{{tpl:lang To menu}}</a> |
+<a href="#search">{{tpl:lang To search}}</a></p>
Index: inc/public/default-templates/archive.html
===================================================================
--- inc/public/default-templates/archive.html	(revision 0)
+++ inc/public/default-templates/archive.html	(revision 0)
@@ -0,0 +1,80 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
+  
+  <title>{{tpl:lang Archives}} - {{tpl:BlogName encode_html="1"}}</title>
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Archives}} - {{tpl:BlogName encode_html="1"}}" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  
+  <tpl:Archives>
+    <link rel="chapter" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" />
+  </tpl:Archives>
+  
+  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-archive">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  
+  <div id="content-info">
+    <h2>{{tpl:lang Archives}}</h2>
+  </div>
+  
+  <div class="content-inner">
+  <tpl:Archives>
+    <tpl:ArchivesYearHeader>
+      <h3>{{tpl:ArchiveDate format="%Y"}}</h3>
+      <ul>
+    </tpl:ArchivesYearHeader>
+      <li><a href="{{tpl:ArchiveURL}}"
+      title="{{tpl:ArchiveDate encode_html="1"}}">{{tpl:ArchiveDate encode_html="1" format="%B"}}</a>
+      ({{tpl:ArchiveEntriesCount}})</li>
+    <tpl:ArchivesYearFooter>
+      </ul>
+    </tpl:ArchivesYearFooter>
+  </tpl:Archives>
+  </div>
+  
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/archive_month.html
===================================================================
--- inc/public/default-templates/archive_month.html	(revision 0)
+++ inc/public/default-templates/archive_month.html	(revision 0)
@@ -0,0 +1,97 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
+  
+  <title>{{tpl:lang Archives}} - {{tpl:ArchiveDate}} - {{tpl:BlogName encode_html="1"}}</title>
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Archives}} - {{tpl:ArchiveDate}} - {{tpl:BlogName encode_html="1"}}" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  <link rel="up" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
+  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
+  
+  
+  <tpl:ArchiveNext><link rel="next" href="{{tpl:ArchiveURL}}"
+  title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchiveNext>
+  <tpl:ArchivePrevious><link rel="prev" href="{{tpl:ArchiveURL}}"
+  title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchivePrevious>
+  
+  <tpl:Entries no_content="1">
+  <link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
+  </tpl:Entries>
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-archive-month">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  
+  <p id="navlinks">
+  <tpl:ArchivePrevious><a href="{{tpl:ArchiveURL}}" class="prev">&#171; {{tpl:ArchiveDate encode_html="1"}}</a>
+  - </tpl:ArchivePrevious>
+  <a href="{{tpl:BlogArchiveURL}}">{{tpl:lang Archives}}</a>
+  <tpl:ArchiveNext> - <a href="{{tpl:ArchiveURL}}" class="next">{{tpl:ArchiveDate encode_html="1"}} &#187;</a></tpl:ArchiveNext>
+  </p>
+  
+  <div id="content-info">
+    <h2>{{tpl:ArchiveDate}}</h2>
+  </div>
+  
+  <div class="content-inner">
+  <tpl:Entries no_content="1">
+    <!-- # New day date -->
+    <tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
+    
+    <h2 id="p{{tpl:EntryID}}" class="post-title" lang="{{tpl:EntryLang}}" xml:lang="{{tpl:EntryLang}}"><a
+    href="{{tpl:EntryURL}}" title="{{tpl:lang Read}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
+    
+    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
+    <tpl:EntryIf show_comments="1">
+    - <a href="{{tpl:EntryURL}}#comments">{{tpl:EntryCommentCount}}</a>
+    </tpl:EntryIf>
+    <tpl:EntryIf show_pings="1">
+    - <a href="{{tpl:EntryURL}}#pings">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf has_attachment="1">
+    - <a href="{{tpl:EntryURL}}#attachments">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
+    </p>
+  </tpl:Entries>
+  </div>
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/atom-comments.xml
===================================================================
--- inc/public/default-templates/atom-comments.xml	(revision 0)
+++ inc/public/default-templates/atom-comments.xml	(revision 0)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{tpl:BlogLanguage}}">
+  
+  <title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}
+  - {{tpl:lang Comments}}</title>
+  <subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
+  <link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
+  <link href="{{tpl:BlogURL}}" rel="alternate" type="text/html"
+  title="{{tpl:BlogDescription encode_xml="1"}}"/>
+  <updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
+  <author>
+    <name>{{tpl:BlogEditor encode_xml="1"}}</name>
+  </author>
+  <id>{{tpl:BlogFeedID}}</id>
+  <generator uri="http://www.dotclear.org/">Dotclear</generator>
+  
+  <tpl:Comments order="desc" with_pings="1">
+  
+  <tpl:CommentIf is_ping="1">
+  <entry>
+    <title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
+    <link href="{{tpl:PingPostURL encode_xml="1"}}#c{{tpl:PingID}}" rel="alternate" type="text/html"
+    title="[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}" />
+    <id>{{tpl:PingFeedID}}</id>
+    <published>{{tpl:PingDate iso8601="1"}}</published>
+    <updated>{{tpl:PingDate iso8601="1" upddt="1"}}</updated>
+    <author><name>{{tpl:PingBlogName encode_xml="1"}}</name></author>
+    <content type="html">&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt; {{tpl:PingContent encode_xml="1"}}</content>
+  </entry>
+  
+  </tpl:CommentIf>
+  
+  <tpl:CommentIf is_ping="0">
+  <entry>
+    <title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
+    <link href="{{tpl:CommentPostURL encode_xml="1"}}#c{{tpl:CommentID}}" rel="alternate" type="text/html"
+    title="{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}" />
+    <id>{{tpl:CommentFeedID}}</id>
+    <published>{{tpl:CommentDate iso8601="1"}}</published>
+    <updated>{{tpl:CommentDate iso8601="1" upddt="1"}}</updated>
+    <author><name>{{tpl:CommentAuthor encode_xml="1"}}</name></author>
+    <content type="html">{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</content>
+  </entry>
+  </tpl:CommentIf>
+  </tpl:Comments>
+  
+</feed>
Index: inc/public/default-templates/atom.xml
===================================================================
--- inc/public/default-templates/atom.xml	(revision 0)
+++ inc/public/default-templates/atom.xml	(revision 0)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+  xml:lang="{{tpl:BlogLanguage}}">
+  
+  <title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
+  <subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
+  <link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
+  <link href="{{tpl:BlogURL}}" rel="alternate" type="text/html"
+  title="{{tpl:BlogDescription encode_xml="1"}}"/>
+  <updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
+  <author>
+    <name>{{tpl:BlogEditor encode_xml="1"}}</name>
+  </author>
+  <id>{{tpl:BlogFeedID}}</id>
+  <generator uri="http://www.dotclear.org/">Dotclear</generator>
+  
+  <tpl:Entries>
+  
+  <entry>
+    <title>{{tpl:EntryTitle encode_xml="1"}}</title>
+    <link href="{{tpl:EntryURL}}" rel="alternate" type="text/html"
+    title="{{tpl:EntryTitle encode_xml="1"}}" />
+    <id>{{tpl:EntryFeedID}}</id>
+    <published>{{tpl:EntryDate iso8601="1"}}</published>
+    <updated>{{tpl:EntryDate iso8601="1" upddt="1"}}</updated>
+    <author><name>{{tpl:EntryAuthorCommonName encode_xml="1"}}</name></author>
+    <tpl:EntryIf has_category="1">
+    <dc:subject>{{tpl:EntryCategory encode_html="1"}}</dc:subject>
+    </tpl:EntryIf>
+    <tpl:EntryTags><dc:subject>{{tpl:TagID}}</dc:subject></tpl:EntryTags>
+    
+    <content type="html">{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}}
+    {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</content>
+    
+    <tpl:Attachments>
+      <link rel="enclosure" href="{{tpl:AttachmentURL}}"
+      length="{{tpl:AttachmentSize full="1"}}" type="{{tpl:AttachmentMimeType}}" />
+    </tpl:Attachments>
+
+    
+    <tpl:EntryIf comments_active="1">
+      <wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
+      <wfw:commentRss>{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}</wfw:commentRss>
+    </tpl:EntryIf>
+  </entry>
+  </tpl:Entries>
+
+</feed>
Index: inc/public/default-templates/category.html
===================================================================
--- inc/public/default-templates/category.html	(revision 0)
+++ inc/public/default-templates/category.html	(revision 0)
@@ -0,0 +1,168 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
+  
+  <title>{{tpl:CategoryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
+  <meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:CategoryDescription cut_string="180" remove_html="1"}}" />
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:CategoryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
+  <meta name="dc.description" lang="{{tpl:BlogLanguage}}" content="{{tpl:CategoryDescription remove_html="1"}}" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
+  
+  <tpl:Entries no_content="1">
+    <tpl:EntriesHeader>
+      <tpl:Pagination>
+        <tpl:PaginationIf end="0">
+        <link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
+        </tpl:PaginationIf>
+        
+        <tpl:PaginationIf start="0">
+        <link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
+        </tpl:PaginationIf>
+      </tpl:Pagination>
+    </tpl:EntriesHeader>
+    
+    <link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
+  </tpl:Entries>
+  
+  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:CategoryFeedURL type="atom"}}" />
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-category">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+
+  <div id="content-info">
+    <h2><tpl:CategoryParents><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> &rsaquo; </tpl:CategoryParents>
+    {{tpl:CategoryTitle encode_html="1"}}</h2>
+    {{tpl:CategoryDescription}}
+    
+    <tpl:CategoryIf has_entries="1">
+      <p><a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}"
+      title="{{tpl:lang This category's entries Atom feed}}" class="feed">{{tpl:lang Entries feed}}</a>
+      
+      <tpl:SysIf operator="or" comments_active="1" pings_active="1">
+      - <a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}/comments"
+      title="{{tpl:lang This category's comments Atom feed}}" class="feed">{{tpl:lang Comments feed}}</a>
+      </tpl:SysIf>
+      </p>
+    </tpl:CategoryIf>
+  </div>
+  
+  <tpl:CategoryFirstChildren>
+    <tpl:CategoriesHeader>
+      <div id="subcategories">
+      <h3>{{tpl:lang Subcategories}}</h3>
+      <ul>
+    </tpl:CategoriesHeader>
+    <li><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></li>
+    <tpl:CategoriesFooter>
+      </ul>
+      </div>
+    </tpl:CategoriesFooter>
+  </tpl:CategoryFirstChildren>
+  
+  <tpl:Entries>
+    <div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" xml:lang="{{tpl:EntryLang}}">
+    <!-- # New day date -->
+    <tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
+    
+    <h2 class="post-title"><a
+    href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
+    
+    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
+    {{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}</p>
+    
+    <tpl:EntryTags>
+    <tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
+    <li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
+    <tpl:TagsFooter></ul></tpl:TagsFooter>
+    </tpl:EntryTags>
+    
+    <!-- # --BEHAVIOR-- publicEntryBeforeContent -->
+    {{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
+    
+    <!-- # Entry with an excerpt -->
+    <tpl:EntryIf extended="1">
+      <div class="post-content">{{tpl:EntryExcerpt}}</div>
+      <p class="read-it"><a href="{{tpl:EntryURL}}"
+      title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue
+      reading}}</a>...</p>
+    </tpl:EntryIf>
+    
+    <!-- # Entry without excerpt -->
+    <tpl:EntryIf extended="0">
+      <div class="post-content">{{tpl:EntryContent}}</div>
+    </tpl:EntryIf>
+    
+    <!-- # --BEHAVIOR-- publicEntryAfterContent -->
+    {{tpl:SysBehavior behavior="publicEntryAfterContent"}}
+    
+    <!-- # Number of comments, trackbacks and attachments -->
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      <p class="post-info-co">
+    </tpl:EntryIf>
+    <tpl:EntryIf show_comments="1">
+      <a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
+    </tpl:EntryIf>
+    <tpl:EntryIf show_pings="1">
+      <a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf has_attachment="1">
+      <a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      </p>
+    </tpl:EntryIf>
+    </div>
+    
+    <tpl:EntriesFooter>
+      <tpl:Pagination>
+        <p class="pagination"><tpl:PaginationIf end="0"><a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171;
+        {{tpl:lang previous entries}}</a> - </tpl:PaginationIf>
+        {{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
+        <tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}}
+        &#187;</a></tpl:PaginationIf></p>
+      </tpl:Pagination>
+    </tpl:EntriesFooter>
+  </tpl:Entries>
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/currywurst/404.html
===================================================================
--- inc/public/default-templates/currywurst/404.html	(revision 3422)
+++ 	(revision )
@@ -1,32 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Document not found}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-404"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<div id="content-info">
-		<h2>{{tpl:lang Document not found}}</h2>
-		<p>{{tpl:lang URL you've tried has typos, or the page has been deleted or moved.}}</p>
-	</div>
-
-	<div class="content-inner">
-		<h3>{{tpl:lang Suggestions:}}</h3>
-		<ul>
-			<li><a href="{{tpl:BlogURL}}">{{tpl:lang Go to homepage}}</a></li>
-			<li><a href="#search">{{tpl:lang Use search form}}</a></li>
-			<li><a href="{{tpl:BlogURL}}archive">{{tpl:lang Explore archives}}</a></li>
-		</ul>
-	</div> <!-- End #content-inner -->
-</tpl:Block>
Index: inc/public/default-templates/currywurst/README.md
===================================================================
--- inc/public/default-templates/currywurst/README.md	(revision 2692)
+++ 	(revision )
@@ -1,108 +1,0 @@
-# Currywurst
-
-Un nouveau jeu de templates par défaut pour Dotclear (versions ≥ 2.7)
-
-## Motivations
-
-Le jeu de templates Currywurst répond à divers objectifs :
-
-- Proposer un jeu de templates en HTML 5.
-- Pouvoir ainsi y introduire des balises [http://fr.wikipedia.org/wiki/Accessible_Rich_Internet_Applications](ARIA) pour une meilleure accessibilité.
-- Améliorer la sémantique des tags html (par exemple ne plus présenter les commentaires dans une liste de définition).
-- Factoriser les éléments récurrents dès que c'est possible sans pâtir à la compréhension.
-- Préparer le passage à la syntaxe [http://twig.sensiolabs.org/](twig).
-- Adopter une nomenclature inspirée de [http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/](BEM) – sans en faire une religion dogmatique toutefois. Voir aussi [http://coding.smashingmagazine.com/2011/12/12/an-introduction-to-object-oriented-css-oocss/](OOCSS).
-- Faire en sorte de réduire l'obligation de recourir aux sélecteurs enfants (`#top h1 {}` par exemple) ou aux ID dans les CSS.
-
-## Revue fichier par fichier
-
-Ne sont pas listées les modifications systématiques : ajout de classes sur tous les éléments « probablement stylés » ou ne possédant qu'un id ; syntaxe html5.
-
-Les modifications nécessitant des explications sont listées de la façon suivante :
-
-    <Description courte> : <motivation>. <Explication>.
-
-Les motivations sont abrégées en :
-- a11y : amélioration accessibilité
-- sém. : amélioration ou correction sémantique (html)
-- cont. : amélioration du contenu
-- ergo : amélioration ergonomique
-
-Par convention l'ordre des attributs dans les balises html est *class, id, autres attributs*.
-
-Toutes les listes (ul ou ol) comportent le terme "list" dans leur nom de class.
-
-### _top.html
-
-Déplacement des liens d'accès rapides au-dessus du titre du blog : **a11y**, **ergo**. *Le titre de fenêtre étant lu avant tout par les aides techniques, l'internaute sait déjà où il se trouve. L'accès est également plus rapide au clavier. Côté design, la plupart des créateurs de thèmes ont pris l'habitude de déplacer ce bloc en haut de la page ; ils n'auront plus besoin de passer par des position absolute pour ce faire.*
-
-### _simple-entry.html
-
-(aka contexte du billet seul entier avec commentaires etc.)
-
-Formulaire de dépôt de commentaire :
-- remplacement des inputs par des buttons
-- typage des champs
-- ajout des attributs required quand nécessaire
-
-Découpage en deux grandes div : post et post-feedback.
-- post
-  - post-title : titre
-  - post-meta
-    - post-info
-    - post-tags-list
-  - post-excerpt
-  - post-content
-  - post-attachments
-    - post-attachments-title
-    - post-attachments-list
-- post-feedback
-  - feedback__comments
-    - comments-feed
-    - comments-list
-  - comment-form
-  - send-trackback
-
-### __layout.html
-
-Reprend l'intégralité du home.html et définit les blocs permettant l'héritage et extension
-
-La liste des noms utilisés pour les blocs sont les suivants (les noms sont composés de deux termes, le nom du parent direct du bloc et le nom du bloc en question, sachant que le nom 'attr' est réservé aux attributs des balises, comme par exemple 'body-attr', et 'tag' pour encadrer une balise ouvrante seule) :
-
-- html-head : contenu de la balise head
-  - head-title : balise title
-  - head-meta : liste des balises meta du head
-    - meta-robots : consigne pour les robots
-    - meta-entry : partie spécifique au contexte
-  - head-dc : liste des balises dublin core du head
-    - dc-entry : partie spécifique au contexte
-  - head-linkrel : liste des balises link rel du head
-- body-tag : balise body (sans contenu ni balise fermante)
-- html-body : contenu de la balise body
-  - body-page : contenu de la div #page
-    - page-top : contenu d'entête de la div #page (en général inclusion du _top.html)
-    - page-wrapper : contenu principal de la div #page, soit le contenu de la div #wrapper
-      - wrapper-main : contenu principal de la div #wrapper, soit le contenu de la div #main
-        - main-content : contenu de la div #content
-      - wrapper-sidebar : contenu annexe de la div #wrapper (en général inclusion de _sidebar.html)
-    - page-footer : contenu de pied de page de la div #page (en général inclusion du _footer.html)
-
-Pour rappel, la hiérarchie des blocs html est la suivante :
-
-- html
-  - head
-  - body
-    - #page
-      - .header
-      - #wrapper
-        - #main
-          - #content
-        - #sidebar/.sidebar
-      - #footer/.footer
-
-
-***
-
-A réfléchir : inclusion par défaut de liens "sociaux" ?
-
-***
Index: inc/public/default-templates/currywurst/__layout.html
===================================================================
--- inc/public/default-templates/currywurst/__layout.html	(revision 3371)
+++ 	(revision )
@@ -1,116 +1,0 @@
-<!DOCTYPE html>
-<html lang="{{tpl:BlogLanguage}}">
-<head>
-	<tpl:Block name="html-head">
-		<meta charset="UTF-8" />
-
-		<tpl:Block name="head-title">
-			<title>{{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-		</tpl:Block>	<!-- head-title -->
-
-		<tpl:Block name="head-meta">
-			<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
-			<tpl:Block name="meta-robots">
-				<meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
-			</tpl:Block>	<!-- meta-robots -->
-			<tpl:Block name="meta-entry">
-				<meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:BlogDescription cut_string="180" remove_html="1" encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
-				<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
-				<meta name="date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
-			</tpl:Block>	<!-- meta-entry -->
-		</tpl:Block>	<!-- head-meta -->
-
-		<tpl:Block name="head-linkrel">
-			<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-			<tpl:Categories>
-				<link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
-			</tpl:Categories>
-
-			<tpl:Entries no_content="1">
-				<tpl:EntriesHeader>
-					<tpl:Pagination>
-						<tpl:PaginationIf end="0">
-							<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-						</tpl:PaginationIf>
-
-						<tpl:PaginationIf start="0">
-							<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-						</tpl:PaginationIf>
-					</tpl:Pagination>
-				</tpl:EntriesHeader>
-
-				<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-			</tpl:Entries>
-
-			<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-			<link rel="EditURI" type="application/rsd+xml" title="RSD" href="{{tpl:BlogRSDURL}}" />
-			<link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
-		</tpl:Block>	<!-- head-linkrel -->
-
-		{{tpl:include src="_head.html"}}
-	</tpl:Block>	<!-- html-head -->
-</head>
-<tpl:Block name="body-tag">
-	<body class="dc-home <tpl:SysIf current_mode="default">dc-home-first</tpl:SysIf>">
-</tpl:Block>
-	<tpl:Block name="html-body">
-		<div id="page">
-			<tpl:Block name="body-page">
-				<tpl:Block name="page-top">
-					{{tpl:include src="_top.html"}}
-				</tpl:Block>	<!-- page-top -->
-
-				<div id="wrapper">
-					<tpl:Block name="page-wrapper">
-						<div id="main" role="main">
-							<tpl:Block name="wrapper-main">
-								<tpl:Block name="main-breadcrumb">
-									{{tpl:Breadcrumb}}
-								</tpl:Block>
-								<div id="content">
-									<tpl:Block name="main-content">
-
-										<tpl:Entries>
-
-											<!-- First page -->
-											<tpl:SysIf current_mode="default">
-												<tpl:LoopPosition start="1" length="1">
-													{{tpl:include src="_entry-full.html"}}
-												</tpl:LoopPosition>
-
-												<tpl:LoopPosition start="2">
-													{{tpl:include src="_entry-short.html"}}
-												</tpl:LoopPosition>
-											</tpl:SysIf>
-
-											<!-- Next pages -->
-											<tpl:SysIf current_mode="!default">
-												{{tpl:include src="_entry-short.html"}}
-											</tpl:SysIf>
-
-											<!-- Pagination -->
-											<tpl:EntriesFooter>
-												{{tpl:include src="_pagination.html"}}
-											</tpl:EntriesFooter>
-
-										</tpl:Entries>
-
-									</tpl:Block>	<!-- main-content -->
-								</div> <!-- End #content -->
-							</tpl:Block>	<!-- wrapper-main -->
-						</div> <!-- End #main -->
-
-						<tpl:Block name="wrapper-sidebar">
-							{{tpl:include src="_sidebar.html"}}
-						</tpl:Block>	<!-- wrapper-sidebar -->
-					</tpl:Block>	<!-- page-wrapper -->
-				</div> <!-- End #wrapper -->
-
-				<tpl:Block name="page-footer">
-					{{tpl:include src="_footer.html"}}
-				</tpl:Block>	<!-- page-footer -->
-			</tpl:Block>	<!-- body-page -->
-		</div> <!-- End #page -->
-	</tpl:Block>	<!-- html-body -->
-</body>
-</html>
Index: inc/public/default-templates/currywurst/_audio_player.html
===================================================================
--- inc/public/default-templates/currywurst/_audio_player.html	(revision 3167)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<audio controls preload="auto">
-	<source src="{{tpl:MediaURL}}">
-</audio>
Index: inc/public/default-templates/currywurst/_entry-content.html
===================================================================
--- inc/public/default-templates/currywurst/_entry-content.html	(revision 3958)
+++ 	(revision )
@@ -1,63 +1,0 @@
-<div class="post simple" id="p{{tpl:EntryID}}" role="article" lang="{{tpl:EntryLang}}">
-	<h2 class="post-title">{{tpl:EntryTitle encode_html="1"}}</h2>
-
-	<div class="post-meta">
-		<p class="post-info">
-			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date">{{tpl:EntryDate}}. </span>
-			<span class="post-permalink"><a href="{{tpl:EntryURL}}">{{tpl:lang Permalink}}</a></span>
-			<tpl:EntryIf has_category="1">
-				<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> › </tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a></span>
-			</tpl:EntryIf>
-		</p>
-
-		<tpl:EntryTags>
-			<tpl:TagsHeader>
-				<ul class="post-tags-list">
-			</tpl:TagsHeader>
-				<li class="post-tags-item"><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-			<tpl:TagsFooter>
-				</ul>
-			</tpl:TagsFooter>
-		</tpl:EntryTags>
-	</div>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<!-- # Entry with an excerpt -->
-	<tpl:EntryIf extended="1">
-		<div class="post-excerpt">{{tpl:EntryExcerpt}}</div>
-	</tpl:EntryIf>
-
-	<div class="post-content">{{tpl:EntryContent}}</div>
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-<!-- # Attachments -->
-<tpl:Attachments>
-	<tpl:AttachmentsHeader>
-	<div class="post-attachments" id="attachments">
-		<h3 class="post-attachments-title">{{tpl:lang Attachments}}</h3>
-		<ul class="post-attachments-list">
-	</tpl:AttachmentsHeader>
-				<li class="post-attachments-item {{tpl:AttachmentType}}">
-          <tpl:AttachmentIf is_audio="1">
-            {{tpl:include src="_audio_player.html"}}
-          </tpl:AttachmentIf>
-          <tpl:AttachmentIf is_video="1">
-            {{tpl:include src="_video_player.html"}}
-          </tpl:AttachmentIf>
-          <tpl:AttachmentIf is_audio="0" is_video="0">
-             <a href="{{tpl:AttachmentURL}}" title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
-          </tpl:AttachmentIf>
-				</li>
-	<tpl:AttachmentsFooter>
-			</ul>
-		</div>
-	</tpl:AttachmentsFooter>
-</tpl:Attachments>
-</div>
Index: inc/public/default-templates/currywurst/_entry-feedback.html
===================================================================
--- inc/public/default-templates/currywurst/_entry-feedback.html	(revision 2938)
+++ 	(revision )
@@ -1,117 +1,0 @@
-<tpl:EntryIf operator="or" show_comments="1" show_pings="1">
-	<div class="post-feedback">
-</tpl:EntryIf>
-
-<!-- # Comments -->
-<tpl:EntryIf show_comments="1">
-	<tpl:Comments with_pings="1">
-		<tpl:CommentsHeader>
-			<div class="feedback__comments" id="comments">
-				<h3>{{tpl:EntryCommentCount count_all="1" none="no reactions" one="one reaction" more="%s reactions"}}</h3>
-				<tpl:EntryIf operator="or" comments_active="1" pings_active="1">
-					<p id="comments-feed"><a class="feed" href="{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}"
-						title="{{tpl:lang This post's comments Atom feed}}">{{tpl:lang This post's comments feed}}</a></p>
-				</tpl:EntryIf>
-				<ul class="comments-list">
-		</tpl:CommentsHeader>
-					<tpl:CommentIf is_ping="0">
-						<li id="c{{tpl:CommentID}}" class="comment {{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
-					</tpl:CommentIf>
-					<tpl:CommentIf is_ping="1">
-						<li id="c{{tpl:PingID}}" class="ping {{tpl:PingIfOdd}} {{tpl:PingIfFirst}}">
-					</tpl:CommentIf>
-							<p class="comment-info"><a href="#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}</a>
-								{{tpl:lang From}} {{tpl:CommentAuthorLink}} - {{tpl:CommentDate format="%d"}}/{{tpl:CommentDate format="%m"}}/{{tpl:CommentDate format="%Y"}}, {{tpl:CommentTime}}
-							</p>
-							<div class="comment-content">
-								<!-- # --BEHAVIOR-- publicCommentBeforeContent -->
-								{{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
-
-								{{tpl:CommentContent}}
-
-								<!-- # --BEHAVIOR-- publicCommentAfterContent -->
-								{{tpl:SysBehavior behavior="publicCommentAfterContent"}}
-							</div>
-						</li>
-		<tpl:CommentsFooter>
-					</ul>
-				</div>
-		</tpl:CommentsFooter>
-	</tpl:Comments>
-</tpl:EntryIf>
-
-<tpl:EntryIf comments_active="1">
-	<tpl:SysIfFormError>
-		<p class="error" id="pr">{{tpl:SysFormError}}</p>
-	</tpl:SysIfFormError>
-
-	<tpl:SysIfCommentPublished>
-		<p class="message" id="pr">{{tpl:lang Your comment has been published.}}</p>
-	</tpl:SysIfCommentPublished>
-
-	<tpl:SysIfCommentPending>
-		<p class="message" id="pr">{{tpl:lang Your comment has been submitted and will be reviewed for publication.}}</p>
-	</tpl:SysIfCommentPending>
-
-	<!-- # Comment form -->
-	<form class="comment-form" action="{{tpl:EntryURL}}#pr" method="post" id="comment-form" role="form">
-		<tpl:IfCommentPreview>
-			<div id="pr">
-				<h3>{{tpl:lang Your comment}}</h3>
-				<div class="comment-preview">{{tpl:CommentPreviewContent}}</div>
-				<p class="buttons"><button type="submit" class="submit" value="{{tpl:lang Send}}">{{tpl:lang Send}}</button></p>
-			</div>
-		</tpl:IfCommentPreview>
-
-		<h3>{{tpl:lang Add a comment}}</h3>
-			<!-- # --BEHAVIOR-- publicCommentFormBeforeContent -->
-			{{tpl:SysBehavior behavior="publicCommentFormBeforeContent"}}
-
-			<p class="field name-field"><label for="c_name">{{tpl:lang Name or nickname}}<abbr title="{{tpl:lang Required field}}">*</abbr>&nbsp;:</label>
-				<input name="c_name" id="c_name" type="text" size="30" maxlength="255"
-				 value="{{tpl:CommentPreviewName encode_html="1"}}" required />
-			</p>
-
-			<p class="field mail-field"><label for="c_mail">{{tpl:lang Email address}}<abbr title="{{tpl:lang Required field}}">*</abbr>&nbsp;:</label>
-				<input name="c_mail" id="c_mail" type="email" size="30" maxlength="255"
-				 value="{{tpl:CommentPreviewEmail encode_html="1"}}" required />
-			</p>
-
-			<p class="field site-field"><label for="c_site">{{tpl:lang Website}}&nbsp;:</label>
-				<input name="c_site" id="c_site" type="url" size="30" maxlength="255"
-				 value="{{tpl:CommentPreviewSite encode_html="1"}}" />
-			</p>
-
-			<p style="display:none">
-				<input name="f_mail" type="text" size="30" maxlength="255" value="" />
-			</p>
-
-			<p class="field field-content"><label for="c_content" aria-describedby="c_help">{{tpl:lang Comment}}<abbr title="{{tpl:lang Required field}}">*</abbr>&nbsp;:</label>
-				<textarea name="c_content" id="c_content" cols="35"
-				 rows="7" required>{{tpl:CommentPreviewContent raw="1" encode_html="1"}}</textarea>
-			</p>
-
-			<p class="form-help" id="c_help">{{tpl:CommentHelp}}</p>
-
-			<!-- # --BEHAVIOR-- publicCommentFormAfterContent -->
-			{{tpl:SysBehavior behavior="publicCommentFormAfterContent"}}
-
-			<p class="buttons">
-				<button type="submit" class="preview" name="preview" value="{{tpl:lang Preview}}">{{tpl:lang Preview}}</button>
-		        <tpl:IfCommentPreviewOptional>
-		        	<button type="submit" class="submit" value="{{tpl:lang Send}}">{{tpl:lang Send}}</button>
-		        </tpl:IfCommentPreviewOptional>
-			</p>
-	</form>
-</tpl:EntryIf>
-
-<tpl:EntryIf pings_active="1">
-	<div class="send-ping">
-		<h3>{{tpl:lang Add ping}}</h3>
-		<p id="ping-url">{{tpl:lang Trackback URL}}&nbsp;: {{tpl:EntryPingLink}}</p>
-	</div>
-</tpl:EntryIf>
-
-<tpl:EntryIf operator="or" show_comments="1" show_pings="1">
-	</div> <!-- end post-feedback -->
-</tpl:EntryIf>
Index: inc/public/default-templates/currywurst/_entry-full.html
===================================================================
--- inc/public/default-templates/currywurst/_entry-full.html	(revision 2623)
+++ 	(revision )
@@ -1,55 +1,0 @@
-<div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}} full" lang="{{tpl:EntryLang}}" role="article">
-
-	<!-- # New day date -->
-	<tpl:DateHeader><p class="post-day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
-
-	<h2 class="post-title"><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<tpl:EntryIf extended="1">
-	<div class="post-excerpt">{{tpl:EntryExcerpt}}</div>
-	</tpl:EntryIf>
-
-	<div class="post-content">{{tpl:EntryContent}}</div>
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-	<div class="post-meta">
-		<p class="post-info">
-			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date">{{tpl:EntryDate}}.</span>
-			<tpl:EntryIf has_category="1">
-			<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> › </tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
-			</span>
-			</tpl:EntryIf>
-		</p>
-
-		<tpl:EntryTags>
-			<tpl:TagsHeader>
-			<ul class="post-tags-list">
-			</tpl:TagsHeader>
-				<li class="post-tags-item"><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-			<tpl:TagsFooter>
-			</ul>
-			</tpl:TagsFooter>
-		</tpl:EntryTags>
-
-		<!-- # Number of comments, trackbacks and attachments -->
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			<p class="post-info-co">
-			<tpl:EntryIf show_comments="1">
-			<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-			</tpl:EntryIf>
-			<tpl:EntryIf show_pings="1">
-			<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf has_attachment="1">
-			<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-			</p>
-		</tpl:EntryIf>
-	</div>
-</div>
Index: inc/public/default-templates/currywurst/_entry-short.html
===================================================================
--- inc/public/default-templates/currywurst/_entry-short.html	(revision 3431)
+++ 	(revision )
@@ -1,77 +1,0 @@
-<div id="p{{tpl:EntryID}}" class="post short {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" role="article">
-
-	<!-- # New day date -->
-	<tpl:DateHeader><p class="post-day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
-
-	<h2 class="post-title"><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<!-- # Entry with an excerpt -->
-	<tpl:EntryIf extended="1">
-		<div class="post-content">
-			{{tpl:EntryFirstImage size="t" class="post-icon"}}
-			{{tpl:EntryExcerpt}}
-		</div>
-		<p class="post-read-it"><a href="{{tpl:EntryURL}}"
-		 title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue reading}}</a></p>
-	</tpl:EntryIf>
-
-	<!-- # Entry without excerpt -->
-	<tpl:EntryIf extended="0">
-		<div class="post-content">
-			{{tpl:EntryFirstImage size="t" class="post-icon"}}
-			<p>
-				{{tpl:EntryContent encode_html="1" remove_html="1" cut_string="300"}}
-				<tpl:EntryIfContentCut encode_html="1" remove_html="1" cut_string="300">
-					<span class="ellipsis">&nbsp;[&#8230;]</span>
-				</tpl:EntryIfContentCut>
-			</p>
-		</div>
-		<tpl:EntryIfContentCut encode_html="1" remove_html="1" cut_string="300">
-			<p class="post-read-it"><a href="{{tpl:EntryURL}}"
-			 title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue reading}}</a></p>
-		</tpl:EntryIfContentCut>
-	</tpl:EntryIf>
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-	<div class="post-meta">
-		<p class="post-info">
-			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date">{{tpl:EntryDate}}.</span>
-			<tpl:EntryIf has_category="1">
-			<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> › </tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a></span>
-			</tpl:EntryIf>
-		</p>
-
-		<tpl:EntryTags>
-			<tpl:TagsHeader>
-				<ul class="post-tags-list">
-			</tpl:TagsHeader>
-				<li class="post-tags-item"><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-			<tpl:TagsFooter>
-				</ul>
-			</tpl:TagsFooter>
-		</tpl:EntryTags>
-
-		<!-- # Number of comments, trackbacks and attachments -->
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			<p class="post-info-co">
-		</tpl:EntryIf>
-			<tpl:EntryIf show_comments="1">
-				<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-			</tpl:EntryIf>
-			<tpl:EntryIf show_pings="1">
-				<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf has_attachment="1">
-				<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			</p>
-		</tpl:EntryIf>
-	</div>
-</div>
Index: inc/public/default-templates/currywurst/_entry-title.html
===================================================================
--- inc/public/default-templates/currywurst/_entry-title.html	(revision 2619)
+++ 	(revision )
@@ -1,41 +1,0 @@
-<div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}} title" lang="{{tpl:EntryLang}}" role="article">
-
-	<!-- # New day date -->
-	<tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
-
-	<h2 class="post-title"><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-
-	<div class="post-meta">
-		<p class="post-info">
-			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date">{{tpl:EntryDate}}. </span>
-			<tpl:EntryIf has_category="1">
-				<tpl:EntryCategoriesBreadcrumb>
-					<span class="post-breadcrumb-cat"><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></span> ›
-				</tpl:EntryCategoriesBreadcrumb>
-				<span class="post-cat"><a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a></span>
-			</tpl:EntryIf>
-		</p>
-	</div>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-	<!-- # Number of comments, trackbacks and attachments -->
-	<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-		<p class="post-info-co">
-	</tpl:EntryIf>
-	<tpl:EntryIf show_comments="1">
-			<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-	</tpl:EntryIf>
-	<tpl:EntryIf show_pings="1">
-			<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-	<tpl:EntryIf has_attachment="1">
-			<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-	<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-		</p>
-	</tpl:EntryIf>
-</div>
Index: inc/public/default-templates/currywurst/_flv_player.html
===================================================================
--- inc/public/default-templates/currywurst/_flv_player.html	(revision 3958)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<a href="{{tpl:AttachmentURL}}" title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
Index: inc/public/default-templates/currywurst/_footer.html
===================================================================
--- inc/public/default-templates/currywurst/_footer.html	(revision 2992)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<p id="gotop"><a href="#top">{{tpl:lang Page top}}</a></p>
-
-<div class="footer" id="footer" role="contentinfo">
-	<tpl:IfWidgets type="custom">
-		<div class="widgets footer__widgets" id="blogcustom">
-	        <h2 class="blogcustom__title">{{tpl:lang Blog info}}</h2>
-			{{tpl:Widgets type="custom"}}
-		</div> <!-- End #custom widgets -->
-	</tpl:IfWidgets>
-
-	{{tpl:SysBehavior behavior="publicInsideFooter"}}
-
-	<p>{{tpl:SysPoweredBy}}</p>
-</div>
-{{tpl:SysBehavior behavior="publicFooterContent"}}
-
-{{tpl:include src="user_footer.html"}}
Index: inc/public/default-templates/currywurst/_head.html
===================================================================
--- inc/public/default-templates/currywurst/_head.html	(revision 3417)
+++ 	(revision )
@@ -1,11 +1,0 @@
-<!-- media queries -->
-<meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
-<link rel="stylesheet" type="text/css" href="{{tpl:BlogThemeURL}}/style.css" media="screen" />
-<link rel="stylesheet" type="text/css" href="{{tpl:BlogQmarkURL}}pf=print.css" media="print" />
-
-<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.js"></script>
-<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.cookie.js"></script>
-
-{{tpl:include src="user_head.html"}}
-{{tpl:SysBehavior behavior="publicHeadContent"}}
Index: inc/public/default-templates/currywurst/_mp3_player.html
===================================================================
--- inc/public/default-templates/currywurst/_mp3_player.html	(revision 3958)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<audio controls preload="auto">
-	<source src="{{tpl:MediaURL}}" type="audio/mpeg"/>
-</audio>
Index: inc/public/default-templates/currywurst/_pagination.html
===================================================================
--- inc/public/default-templates/currywurst/_pagination.html	(revision 2600)
+++ 	(revision )
@@ -1,13 +1,0 @@
-<tpl:Pagination>
-	<p class="pagination">
-		<tpl:PaginationIf end="0">
-			<a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171; {{tpl:lang previous entries}}</a> -
-		</tpl:PaginationIf>
-
-		{{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
-
-		<tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">
-			{{tpl:lang next entries}} &#187;</a>
-		</tpl:PaginationIf>
-	</p>
-</tpl:Pagination>
Index: inc/public/default-templates/currywurst/_sidebar.html
===================================================================
--- inc/public/default-templates/currywurst/_sidebar.html	(revision 2772)
+++ 	(revision )
@@ -1,14 +1,0 @@
-<div class="sidebar" id="sidebar" role="complementary">
-	<tpl:IfWidgets type="nav">
-		<div class="widgets blognav__widgets" id="blognav">
-	        <h2 class="blognav__title">{{tpl:lang Blog menu}}</h2>
-			{{tpl:Widgets type="nav"}}
-		</div> <!-- End #blognav -->
-	</tpl:IfWidgets>
-	<tpl:IfWidgets type="extra">
-		<div class="widgets blogextra__widgets" id="blogextra">
-	        <h2 class="blogextra__title">{{tpl:lang Extra menu}}</h2>
-			{{tpl:Widgets type="extra"}}
-		</div> <!-- End #blogextra -->
-	</tpl:IfWidgets>
-</div>
Index: inc/public/default-templates/currywurst/_simple-entry.html
===================================================================
--- inc/public/default-templates/currywurst/_simple-entry.html	(revision 2938)
+++ 	(revision )
@@ -1,5 +1,0 @@
-<!-- # Post content and attachments -->
-{{tpl:include src="_entry-content.html"}}
-
-<!-- # Comments, pings and comment form -->
-{{tpl:include src="_entry-feedback.html"}}
Index: inc/public/default-templates/currywurst/_top.html
===================================================================
--- inc/public/default-templates/currywurst/_top.html	(revision 2866)
+++ 	(revision )
@@ -1,20 +1,0 @@
-<div class="header">
-	<nav role="navigation">
-		<ul class="skip-links" id="prelude">
-			<li><a href="#main">{{tpl:lang To content}}</a></li>
-			<li><a href="#blognav">{{tpl:lang To menu}}</a></li>
-			<li><a href="#search">{{tpl:lang To search}}</a></li>
-		</ul>
-	</nav>
-
-	<div class="banner" role="banner">
-		<h1 class="site-title"><a class="site-title__link"
-			href="{{tpl:BlogURL}}"><span class="site-title__text">{{tpl:BlogName encode_html="1"}}</span></a></h1>
-		<p class="site-baseline">{{tpl:BlogDescription}}</p>
-	</div>
-
-	<!-- # --BEHAVIOR-- publicTopAfterContent -->
-	{{tpl:SysBehavior behavior="publicTopAfterContent"}}
-
-	{{tpl:SimpleMenu class="nav header__nav"}}
-</div>
Index: inc/public/default-templates/currywurst/_video_player.html
===================================================================
--- inc/public/default-templates/currywurst/_video_player.html	(revision 3167)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<video controls preload="auto" width="400" height="300">
-	<source src="{{tpl:MediaURL}}">
-</video>
Index: inc/public/default-templates/currywurst/archive.html
===================================================================
--- inc/public/default-templates/currywurst/archive.html	(revision 3422)
+++ 	(revision )
@@ -1,116 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Archives}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<tpl:Archives>
-		<link rel="chapter" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" />
-	</tpl:Archives>
-	<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-	<tpl:Categories>
-		<link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
-	</tpl:Categories>
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-archive"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<div id="content-info">
-		<h2>{{tpl:lang Archives}}</h2>
-	</div>
-
-	<div class="content-inner">
-
-		<div id="time-criteria"><!-- entries sorted by date -->
-			<div id="arch-by-year" class="arch-block arch-by-year">
-				<h3>{{tpl:lang By date}}</h3>
-				<p class="fromto">{{tpl:lang FromDay}} <tpl:Entries no_content="1" order="asc" lastn="1"><a href="{{tpl:EntryURL}}">{{tpl:EntryDate format="%e %B %Y"}}</a></tpl:Entries> {{tpl:lang toDay}} <tpl:Entries no_content="1" order="desc" lastn="1"><a href="{{tpl:EntryURL}}">{{tpl:EntryDate format="%e %B %Y"}}</a></tpl:Entries></p>
-				<tpl:Archives order="asc">
-					<tpl:ArchivesYearHeader>
-						<div class="arch-by-year__each-year">
-							<h4>{{tpl:ArchiveDate format="%Y"}}</h4>
-							<ul class="arch-list arch-year-list">
-					</tpl:ArchivesYearHeader>
-								<li><a href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}">{{tpl:ArchiveDate encode_html="1" format="%B"}}</a>
-									<span>({{tpl:ArchiveEntriesCount}})</span></li>
-					<tpl:ArchivesYearFooter>
-							</ul>
-						</div>
-					</tpl:ArchivesYearFooter>
-				</tpl:Archives>
-			</div>
-		</div>
-
-		<div id="other-criteria"><!-- entries sorted by others criterias -->
-			<tpl:Categories level="1">
-				<tpl:CategoriesHeader>
-					<div id="arch-by-cat" class="arch-block arch-by-cat">
-						<h3>{{tpl:lang By category}}</h3>
-						<ul class="arch-list arch-cat-list">
-							</tpl:CategoriesHeader>
-							<li><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a>
-							<tpl:CategoryFirstChildren>
-								<tpl:CategoriesHeader>
-								<ul class="arch-list arch-sub-cat-list">
-								</tpl:CategoriesHeader>
-									<li><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></li>
-								<tpl:CategoriesFooter>
-								</ul>
-								</tpl:CategoriesFooter>
-							</tpl:CategoryFirstChildren>
-							</li>
-					<tpl:CategoriesFooter>
-						</ul>
-					</div>
-					</tpl:CategoriesFooter>
-			</tpl:Categories>
-
-			<tpl:Tags sortby="count" order="desc">
-				<tpl:TagsHeader>
-					<div id="arch-by-tag" class="arch-block arch-by-tag">
-						<h3>{{tpl:lang By tag}}</h3>
-						<ul class="arch-list arch-tag-list">
-				</tpl:TagsHeader>
-							<li><a href="{{tpl:TagURL}}" class="tag{{tpl:TagRoundPercent}}">{{tpl:TagID}}</a></li>
-				<tpl:TagsFooter>
-						</ul>
-					</div>
-				</tpl:TagsFooter>
-			</tpl:Tags>
-		</div>
-
-		<div id="more-arch"><!-- others things -->
-			<div id="arch-by-page" class="arch-block arch-by-page">
-				<tpl:Entries type="page" no_content="1" lastn="0" selected="0">
-					<tpl:EntriesHeader>
-						<h3>{{tpl:lang Pages}}</h3>
-						<ul class="arch-list arch-page-list">
-					</tpl:EntriesHeader>
-							<li><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></li>
-					<tpl:EntriesFooter>
-						</ul>
-					</tpl:EntriesFooter>
-				</tpl:Entries>
-			</div>
-		</div>
-	</div> <!-- End .content-inner -->
-</tpl:Block>
-
-<tpl:Block name="wrapper-sidebar">
-	<div class="sidebar" id="sidebar" role="complementary">
-		<div class="widgets blognav__widgets" id="blognav">
-			<tpl:Widget id="search">
-			</tpl:Widget>
-		</div> <!-- End #blognav -->
-
-		<tpl:IfWidgets type="extra">
-			<div class="widgets blogextra__widgets" id="blogextra">
-		        <h2 class="blogextra__title">{{tpl:lang Extra menu}}</h2>
-				{{tpl:Widgets type="extra"}}
-			</div> <!-- End #blogextra -->
-		</tpl:IfWidgets>
-	</div> <!-- End #sidebar -->
-</tpl:Block>
Index: inc/public/default-templates/currywurst/archive_month.html
===================================================================
--- inc/public/default-templates/currywurst/archive_month.html	(revision 3422)
+++ 	(revision )
@@ -1,45 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Archives}} - {{tpl:ArchiveDate}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:ArchiveNext><link rel="next" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchiveNext>
-	<tpl:ArchivePrevious><link rel="prev" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchivePrevious>
-
-	<tpl:Entries no_content="1">
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-archive-month"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<p class="navlinks topnl">
-		<tpl:ArchivePrevious><a href="{{tpl:ArchiveURL}}" class="prev">&#171; {{tpl:ArchiveDate encode_html="1"}}</a> - </tpl:ArchivePrevious>
-		{{tpl:ArchiveDate}}
-		<tpl:ArchiveNext> - <a href="{{tpl:ArchiveURL}}" class="next">{{tpl:ArchiveDate encode_html="1"}} &#187;</a></tpl:ArchiveNext>
-	</p>
-
-	<div id="content-info">
-		<h2>{{tpl:ArchiveDate}} <span>({{tpl:ArchiveEntriesCount}})</span></h2>
-	</div>
-
-	<div class="content-inner">
-		<tpl:Entries>
-			{{tpl:include src="_entry-short.html"}}
-		</tpl:Entries>
-	</div>
-
-	<p class="navlinks">
-		<tpl:ArchivePrevious><a href="{{tpl:ArchiveURL}}" class="prev">&#171; {{tpl:ArchiveDate encode_html="1"}}</a> - </tpl:ArchivePrevious>
-		{{tpl:ArchiveDate}}
-		<tpl:ArchiveNext> - <a href="{{tpl:ArchiveURL}}" class="next">{{tpl:ArchiveDate encode_html="1"}} &#187;</a></tpl:ArchiveNext>
-	</p>
-</tpl:Block>
Index: inc/public/default-templates/currywurst/atom-comments.xml
===================================================================
--- inc/public/default-templates/currywurst/atom-comments.xml	(revision 3226)
+++ 	(revision )
@@ -1,47 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{tpl:BlogLanguage}}">
-
-  <title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}
-  - {{tpl:lang Comments}}</title>
-  <subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
-  <link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
-  <link href="{{tpl:BlogURL}}" rel="alternate" type="text/html"
-  title="{{tpl:BlogDescription remove_html="1" encode_xml="1"}}"/>
-  <updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
-  <author>
-    <name>{{tpl:BlogEditor encode_xml="1"}}</name>
-  </author>
-  <id>{{tpl:BlogFeedID}}</id>
-  <generator uri="http://www.dotclear.org/">Dotclear</generator>
-
-  <tpl:Comments order="desc" with_pings="1">
-
-  <tpl:CommentIf is_ping="1">
-  <entry>
-    <title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
-    <link href="{{tpl:PingPostURL encode_xml="1"}}#c{{tpl:PingID}}" rel="alternate" type="text/html"
-    title="[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}" />
-    <id>{{tpl:PingFeedID}}</id>
-    <published>{{tpl:PingDate iso8601="1"}}</published>
-    <updated>{{tpl:PingDate iso8601="1" upddt="1"}}</updated>
-    <author><name>{{tpl:PingBlogName encode_xml="1"}}</name></author>
-    <content type="html">&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt; {{tpl:PingContent encode_xml="1"}}</content>
-  </entry>
-
-  </tpl:CommentIf>
-
-  <tpl:CommentIf is_ping="0">
-  <entry>
-    <title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
-    <link href="{{tpl:CommentPostURL encode_xml="1"}}#c{{tpl:CommentID}}" rel="alternate" type="text/html"
-    title="{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}" />
-    <id>{{tpl:CommentFeedID}}</id>
-    <published>{{tpl:CommentDate iso8601="1"}}</published>
-    <updated>{{tpl:CommentDate iso8601="1" upddt="1"}}</updated>
-    <author><name>{{tpl:CommentAuthor encode_xml="1"}}</name></author>
-    <content type="html">{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</content>
-  </entry>
-  </tpl:CommentIf>
-  </tpl:Comments>
-
-</feed>
Index: inc/public/default-templates/currywurst/atom.xml
===================================================================
--- inc/public/default-templates/currywurst/atom.xml	(revision 3226)
+++ 	(revision )
@@ -1,55 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
-  xml:lang="{{tpl:BlogLanguage}}">
-
-  <title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
-  <subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
-  <link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
-  <link href="{{tpl:BlogURL}}" rel="alternate" type="text/html"
-  title="{{tpl:BlogDescription remove_html="1" encode_xml="1"}}"/>
-  <updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
-  <author>
-    <name>{{tpl:BlogEditor encode_xml="1"}}</name>
-  </author>
-  <id>{{tpl:BlogFeedID}}</id>
-  <generator uri="http://www.dotclear.org/">Dotclear</generator>
-
-  <tpl:Entries>
-
-  <entry>
-    <title>{{tpl:EntryTitle encode_xml="1"}}</title>
-    <link href="{{tpl:EntryURL}}" rel="alternate" type="text/html"
-    title="{{tpl:EntryTitle encode_xml="1"}}" />
-    <id>{{tpl:EntryFeedID}}</id>
-    <published>{{tpl:EntryDate iso8601="1"}}</published>
-    <tpl:EntryIf republished="1">
-      <updated>{{tpl:EntryDate iso8601="1" upddt="1"}}</updated>
-    </tpl:EntryIf>
-    <tpl:EntryIf republished="0">
-      <updated>{{tpl:EntryDate iso8601="1"}}</updated>
-    </tpl:EntryIf>
-    <author><name>{{tpl:EntryAuthorCommonName encode_xml="1"}}</name></author>
-    <tpl:EntryIf has_category="1">
-    <dc:subject>{{tpl:EntryCategory encode_html="1"}}</dc:subject>
-    </tpl:EntryIf>
-    <tpl:EntryTags><dc:subject>{{tpl:TagID}}</dc:subject></tpl:EntryTags>
-
-    <content type="html">{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}}
-    {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</content>
-
-    <tpl:Attachments>
-      <link rel="enclosure" href="{{tpl:AttachmentURL}}"
-      length="{{tpl:AttachmentSize full="1"}}" type="{{tpl:AttachmentMimeType}}" />
-    </tpl:Attachments>
-
-
-    <tpl:EntryIf comments_active="1">
-      <wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
-      <wfw:commentRss>{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}</wfw:commentRss>
-    </tpl:EntryIf>
-  </entry>
-  </tpl:Entries>
-
-</feed>
Index: inc/public/default-templates/currywurst/category.html
===================================================================
--- inc/public/default-templates/currywurst/category.html	(revision 3422)
+++ 	(revision )
@@ -1,89 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:CategoryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
-</tpl:Block>
-
-<tpl:Block name="meta-entry">
-	<meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:CategoryDescription encode_html="1" cut_string="180" remove_html="1"}}" />
-	<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
-	<meta name="date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:Entries no_content="1">
-		<tpl:EntriesHeader>
-			<tpl:Pagination>
-				<tpl:PaginationIf end="0">
-					<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-				</tpl:PaginationIf>
-
-				<tpl:PaginationIf start="0">
-					<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-				</tpl:PaginationIf>
-			</tpl:Pagination>
-		</tpl:EntriesHeader>
-
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:CategoryFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-category"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<div id="content-info">
-		<h2>
-			<tpl:CategoryParents>
-				<a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> &rsaquo;
-			</tpl:CategoryParents>
-			{{tpl:CategoryTitle encode_html="1"}}
-		</h2>
-
-		<tpl:CategoryIf has_entries="1">
-			<ul class="content-info__feed">
-				<li><a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}"
-				 title="{{tpl:lang This category's entries Atom feed}}" class="feed">{{tpl:lang Entries feed}}</a></li>
-
-				<tpl:SysIf operator="or" comments_active="1" pings_active="1">
-					 <li><a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}/comments"
-					 title="{{tpl:lang This category's comments Atom feed}}" class="feed">{{tpl:lang Comments feed}}</a></li>
-				</tpl:SysIf>
-			</ul>
-		</tpl:CategoryIf>
-
-		<div class="content-info__cat-desc">
-			{{tpl:CategoryDescription}}
-		</div>
-
-
-		<tpl:CategoryFirstChildren>
-			<tpl:CategoriesHeader>
-				<div id="subcategories" class="content-info__sub-cat">
-					<h3>{{tpl:lang Subcategories}}</h3>
-					<ul>
-			</tpl:CategoriesHeader>
-						<li class="post-cat"><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></li>
-			<tpl:CategoriesFooter>
-					</ul>
-				</div>
-			</tpl:CategoriesFooter>
-		</tpl:CategoryFirstChildren>
-	</div>	<!-- End #content-info -->
-
-	<div class="content-inner">
-		<tpl:Entries>
-			{{tpl:include src="_entry-short.html"}}
-
-			<tpl:EntriesFooter>
-				{{tpl:include src="_pagination.html"}}
-			</tpl:EntriesFooter>
-		</tpl:Entries>
-	</div> <!-- End #content-inner -->
-</tpl:Block>
Index: inc/public/default-templates/currywurst/home.html
===================================================================
--- inc/public/default-templates/currywurst/home.html	(revision 2675)
+++ 	(revision )
@@ -1,1 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
Index: inc/public/default-templates/currywurst/password-form.html
===================================================================
--- inc/public/default-templates/currywurst/password-form.html	(revision 2603)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<!DOCTYPE html>
-<html lang="{{tpl:BlogLanguage}}">
-<head>
-  <meta charset="UTF-8" />
-  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
-  <title>{{tpl:lang Password needed}} - {{tpl:BlogName encode_html="1"}}</title>
-
-  <style type="text/css">
-  body {
-  font: 0.8em Verdana,Arial,Geneva,sans-serif;
-  }
-
-  form {
-  display : block;
-  width : 500px;
-  margin : 0 auto;
-  padding : 1em;
-  background : #eee;
-  }
-
-  h2 { font : 140% Arial,Helvetica,sans-serif; margin : 0; }
-
-  label { font-weight : bold; }
-
-  input { border-width : 1px; }
-  </style>
-</head>
-
-<body>
-
-<form action="{{tpl:EntryURL}}" method="post" role="form">
-<h2>{{tpl:lang Password needed}}</h2>
-
-<p>{{tpl:lang You must give a password to access this area.}}</p>
-<p><label>{{tpl:lang Password:}} <input type="password" name="password" value="" /></label> <input type="submit" value="ok" /></p>
-
-</form>
-
-</body>
-</html>
Index: inc/public/default-templates/currywurst/post.html
===================================================================
--- inc/public/default-templates/currywurst/post.html	(revision 4003)
+++ 	(revision )
@@ -1,58 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:EntryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-entry">
-	<meta name="description" lang="{{tpl:EntryLang}}" content="{{tpl:EntryContent full="1" encode_html="1" remove_html="1" cut_string="180"}}" />
-	<meta name="author" content="{{tpl:EntryAuthorCommonName encode_html="1"}}" />
-	<meta name="date" content="{{tpl:EntryDate iso8601="1"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:EntryIf pings_active="1"><link rel="pingback" href="{{tpl:BlogXMLRPCURL}}" /></tpl:EntryIf>
-	<tpl:EntryNext><link rel="next" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryNext>
-	<tpl:EntryPrevious><link rel="prev" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryPrevious>
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="html-head">
-	{{tpl:parent}}
-
-  <script type="application/json" id="dc_post_remember_str-data">
-    {"post_remember_str": "{{tpl:lang Remember me on this blog}}"}
-  </script>
-  <script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf=util.js"></script>
-  <script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf=post.js"></script>
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-post"></tpl:Block>
-
-<tpl:Block name="page-top">
-	{{tpl:EntryPingData}}
-	{{tpl:parent}}
-</tpl:Block>
-
-<tpl:Block name="main-content">
-	<p class="navlinks topnl">
-		<tpl:EntryPrevious><a href="{{tpl:EntryURL}}"
-		 title="{{tpl:EntryTitle encode_html="1"}}" class="prev">&#171; {{tpl:EntryTitle encode_html="1"
-		 cut_string="50"}}</a></tpl:EntryPrevious>
-		<tpl:EntryNext> <span>-</span> <a href="{{tpl:EntryURL}}"
-		 title="{{tpl:EntryTitle encode_html="1"}}" class="next">{{tpl:EntryTitle encode_html="1"
-		 cut_string="50"}} &#187;</a></tpl:EntryNext>
-	</p>
-
-	{{tpl:include src="_simple-entry.html"}}
-
-	<p class="navlinks">
-		<tpl:EntryPrevious><a href="{{tpl:EntryURL}}"
-		 title="{{tpl:EntryTitle encode_html="1"}}" class="prev">&#171; {{tpl:EntryTitle encode_html="1"
-		 cut_string="50"}}</a></tpl:EntryPrevious>
-		<tpl:EntryNext> <span>-</span> <a href="{{tpl:EntryURL}}"
-		 title="{{tpl:EntryTitle encode_html="1"}}" class="next">{{tpl:EntryTitle encode_html="1"
-		 cut_string="50"}} &#187;</a></tpl:EntryNext>
-	</p>
-</tpl:Block>
Index: inc/public/default-templates/currywurst/rss2-comments.xml
===================================================================
--- inc/public/default-templates/currywurst/rss2-comments.xml	(revision 3226)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
-<rss version="2.0"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xmlns:content="http://purl.org/rss/1.0/modules/content/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-<channel>
-  <title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}
-  - {{tpl:lang Comments}}</title>
-  <link>{{tpl:BlogURL}}</link>
-  <atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml"/>
-  <description>{{tpl:BlogDescription remove_html="1" encode_xml="1"}}</description>
-  <language>{{tpl:BlogLanguage}}</language>
-  <pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
-  <copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
-  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
-  <generator>Dotclear</generator>
-
-  <tpl:Comments order="desc" with_pings="1">
-
-  <tpl:CommentIf is_ping="1">
-  <item>
-    <title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
-    <link>{{tpl:PingPostURL encode_xml="1"}}#c{{tpl:PingID}}</link>
-    <guid isPermaLink="false">{{tpl:PingFeedID}}</guid>
-    <pubDate>{{tpl:PingDate rfc822="1"}}</pubDate>
-    <dc:creator>{{tpl:PingBlogName encode_xml="1"}}</dc:creator>
-
-    <description>&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt;
-    {{tpl:PingContent encode_xml="1"}}</description>
-  </item>
-  </tpl:CommentIf>
-
-  <tpl:CommentIf is_ping="0">
-  <item>
-    <title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
-    <link>{{tpl:CommentPostURL encode_xml="1"}}#c{{tpl:CommentID}}</link>
-    <guid isPermaLink="false">{{tpl:CommentFeedID}}</guid>
-    <pubDate>{{tpl:CommentDate rfc822="1"}}</pubDate>
-    <dc:creator>{{tpl:CommentAuthor encode_xml="1"}}</dc:creator>
-
-    <description>{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</description>
-  </item>
-  </tpl:CommentIf>
-  </tpl:Comments>
-
-</channel>
-</rss>
Index: inc/public/default-templates/currywurst/rss2.xml
===================================================================
--- inc/public/default-templates/currywurst/rss2.xml	(revision 3226)
+++ 	(revision )
@@ -1,49 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
-<rss version="2.0"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
-  xmlns:content="http://purl.org/rss/1.0/modules/content/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-<channel>
-  <title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
-  <link>{{tpl:BlogURL}}</link>
-  <atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml"/>
-  <description>{{tpl:BlogDescription remove_html="1" encode_xml="1"}}</description>
-  <language>{{tpl:BlogLanguage}}</language>
-  <pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
-  <copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
-  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
-  <generator>Dotclear</generator>
-
-  <tpl:Entries>
-
-  <item>
-    <title>{{tpl:EntryTitle encode_xml="1"}}</title>
-    <link>{{tpl:EntryURL}}</link>
-    <guid isPermaLink="false">{{tpl:EntryFeedID}}</guid>
-    <pubDate>{{tpl:EntryDate rfc822="1"}}</pubDate>
-    <dc:creator>{{tpl:EntryAuthorCommonName encode_xml="1"}}</dc:creator>
-    <tpl:EntryIf has_category="1">
-    <category>{{tpl:EntryCategory encode_html="1"}}</category>
-    </tpl:EntryIf>
-    <tpl:EntryTags><category>{{tpl:TagID}}</category></tpl:EntryTags>
-
-    <description>{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}}
-    {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</description>
-
-    <tpl:Attachments>
-      <enclosure url="{{tpl:AttachmentURL}}"
-      length="{{tpl:AttachmentSize full="1"}}" type="{{tpl:AttachmentMimeType}}" />
-    </tpl:Attachments>
-
-    <tpl:EntryIf comments_active="1">
-      <comments>{{tpl:EntryURL}}#comment-form</comments>
-      <wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
-      <wfw:commentRss>{{tpl:BlogFeedURL}}/comments/{{tpl:EntryID}}</wfw:commentRss>
-    </tpl:EntryIf>
-  </item>
-  </tpl:Entries>
-
-</channel>
-</rss>
Index: inc/public/default-templates/currywurst/rss2.xsl
===================================================================
--- inc/public/default-templates/currywurst/rss2.xsl	(revision 2600)
+++ 	(revision )
@@ -1,120 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-xmlns:content="http://purl.org/rss/1.0/modules/content/"
-xmlns="http://www.w3.org/1999/xhtml">
-
-<xsl:output method="html"/>
-
-<xsl:template match="/">
-<html>
-  <head>
-    <title>{{tpl:lang Subscribe to}} <xsl:value-of select="/rss/channel/title"/></title>
-    <style type="text/css">
-    <![CDATA[
-    body {
-      font: 80% Verdana,Arial,sans-serif;
-      margin: 20px 0;
-      padding: 0 0;
-      background: #fff;
-      color: #000;
-    }
-    a { color: #039; }
-    h1, h2 { font-family: Arial,sans-serif; }
-    h1 { font-size: 160%; margin: 0; }
-    h2 { font-size: 140%; font-weight: bold; margin: 0.5em 0 0.2em 0; }
-    h2 a { text-decoration: none; }
-    p { margin: 0 0 0.5em 0; }
-    #page {
-      margin: 0 80px;
-    }
-    #top {
-      background: #036;
-      padding : 1em;
-      color: #fff;
-    }
-    #top a {
-      color: #fff;
-      text-decoration: none;
-    }
-    #what {
-      padding: 1em;
-      background: #eee;
-      border-bottom: 1px solid #000;
-      font-size: 80%;
-    }
-    #what p {
-      margin: 0 0 0.5em 0;
-    }
-    #footer {
-      border-top: 1px solid #000;
-    }
-    #items {
-      background: #fff;
-      color: inherit;
-    }
-    #items div {
-      margin: 0 0 1em 0;
-    }
-    ]]>
-    </style>
-    <script type="text/javascript"><![CDATA[
-    window.onload = function() {
-      document.getElementById('feedurl').value = window.location.href;
-
-      // Ugly but works ;)
-      var c = document.getElementsByTagName('div');
-      var t = '';
-      for (var i=0; c.length-i != 0; i++) {
-        if (c[i].className == 'item-content') {
-          if (c[i].textContent) {
-            t = c[i].textContent;
-          } else if (c[i].innerText) {
-            t = c[i].innerText;
-          } else {
-            t = '';
-          }
-
-          if (t) { c[i].innerHTML = t; }
-        }
-      }
-    };
-    ]]></script>
-  </head>
-  <body>
-    <div id="page">
-      <div id="top">
-        <h1><a href="{/rss/channel/link}"><xsl:value-of select="/rss/channel/title"/></a></h1>
-        <p><xsl:value-of select="/rss/channel/description"/></p>
-      </div>
-      <div id="what">
-      <h3>{{tpl:lang What is an RSS feed?}}</h3>
-      <p>{{tpl:lang RSS feed is a free blog summary. It provides content
-      (either posts or comments) or  summaries of content, together with links
-      to the full versions, and other metadata. The last published items may
-      then be read by your favorite RSS
-      <a href="http://en.wikipedia.org/wiki/Aggregator">aggregator</a>.}}</p>
-      <h3>{{tpl:lang Subscribe}}</h3>
-      <p>{{tpl:lang Simply copy the following URL into your aggregator:}}</p>
-      <p><input type="text" size="60" value="" id="feedurl" /></p>
-      </div>
-      <div id="items">
-        <xsl:apply-templates select="//item"/>
-      </div>
-      <div id="footer">
-        <p><xsl:value-of select="/rss/channel/copyright"/></p>
-      </div>
-    </div>
-  </body>
-</html>
-</xsl:template>
-
-<!-- Item template -->
-<xsl:template match="item">
-  <div>
-    <h2><a href="{link}"><xsl:value-of select="title"/></a></h2>
-    <div class="item-content"><xsl:value-of select="description" /></div>
-  </div>
-</xsl:template>
-
-</xsl:stylesheet>
Index: inc/public/default-templates/currywurst/search.html
===================================================================
--- inc/public/default-templates/currywurst/search.html	(revision 3422)
+++ 	(revision )
@@ -1,65 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Search}} - {{tpl:SysSearchString encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:Entries no_content="1">
-		<tpl:EntriesHeader>
-			<tpl:Pagination>
-				<tpl:PaginationIf end="0">
-					<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-				</tpl:PaginationIf>
-				<tpl:PaginationIf start="0">
-					<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-				</tpl:PaginationIf>
-			</tpl:Pagination>
-		</tpl:EntriesHeader>
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-	<link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-search"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<div id="content-info">
-		<h2>{{tpl:lang Search}}</h2>
-		<tpl:SysIf search_count="==0">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned no result."}}</p>
-		</tpl:SysIf>
-		<tpl:SysIf search_count="==1">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> result."}}</p>
-		</tpl:SysIf>
-		<tpl:SysIf search_count="&gt;1">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> results."}}</p>
-		</tpl:SysIf>
-	</div>
-
-	<div class="content-inner">
-		<tpl:Entries>
-
-			{{tpl:include src="_entry-short.html"}}
-
-			<tpl:EntriesFooter>
-				<tpl:Pagination>
-					<p class="pagination">
-						<tpl:PaginationIf end="0">
-							<a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171; {{tpl:lang previous entries}}</a> -
-						</tpl:PaginationIf>
-						 {{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
-						<tpl:PaginationIf start="0">
-							 - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}} &#187;</a>
-						</tpl:PaginationIf>
-					</p>
-				</tpl:Pagination>
-			</tpl:EntriesFooter>
-		</tpl:Entries>
-	</div> <!-- End #content-inner -->
-</tpl:Block>
Index: inc/public/default-templates/currywurst/user_head.html
===================================================================
--- inc/public/default-templates/currywurst/user_head.html	(revision 2600)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<!-- # This template is included at the end of _head.html template -->
Index: inc/public/default-templates/dotty/404.html
===================================================================
--- inc/public/default-templates/dotty/404.html	(revision 3849)
+++ 	(revision )
@@ -1,32 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Document not found}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-404"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<header id="content-info">
-		<h2>{{tpl:lang Document not found}}</h2>
-		<p>{{tpl:lang URL you've tried has typos, or the page has been deleted or moved.}}</p>
-	</header>
-
-	<div class="content-inner">
-		<h3>{{tpl:lang Suggestions:}}</h3>
-		<ul>
-			<li><a href="{{tpl:BlogURL}}">{{tpl:lang Go to homepage}}</a></li>
-			<li><a href="#search">{{tpl:lang Use search form}}</a></li>
-			<li><a href="{{tpl:BlogURL}}archive">{{tpl:lang Explore archives}}</a></li>
-		</ul>
-	</div> <!-- # End #content-inner -->
-</tpl:Block>
Index: inc/public/default-templates/dotty/README.md
===================================================================
--- inc/public/default-templates/dotty/README.md	(revision 3289)
+++ 	(revision )
@@ -1,7 +1,0 @@
-# Dotty
-
-Un nouveau jeu de templates pour Dotclear (versions ≥ 2.10)
-
-## Motivations
-
-Le jeu de templates Dotty reprend la même structure que le jeu currywurst avec la différence qu'il tire parti des balises sémantiques spécifiques de HTML5 : section, article, aside, header, footer, …
Index: inc/public/default-templates/dotty/__layout.html
===================================================================
--- inc/public/default-templates/dotty/__layout.html	(revision 3527)
+++ 	(revision )
@@ -1,116 +1,0 @@
-<!DOCTYPE html>
-<html lang="{{tpl:BlogLanguage}}">
-<head>
-	<tpl:Block name="html-head">
-		<meta charset="UTF-8" />
-
-		<tpl:Block name="head-title">
-			<title>{{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-		</tpl:Block>	<!-- # head-title -->
-
-		<tpl:Block name="head-meta">
-			<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
-			<tpl:Block name="meta-robots">
-				<meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
-			</tpl:Block>	<!-- # meta-robots -->
-			<tpl:Block name="meta-entry">
-				<meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:BlogDescription cut_string="180" remove_html="1" encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
-				<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
-				<meta name="date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
-			</tpl:Block>	<!-- # meta-entry -->
-		</tpl:Block>	<!-- # head-meta -->
-
-		<tpl:Block name="head-linkrel">
-			<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-			<tpl:Categories>
-				<link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
-			</tpl:Categories>
-
-			<tpl:Entries no_content="1">
-				<tpl:EntriesHeader>
-					<tpl:Pagination>
-						<tpl:PaginationIf end="0">
-							<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-						</tpl:PaginationIf>
-
-						<tpl:PaginationIf start="0">
-							<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-						</tpl:PaginationIf>
-					</tpl:Pagination>
-				</tpl:EntriesHeader>
-
-				<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-			</tpl:Entries>
-
-			<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-			<link rel="EditURI" type="application/rsd+xml" title="RSD" href="{{tpl:BlogRSDURL}}" />
-			<link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
-		</tpl:Block>	<!-- # head-linkrel -->
-
-		{{tpl:include src="_head.html"}}
-	</tpl:Block>	<!-- # html-head -->
-</head>
-<tpl:Block name="body-tag">
-	<body class="dc-home <tpl:SysIf current_mode="default">dc-home-first</tpl:SysIf>">
-</tpl:Block>
-	<tpl:Block name="html-body">
-		<div id="page">
-			<tpl:Block name="body-page">
-				<tpl:Block name="page-top">
-					{{tpl:include src="_top.html"}}
-				</tpl:Block>	<!-- # page-top -->
-
-				<div id="wrapper">
-					<tpl:Block name="page-wrapper">
-						<main id="main" role="main">
-							<tpl:Block name="wrapper-main">
-								<tpl:Block name="main-breadcrumb">
-									{{tpl:Breadcrumb}}
-								</tpl:Block>
-								<section id="content">
-									<tpl:Block name="main-content">
-
-										<tpl:Entries>
-
-											<!-- # First page -->
-											<tpl:SysIf current_mode="default">
-												<tpl:LoopPosition start="1" length="1">
-													{{tpl:include src="_entry-full.html"}}
-												</tpl:LoopPosition>
-
-												<tpl:LoopPosition start="2">
-													{{tpl:include src="_entry-short.html"}}
-												</tpl:LoopPosition>
-											</tpl:SysIf>
-
-											<!-- # Next pages -->
-											<tpl:SysIf current_mode="!default">
-												{{tpl:include src="_entry-short.html"}}
-											</tpl:SysIf>
-
-											<!-- # Pagination -->
-											<tpl:EntriesFooter>
-												{{tpl:include src="_pagination.html"}}
-											</tpl:EntriesFooter>
-
-										</tpl:Entries>
-
-									</tpl:Block>	<!-- # main-content -->
-								</section> <!-- # End #content -->
-							</tpl:Block>	<!-- # wrapper-main -->
-						</main> <!-- # End #main -->
-
-						<tpl:Block name="wrapper-sidebar">
-							{{tpl:include src="_sidebar.html"}}
-						</tpl:Block>	<!-- # wrapper-sidebar -->
-					</tpl:Block>	<!-- # page-wrapper -->
-				</div> <!-- # End #wrapper -->
-
-				<tpl:Block name="page-footer">
-					{{tpl:include src="_footer.html"}}
-				</tpl:Block>	<!-- # page-footer -->
-			</tpl:Block>	<!-- # body-page -->
-		</div> <!-- # End #page -->
-	</tpl:Block>	<!-- # html-body -->
-</body>
-</html>
Index: inc/public/default-templates/dotty/_audio_player.html
===================================================================
--- inc/public/default-templates/dotty/_audio_player.html	(revision 3246)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<audio controls preload="auto">
-	<source src="{{tpl:MediaURL}}">
-</audio>
Index: inc/public/default-templates/dotty/_entry-content.html
===================================================================
--- inc/public/default-templates/dotty/_entry-content.html	(revision 3958)
+++ 	(revision )
@@ -1,65 +1,0 @@
-<article class="post simple" id="p{{tpl:EntryID}}" role="article" lang="{{tpl:EntryLang}}">
-	<header>
-		<h2 class="post-title">{{tpl:EntryTitle encode_html="1"}}</h2>
-
-		<div class="post-meta">
-			<p class="post-info">
-				<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-				<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>. </span>
-				<span class="post-permalink"><a href="{{tpl:EntryURL}}">{{tpl:lang Permalink}}</a></span>
-				<tpl:EntryIf has_category="1">
-					<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
-					href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> › </tpl:EntryCategoriesBreadcrumb><a
-					href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a></span>
-				</tpl:EntryIf>
-			</p>
-
-			<tpl:EntryTags>
-				<tpl:TagsHeader>
-					<ul class="post-tags-list">
-				</tpl:TagsHeader>
-					<li class="post-tags-item"><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-				<tpl:TagsFooter>
-					</ul>
-				</tpl:TagsFooter>
-			</tpl:EntryTags>
-		</div>
-	</header>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<!-- # Entry with an excerpt -->
-	<tpl:EntryIf extended="1">
-		<div class="post-excerpt">{{tpl:EntryExcerpt}}</div>
-	</tpl:EntryIf>
-
-	<div class="post-content">{{tpl:EntryContent}}</div>
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-<!-- # Attachments -->
-<tpl:Attachments>
-	<tpl:AttachmentsHeader>
-		<footer class="post-attachments" id="attachments">
-			<h3 class="post-attachments-title">{{tpl:lang Attachments}}</h3>
-			<ul class="post-attachments-list">
-	</tpl:AttachmentsHeader>
-				<li class="post-attachments-item {{tpl:AttachmentType}}">
-          <tpl:AttachmentIf is_audio="1">
-            {{tpl:include src="_audio_player.html"}}
-          </tpl:AttachmentIf>
-          <tpl:AttachmentIf is_video="1">
-            {{tpl:include src="_video_player.html"}}
-          </tpl:AttachmentIf>
-          <tpl:AttachmentIf is_audio="0" is_video="0">
-             <a href="{{tpl:AttachmentURL}}" title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
-          </tpl:AttachmentIf>
-				</li>
-	<tpl:AttachmentsFooter>
-			</ul>
-		</footer>
-	</tpl:AttachmentsFooter>
-</tpl:Attachments>
-</article>
Index: inc/public/default-templates/dotty/_entry-feedback.html
===================================================================
--- inc/public/default-templates/dotty/_entry-feedback.html	(revision 3972)
+++ 	(revision )
@@ -1,117 +1,0 @@
-<tpl:EntryIf operator="or" show_comments="1" show_pings="1">
-	<section class="post-feedback">
-</tpl:EntryIf>
-
-<!-- # Comments -->
-<tpl:EntryIf show_comments="1">
-	<tpl:Comments with_pings="1">
-		<tpl:CommentsHeader>
-			<div class="feedback__comments" id="comments">
-				<h3>{{tpl:EntryCommentCount count_all="1" none="no reactions" one="one reaction" more="%s reactions"}}</h3>
-				<tpl:EntryIf operator="or" comments_active="1" pings_active="1">
-					<p id="comments-feed"><a class="feed" href="{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}"
-						title="{{tpl:lang This post's comments Atom feed}}">{{tpl:lang This post's comments feed}}</a></p>
-				</tpl:EntryIf>
-				<ul class="comments-list">
-		</tpl:CommentsHeader>
-					<tpl:CommentIf is_ping="0">
-						<li id="c{{tpl:CommentID}}" class="comment {{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
-					</tpl:CommentIf>
-					<tpl:CommentIf is_ping="1">
-						<li id="c{{tpl:PingID}}" class="ping {{tpl:PingIfOdd}} {{tpl:PingIfFirst}}">
-					</tpl:CommentIf>
-							<p class="comment-info"><a href="#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}</a>
-								{{tpl:lang From}} {{tpl:CommentAuthorLink}} - <time datetime="{{tpl:CommentDate iso8601="1"}}">{{tpl:CommentDate format="%d"}}/{{tpl:CommentDate format="%m"}}/{{tpl:CommentDate format="%Y"}}, {{tpl:CommentTime}}</time>
-							</p>
-							<div class="comment-content">
-								<!-- # --BEHAVIOR-- publicCommentBeforeContent -->
-								{{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
-
-								{{tpl:CommentContent}}
-
-								<!-- # --BEHAVIOR-- publicCommentAfterContent -->
-								{{tpl:SysBehavior behavior="publicCommentAfterContent"}}
-							</div>
-						</li>
-		<tpl:CommentsFooter>
-					</ul>
-				</div>
-		</tpl:CommentsFooter>
-	</tpl:Comments>
-</tpl:EntryIf>
-
-<tpl:EntryIf comments_active="1">
-	<tpl:SysIfFormError>
-		<p class="error" id="pr">{{tpl:SysFormError}}</p>
-	</tpl:SysIfFormError>
-
-	<tpl:SysIfCommentPublished>
-		<p class="message" id="pr">{{tpl:lang Your comment has been published.}}</p>
-	</tpl:SysIfCommentPublished>
-
-	<tpl:SysIfCommentPending>
-		<p class="message" id="pr">{{tpl:lang Your comment has been submitted and will be reviewed for publication.}}</p>
-	</tpl:SysIfCommentPending>
-
-	<!-- # Comment form -->
-	<form class="comment-form" action="{{tpl:EntryURL}}#pr" method="post" id="comment-form" role="form">
-		<tpl:IfCommentPreview>
-			<div id="pr">
-				<h3>{{tpl:lang Your comment}}</h3>
-				<div class="comment-preview">{{tpl:CommentPreviewContent}}</div>
-				<p class="buttons"><button type="submit" class="submit" value="{{tpl:lang Send}}">{{tpl:lang Send}}</button></p>
-			</div>
-		</tpl:IfCommentPreview>
-
-		<h3>{{tpl:lang Add a comment}}</h3>
-			<!-- # --BEHAVIOR-- publicCommentFormBeforeContent -->
-			{{tpl:SysBehavior behavior="publicCommentFormBeforeContent"}}
-
-			<p class="field name-field"><label for="c_name">{{tpl:lang Name or nickname}}<abbr title="{{tpl:lang Required field}}">*</abbr>&nbsp;:</label>
-				<input name="c_name" id="c_name" type="text" size="30" maxlength="255"
-				 value="{{tpl:CommentPreviewName encode_html="1"}}" required />
-			</p>
-
-			<p class="field mail-field"><label for="c_mail">{{tpl:lang Email address}}<abbr title="{{tpl:lang Required field}}">*</abbr>&nbsp;:</label>
-				<input name="c_mail" id="c_mail" type="email" size="30" maxlength="255"
-				 value="{{tpl:CommentPreviewEmail encode_html="1"}}" required />
-			</p>
-
-			<p class="field site-field"><label for="c_site">{{tpl:lang Website}}&nbsp;:</label>
-				<input name="c_site" id="c_site" type="url" size="30" maxlength="255"
-				 value="{{tpl:CommentPreviewSite encode_html="1"}}" />
-			</p>
-
-			<p style="display:none">
-				<input name="f_mail" type="text" size="30" maxlength="255" value="" />
-			</p>
-
-			<p class="field field-content"><label for="c_content">{{tpl:lang Comment}}<abbr title="{{tpl:lang Required field}}">*</abbr>&nbsp;:</label>
-				<textarea name="c_content" id="c_content" cols="35"
-				 rows="7" required aria-describedby="c_help">{{tpl:CommentPreviewContent raw="1" encode_html="1"}}</textarea>
-			</p>
-
-			<p class="form-help" id="c_help">{{tpl:CommentHelp}}</p>
-
-			<!-- # --BEHAVIOR-- publicCommentFormAfterContent -->
-			{{tpl:SysBehavior behavior="publicCommentFormAfterContent"}}
-
-			<p class="buttons">
-				<button type="submit" class="preview" name="preview" value="{{tpl:lang Preview}}">{{tpl:lang Preview}}</button>
-		        <tpl:IfCommentPreviewOptional>
-		        	<button type="submit" class="submit" value="{{tpl:lang Send}}">{{tpl:lang Send}}</button>
-		        </tpl:IfCommentPreviewOptional>
-			</p>
-	</form>
-</tpl:EntryIf>
-
-<tpl:EntryIf pings_active="1">
-	<div class="send-ping">
-		<h3>{{tpl:lang Add ping}}</h3>
-		<p id="ping-url">{{tpl:lang Trackback URL}}&nbsp;: {{tpl:EntryPingLink}}</p>
-	</div>
-</tpl:EntryIf>
-
-<tpl:EntryIf operator="or" show_comments="1" show_pings="1">
-	</section> <!-- # end post-feedback -->
-</tpl:EntryIf>
Index: inc/public/default-templates/dotty/_entry-full.html
===================================================================
--- inc/public/default-templates/dotty/_entry-full.html	(revision 3331)
+++ 	(revision )
@@ -1,59 +1,0 @@
-<article id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}} full" lang="{{tpl:EntryLang}}" role="article">
-
-	<header>
-		<!-- # New day date -->
-		<tpl:DateHeader>
-			<p class="post-day-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time></p>
-		</tpl:DateHeader>
-
-		<h2 class="post-title"><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-	</header>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<tpl:EntryIf extended="1">
-	<div class="post-excerpt">{{tpl:EntryExcerpt}}</div>
-	</tpl:EntryIf>
-
-	<div class="post-content">{{tpl:EntryContent}}</div>
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-	<footer class="post-meta">
-		<p class="post-info">
-			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>.</span>
-			<tpl:EntryIf has_category="1">
-			<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> › </tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
-			</span>
-			</tpl:EntryIf>
-		</p>
-
-		<tpl:EntryTags>
-			<tpl:TagsHeader>
-			<ul class="post-tags-list">
-			</tpl:TagsHeader>
-				<li class="post-tags-item"><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-			<tpl:TagsFooter>
-			</ul>
-			</tpl:TagsFooter>
-		</tpl:EntryTags>
-
-		<!-- # Number of comments, trackbacks and attachments -->
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			<p class="post-info-co">
-			<tpl:EntryIf show_comments="1">
-			<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-			</tpl:EntryIf>
-			<tpl:EntryIf show_pings="1">
-			<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf has_attachment="1">
-			<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-			</p>
-		</tpl:EntryIf>
-	</footer>
-</article>
Index: inc/public/default-templates/dotty/_entry-short.html
===================================================================
--- inc/public/default-templates/dotty/_entry-short.html	(revision 3431)
+++ 	(revision )
@@ -1,81 +1,0 @@
-<article id="p{{tpl:EntryID}}" class="post short {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" role="article">
-
-	<header>
-		<!-- # New day date -->
-		<tpl:DateHeader>
-			<p class="post-day-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time></p>
-		</tpl:DateHeader>
-
-		<h2 class="post-title"><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-	</header>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<!-- # Entry with an excerpt -->
-	<tpl:EntryIf extended="1">
-		<div class="post-content">
-			{{tpl:EntryFirstImage size="t" class="post-icon"}}
-			{{tpl:EntryExcerpt}}
-		</div>
-		<p class="post-read-it"><a href="{{tpl:EntryURL}}"
-		 title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue reading}}</a></p>
-	</tpl:EntryIf>
-
-	<!-- # Entry without excerpt -->
-	<tpl:EntryIf extended="0">
-		<div class="post-content">
-			{{tpl:EntryFirstImage size="t" class="post-icon"}}
-			<p>
-				{{tpl:EntryContent encode_html="1" remove_html="1" cut_string="300"}}
-				<tpl:EntryIfContentCut encode_html="1" remove_html="1" cut_string="300">
-					<span class="ellipsis">&nbsp;[&#8230;]</span>
-				</tpl:EntryIfContentCut>
-			</p>
-		</div>
-		<tpl:EntryIfContentCut encode_html="1" remove_html="1" cut_string="300">
-			<p class="post-read-it"><a href="{{tpl:EntryURL}}"
-			 title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue reading}}</a></p>
-		</tpl:EntryIfContentCut>
-	</tpl:EntryIf>
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-	<footer class="post-meta">
-		<p class="post-info">
-			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>.</span>
-			<tpl:EntryIf has_category="1">
-			<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> › </tpl:EntryCategoriesBreadcrumb><a
-				href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a></span>
-			</tpl:EntryIf>
-		</p>
-
-		<tpl:EntryTags>
-			<tpl:TagsHeader>
-				<ul class="post-tags-list">
-			</tpl:TagsHeader>
-				<li class="post-tags-item"><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-			<tpl:TagsFooter>
-				</ul>
-			</tpl:TagsFooter>
-		</tpl:EntryTags>
-
-		<!-- # Number of comments, trackbacks and attachments -->
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			<p class="post-info-co">
-		</tpl:EntryIf>
-			<tpl:EntryIf show_comments="1">
-				<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-			</tpl:EntryIf>
-			<tpl:EntryIf show_pings="1">
-				<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf has_attachment="1">
-				<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			</p>
-		</tpl:EntryIf>
-	</footer>
-</article>
Index: inc/public/default-templates/dotty/_entry-title.html
===================================================================
--- inc/public/default-templates/dotty/_entry-title.html	(revision 3331)
+++ 	(revision )
@@ -1,45 +1,0 @@
-<article id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}} title" lang="{{tpl:EntryLang}}" role="article">
-
-	<header>
-		<!-- # New day date -->
-		<tpl:DateHeader>
-			<p class="day-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time></p>
-		</tpl:DateHeader>
-
-		<h2 class="post-title"><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-	</header>
-
-	<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-	{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-	<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-	{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-	<footer class="post-meta">
-		<p class="post-info">
-			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>. </span>
-			<tpl:EntryIf has_category="1">
-				<tpl:EntryCategoriesBreadcrumb>
-					<span class="post-breadcrumb-cat"><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></span> ›
-				</tpl:EntryCategoriesBreadcrumb>
-				<span class="post-cat"><a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a></span>
-			</tpl:EntryIf>
-		</p>
-		<!-- # Number of comments, trackbacks and attachments -->
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			<p class="post-info-co">
-		</tpl:EntryIf>
-		<tpl:EntryIf show_comments="1">
-				<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-		</tpl:EntryIf>
-		<tpl:EntryIf show_pings="1">
-				<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-		<tpl:EntryIf has_attachment="1">
-				<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-		<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			</p>
-		</tpl:EntryIf>
-	</footer>
-
-</article>
Index: inc/public/default-templates/dotty/_flv_player.html
===================================================================
--- inc/public/default-templates/dotty/_flv_player.html	(revision 3958)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<a href="{{tpl:AttachmentURL}}" title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
Index: inc/public/default-templates/dotty/_footer.html
===================================================================
--- inc/public/default-templates/dotty/_footer.html	(revision 3846)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<p id="gotop"><a href="#prelude">{{tpl:lang Page top}}</a></p>
-
-<footer class="footer" id="footer" role="contentinfo">
-	<tpl:IfWidgets type="custom">
-		<div class="widgets footer__widgets" id="blogcustom">
-	        <h2 class="blogcustom__title">{{tpl:lang Blog info}}</h2>
-			{{tpl:Widgets type="custom"}}
-		</div> <!-- # End #custom widgets -->
-	</tpl:IfWidgets>
-
-	{{tpl:SysBehavior behavior="publicInsideFooter"}}
-
-	<p>{{tpl:SysPoweredBy}}</p>
-</footer>
-{{tpl:SysBehavior behavior="publicFooterContent"}}
-
-{{tpl:include src="user_footer.html"}}
Index: inc/public/default-templates/dotty/_head.html
===================================================================
--- inc/public/default-templates/dotty/_head.html	(revision 3455)
+++ 	(revision )
@@ -1,11 +1,0 @@
-<!-- # media queries -->
-<meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
-<link rel="stylesheet" type="text/css" href="{{tpl:BlogThemeURL}}/style.css" media="screen" />
-<link rel="stylesheet" type="text/css" href="{{tpl:BlogQmarkURL}}pf=print.css" media="print" />
-
-<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.js"></script>
-<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.cookie.js"></script>
-
-{{tpl:include src="user_head.html"}}
-{{tpl:SysBehavior behavior="publicHeadContent"}}
Index: inc/public/default-templates/dotty/_mp3_player.html
===================================================================
--- inc/public/default-templates/dotty/_mp3_player.html	(revision 3958)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<audio controls preload="auto">
-	<source src="{{tpl:MediaURL}}" type="audio/mpeg"/>
-</audio>
Index: inc/public/default-templates/dotty/_pagination.html
===================================================================
--- inc/public/default-templates/dotty/_pagination.html	(revision 3246)
+++ 	(revision )
@@ -1,13 +1,0 @@
-<tpl:Pagination>
-	<nav class="pagination">
-		<tpl:PaginationIf end="0">
-			<a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171; {{tpl:lang previous entries}}</a> -
-		</tpl:PaginationIf>
-
-		{{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
-
-		<tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">
-			{{tpl:lang next entries}} &#187;</a>
-		</tpl:PaginationIf>
-	</nav>
-</tpl:Pagination>
Index: inc/public/default-templates/dotty/_sidebar.html
===================================================================
--- inc/public/default-templates/dotty/_sidebar.html	(revision 3455)
+++ 	(revision )
@@ -1,14 +1,0 @@
-<aside class="sidebar" id="sidebar" role="complementary">
-	<tpl:IfWidgets type="nav">
-		<div class="widgets blognav__widgets" id="blognav">
-	        <h2 class="blognav__title">{{tpl:lang Blog menu}}</h2>
-			{{tpl:Widgets type="nav"}}
-		</div> <!-- # End #blognav -->
-	</tpl:IfWidgets>
-	<tpl:IfWidgets type="extra">
-		<div class="widgets blogextra__widgets" id="blogextra">
-	        <h2 class="blogextra__title">{{tpl:lang Extra menu}}</h2>
-			{{tpl:Widgets type="extra"}}
-		</div> <!-- # End #blogextra -->
-	</tpl:IfWidgets>
-</aside>
Index: inc/public/default-templates/dotty/_simple-entry.html
===================================================================
--- inc/public/default-templates/dotty/_simple-entry.html	(revision 3246)
+++ 	(revision )
@@ -1,5 +1,0 @@
-<!-- # Post content and attachments -->
-{{tpl:include src="_entry-content.html"}}
-
-<!-- # Comments, pings and comment form -->
-{{tpl:include src="_entry-feedback.html"}}
Index: inc/public/default-templates/dotty/_top.html
===================================================================
--- inc/public/default-templates/dotty/_top.html	(revision 3949)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<div class="header">
-		<ul class="skip-links" id="prelude">
-			<li><a href="#main">{{tpl:lang To content}}</a></li>
-			<li><a href="#blognav">{{tpl:lang To menu}}</a></li>
-			<li><a href="#search">{{tpl:lang To search}}</a></li>
-		</ul>
-
-	<header class="banner" role="banner">
-		<h1 class="site-title"><a class="site-title__link"
-			href="{{tpl:BlogURL}}"><span class="site-title__text">{{tpl:BlogName encode_html="1"}}</span></a></h1>
-		<p class="site-baseline">{{tpl:BlogDescription}}</p>
-	</header>
-
-	<!-- # --BEHAVIOR-- publicTopAfterContent -->
-	{{tpl:SysBehavior behavior="publicTopAfterContent"}}
-
-	{{tpl:SimpleMenu class="nav header__nav"}}
-</div>
Index: inc/public/default-templates/dotty/_video_player.html
===================================================================
--- inc/public/default-templates/dotty/_video_player.html	(revision 3848)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<video controls preload="auto" style="width:400px; height:300px;">
-	<source src="{{tpl:MediaURL}}">
-</video>
Index: inc/public/default-templates/dotty/archive.html
===================================================================
--- inc/public/default-templates/dotty/archive.html	(revision 3455)
+++ 	(revision )
@@ -1,117 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Archives}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<tpl:Archives>
-		<link rel="chapter" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" />
-	</tpl:Archives>
-	<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-	<tpl:Categories>
-		<link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
-	</tpl:Categories>
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-archive"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<header id="content-info">
-		<h2>{{tpl:lang Archives}}</h2>
-	</header>
-
-	<div class="content-inner">
-
-		<article id="time-criteria"><!-- # entries sorted by date -->
-			<div id="arch-by-year" class="arch-block arch-by-year">
-				<h3>{{tpl:lang By date}}</h3>
-				<p class="fromto">{{tpl:lang FromDay}} <tpl:Entries no_content="1" order="asc" lastn="1"><a href="{{tpl:EntryURL}}"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate format="%e %B %Y"}}</time></a></tpl:Entries> {{tpl:lang toDay}} <tpl:Entries no_content="1" order="desc" lastn="1"><a href="{{tpl:EntryURL}}"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate format="%e %B %Y"}}</time></a></tpl:Entries></p>
-				<tpl:Archives order="asc">
-					<tpl:ArchivesYearHeader>
-						<div class="arch-by-year__each-year">
-							<h4><time datetime="{{tpl:ArchiveDate format="%Y"}}">{{tpl:ArchiveDate format="%Y"}}</time></h4>
-							<ul class="arch-list arch-year-list">
-					</tpl:ArchivesYearHeader>
-								<li><a href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}"><time datetime="{{tpl:ArchiveDate format="%Y-%m"}}">{{tpl:ArchiveDate encode_html="1" format="%B"}}</time></a>
-									<span>({{tpl:ArchiveEntriesCount}})</span></li>
-					<tpl:ArchivesYearFooter>
-							</ul>
-						</div>
-					</tpl:ArchivesYearFooter>
-				</tpl:Archives>
-			</div>
-		</article>
-
-		<article id="other-criteria"><!-- # entries sorted by others criterias -->
-			<tpl:Categories level="1">
-				<tpl:CategoriesHeader>
-					<div id="arch-by-cat" class="arch-block arch-by-cat">
-						<h3>{{tpl:lang By category}}</h3>
-						<ul class="arch-list arch-cat-list">
-							</tpl:CategoriesHeader>
-							<li><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a>
-							<tpl:CategoryFirstChildren>
-								<tpl:CategoriesHeader>
-								<ul class="arch-list arch-sub-cat-list">
-								</tpl:CategoriesHeader>
-									<li><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></li>
-								<tpl:CategoriesFooter>
-								</ul>
-								</tpl:CategoriesFooter>
-							</tpl:CategoryFirstChildren>
-							</li>
-					<tpl:CategoriesFooter>
-						</ul>
-					</div>
-					</tpl:CategoriesFooter>
-			</tpl:Categories>
-
-			<tpl:Tags sortby="count" order="desc">
-				<tpl:TagsHeader>
-					<div id="arch-by-tag" class="arch-block arch-by-tag">
-						<h3>{{tpl:lang By tag}}</h3>
-						<ul class="arch-list arch-tag-list">
-				</tpl:TagsHeader>
-							<li><a href="{{tpl:TagURL}}" class="tag{{tpl:TagRoundPercent}}">{{tpl:TagID}}</a></li>
-				<tpl:TagsFooter>
-						</ul>
-					</div>
-				</tpl:TagsFooter>
-			</tpl:Tags>
-		</article>
-
-		<article id="more-arch"><!-- # others things -->
-			<div id="arch-by-page" class="arch-block arch-by-page">
-				<tpl:Entries type="page" no_content="1" lastn="0" selected="0">
-					<tpl:EntriesHeader>
-						<h3>{{tpl:lang Pages}}</h3>
-						<ul class="arch-list arch-page-list">
-					</tpl:EntriesHeader>
-							<li><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></li>
-					<tpl:EntriesFooter>
-						</ul>
-					</tpl:EntriesFooter>
-				</tpl:Entries>
-			</div>
-		</article>
-
-	</div> <!-- # End .content-inner -->
-</tpl:Block>
-
-<tpl:Block name="wrapper-sidebar">
-	<aside class="sidebar" id="sidebar" role="complementary">
-		<div class="widgets blognav__widgets" id="blognav">
-			<tpl:Widget id="search">
-			</tpl:Widget>
-		</div> <!-- # End #blognav -->
-
-		<tpl:IfWidgets type="extra">
-			<div class="widgets blogextra__widgets" id="blogextra">
-		        <h2 class="blogextra__title">{{tpl:lang Extra menu}}</h2>
-				{{tpl:Widgets type="extra"}}
-			</div> <!-- # End #blogextra -->
-		</tpl:IfWidgets>
-	</aside> <!-- # End #sidebar -->
-</tpl:Block>
Index: inc/public/default-templates/dotty/archive_month.html
===================================================================
--- inc/public/default-templates/dotty/archive_month.html	(revision 3422)
+++ 	(revision )
@@ -1,47 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Archives}} - {{tpl:ArchiveDate}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:ArchiveNext><link rel="next" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchiveNext>
-	<tpl:ArchivePrevious><link rel="prev" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchivePrevious>
-
-	<tpl:Entries no_content="1">
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-archive-month"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<nav class="navlinks topnl">
-		<tpl:ArchivePrevious><a href="{{tpl:ArchiveURL}}" class="prev">&#171; {{tpl:ArchiveDate encode_html="1"}}</a> - </tpl:ArchivePrevious>
-		{{tpl:ArchiveDate}}
-		<tpl:ArchiveNext> - <a href="{{tpl:ArchiveURL}}" class="next">{{tpl:ArchiveDate encode_html="1"}} &#187;</a></tpl:ArchiveNext>
-	</nav>
-
-	<header id="content-info">
-		<h2>
-			<time datetime="{{tpl:ArchiveDate format="%Y-%m"}}">{{tpl:ArchiveDate}}</time> <span>({{tpl:ArchiveEntriesCount}})</span>
-		</h2>
-	</header>
-
-	<div class="content-inner">
-		<tpl:Entries>
-			{{tpl:include src="_entry-short.html"}}
-		</tpl:Entries>
-	</div>
-
-	<nav class="navlinks">
-		<tpl:ArchivePrevious><a href="{{tpl:ArchiveURL}}" class="prev">&#171; {{tpl:ArchiveDate encode_html="1"}}</a> - </tpl:ArchivePrevious>
-		{{tpl:ArchiveDate}}
-		<tpl:ArchiveNext> - <a href="{{tpl:ArchiveURL}}" class="next">{{tpl:ArchiveDate encode_html="1"}} &#187;</a></tpl:ArchiveNext>
-	</nav>
-</tpl:Block>
Index: inc/public/default-templates/dotty/atom-comments.xml
===================================================================
--- inc/public/default-templates/dotty/atom-comments.xml	(revision 3455)
+++ 	(revision )
@@ -1,41 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{tpl:BlogLanguage}}">
-	<title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}} - {{tpl:lang Comments}}</title>
-	<subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
-	<link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml" />
-	<link href="{{tpl:BlogURL}}" rel="alternate" type="text/html" title="{{tpl:BlogDescription remove_html=" 1 " encode_xml="1 "}}"/>
-	<updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
-	<author>
-		<name>{{tpl:BlogEditor encode_xml="1"}}</name>
-	</author>
-	<id>{{tpl:BlogFeedID}}</id>
-	<generator uri="http://www.dotclear.org/">Dotclear</generator>
-	<tpl:Comments order="desc" with_pings="1">
-		<tpl:CommentIf is_ping="1">
-			<entry>
-				<title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
-				<link href="{{tpl:PingPostURL encode_xml=" 1 "}}#c{{tpl:PingID}}" rel="alternate" type="text/html" title="[ping] {{tpl:PingEntryTitle encode_xml=" 1 "}} - {{tpl:PingBlogName encode_xml="1 "}}" />
-				<id>{{tpl:PingFeedID}}</id>
-				<published>{{tpl:PingDate iso8601="1"}}</published>
-				<updated>{{tpl:PingDate iso8601="1" upddt="1"}}</updated>
-				<author>
-					<name>{{tpl:PingBlogName encode_xml="1"}}</name>
-				</author>
-				<content type="html">&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt; {{tpl:PingContent encode_xml="1"}}</content>
-			</entry>
-		</tpl:CommentIf>
-		<tpl:CommentIf is_ping="0">
-			<entry>
-				<title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
-				<link href="{{tpl:CommentPostURL encode_xml=" 1 "}}#c{{tpl:CommentID}}" rel="alternate" type="text/html" title="{{tpl:CommentEntryTitle encode_xml=" 1 "}} - {{tpl:CommentAuthor encode_xml="1 "}}" />
-				<id>{{tpl:CommentFeedID}}</id>
-				<published>{{tpl:CommentDate iso8601="1"}}</published>
-				<updated>{{tpl:CommentDate iso8601="1" upddt="1"}}</updated>
-				<author>
-					<name>{{tpl:CommentAuthor encode_xml="1"}}</name>
-				</author>
-				<content type="html">{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</content>
-			</entry>
-		</tpl:CommentIf>
-	</tpl:Comments>
-</feed>
Index: inc/public/default-templates/dotty/atom.xml
===================================================================
--- inc/public/default-templates/dotty/atom.xml	(revision 3455)
+++ 	(revision )
@@ -1,44 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xml:lang="{{tpl:BlogLanguage}}">
-	<title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
-	<subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
-	<link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml" />
-	<link href="{{tpl:BlogURL}}" rel="alternate" type="text/html" title="{{tpl:BlogDescription remove_html=" 1 " encode_xml="1 "}}"/>
-	<updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
-	<author>
-		<name>{{tpl:BlogEditor encode_xml="1"}}</name>
-	</author>
-	<id>{{tpl:BlogFeedID}}</id>
-	<generator uri="http://www.dotclear.org/">Dotclear</generator>
-	<tpl:Entries>
-		<entry>
-			<title>{{tpl:EntryTitle encode_xml="1"}}</title>
-			<link href="{{tpl:EntryURL}}" rel="alternate" type="text/html" title="{{tpl:EntryTitle encode_xml=" 1 "}}" />
-			<id>{{tpl:EntryFeedID}}</id>
-			<published>{{tpl:EntryDate iso8601="1"}}</published>
-			<tpl:EntryIf republished="1">
-				<updated>{{tpl:EntryDate iso8601="1" upddt="1"}}</updated>
-			</tpl:EntryIf>
-			<tpl:EntryIf republished="0">
-				<updated>{{tpl:EntryDate iso8601="1"}}</updated>
-			</tpl:EntryIf>
-			<author>
-				<name>{{tpl:EntryAuthorCommonName encode_xml="1"}}</name>
-			</author>
-			<tpl:EntryIf has_category="1">
-				<dc:subject>{{tpl:EntryCategory encode_html="1"}}</dc:subject>
-			</tpl:EntryIf>
-			<tpl:EntryTags>
-				<dc:subject>{{tpl:TagID}}</dc:subject>
-			</tpl:EntryTags>
-			<content type="html">{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}} {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</content>
-			<tpl:Attachments>
-				<link rel="enclosure" href="{{tpl:AttachmentURL}}" length="{{tpl:AttachmentSize full=" 1 "}}" type="{{tpl:AttachmentMimeType}}" />
-			</tpl:Attachments>
-			<tpl:EntryIf comments_active="1">
-				<wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
-				<wfw:commentRss>{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}</wfw:commentRss>
-			</tpl:EntryIf>
-		</entry>
-	</tpl:Entries>
-</feed>
Index: inc/public/default-templates/dotty/category.html
===================================================================
--- inc/public/default-templates/dotty/category.html	(revision 3455)
+++ 	(revision )
@@ -1,89 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:CategoryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
-</tpl:Block>
-
-<tpl:Block name="meta-entry">
-	<meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:CategoryDescription encode_html="1" cut_string="180" remove_html="1"}}" />
-	<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
-	<meta name="date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:Entries no_content="1">
-		<tpl:EntriesHeader>
-			<tpl:Pagination>
-				<tpl:PaginationIf end="0">
-					<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-				</tpl:PaginationIf>
-
-				<tpl:PaginationIf start="0">
-					<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-				</tpl:PaginationIf>
-			</tpl:Pagination>
-		</tpl:EntriesHeader>
-
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:CategoryFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-category"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<header id="content-info">
-		<h2>
-			<tpl:CategoryParents>
-				<a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> &rsaquo;
-			</tpl:CategoryParents>
-			{{tpl:CategoryTitle encode_html="1"}}
-		</h2>
-
-		<tpl:CategoryIf has_entries="1">
-			<ul class="content-info__feed">
-				<li><a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}"
-				 title="{{tpl:lang This category's entries Atom feed}}" class="feed">{{tpl:lang Entries feed}}</a></li>
-
-				<tpl:SysIf operator="or" comments_active="1" pings_active="1">
-					 <li><a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}/comments"
-					 title="{{tpl:lang This category's comments Atom feed}}" class="feed">{{tpl:lang Comments feed}}</a></li>
-				</tpl:SysIf>
-			</ul>
-		</tpl:CategoryIf>
-
-		<div class="content-info__cat-desc">
-			{{tpl:CategoryDescription}}
-		</div>
-
-
-		<tpl:CategoryFirstChildren>
-			<tpl:CategoriesHeader>
-				<div id="subcategories" class="content-info__sub-cat">
-					<h3>{{tpl:lang Subcategories}}</h3>
-					<ul>
-			</tpl:CategoriesHeader>
-						<li class="post-cat"><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></li>
-			<tpl:CategoriesFooter>
-					</ul>
-				</div>
-			</tpl:CategoriesFooter>
-		</tpl:CategoryFirstChildren>
-	</header>	<!-- # End #content-info -->
-
-	<div class="content-inner">
-		<tpl:Entries>
-			{{tpl:include src="_entry-short.html"}}
-
-			<tpl:EntriesFooter>
-				{{tpl:include src="_pagination.html"}}
-			</tpl:EntriesFooter>
-		</tpl:Entries>
-	</div> <!-- # End #content-inner -->
-</tpl:Block>
Index: inc/public/default-templates/dotty/home.html
===================================================================
--- inc/public/default-templates/dotty/home.html	(revision 3246)
+++ 	(revision )
@@ -1,1 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
Index: inc/public/default-templates/dotty/password-form.html
===================================================================
--- inc/public/default-templates/dotty/password-form.html	(revision 3847)
+++ 	(revision )
@@ -1,49 +1,0 @@
-<!DOCTYPE html>
-<html lang="{{tpl:BlogLanguage}}">
-
-<head>
-	<meta charset="UTF-8" />
-	<meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
-	<title>{{tpl:lang Password needed}} - {{tpl:BlogName encode_html="1"}}</title>
-	<style type="text/css">
-	body {
-		font: 0.8em Verdana, Arial, Geneva, sans-serif;
-	}
-
-	form {
-		display: block;
-		width: 500px;
-		margin: 0 auto;
-		padding: 1em;
-		background: #eee;
-	}
-
-	h2 {
-		font: 140% Arial, Helvetica, sans-serif;
-		margin: 0;
-	}
-
-	label {
-		font-weight: bold;
-	}
-
-	input {
-		border-width: 1px;
-	}
-	</style>
-</head>
-
-<body>
-	<form action="{{tpl:EntryURL}}" method="post" role="form">
-		<h2>{{tpl:lang Password needed}}</h2>
-		<p>{{tpl:lang You must give a password to access this area.}}</p>
-		<p>
-			<label>{{tpl:lang Password:}}
-				<input type="password" name="password" value="" />
-			</label>
-			<input type="submit" value="ok" title="{{tpl:lang Access to content}}" />
-		</p>
-	</form>
-</body>
-
-</html>
Index: inc/public/default-templates/dotty/post.html
===================================================================
--- inc/public/default-templates/dotty/post.html	(revision 4003)
+++ 	(revision )
@@ -1,52 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:EntryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-entry">
-	<meta name="description" lang="{{tpl:EntryLang}}" content="{{tpl:EntryContent full="1" encode_html="1" remove_html="1" cut_string="180"}}" />
-	<meta name="author" content="{{tpl:EntryAuthorCommonName encode_html="1"}}" />
-	<meta name="date" content="{{tpl:EntryDate iso8601="1"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:EntryIf pings_active="1"><link rel="pingback" href="{{tpl:BlogXMLRPCURL}}" /></tpl:EntryIf>
-	<tpl:EntryNext><link rel="next" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryNext>
-	<tpl:EntryPrevious><link rel="prev" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryPrevious>
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="html-head">
-	{{tpl:parent}}
-
-  <script type="application/json" id="dc_post_remember_str-data">
-    {"post_remember_str": "{{tpl:lang Remember me on this blog}}"}
-  </script>
-  <script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf=util.js"></script>
-  <script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf=post.js"></script>
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-post"></tpl:Block>
-
-<tpl:Block name="page-top">
-	{{tpl:EntryPingData}}
-	{{tpl:parent}}
-</tpl:Block>
-
-<tpl:Block name="main-content">
-	<nav class="navlinks topnl" role="navigation" aria-label="{{tpl:lang Entries}}">
-		<tpl:EntryPrevious><a href="{{tpl:EntryURL}}" class="prev"><span aria-hidden="true">&#171; </span><span class="sr">{{tpl:lang Previous entry:}} </span>{{tpl:EntryTitle encode_html="1"
-		 cut_string="50"}}</a></tpl:EntryPrevious>
-		<tpl:EntryNext> <span>-</span> <a href="{{tpl:EntryURL}}" class="next"><span class="sr">{{tpl:lang Next entry:}} </span>{{tpl:EntryTitle encode_html="1" cut_string="50"}}<span aria-hidden="true"> &#187;</span></a></tpl:EntryNext>
-	</nav>
-
-	{{tpl:include src="_simple-entry.html"}}
-
-	<nav class="navlinks" role="navigation" aria-label="{{tpl:lang Entries}}">
-		<tpl:EntryPrevious><a href="{{tpl:EntryURL}}" class="prev"><span aria-hidden="true">&#171; </span><span class="sr">{{tpl:lang Previous entry:}} </span>{{tpl:EntryTitle encode_html="1"
-		 cut_string="50"}}</a></tpl:EntryPrevious>
-		<tpl:EntryNext> <span>-</span> <a href="{{tpl:EntryURL}}" class="next"><span class="sr">{{tpl:lang Next entry:}} </span>{{tpl:EntryTitle encode_html="1" cut_string="50"}}<span aria-hidden="true"> &#187;</span></a></tpl:EntryNext>
-	</nav>
-</tpl:Block>
Index: inc/public/default-templates/dotty/rss2-comments.xml
===================================================================
--- inc/public/default-templates/dotty/rss2-comments.xml	(revision 3455)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
-	<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
-		<channel>
-			<title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}} - {{tpl:lang Comments}}</title>
-			<link>{{tpl:BlogURL}}</link>
-			<atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml" />
-			<description>{{tpl:BlogDescription remove_html="1" encode_xml="1"}}</description>
-			<language>{{tpl:BlogLanguage}}</language>
-			<pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
-			<copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
-			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
-			<generator>Dotclear</generator>
-			<tpl:Comments order="desc" with_pings="1">
-				<tpl:CommentIf is_ping="1">
-					<item>
-						<title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
-						<link>{{tpl:PingPostURL encode_xml="1"}}#c{{tpl:PingID}}</link>
-						<guid isPermaLink="false">{{tpl:PingFeedID}}</guid>
-						<pubDate>{{tpl:PingDate rfc822="1"}}</pubDate>
-						<dc:creator>{{tpl:PingBlogName encode_xml="1"}}</dc:creator>
-						<description>&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt; {{tpl:PingContent encode_xml="1"}}</description>
-					</item>
-				</tpl:CommentIf>
-				<tpl:CommentIf is_ping="0">
-					<item>
-						<title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
-						<link>{{tpl:CommentPostURL encode_xml="1"}}#c{{tpl:CommentID}}</link>
-						<guid isPermaLink="false">{{tpl:CommentFeedID}}</guid>
-						<pubDate>{{tpl:CommentDate rfc822="1"}}</pubDate>
-						<dc:creator>{{tpl:CommentAuthor encode_xml="1"}}</dc:creator>
-						<description>{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</description>
-					</item>
-				</tpl:CommentIf>
-			</tpl:Comments>
-		</channel>
-	</rss>
Index: inc/public/default-templates/dotty/rss2.xml
===================================================================
--- inc/public/default-templates/dotty/rss2.xml	(revision 3455)
+++ 	(revision )
@@ -1,39 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
-	<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
-		<channel>
-			<title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
-			<link>{{tpl:BlogURL}}</link>
-			<atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml" />
-			<description>{{tpl:BlogDescription remove_html="1" encode_xml="1"}}</description>
-			<language>{{tpl:BlogLanguage}}</language>
-			<pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
-			<copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
-			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
-			<generator>Dotclear</generator>
-			<tpl:Entries>
-				<item>
-					<title>{{tpl:EntryTitle encode_xml="1"}}</title>
-					<link>{{tpl:EntryURL}}</link>
-					<guid isPermaLink="false">{{tpl:EntryFeedID}}</guid>
-					<pubDate>{{tpl:EntryDate rfc822="1"}}</pubDate>
-					<dc:creator>{{tpl:EntryAuthorCommonName encode_xml="1"}}</dc:creator>
-					<tpl:EntryIf has_category="1">
-						<category>{{tpl:EntryCategory encode_html="1"}}</category>
-					</tpl:EntryIf>
-					<tpl:EntryTags>
-						<category>{{tpl:TagID}}</category>
-					</tpl:EntryTags>
-					<description>{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}} {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</description>
-					<tpl:Attachments>
-						<enclosure url="{{tpl:AttachmentURL}}" length="{{tpl:AttachmentSize full=" 1 "}}" type="{{tpl:AttachmentMimeType}}" />
-					</tpl:Attachments>
-					<tpl:EntryIf comments_active="1">
-						<comments>{{tpl:EntryURL}}#comment-form</comments>
-						<wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
-						<wfw:commentRss>{{tpl:BlogFeedURL}}/comments/{{tpl:EntryID}}</wfw:commentRss>
-					</tpl:EntryIf>
-				</item>
-			</tpl:Entries>
-		</channel>
-	</rss>
Index: inc/public/default-templates/dotty/rss2.xsl
===================================================================
--- inc/public/default-templates/dotty/rss2.xsl	(revision 3455)
+++ 	(revision )
@@ -1,120 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-xmlns:content="http://purl.org/rss/1.0/modules/content/"
-xmlns="http://www.w3.org/1999/xhtml">
-
-<xsl:output method="html"/>
-
-<xsl:template match="/">
-	<html>
-		<head>
-			<title>{{tpl:lang Subscribe to}} <xsl:value-of select="/rss/channel/title"/></title>
-			<style type="text/css">
-			<![CDATA[
-			body {
-				font: 80% Verdana,Arial,sans-serif;
-				margin: 20px 0;
-				padding: 0 0;
-				background: #fff;
-				color: #000;
-			}
-			a { color: #039; }
-			h1, h2 { font-family: Arial,sans-serif; }
-			h1 { font-size: 160%; margin: 0; }
-			h2 { font-size: 140%; font-weight: bold; margin: 0.5em 0 0.2em 0; }
-			h2 a { text-decoration: none; }
-			p { margin: 0 0 0.5em 0; }
-			#page {
-				margin: 0 80px;
-			}
-			#top {
-				background: #036;
-				padding : 1em;
-				color: #fff;
-			}
-			#top a {
-				color: #fff;
-				text-decoration: none;
-			}
-			#what {
-				padding: 1em;
-				background: #eee;
-				border-bottom: 1px solid #000;
-				font-size: 80%;
-			}
-			#what p {
-				margin: 0 0 0.5em 0;
-			}
-			#footer {
-				border-top: 1px solid #000;
-			}
-			#items {
-				background: #fff;
-				color: inherit;
-			}
-			#items div {
-				margin: 0 0 1em 0;
-			}
-			]]>
-			</style>
-			<script type="text/javascript"><![CDATA[
-				window.onload = function() {
-					document.getElementById('feedurl').value = window.location.href;
-
-					// Ugly but works ;)
-					var c = document.getElementsByTagName('div');
-					var t = '';
-					for (var i=0; c.length-i != 0; i++) {
-						if (c[i].className == 'item-content') {
-							if (c[i].textContent) {
-								t = c[i].textContent;
-							} else if (c[i].innerText) {
-								t = c[i].innerText;
-							} else {
-								t = '';
-							}
-
-							if (t) { c[i].innerHTML = t; }
-						}
-					}
-				};
-			]]></script>
-		</head>
-		<body>
-			<div id="page">
-				<div id="top">
-					<h1><a href="{/rss/channel/link}"><xsl:value-of select="/rss/channel/title"/></a></h1>
-					<p><xsl:value-of select="/rss/channel/description"/></p>
-				</div>
-				<div id="what">
-					<h3>{{tpl:lang What is an RSS feed?}}</h3>
-					<p>{{tpl:lang RSS feed is a free blog summary. It provides content
-					(either posts or comments) or  summaries of content, together with links
-					to the full versions, and other metadata. The last published items may
-					then be read by your favorite RSS
-					<a href="http://en.wikipedia.org/wiki/Aggregator">aggregator</a>.}}</p>
-					<h3>{{tpl:lang Subscribe}}</h3>
-					<p>{{tpl:lang Simply copy the following URL into your aggregator:}}</p>
-					<p><input type="text" size="60" value="" id="feedurl" /></p>
-				</div>
-				<div id="items">
-					<xsl:apply-templates select="//item"/>
-				</div>
-				<div id="footer">
-					<p><xsl:value-of select="/rss/channel/copyright"/></p>
-				</div>
-			</div>
-		</body>
-	</html>
-</xsl:template>
-
-<!-- Item template -->
-<xsl:template match="item">
-	<div>
-		<h2><a href="{link}"><xsl:value-of select="title"/></a></h2>
-		<div class="item-content"><xsl:value-of select="description" /></div>
-	</div>
-</xsl:template>
-
-</xsl:stylesheet>
Index: inc/public/default-templates/dotty/search.html
===================================================================
--- inc/public/default-templates/dotty/search.html	(revision 3455)
+++ 	(revision )
@@ -1,65 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Search}} - {{tpl:SysSearchString encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:Entries no_content="1">
-		<tpl:EntriesHeader>
-			<tpl:Pagination>
-				<tpl:PaginationIf end="0">
-					<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-				</tpl:PaginationIf>
-				<tpl:PaginationIf start="0">
-					<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-				</tpl:PaginationIf>
-			</tpl:Pagination>
-		</tpl:EntriesHeader>
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-	<link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-search"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<header id="content-info">
-		<h2>{{tpl:lang Search}}</h2>
-		<tpl:SysIf search_count="==0">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned no result."}}</p>
-		</tpl:SysIf>
-		<tpl:SysIf search_count="==1">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> result."}}</p>
-		</tpl:SysIf>
-		<tpl:SysIf search_count="&gt;1">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> results."}}</p>
-		</tpl:SysIf>
-	</header>
-
-	<div class="content-inner">
-		<tpl:Entries>
-
-			{{tpl:include src="_entry-short.html"}}
-
-			<tpl:EntriesFooter>
-				<tpl:Pagination>
-					<p class="pagination">
-						<tpl:PaginationIf end="0">
-							<a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171; {{tpl:lang previous entries}}</a> -
-						</tpl:PaginationIf>
-						 {{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
-						<tpl:PaginationIf start="0">
-							 - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}} &#187;</a>
-						</tpl:PaginationIf>
-					</p>
-				</tpl:Pagination>
-			</tpl:EntriesFooter>
-		</tpl:Entries>
-	</div> <!-- # End #content-inner -->
-</tpl:Block>
Index: inc/public/default-templates/dotty/user_head.html
===================================================================
--- inc/public/default-templates/dotty/user_head.html	(revision 3246)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<!-- # This template is included at the end of _head.html template -->
Index: inc/public/default-templates/home.html
===================================================================
--- inc/public/default-templates/home.html	(revision 0)
+++ inc/public/default-templates/home.html	(revision 0)
@@ -0,0 +1,145 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
+  
+  <title>{{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
+  <meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:BlogDescription cut_string="180" encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
+  <meta name="dc.description" lang="{{tpl:BlogLanguage}}" content="{{tpl:BlogDescription encode_html="1"}}" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
+  <tpl:Categories>
+  <link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
+  </tpl:Categories>
+  
+  <tpl:Entries no_content="1">
+    <tpl:EntriesHeader>
+      <tpl:Pagination>
+        <tpl:PaginationIf end="0">
+        <link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
+        </tpl:PaginationIf>
+        
+        <tpl:PaginationIf start="0">
+        <link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
+        </tpl:PaginationIf>
+      </tpl:Pagination>
+    </tpl:EntriesHeader>
+    
+    <link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
+  </tpl:Entries>
+  
+  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
+  <link rel="EditURI" type="application/rsd+xml" title="RSD" href="{{tpl:BlogRSDURL}}" />
+  <link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-home">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  <tpl:Entries>
+    <div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" xml:lang="{{tpl:EntryLang}}">
+    <!-- # New day date -->
+    <tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
+    
+    <h2 class="post-title"><a
+    href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
+    
+    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
+    {{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
+    <tpl:EntryIf has_category="1">
+    - <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
+    </tpl:EntryIf>
+    </p>
+    
+    <tpl:EntryTags>
+    <tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
+    <li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
+    <tpl:TagsFooter></ul></tpl:TagsFooter>
+    </tpl:EntryTags>
+    
+    <!-- # --BEHAVIOR-- publicEntryBeforeContent -->
+    {{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
+    
+    <!-- # Entry with an excerpt -->
+    <tpl:EntryIf extended="1">
+      <div class="post-content">{{tpl:EntryExcerpt}}</div>
+      <p class="read-it"><a href="{{tpl:EntryURL}}"
+      title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue
+      reading}}</a>...</p>
+    </tpl:EntryIf>
+    
+    <!-- # Entry without excerpt -->
+    <tpl:EntryIf extended="0">
+      <div class="post-content">{{tpl:EntryContent}}</div>
+    </tpl:EntryIf>
+    
+    <!-- # --BEHAVIOR-- publicEntryAfterContent -->
+    {{tpl:SysBehavior behavior="publicEntryAfterContent"}}
+    
+    <!-- # Number of comments, trackbacks and attachments -->
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      <p class="post-info-co">
+    </tpl:EntryIf>
+    <tpl:EntryIf show_comments="1">
+      <a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
+    </tpl:EntryIf>
+    <tpl:EntryIf show_pings="1">
+      <a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf has_attachment="1">
+      <a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      </p>
+    </tpl:EntryIf>
+    </div>
+    
+    <tpl:EntriesFooter>
+      <tpl:Pagination>
+        <p class="pagination"><tpl:PaginationIf end="0"><a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171;
+        {{tpl:lang previous entries}}</a> - </tpl:PaginationIf>
+        {{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
+        <tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}}
+        &#187;</a></tpl:PaginationIf></p>
+      </tpl:Pagination>
+    </tpl:EntriesFooter>
+  </tpl:Entries>
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/mustek/404.html
===================================================================
--- inc/public/default-templates/mustek/404.html	(revision 3422)
+++ 	(revision )
@@ -1,26 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-  <title>{{tpl:lang Document not found}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-  <link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-404"></tpl:Block>
-
-<tpl:Block name="main-content">
-  <div id="content-info">
-	<h2>{{tpl:lang Document not found}}</h2>
-  </div>
-
-  <div class="content-inner">
-	<p>{{tpl:lang The document you are looking for does not exist.}}</p>
-  </div>
-</tpl:Block>
Index: inc/public/default-templates/mustek/__layout.html
===================================================================
--- inc/public/default-templates/mustek/__layout.html	(revision 3371)
+++ 	(revision )
@@ -1,162 +1,0 @@
-<!DOCTYPE html>
-<html lang="{{tpl:BlogLanguage}}">
-<head>
-	<tpl:Block name="html-head">
-		<meta charset="UTF-8" />
-
-		<tpl:Block name="head-title">
-			<title>{{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-		</tpl:Block>	<!-- head-title -->
-
-		<tpl:Block name="head-meta">
-			<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
-			<tpl:Block name="meta-robots">
-				<meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
-			</tpl:Block>	<!-- meta-robots -->
-			<tpl:Block name="meta-entry">
-				<meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:BlogDescription cut_string="180" remove_html="1" encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
-				<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
-				<meta name="date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
-			</tpl:Block>	<!-- meta-entry -->
-		</tpl:Block>	<!-- head-meta -->
-
-		<tpl:Block name="head-linkrel">
-			<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
-			<tpl:Categories>
-				<link rel="section" href="{{tpl:CategoryURL}}" title="{{tpl:CategoryTitle encode_html="1"}}" />
-			</tpl:Categories>
-
-			<tpl:Entries no_content="1">
-				<tpl:EntriesHeader>
-					<tpl:Pagination>
-						<tpl:PaginationIf end="0">
-							<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-						</tpl:PaginationIf>
-
-						<tpl:PaginationIf start="0">
-							<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-						</tpl:PaginationIf>
-					</tpl:Pagination>
-				</tpl:EntriesHeader>
-
-				<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-			</tpl:Entries>
-
-			<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-			<link rel="EditURI" type="application/rsd+xml" title="RSD" href="{{tpl:BlogRSDURL}}" />
-			<link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
-		</tpl:Block>	<!-- head-linkrel -->
-
-		{{tpl:include src="_head.html"}}
-	</tpl:Block>	<!-- html-head -->
-</head>
-<tpl:Block name="body-tag">
-	<body class="dc-home">
-</tpl:Block>
-	<tpl:Block name="html-body">
-		<div id="page">
-			<tpl:Block name="body-page">
-				<tpl:Block name="page-top">
-					{{tpl:include src="_top.html"}}
-				</tpl:Block>	<!-- page-top -->
-
-				<div id="wrapper">
-					<tpl:Block name="page-wrapper">
-						<div id="main" role="main">
-							<tpl:Block name="wrapper-main">
-								<tpl:Block name="main-breadcrumb">
-									{{tpl:Breadcrumb}}
-								</tpl:Block>
-								<div id="content">
-									<tpl:Block name="main-content">
-										<tpl:Entries>
-											<div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" role="article">
-											<!-- # New day date -->
-											<tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
-
-											<h2 class="post-title"><a href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-
-											<p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
-											{{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
-											<tpl:EntryIf has_category="1">
-											- <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
-											</tpl:EntryIf>
-											</p>
-
-											<tpl:EntryTags>
-											<tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
-											<li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-											<tpl:TagsFooter></ul></tpl:TagsFooter>
-											</tpl:EntryTags>
-
-											<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-											{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-											<!-- # Entry with an excerpt -->
-											<tpl:EntryIf extended="1">
-												<div class="post-content">{{tpl:EntryExcerpt}}</div>
-												<p class="read-it"><a href="{{tpl:EntryURL}}"
-												title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue
-												reading}}</a><span class="readmore-ellipsis">...</span></p>
-											</tpl:EntryIf>
-
-											<!-- # Entry without excerpt -->
-											<tpl:EntryIf extended="0">
-												<div class="post-content">{{tpl:EntryContent}}</div>
-											</tpl:EntryIf>
-
-											<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-											{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-											<!-- # Number of comments, trackbacks and attachments -->
-											<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-												<p class="post-info-co">
-											</tpl:EntryIf>
-											<tpl:EntryIf show_comments="1">
-												<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-											</tpl:EntryIf>
-											<tpl:EntryIf show_pings="1">
-												<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-											<tpl:EntryIf has_attachment="1">
-												<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-											<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-												</p>
-											</tpl:EntryIf>
-											</div>
-
-											<tpl:EntriesFooter>
-												<tpl:Pagination>
-													<p class="pagination"><tpl:PaginationIf end="0"><a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171;
-													{{tpl:lang previous entries}}</a> - </tpl:PaginationIf>
-													{{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
-													<tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}}
-													&#187;</a></tpl:PaginationIf></p>
-												</tpl:Pagination>
-											</tpl:EntriesFooter>
-										</tpl:Entries>
-									</tpl:Block>	<!-- main-content -->
-								</div> <!-- End #content -->
-							</tpl:Block>	<!-- wrapper-main -->
-						</div> <!-- End #main -->
-
-						<tpl:Block name="wrapper-sidebar">
-							<div id="sidebar" role="complementary">
-								<div id="blognav">
-									{{tpl:Widgets type="nav"}}
-								</div> <!-- End #blognav -->
-								<div id="blogextra">
-									{{tpl:Widgets type="extra"}}
-								</div> <!-- End #blogextra -->
-							</div>
-						</tpl:Block>	<!-- wrapper-sidebar -->
-					</tpl:Block>	<!-- page-wrapper -->
-				</div> <!-- End #wrapper -->
-
-				<tpl:Block name="page-footer">
-					{{tpl:include src="_footer.html"}}
-				</tpl:Block>	<!-- page-footer -->
-			</tpl:Block>	<!-- body-page -->
-		</div> <!-- End #page -->
-	</tpl:Block>	<!-- html-body -->
-</body>
-</html>
Index: inc/public/default-templates/mustek/_audio_player.html
===================================================================
--- inc/public/default-templates/mustek/_audio_player.html	(revision 3167)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<audio controls preload="auto">
-	<source src="{{tpl:MediaURL}}">
-</audio>
Index: inc/public/default-templates/mustek/_flv_player.html
===================================================================
--- inc/public/default-templates/mustek/_flv_player.html	(revision 3958)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<a href="{{tpl:AttachmentURL}}" title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
Index: inc/public/default-templates/mustek/_footer.html
===================================================================
--- inc/public/default-templates/mustek/_footer.html	(revision 2603)
+++ 	(revision )
@@ -1,5 +1,0 @@
-<div id="footer" role="contentinfo">
-  <p>{{tpl:SysPoweredBy}}</p>
-</div>
-
-{{tpl:SysBehavior behavior="publicFooterContent"}}
Index: inc/public/default-templates/mustek/_head.html
===================================================================
--- inc/public/default-templates/mustek/_head.html	(revision 2804)
+++ 	(revision )
@@ -1,8 +1,0 @@
-<link rel="stylesheet" type="text/css" href="{{tpl:BlogThemeURL}}/style.css" media="screen" />
-<link rel="stylesheet" type="text/css" href="{{tpl:BlogQmarkURL}}pf=print.css" media="print" />
-
-<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.js"></script>
-<script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf={{tpl:BlogJsJQuery}}/jquery.cookie.js"></script>
-
-{{tpl:include src="user_head.html"}}
-{{tpl:SysBehavior behavior="publicHeadContent"}}
Index: inc/public/default-templates/mustek/_mp3_player.html
===================================================================
--- inc/public/default-templates/mustek/_mp3_player.html	(revision 3958)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<audio controls preload="auto">
-	<source src="{{tpl:MediaURL}}" type="audio/mpeg"/>
-</audio>
Index: inc/public/default-templates/mustek/_top.html
===================================================================
--- inc/public/default-templates/mustek/_top.html	(revision 2603)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<div id="top" role="banner">
-  <h1><span><a href="{{tpl:BlogURL}}">{{tpl:BlogName encode_html="1"}}</a></span></h1>
-
-  <!-- # --BEHAVIOR-- publicTopAfterContent -->
-  {{tpl:SysBehavior behavior="publicTopAfterContent"}}
-</div>
-
-<p id="prelude" role="navigation"><a href="#main">{{tpl:lang To content}}</a> |
-<a href="#blognav">{{tpl:lang To menu}}</a> |
-<a href="#search">{{tpl:lang To search}}</a></p>
Index: inc/public/default-templates/mustek/_video_player.html
===================================================================
--- inc/public/default-templates/mustek/_video_player.html	(revision 3167)
+++ 	(revision )
@@ -1,3 +1,0 @@
-<video controls preload="auto" width="400" height="300">
-	<source src="{{tpl:MediaURL}}">
-</video>
Index: inc/public/default-templates/mustek/archive.html
===================================================================
--- inc/public/default-templates/mustek/archive.html	(revision 3422)
+++ 	(revision )
@@ -1,35 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Archives}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<tpl:Archives>
-		<link rel="chapter" href="{{tpl:ArchiveURL}}" title="{{tpl:ArchiveDate encode_html="1"}}" />
-	</tpl:Archives>
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-archive"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<div id="content-info">
-		<h2>{{tpl:lang Archives}}</h2>
-	</div>
-
-	<div class="content-inner">
-		<tpl:Archives>
-			<tpl:ArchivesYearHeader>
-				<h3>{{tpl:ArchiveDate format="%Y"}}</h3>
-				<ul>
-			</tpl:ArchivesYearHeader>
-			<li><a href="{{tpl:ArchiveURL}}"
-			title="{{tpl:ArchiveDate encode_html="1"}}">{{tpl:ArchiveDate encode_html="1" format="%B"}}</a>
-			({{tpl:ArchiveEntriesCount}})</li>
-			<tpl:ArchivesYearFooter>
-				</ul>
-			</tpl:ArchivesYearFooter>
-		</tpl:Archives>
-	</div>
-</tpl:Block>
Index: inc/public/default-templates/mustek/archive_month.html
===================================================================
--- inc/public/default-templates/mustek/archive_month.html	(revision 3422)
+++ 	(revision )
@@ -1,56 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Archives}} - {{tpl:ArchiveDate}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:ArchiveNext><link rel="next" href="{{tpl:ArchiveURL}}"
-	title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchiveNext>
-	<tpl:ArchivePrevious><link rel="prev" href="{{tpl:ArchiveURL}}"
-	title="{{tpl:ArchiveDate encode_html="1"}}" /></tpl:ArchivePrevious>
-
-	<tpl:Entries no_content="1">
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-archive-month"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<p id="navlinks">
-		<tpl:ArchivePrevious><a href="{{tpl:ArchiveURL}}" class="prev">&#171; {{tpl:ArchiveDate encode_html="1"}}</a>
-		- </tpl:ArchivePrevious>
-		<a href="{{tpl:BlogArchiveURL}}">{{tpl:lang Archives}}</a>
-		<tpl:ArchiveNext> - <a href="{{tpl:ArchiveURL}}" class="next">{{tpl:ArchiveDate encode_html="1"}} &#187;</a></tpl:ArchiveNext>
-	</p>
-
-	<div id="content-info">
-		<h2>{{tpl:ArchiveDate}}</h2>
-	</div>
-
-	<div class="content-inner">
-		<tpl:Entries no_content="1">
-			<!-- # New day date -->
-			<tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
-
-			<h2 id="p{{tpl:EntryID}}" class="post-title" lang="{{tpl:EntryLang}}"><a
-			href="{{tpl:EntryURL}}" title="{{tpl:lang Read}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-
-			<p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
-			<tpl:EntryIf show_comments="1">
-			- <a href="{{tpl:EntryURL}}#comments">{{tpl:EntryCommentCount}}</a>
-			</tpl:EntryIf>
-			<tpl:EntryIf show_pings="1">
-			- <a href="{{tpl:EntryURL}}#pings">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf has_attachment="1">
-			- <a href="{{tpl:EntryURL}}#attachments">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-			</p>
-		</tpl:Entries>
-	</div>
-</tpl:Block>
Index: inc/public/default-templates/mustek/atom-comments.xml
===================================================================
--- inc/public/default-templates/mustek/atom-comments.xml	(revision 3226)
+++ 	(revision )
@@ -1,47 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{tpl:BlogLanguage}}">
-
-  <title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}
-  - {{tpl:lang Comments}}</title>
-  <subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
-  <link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
-  <link href="{{tpl:BlogURL}}" rel="alternate" type="text/html"
-  title="{{tpl:BlogDescription remove_html="1" encode_xml="1"}}"/>
-  <updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
-  <author>
-    <name>{{tpl:BlogEditor encode_xml="1"}}</name>
-  </author>
-  <id>{{tpl:BlogFeedID}}</id>
-  <generator uri="http://www.dotclear.org/">Dotclear</generator>
-
-  <tpl:Comments order="desc" with_pings="1">
-
-  <tpl:CommentIf is_ping="1">
-  <entry>
-    <title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
-    <link href="{{tpl:PingPostURL encode_xml="1"}}#c{{tpl:PingID}}" rel="alternate" type="text/html"
-    title="[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}" />
-    <id>{{tpl:PingFeedID}}</id>
-    <published>{{tpl:PingDate iso8601="1"}}</published>
-    <updated>{{tpl:PingDate iso8601="1" upddt="1"}}</updated>
-    <author><name>{{tpl:PingBlogName encode_xml="1"}}</name></author>
-    <content type="html">&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt; {{tpl:PingContent encode_xml="1"}}</content>
-  </entry>
-
-  </tpl:CommentIf>
-
-  <tpl:CommentIf is_ping="0">
-  <entry>
-    <title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
-    <link href="{{tpl:CommentPostURL encode_xml="1"}}#c{{tpl:CommentID}}" rel="alternate" type="text/html"
-    title="{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}" />
-    <id>{{tpl:CommentFeedID}}</id>
-    <published>{{tpl:CommentDate iso8601="1"}}</published>
-    <updated>{{tpl:CommentDate iso8601="1" upddt="1"}}</updated>
-    <author><name>{{tpl:CommentAuthor encode_xml="1"}}</name></author>
-    <content type="html">{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</content>
-  </entry>
-  </tpl:CommentIf>
-  </tpl:Comments>
-
-</feed>
Index: inc/public/default-templates/mustek/atom.xml
===================================================================
--- inc/public/default-templates/mustek/atom.xml	(revision 3226)
+++ 	(revision )
@@ -1,55 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
-  xml:lang="{{tpl:BlogLanguage}}">
-
-  <title type="html">{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
-  <subtitle type="html">{{tpl:BlogDescription encode_xml="1"}}</subtitle>
-  <link href="{{tpl:SysSelfURI}}" rel="self" type="application/atom+xml"/>
-  <link href="{{tpl:BlogURL}}" rel="alternate" type="text/html"
-  title="{{tpl:BlogDescription remove_html="1" encode_xml="1"}}"/>
-  <updated>{{tpl:BlogUpdateDate iso8601="1"}}</updated>
-  <author>
-    <name>{{tpl:BlogEditor encode_xml="1"}}</name>
-  </author>
-  <id>{{tpl:BlogFeedID}}</id>
-  <generator uri="http://www.dotclear.org/">Dotclear</generator>
-
-  <tpl:Entries>
-
-  <entry>
-    <title>{{tpl:EntryTitle encode_xml="1"}}</title>
-    <link href="{{tpl:EntryURL}}" rel="alternate" type="text/html"
-    title="{{tpl:EntryTitle encode_xml="1"}}" />
-    <id>{{tpl:EntryFeedID}}</id>
-    <published>{{tpl:EntryDate iso8601="1"}}</published>
-    <tpl:EntryIf republished="1">
-      <updated>{{tpl:EntryDate iso8601="1" upddt="1"}}</updated>
-    </tpl:EntryIf>
-    <tpl:EntryIf republished="0">
-      <updated>{{tpl:EntryDate iso8601="1"}}</updated>
-    </tpl:EntryIf>
-    <author><name>{{tpl:EntryAuthorCommonName encode_xml="1"}}</name></author>
-    <tpl:EntryIf has_category="1">
-    <dc:subject>{{tpl:EntryCategory encode_html="1"}}</dc:subject>
-    </tpl:EntryIf>
-    <tpl:EntryTags><dc:subject>{{tpl:TagID}}</dc:subject></tpl:EntryTags>
-
-    <content type="html">{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}}
-    {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</content>
-
-    <tpl:Attachments>
-      <link rel="enclosure" href="{{tpl:AttachmentURL}}"
-      length="{{tpl:AttachmentSize full="1"}}" type="{{tpl:AttachmentMimeType}}" />
-    </tpl:Attachments>
-
-
-    <tpl:EntryIf comments_active="1">
-      <wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
-      <wfw:commentRss>{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}</wfw:commentRss>
-    </tpl:EntryIf>
-  </entry>
-  </tpl:Entries>
-
-</feed>
Index: inc/public/default-templates/mustek/category.html
===================================================================
--- inc/public/default-templates/mustek/category.html	(revision 3422)
+++ 	(revision )
@@ -1,133 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:CategoryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
-</tpl:Block>
-
-<tpl:Block name="meta-entry">
-	<meta name="description" lang="{{tpl:BlogLanguage}}" content="{{tpl:CategoryDescription encode_html="1" cut_string="180" remove_html="1"}}" />
-	<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
-	<meta name="date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:Entries no_content="1">
-		<tpl:EntriesHeader>
-			<tpl:Pagination>
-				<tpl:PaginationIf end="0">
-					<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-				</tpl:PaginationIf>
-
-				<tpl:PaginationIf start="0">
-					<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-				</tpl:PaginationIf>
-			</tpl:Pagination>
-		</tpl:EntriesHeader>
-
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-
-	<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:CategoryFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-category"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<div id="content-info">
-		<h2><tpl:CategoryParents><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a> &rsaquo; </tpl:CategoryParents>
-		{{tpl:CategoryTitle encode_html="1"}}</h2>
-		{{tpl:CategoryDescription}}
-
-		<tpl:CategoryIf has_entries="1">
-			<p><a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}"
-			title="{{tpl:lang This category's entries Atom feed}}" class="feed">{{tpl:lang Entries feed}}</a>
-
-			<tpl:SysIf operator="or" comments_active="1" pings_active="1">
-			- <a type="application/atom+xml" href="{{tpl:CategoryFeedURL type="atom"}}/comments"
-			title="{{tpl:lang This category's comments Atom feed}}" class="feed">{{tpl:lang Comments feed}}</a>
-			</tpl:SysIf>
-			</p>
-		</tpl:CategoryIf>
-	</div>
-
-	<tpl:CategoryFirstChildren>
-		<tpl:CategoriesHeader>
-			<div id="subcategories">
-				<h3>{{tpl:lang Subcategories}}</h3>
-				<ul>
-		</tpl:CategoriesHeader>
-				<li><a href="{{tpl:CategoryURL}}">{{tpl:CategoryTitle encode_html="1"}}</a></li>
-		<tpl:CategoriesFooter>
-				</ul>
-			</div>
-		</tpl:CategoriesFooter>
-	</tpl:CategoryFirstChildren>
-
-	<tpl:Entries>
-		<div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" role="article">
-			<!-- # New day date -->
-			<tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
-
-			<h2 class="post-title"><a
-			href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-
-			<p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
-			{{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}</p>
-
-			<tpl:EntryTags>
-				<tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
-				<li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-				<tpl:TagsFooter></ul></tpl:TagsFooter>
-			</tpl:EntryTags>
-
-			<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-			{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-			<!-- # Entry with an excerpt -->
-			<tpl:EntryIf extended="1">
-				<div class="post-content">{{tpl:EntryExcerpt}}</div>
-				<p class="read-it"><a href="{{tpl:EntryURL}}"
-				title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue
-				reading}}</a><span class="readmore-ellipsis">...</span></p>
-			</tpl:EntryIf>
-
-			<!-- # Entry without excerpt -->
-			<tpl:EntryIf extended="0">
-				<div class="post-content">{{tpl:EntryContent}}</div>
-			</tpl:EntryIf>
-
-			<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-			{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-			<!-- # Number of comments, trackbacks and attachments -->
-			<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-				<p class="post-info-co">
-			</tpl:EntryIf>
-			<tpl:EntryIf show_comments="1">
-				<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-			</tpl:EntryIf>
-			<tpl:EntryIf show_pings="1">
-				<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf has_attachment="1">
-				<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-			  </p>
-			</tpl:EntryIf>
-		</div>
-
-		<tpl:EntriesFooter>
-			<tpl:Pagination>
-				<p class="pagination"><tpl:PaginationIf end="0"><a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171;
-				{{tpl:lang previous entries}}</a> - </tpl:PaginationIf>
-				{{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
-				<tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}}
-				&#187;</a></tpl:PaginationIf></p>
-			</tpl:Pagination>
-		</tpl:EntriesFooter>
-	</tpl:Entries>
-</tpl:Block>
Index: inc/public/default-templates/mustek/home.html
===================================================================
--- inc/public/default-templates/mustek/home.html	(revision 3017)
+++ 	(revision )
@@ -1,1 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
Index: inc/public/default-templates/mustek/password-form.html
===================================================================
--- inc/public/default-templates/mustek/password-form.html	(revision 2603)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<!DOCTYPE html>
-<html lang="{{tpl:BlogLanguage}}">
-<head>
-  <meta charset="UTF-8" />
-  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
-  <title>{{tpl:lang Password needed}} - {{tpl:BlogName encode_html="1"}}</title>
-
-  <style type="text/css">
-  body {
-  font: 0.8em Verdana,Arial,Geneva,sans-serif;
-  }
-
-  form {
-  display : block;
-  width : 500px;
-  margin : 0 auto;
-  padding : 1em;
-  background : #eee;
-  }
-
-  h2 { font : 140% Arial,Helvetica,sans-serif; margin : 0; }
-
-  label { font-weight : bold; }
-
-  input { border-width : 1px; }
-  </style>
-</head>
-
-<body>
-
-<form action="{{tpl:EntryURL}}" method="post" role="form">
-<h2>{{tpl:lang Password needed}}</h2>
-
-<p>{{tpl:lang You must give a password to access this area.}}</p>
-<p><label>{{tpl:lang Password:}} <input type="password" name="password" value="" /></label> <input type="submit" value="ok" /></p>
-
-</form>
-
-</body>
-</html>
Index: inc/public/default-templates/mustek/post.html
===================================================================
--- inc/public/default-templates/mustek/post.html	(revision 4003)
+++ 	(revision )
@@ -1,241 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-  <title>{{tpl:EntryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
-</tpl:Block>
-
-<tpl:Block name="meta-entry">
-  <meta name="description" lang="{{tpl:EntryLang}}" content="{{tpl:EntryContent full="1" encode_html="1" remove_html="1" cut_string="180"}}" />
-  <meta name="author" content="{{tpl:EntryAuthorCommonName encode_html="1"}}" />
-  <meta name="date" content="{{tpl:EntryDate iso8601="1"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-  <tpl:EntryIf pings_active="1"><link rel="pingback" href="{{tpl:BlogXMLRPCURL}}" /></tpl:EntryIf>
-
-  <tpl:EntryNext><link rel="next" href="{{tpl:EntryURL}}"
-  title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryNext>
-
-  <tpl:EntryPrevious><link rel="prev" href="{{tpl:EntryURL}}"
-  title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryPrevious>
-
-  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
-</tpl:Block>
-
-<tpl:Block name="html-head">
-  {{tpl:parent}}
-  <script type="application/json" id="dc_post_remember_str-data">
-    {"post_remember_str": "{{tpl:lang Remember me on this blog}}"}
-  </script>
-  <script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf=util.js"></script>
-  <script type="text/javascript" src="{{tpl:BlogQmarkURL}}pf=post.js"></script>
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-post"></tpl:Block>
-
-<tpl:Block name="page-top">
-  {{tpl:EntryPingData}}
-  {{tpl:parent}}
-</tpl:Block>
-
-<tpl:Block name="main-content">
-  <p id="navlinks">
-    <tpl:EntryPrevious><a href="{{tpl:EntryURL}}"
-    title="{{tpl:EntryTitle encode_html="1"}}" class="prev">&#171; {{tpl:EntryTitle encode_html="1"
-    cut_string="50"}}</a></tpl:EntryPrevious>
-    <tpl:EntryNext> <span>-</span> <a href="{{tpl:EntryURL}}"
-    title="{{tpl:EntryTitle encode_html="1"}}" class="next">{{tpl:EntryTitle encode_html="1"
-    cut_string="50"}} &#187;</a></tpl:EntryNext>
-  </p>
-
-  <div id="p{{tpl:EntryID}}" class="post" role="article">
-    <h2 class="post-title">{{tpl:EntryTitle encode_html="1"}}</h2>
-
-    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
-    {{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
-    <tpl:EntryIf has_category="1">
-    - <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
-    </tpl:EntryIf>
-    - <a href="{{tpl:EntryURL}}">{{tpl:lang Permalink}}</a>
-    </p>
-
-    <tpl:EntryTags>
-    <tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
-    <li><a href="{{tpl:TagURL}}" rel="tag">{{tpl:TagID}}</a></li>
-    <tpl:TagsFooter></ul></tpl:TagsFooter>
-    </tpl:EntryTags>
-
-    <!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-    {{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-    <!-- # Entry with an excerpt -->
-    <tpl:EntryIf extended="1">
-      <div class="post-excerpt">{{tpl:EntryExcerpt}}</div>
-    </tpl:EntryIf>
-
-    <div class="post-content">{{tpl:EntryContent}}</div>
-
-    <!-- # --BEHAVIOR-- publicEntryAfterContent -->
-    {{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-  </div>
-
-  <!-- # Attachments -->
-  <tpl:Attachments>
-    <tpl:AttachmentsHeader>
-      <div id="attachments">
-      <h3>{{tpl:lang Attachments}}</h3>
-      <ul>
-    </tpl:AttachmentsHeader>
-      <li class="{{tpl:AttachmentType}}">
-        <tpl:AttachmentIf is_audio="1">
-          {{tpl:include src="_audio_player.html"}}
-        </tpl:AttachmentIf>
-        <tpl:AttachmentIf is_video="1">
-          {{tpl:include src="_video_player.html"}}
-        </tpl:AttachmentIf>
-        <tpl:AttachmentIf is_audio="0" is_video="0">
-           <a href="{{tpl:AttachmentURL}}" title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
-        </tpl:AttachmentIf>
-      </li>
-    <tpl:AttachmentsFooter>
-      </ul>
-      </div>
-    </tpl:AttachmentsFooter>
-  </tpl:Attachments>
-
-  <!-- # Comments -->
-  <tpl:EntryIf show_comments="1">
-    <tpl:Comments>
-    <tpl:CommentsHeader>
-      <div id="comments">
-        <h3>{{tpl:lang Comments}}</h3>
-      <dl>
-    </tpl:CommentsHeader>
-      <dt id="c{{tpl:CommentID}}" class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}"><a
-      href="#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}.</a>
-      {{tpl:lang On}} {{tpl:CommentDate}}, {{tpl:CommentTime}}
-      {{tpl:lang by}} {{tpl:CommentAuthorLink}}</dt>
-
-      <dd class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
-      <!-- # --BEHAVIOR-- publicCommentBeforeContent -->
-      {{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
-
-      {{tpl:CommentContent}}
-
-      <!-- # --BEHAVIOR-- publicCommentAfterContent -->
-      {{tpl:SysBehavior behavior="publicCommentAfterContent"}}
-      </dd>
-    <tpl:CommentsFooter>
-      </dl>
-      </div>
-    </tpl:CommentsFooter>
-    </tpl:Comments>
-  </tpl:EntryIf>
-
-  <tpl:EntryIf comments_active="1">
-    <tpl:SysIfFormError>
-      <p class="error" id="pr">{{tpl:SysFormError}}</p>
-    </tpl:SysIfFormError>
-
-    <tpl:SysIfCommentPublished>
-      <p class="message" id="pr">{{tpl:lang Your comment has been published.}}</p>
-    </tpl:SysIfCommentPublished>
-
-    <tpl:SysIfCommentPending>
-      <p class="message" id="pr">{{tpl:lang Your comment has been submitted and
-      will be reviewed for publication.}}</p>
-    </tpl:SysIfCommentPending>
-
-    <!-- # Comment form -->
-    <form action="{{tpl:EntryURL}}#pr" method="post" id="comment-form" role="form">
-      <tpl:IfCommentPreview>
-        <div id="pr">
-          <h3>{{tpl:lang Your comment}}</h3>
-          <dl>
-            <dd class="comment-preview">{{tpl:CommentPreviewContent}}</dd>
-          </dl>
-          <p class="buttons"><input type="submit" class="submit" value="{{tpl:lang send}}" /></p>
-        </div>
-      </tpl:IfCommentPreview>
-
-      <h3>{{tpl:lang Add a comment}}</h3>
-      <fieldset>
-        <!-- # --BEHAVIOR-- publicCommentFormBeforeContent -->
-        {{tpl:SysBehavior behavior="publicCommentFormBeforeContent"}}
-
-        <p class="field"><label for="c_name">{{tpl:lang Name or nickname}}&nbsp;:</label>
-        <input name="c_name" id="c_name" type="text" size="30" maxlength="255"
-        value="{{tpl:CommentPreviewName encode_html="1"}}" />
-        </p>
-
-        <p class="field"><label for="c_mail">{{tpl:lang Email address}}&nbsp;:</label>
-        <input name="c_mail" id="c_mail" type="text" size="30" maxlength="255"
-        value="{{tpl:CommentPreviewEmail encode_html="1"}}" />
-        </p>
-
-        <p class="field"><label for="c_site">{{tpl:lang Website}} ({{tpl:lang optional}})&nbsp;:</label>
-        <input name="c_site" id="c_site" type="text" size="30" maxlength="255"
-        value="{{tpl:CommentPreviewSite encode_html="1"}}" />
-        </p>
-
-        <p style="display:none"><input name="f_mail" type="text" size="30"
-        maxlength="255" value="" /></p>
-
-        <p class="field"><label for="c_content">{{tpl:lang Comment}}&nbsp;:</label>
-        <textarea name="c_content" id="c_content" cols="35"
-        rows="7">{{tpl:CommentPreviewContent raw="1" encode_html="1"}}</textarea>
-        </p>
-        <p class="form-help">{{tpl:CommentHelp}}</p>
-
-        <!-- # --BEHAVIOR-- publicCommentFormAfterContent -->
-        {{tpl:SysBehavior behavior="publicCommentFormAfterContent"}}
-      </fieldset>
-
-      <fieldset>
-        <p class="buttons"><input type="submit" class="preview" name="preview" value="{{tpl:lang preview}}" />
-        <tpl:IfCommentPreviewOptional><input type="submit" class="submit" value="{{tpl:lang send}}" /></tpl:IfCommentPreviewOptional></p>
-      </fieldset>
-    </form>
-  </tpl:EntryIf>
-
-  <!-- # Trackbacks -->
-  <tpl:EntryIf show_pings="1">
-    <div id="pings">
-      <h3>{{tpl:lang They posted on the same topic}}</h3>
-      <tpl:Pings>
-        <tpl:PingsHeader>
-        <dl>
-        </tpl:PingsHeader>
-          <dt id="c{{tpl:PingID}}" class="{{tpl:PingIfOdd}} {{tpl:PingIfFirst}}"><a href="#c{{tpl:PingID}}"
-          class="ping-number">{{tpl:PingOrderNumber}}.</a>
-          {{tpl:lang On}} {{tpl:PingDate}}, {{tpl:PingTime}}
-          {{tpl:lang by}} {{tpl:PingBlogName encode_html="1"}}</dt>
-
-          <dd class="{{tpl:PingIfOdd}} {{tpl:PingIfFirst}}">
-          <!-- # --BEHAVIOR-- publicPingBeforeContent -->
-          {{tpl:SysBehavior behavior="publicPingBeforeContent"}}
-
-          <p><a href="{{tpl:PingAuthorURL}}"
-          {{tpl:PingNoFollow}}>{{tpl:PingTitle encode_html="1"}}</a></p>
-          {{tpl:PingContent}}
-
-          <!-- # --BEHAVIOR-- publicPingAfterContent -->
-          {{tpl:SysBehavior behavior="publicPingAfterContent"}}
-          </dd>
-        <tpl:PingsFooter>
-        </dl>
-        </tpl:PingsFooter>
-      </tpl:Pings>
-    </div>
-  </tpl:EntryIf>
-
-  <tpl:EntryIf pings_active="1">
-    <p id="ping-url">{{tpl:lang Trackback URL}}&nbsp;: {{tpl:EntryPingLink}}</p>
-  </tpl:EntryIf>
-
-  <tpl:EntryIf operator="or" comments_active="1" pings_active="1">
-  <p id="comments-feed"><a class="feed" href="{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}"
-  title="{{tpl:lang This post's comments Atom feed}}">{{tpl:lang This post's comments feed}}</a></p>
-  </tpl:EntryIf>
-</tpl:Block>
Index: inc/public/default-templates/mustek/rss2-comments.xml
===================================================================
--- inc/public/default-templates/mustek/rss2-comments.xml	(revision 3226)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
-<rss version="2.0"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xmlns:content="http://purl.org/rss/1.0/modules/content/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-<channel>
-  <title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}
-  - {{tpl:lang Comments}}</title>
-  <link>{{tpl:BlogURL}}</link>
-  <atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml"/>
-  <description>{{tpl:BlogDescription remove_html="1" encode_xml="1"}}</description>
-  <language>{{tpl:BlogLanguage}}</language>
-  <pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
-  <copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
-  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
-  <generator>Dotclear</generator>
-
-  <tpl:Comments order="desc" with_pings="1">
-
-  <tpl:CommentIf is_ping="1">
-  <item>
-    <title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
-    <link>{{tpl:PingPostURL encode_xml="1"}}#c{{tpl:PingID}}</link>
-    <guid isPermaLink="false">{{tpl:PingFeedID}}</guid>
-    <pubDate>{{tpl:PingDate rfc822="1"}}</pubDate>
-    <dc:creator>{{tpl:PingBlogName encode_xml="1"}}</dc:creator>
-
-    <description>&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt;
-    {{tpl:PingContent encode_xml="1"}}</description>
-  </item>
-  </tpl:CommentIf>
-
-  <tpl:CommentIf is_ping="0">
-  <item>
-    <title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
-    <link>{{tpl:CommentPostURL encode_xml="1"}}#c{{tpl:CommentID}}</link>
-    <guid isPermaLink="false">{{tpl:CommentFeedID}}</guid>
-    <pubDate>{{tpl:CommentDate rfc822="1"}}</pubDate>
-    <dc:creator>{{tpl:CommentAuthor encode_xml="1"}}</dc:creator>
-
-    <description>{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</description>
-  </item>
-  </tpl:CommentIf>
-  </tpl:Comments>
-
-</channel>
-</rss>
Index: inc/public/default-templates/mustek/rss2.xml
===================================================================
--- inc/public/default-templates/mustek/rss2.xml	(revision 3226)
+++ 	(revision )
@@ -1,49 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
-<rss version="2.0"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
-  xmlns:content="http://purl.org/rss/1.0/modules/content/"
-  xmlns:atom="http://www.w3.org/2005/Atom">
-<channel>
-  <title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
-  <link>{{tpl:BlogURL}}</link>
-  <atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml"/>
-  <description>{{tpl:BlogDescription remove_html="1" encode_xml="1"}}</description>
-  <language>{{tpl:BlogLanguage}}</language>
-  <pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
-  <copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
-  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
-  <generator>Dotclear</generator>
-
-  <tpl:Entries>
-
-  <item>
-    <title>{{tpl:EntryTitle encode_xml="1"}}</title>
-    <link>{{tpl:EntryURL}}</link>
-    <guid isPermaLink="false">{{tpl:EntryFeedID}}</guid>
-    <pubDate>{{tpl:EntryDate rfc822="1"}}</pubDate>
-    <dc:creator>{{tpl:EntryAuthorCommonName encode_xml="1"}}</dc:creator>
-    <tpl:EntryIf has_category="1">
-    <category>{{tpl:EntryCategory encode_html="1"}}</category>
-    </tpl:EntryIf>
-    <tpl:EntryTags><category>{{tpl:TagID}}</category></tpl:EntryTags>
-
-    <description>{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}}
-    {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</description>
-
-    <tpl:Attachments>
-      <enclosure url="{{tpl:AttachmentURL}}"
-      length="{{tpl:AttachmentSize full="1"}}" type="{{tpl:AttachmentMimeType}}" />
-    </tpl:Attachments>
-
-    <tpl:EntryIf comments_active="1">
-      <comments>{{tpl:EntryURL}}#comment-form</comments>
-      <wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
-      <wfw:commentRss>{{tpl:BlogFeedURL}}/comments/{{tpl:EntryID}}</wfw:commentRss>
-    </tpl:EntryIf>
-  </item>
-  </tpl:Entries>
-
-</channel>
-</rss>
Index: inc/public/default-templates/mustek/rss2.xsl
===================================================================
--- inc/public/default-templates/mustek/rss2.xsl	(revision 2599)
+++ 	(revision )
@@ -1,120 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-xmlns:content="http://purl.org/rss/1.0/modules/content/"
-xmlns="http://www.w3.org/1999/xhtml">
-
-<xsl:output method="html"/>
-
-<xsl:template match="/">
-<html>
-  <head>
-    <title>{{tpl:lang Subscribe to}} <xsl:value-of select="/rss/channel/title"/></title>
-    <style type="text/css">
-    <![CDATA[
-    body {
-      font: 80% Verdana,Arial,sans-serif;
-      margin: 20px 0;
-      padding: 0 0;
-      background: #fff;
-      color: #000;
-    }
-    a { color: #039; }
-    h1, h2 { font-family: Arial,sans-serif; }
-    h1 { font-size: 160%; margin: 0; }
-    h2 { font-size: 140%; font-weight: bold; margin: 0.5em 0 0.2em 0; }
-    h2 a { text-decoration: none; }
-    p { margin: 0 0 0.5em 0; }
-    #page {
-      margin: 0 80px;
-    }
-    #top {
-      background: #036;
-      padding : 1em;
-      color: #fff;
-    }
-    #top a {
-      color: #fff;
-      text-decoration: none;
-    }
-    #what {
-      padding: 1em;
-      background: #eee;
-      border-bottom: 1px solid #000;
-      font-size: 80%;
-    }
-    #what p {
-      margin: 0 0 0.5em 0;
-    }
-    #footer {
-      border-top: 1px solid #000;
-    }
-    #items {
-      background: #fff;
-      color: inherit;
-    }
-    #items div {
-      margin: 0 0 1em 0;
-    }
-    ]]>
-    </style>
-    <script type="text/javascript"><![CDATA[
-    window.onload = function() {
-      document.getElementById('feedurl').value = window.location.href;
-
-      // Ugly but works ;)
-      var c = document.getElementsByTagName('div');
-      var t = '';
-      for (var i=0; c.length-i != 0; i++) {
-        if (c[i].className == 'item-content') {
-          if (c[i].textContent) {
-            t = c[i].textContent;
-          } else if (c[i].innerText) {
-            t = c[i].innerText;
-          } else {
-            t = '';
-          }
-
-          if (t) { c[i].innerHTML = t; }
-        }
-      }
-    };
-    ]]></script>
-  </head>
-  <body>
-    <div id="page">
-      <div id="top">
-        <h1><a href="{/rss/channel/link}"><xsl:value-of select="/rss/channel/title"/></a></h1>
-        <p><xsl:value-of select="/rss/channel/description"/></p>
-      </div>
-      <div id="what">
-      <h3>{{tpl:lang What is an RSS feed?}}</h3>
-      <p>{{tpl:lang RSS feed is a free blog summary. It provides content
-      (either posts or comments) or  summaries of content, together with links
-      to the full versions, and other metadata. The last published items may
-      then be read by your favorite RSS
-      <a href="http://en.wikipedia.org/wiki/Aggregator">aggregator</a>.}}</p>
-      <h3>{{tpl:lang Subscribe}}</h3>
-      <p>{{tpl:lang Simply copy the following URL into your aggregator:}}</p>
-      <p><input type="text" size="60" value="" id="feedurl" /></p>
-      </div>
-      <div id="items">
-        <xsl:apply-templates select="//item"/>
-      </div>
-      <div id="footer">
-        <p><xsl:value-of select="/rss/channel/copyright"/></p>
-      </div>
-    </div>
-  </body>
-</html>
-</xsl:template>
-
-<!-- Item template -->
-<xsl:template match="item">
-  <div>
-    <h2><a href="{link}"><xsl:value-of select="title"/></a></h2>
-    <div class="item-content"><xsl:value-of select="description" /></div>
-  </div>
-</xsl:template>
-
-</xsl:stylesheet>
Index: inc/public/default-templates/mustek/search.html
===================================================================
--- inc/public/default-templates/mustek/search.html	(revision 3422)
+++ 	(revision )
@@ -1,112 +1,0 @@
-{{tpl:extends parent="__layout.html"}}
-
-<tpl:Block name="head-title">
-	<title>{{tpl:lang Search}} - {{tpl:SysSearchString encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
-</tpl:Block>
-
-<tpl:Block name="meta-robots">
-	<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
-</tpl:Block>
-
-<tpl:Block name="head-linkrel">
-	<link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-	<tpl:Entries no_content="1">
-		<tpl:EntriesHeader>
-			<tpl:Pagination>
-				<tpl:PaginationIf end="0">
-					<link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
-				</tpl:PaginationIf>
-
-				<tpl:PaginationIf start="0">
-					<link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
-				</tpl:PaginationIf>
-			</tpl:Pagination>
-		</tpl:EntriesHeader>
-		<link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
-	</tpl:Entries>
-	<link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
-</tpl:Block>
-
-<tpl:Block name="body-tag"><body class="dc-search"></tpl:Block>
-
-<tpl:Block name="main-content">
-	<div id="content-info">
-		<h2>{{tpl:lang Search}}</h2>
-		<tpl:SysIf search_count="==0">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned no result."}}</p>
-		</tpl:SysIf>
-		<tpl:SysIf search_count="==1">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> result."}}</p>
-		</tpl:SysIf>
-		<tpl:SysIf search_count="&gt;1">
-			<p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> results."}}</p>
-		</tpl:SysIf>
-	</div>
-
-	<tpl:Entries>
-		<div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" role="article">
-			<!-- # New day date -->
-			<tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
-
-			<h2 class="post-title"><a
-			href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
-
-			<p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
-			{{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
-			<tpl:EntryIf has_category="1">
-			- <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
-			</tpl:EntryIf>
-			</p>
-
-			<tpl:EntryTags>
-				<tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
-				<li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
-				<tpl:TagsFooter></ul></tpl:TagsFooter>
-			</tpl:EntryTags>
-
-			<!-- # --BEHAVIOR-- publicEntryBeforeContent -->
-			{{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
-
-			<!-- # Entry with an excerpt -->
-			<tpl:EntryIf extended="1">
-				<div class="post-content">{{tpl:EntryExcerpt}}</div>
-				<p class="read-it"><a href="{{tpl:EntryURL}}"
-				title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue
-				reading}}</a><span class="readmore-ellipsis">...</span></p>
-			</tpl:EntryIf>
-
-			<!-- # Entry without excerpt -->
-			<tpl:EntryIf extended="0">
-				<div class="post-content">{{tpl:EntryContent}}</div>
-			</tpl:EntryIf>
-
-			<!-- # --BEHAVIOR-- publicEntryAfterContent -->
-			{{tpl:SysBehavior behavior="publicEntryAfterContent"}}
-
-			<!-- # Number of comments, trackbacks and attachments -->
-			<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-				<p class="post-info-co">
-			</tpl:EntryIf>
-			<tpl:EntryIf show_comments="1">
-				<a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
-			</tpl:EntryIf>
-			<tpl:EntryIf show_pings="1">
-				<a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf has_attachment="1">
-				<a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
-			<tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
-				</p>
-			</tpl:EntryIf>
-		</div>
-
-		<tpl:EntriesFooter>
-			<tpl:Pagination>
-				<p class="pagination"><tpl:PaginationIf end="0"><a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171;
-				{{tpl:lang previous entries}}</a> - </tpl:PaginationIf>
-				{{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
-				<tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}}
-				&#187;</a></tpl:PaginationIf></p>
-			</tpl:Pagination>
-		</tpl:EntriesFooter>
-	</tpl:Entries>
-</tpl:Block>
Index: inc/public/default-templates/mustek/user_head.html
===================================================================
--- inc/public/default-templates/mustek/user_head.html	(revision 2599)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<!-- # This template is included at the end of _head.html template -->
Index: inc/public/default-templates/password-form.html
===================================================================
--- inc/public/default-templates/password-form.html	(revision 0)
+++ inc/public/default-templates/password-form.html	(revision 0)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
+  <title>{{tpl:lang Password needed}} - {{tpl:BlogName encode_html="1"}}</title>
+  
+  <style type="text/css">
+  body {
+  font: 0.8em Verdana,Arial,Geneva,sans-serif;
+  }
+  
+  form {
+  display : block;
+  width : 500px;
+  margin : 0 auto;
+  padding : 1em;
+  background : #eee;
+  }
+  
+  h2 { font : 140% Arial,Helvetica,sans-serif; margin : 0; }
+  
+  label { font-weight : bold; }
+  
+  input { border-width : 1px; }
+  </style>
+</head>
+
+<body>
+
+<form action="{{tpl:EntryURL}}" method="post">
+<h2>{{tpl:lang Password needed}}</h2>
+
+<p>{{tpl:lang You must give a password to access this area.}}</p>
+<p><label>{{tpl:lang Password:}} <input type="password" name="password" value=""
+tabindex="1" /></label> <input type="submit" value="ok" /></p>
+
+</form>
+
+</body>
+</html>
Index: inc/public/default-templates/post.html
===================================================================
--- inc/public/default-templates/post.html	(revision 0)
+++ inc/public/default-templates/post.html	(revision 0)
@@ -0,0 +1,276 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
+  
+  <title>{{tpl:EntryTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
+  <meta name="description" lang="{{tpl:EntryLang}}" content="{{tpl:EntryContent full="1" encode_html="1" remove_html="1" cut_string="180"}}" />
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:EntryAuthorCommonName encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:EntryDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" content="{{tpl:EntryTitle encode_html="1"}}" />
+  <meta name="dc.description" lang="{{tpl:EntryLang}}" content="{{tpl:EntryContent full="1" encode_html="1" remove_html="1" cut_string="180"}}" />
+  <meta name="dc.creator" content="{{tpl:EntryAuthorCommonName encode_html="1"}}" />
+  <meta name="dc.language" content="{{tpl:EntryLang}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:EntryDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
+  
+  <tpl:EntryNext><link rel="next" href="{{tpl:EntryURL}}"
+  title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryNext>
+  
+  <tpl:EntryPrevious><link rel="prev" href="{{tpl:EntryURL}}"
+  title="{{tpl:EntryTitle encode_html="1"}}" /></tpl:EntryPrevious>
+  
+  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
+  
+  {{tpl:include src="_head.html"}}
+  
+  <script type="text/javascript" src="{{tpl:BlogThemeURL}}/../default/js/post.js"></script>
+  <script type="text/javascript">
+  //<![CDATA[
+  var post_remember_str = '{{tpl:lang Remember me on this blog}}';
+  //]]>
+  </script>
+</head>
+
+<body class="dc-post">
+<div id="page">
+{{tpl:EntryPingData}}
+
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  
+  <p id="navlinks">
+  <tpl:EntryPrevious><a href="{{tpl:EntryURL}}"
+  title="{{tpl:EntryTitle encode_html="1"}}" class="prev">&#171; {{tpl:EntryTitle encode_html="1"
+  cut_string="50"}}</a></tpl:EntryPrevious>
+  <tpl:EntryNext> <span>-</span> <a href="{{tpl:EntryURL}}"
+  title="{{tpl:EntryTitle encode_html="1"}}" class="next">{{tpl:EntryTitle encode_html="1"
+  cut_string="50"}} &#187;</a></tpl:EntryNext>
+  </p>
+  
+  <div id="p{{tpl:EntryID}}" class="post">
+    <h2 class="post-title">{{tpl:EntryTitle encode_html="1"}}</h2>
+    
+    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
+    {{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
+    <tpl:EntryIf has_category="1">
+    - <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
+    </tpl:EntryIf>
+    - <a href="{{tpl:EntryURL}}">{{tpl:lang Permalink}}</a>
+    </p>
+    
+    <tpl:EntryTags>
+    <tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
+    <li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
+    <tpl:TagsFooter></ul></tpl:TagsFooter>
+    </tpl:EntryTags>
+    
+    <!-- # --BEHAVIOR-- publicEntryBeforeContent -->
+    {{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
+    
+    <!-- # Entry with an excerpt -->
+    <tpl:EntryIf extended="1">
+      <div class="post-excerpt">{{tpl:EntryExcerpt}}</div>
+    </tpl:EntryIf>
+    
+    <div class="post-content">{{tpl:EntryContent}}</div>
+    
+    <!-- # --BEHAVIOR-- publicEntryAfterContent -->
+    {{tpl:SysBehavior behavior="publicEntryAfterContent"}}
+  </div>
+  
+  <!-- # Attachments -->
+  <tpl:Attachments>
+    <tpl:AttachmentsHeader>
+      <div id="attachments">
+      <h3>{{tpl:lang Attachments}}</h3>
+      <ul>
+    </tpl:AttachmentsHeader>
+      <li class="{{tpl:AttachmentType}}">
+        <tpl:AttachmentIf is_mp3="1">
+          {{tpl:include src="_mp3_player.html"/}} - 
+        </tpl:AttachmentIf>
+        <tpl:AttachmentIf is_flv="1">
+	     {{tpl:include src="_flv_player.html"/}}
+	   </tpl:AttachmentIf>
+	   <tpl:AttachmentIf is_flv="0">
+	   	<a href="{{tpl:AttachmentURL}}"
+		title="{{tpl:AttachmentFileName}} ({{tpl:AttachmentSize}})">{{tpl:AttachmentTitle}}</a>
+        </tpl:AttachmentIf>
+      </li>
+    <tpl:AttachmentsFooter>
+      </ul>
+      </div>
+    </tpl:AttachmentsFooter>
+  </tpl:Attachments>
+ 
+  <!-- # Comments -->
+  <tpl:EntryIf show_comments="1">
+    <tpl:Comments>
+    <tpl:CommentsHeader>
+      <div id="comments">
+        <h3>{{tpl:lang Comments}}</h3>
+      <dl>
+    </tpl:CommentsHeader>
+      <dt id="c{{tpl:CommentID}}" class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}"><a
+      href="#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}.</a>
+      {{tpl:lang On}} {{tpl:CommentDate}}, {{tpl:CommentTime}}
+      {{tpl:lang by}} {{tpl:CommentAuthorLink}}</dt>
+      
+      <dd class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
+      <!-- # --BEHAVIOR-- publicCommentBeforeContent -->
+      {{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
+      
+      {{tpl:CommentContent}}
+      
+      <!-- # --BEHAVIOR-- publicCommentAfterContent -->
+      {{tpl:SysBehavior behavior="publicCommentAfterContent"}}
+      </dd>
+    <tpl:CommentsFooter>
+      </dl>
+      </div>
+    </tpl:CommentsFooter>
+    </tpl:Comments>
+  </tpl:EntryIf>
+  
+  <tpl:EntryIf comments_active="1">    
+    <tpl:SysIfFormError>
+      <p class="error" id="pr">{{tpl:SysFormError}}</p>
+    </tpl:SysIfFormError>
+    
+    <tpl:SysIfCommentPublished>
+      <p class="message" id="pr">{{tpl:lang Your comment has been published.}}</p>
+    </tpl:SysIfCommentPublished>
+    
+    <tpl:SysIfCommentPending>
+      <p class="message" id="pr">{{tpl:lang Your comment has been submitted and
+      will be reviewed for publication.}}</p>
+    </tpl:SysIfCommentPending>
+    
+    <!-- # Comment form -->
+    <form action="{{tpl:EntryURL}}#pr" method="post" id="comment-form">
+      <tpl:IfCommentPreview>
+        <div id="pr">
+          <h3>{{tpl:lang Your comment}}</h3>
+          <dl>
+            <dd class="comment-preview">{{tpl:CommentPreviewContent}}</dd>
+          </dl>
+          <p class="buttons"><input type="submit" class="submit" value="{{tpl:lang send}}" /></p>
+        </div>
+      </tpl:IfCommentPreview>
+      
+      <h3>{{tpl:lang Add a comment}}</h3>
+      <fieldset>
+        <!-- # --BEHAVIOR-- publicCommentFormBeforeContent -->
+        {{tpl:SysBehavior behavior="publicCommentFormBeforeContent"}}
+        
+        <p class="field"><label for="c_name">{{tpl:lang Name or nickname}}&nbsp;:</label>
+        <input name="c_name" id="c_name" type="text" size="30" maxlength="255"
+        value="{{tpl:CommentPreviewName encode_html="1"}}" />
+        </p>
+        
+        <p class="field"><label for="c_mail">{{tpl:lang Email address}}&nbsp;:</label>
+        <input name="c_mail" id="c_mail" type="text" size="30" maxlength="255"
+        value="{{tpl:CommentPreviewEmail encode_html="1"}}" />
+        </p>
+        
+        <p class="field"><label for="c_site">{{tpl:lang Website}}
+        ({{tpl:lang optional}})&nbsp;:</label>
+        <input name="c_site" id="c_site" type="text" size="30" maxlength="255"
+        value="{{tpl:CommentPreviewSite encode_html="1"}}" />
+        </p>
+        
+        <p style="display:none"><input name="f_mail" type="text" size="30"
+        maxlength="255" value="" /></p>
+        
+        <p class="field"><label for="c_content">{{tpl:lang Comment}}&nbsp;:</label>
+        <textarea name="c_content" id="c_content" cols="35"
+        rows="7">{{tpl:CommentPreviewContent raw="1" encode_html="1"}}</textarea>
+        </p>
+        <p class="form-help">{{tpl:CommentHelp}}</p>
+        
+        <!-- # --BEHAVIOR-- publicCommentFormAfterContent -->
+        {{tpl:SysBehavior behavior="publicCommentFormAfterContent"}}
+      </fieldset>
+      
+      <fieldset>
+        <p class="buttons"><input type="submit" class="preview" name="preview" value="{{tpl:lang preview}}" />
+        <tpl:IfCommentPreview><input type="submit" class="submit" value="{{tpl:lang send}}" /></tpl:IfCommentPreview></p>
+      </fieldset>
+    </form>
+  </tpl:EntryIf>
+  
+  <!-- # Trackbacks -->
+  <tpl:EntryIf show_pings="1">
+    <div id="pings">
+    <h3>{{tpl:lang They posted on the same topic}}</h3>
+    <tpl:Pings>
+      <tpl:PingsHeader>
+      <dl>
+      </tpl:PingsHeader>
+        <dt id="c{{tpl:PingID}}" class="{{tpl:PingIfOdd}} {{tpl:PingIfFirst}}"><a href="#c{{tpl:PingID}}"
+        class="ping-number">{{tpl:PingOrderNumber}}.</a>
+        {{tpl:lang On}} {{tpl:PingDate}}, {{tpl:PingTime}}
+        {{tpl:lang by}} {{tpl:PingBlogName encode_html="1"}}</dt>
+        
+        <dd class="{{tpl:PingIfOdd}} {{tpl:PingIfFirst}}">
+        <!-- # --BEHAVIOR-- publicPingBeforeContent -->
+        {{tpl:SysBehavior behavior="publicPingBeforeContent"}}
+        
+        <p><a href="{{tpl:PingAuthorURL}}"
+        {{tpl:PingNoFollow}}>{{tpl:PingTitle encode_html="1"}}</a></p>
+        {{tpl:PingContent}}
+        
+        <!-- # --BEHAVIOR-- publicPingAfterContent -->
+        {{tpl:SysBehavior behavior="publicPingAfterContent"}}
+        </dd>
+      <tpl:PingsFooter>
+      </dl>
+      </tpl:PingsFooter>
+    </tpl:Pings>
+    </div>
+  </tpl:EntryIf>
+  
+  <tpl:EntryIf pings_active="1">
+    <p id="ping-url">{{tpl:lang Trackback URL}}&nbsp;: {{tpl:EntryPingLink}}</p>
+  </tpl:EntryIf>
+  
+  <tpl:EntryIf operator="or" comments_active="1" pings_active="1">
+  <p id="comments-feed"><a class="feed" href="{{tpl:BlogFeedURL type="atom"}}/comments/{{tpl:EntryID}}"
+  title="{{tpl:lang This post's comments Atom feed}}">{{tpl:lang This post's comments feed}}</a></p>
+  </tpl:EntryIf>
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/rss2-comments.xml
===================================================================
--- inc/public/default-templates/rss2-comments.xml	(revision 0)
+++ inc/public/default-templates/rss2-comments.xml	(revision 0)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
+<rss version="2.0"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:content="http://purl.org/rss/1.0/modules/content/"
+  xmlns:atom="http://www.w3.org/2005/Atom">
+<channel>
+  <title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}
+  - {{tpl:lang Comments}}</title>
+  <link>{{tpl:BlogURL}}</link>
+  <atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml"/>
+  <description>{{tpl:BlogDescription encode_xml="1"}}</description>
+  <language>{{tpl:BlogLanguage}}</language>
+  <pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
+  <copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
+  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
+  <generator>Dotclear</generator>
+  
+  <tpl:Comments order="desc" with_pings="1">
+  
+  <tpl:CommentIf is_ping="1">
+  <item>
+    <title>[ping] {{tpl:PingEntryTitle encode_xml="1"}} - {{tpl:PingBlogName encode_xml="1"}}</title>
+    <link>{{tpl:PingPostURL encode_xml="1"}}#c{{tpl:PingID}}</link>
+    <guid isPermaLink="false">{{tpl:PingFeedID}}</guid>
+    <pubDate>{{tpl:PingDate rfc822="1"}}</pubDate>
+    <dc:creator>{{tpl:PingBlogName encode_xml="1"}}</dc:creator>
+    
+    <description>&lt;p&gt;&lt;a href="{{tpl:PingAuthorURL encode_xml="1"}}"&gt;{{tpl:PingTitle encode_xml="1"}}&lt;/a&gt;&lt;/p&gt;
+    {{tpl:PingContent encode_xml="1"}}</description>
+  </item>
+  </tpl:CommentIf>
+  
+  <tpl:CommentIf is_ping="0">
+  <item>
+    <title>{{tpl:CommentEntryTitle encode_xml="1"}} - {{tpl:CommentAuthor encode_xml="1"}}</title>
+    <link>{{tpl:CommentPostURL encode_xml="1"}}#c{{tpl:CommentID}}</link>
+    <guid isPermaLink="false">{{tpl:CommentFeedID}}</guid>
+    <pubDate>{{tpl:CommentDate rfc822="1"}}</pubDate>
+    <dc:creator>{{tpl:CommentAuthor encode_xml="1"}}</dc:creator>
+    
+    <description>{{tpl:CommentContent absolute_urls="1" encode_xml="1"}}</description>
+  </item>
+  </tpl:CommentIf>
+  </tpl:Comments>
+  
+</channel>
+</rss>
Index: inc/public/default-templates/rss2.xml
===================================================================
--- inc/public/default-templates/rss2.xml	(revision 0)
+++ inc/public/default-templates/rss2.xml	(revision 0)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet title="XSL formatting" type="text/xsl" href="{{tpl:BlogURL}}feed/rss2/xslt" ?>
+<rss version="2.0"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+  xmlns:content="http://purl.org/rss/1.0/modules/content/"
+  xmlns:atom="http://www.w3.org/2005/Atom">
+<channel>
+  <title>{{tpl:BlogName encode_xml="1"}}{{tpl:SysFeedSubtitle encode_xml="1"}}</title>
+  <link>{{tpl:BlogURL}}</link>
+  <atom:link href="{{tpl:SysSelfURI}}" rel="self" type="application/rss+xml"/>
+  <description>{{tpl:BlogDescription encode_xml="1"}}</description>
+  <language>{{tpl:BlogLanguage}}</language>
+  <pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate>
+  <copyright>{{tpl:BlogCopyrightNotice encode_xml="1"}}</copyright>
+  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
+  <generator>Dotclear</generator>
+  
+  <tpl:Entries>
+  
+  <item>
+    <title>{{tpl:EntryTitle encode_xml="1"}}</title>
+    <link>{{tpl:EntryURL}}</link>
+    <guid isPermaLink="false">{{tpl:EntryFeedID}}</guid>
+    <pubDate>{{tpl:EntryDate rfc822="1"}}</pubDate>
+    <dc:creator>{{tpl:EntryAuthorCommonName encode_xml="1"}}</dc:creator>
+    <tpl:EntryIf has_category="1">
+    <category>{{tpl:EntryCategory encode_html="1"}}</category>
+    </tpl:EntryIf>
+    <tpl:EntryTags><category>{{tpl:TagID}}</category></tpl:EntryTags>
+    
+    <description>{{tpl:EntryExcerpt absolute_urls="1" encode_xml="1"}}
+    {{tpl:EntryContent absolute_urls="1" encode_xml="1"}}</description>
+    
+    <tpl:Attachments>
+      <enclosure url="{{tpl:AttachmentURL}}"
+      length="{{tpl:AttachmentSize full="1"}}" type="{{tpl:AttachmentMimeType}}" />
+    </tpl:Attachments>
+    
+    <tpl:EntryIf comments_active="1">
+      <comments>{{tpl:EntryURL}}#comment-form</comments>
+      <wfw:comment>{{tpl:EntryURL}}#comment-form</wfw:comment>
+      <wfw:commentRss>{{tpl:BlogFeedURL}}/comments/{{tpl:EntryID}}</wfw:commentRss>
+    </tpl:EntryIf>
+  </item>
+  </tpl:Entries>
+  
+</channel>
+</rss>
Index: inc/public/default-templates/rss2.xsl
===================================================================
--- inc/public/default-templates/rss2.xsl	(revision 0)
+++ inc/public/default-templates/rss2.xsl	(revision 0)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+xmlns:content="http://purl.org/rss/1.0/modules/content/"
+xmlns="http://www.w3.org/1999/xhtml">
+
+<xsl:output method="html"/>
+
+<xsl:template match="/">
+<html>
+  <head>
+    <title>{{tpl:lang Subscribe to}} <xsl:value-of select="/rss/channel/title"/></title>
+    <style type="text/css">
+    <![CDATA[
+    body {
+      font: 80% Verdana,Arial,sans-serif;
+      margin: 20px 0;
+      padding: 0 0;
+      background: #fff;
+      color: #000;
+    }
+    a { color: #039; }
+    h1, h2 { font-family: Arial,sans-serif; }
+    h1 { font-size: 160%; margin: 0; }
+    h2 { font-size: 140%; font-weight: bold; margin: 0.5em 0 0.2em 0; }
+    h2 a { text-decoration: none; }
+    p { margin: 0 0 0.5em 0; }
+    #page {
+      margin: 0 80px;
+    }
+    #top {
+      background: #036;
+      padding : 1em;
+      color: #fff;
+    }
+    #top a {
+      color: #fff;
+      text-decoration: none;
+    }
+    #what {
+      padding: 1em;
+      background: #eee;
+      border-bottom: 1px solid #000;
+      font-size: 80%;
+    }
+    #what p {
+      margin: 0 0 0.5em 0;
+    }
+    #footer {
+      border-top: 1px solid #000;
+    }
+    #items {
+      background: #fff;
+      color: inherit;
+    }
+    #items div {
+      margin: 0 0 1em 0;
+    }
+    ]]>
+    </style>
+    <script type="text/javascript"><![CDATA[
+    window.onload = function() {
+      document.getElementById('feedurl').value = window.location.href;
+      
+      // Ugly but works ;)
+      var c = document.getElementsByTagName('div');
+      var t = '';
+      for (var i=0; c.length-i != 0; i++) {
+        if (c[i].className == 'item-content') {
+          if (c[i].textContent) {
+            t = c[i].textContent;
+          } else if (c[i].innerText) {
+            t = c[i].innerText;
+          } else {
+            t = '';
+          }
+          
+          if (t) { c[i].innerHTML = t; }
+        }
+      }
+    };
+    ]]></script>
+  </head>
+  <body>
+    <div id="page">
+      <div id="top">
+        <h1><a href="{/rss/channel/link}"><xsl:value-of select="/rss/channel/title"/></a></h1>
+        <p><xsl:value-of select="/rss/channel/description"/></p>
+      </div>
+      <div id="what">
+      <h3>{{tpl:lang What is an RSS feed?}}</h3>
+      <p>{{tpl:lang RSS feed is a free blog summary. It provides content
+      (either posts or comments) or  summaries of content, together with links
+      to the full versions, and other metadata. The last published items may
+      then be read by your favorite RSS
+      <a href="http://en.wikipedia.org/wiki/Aggregator">aggregator</a>.}}</p>
+      <h3>{{tpl:lang Subscribe}}</h3>
+      <p>{{tpl:lang Simply copy the following URL into your aggregator:}}</p>
+      <p><input type="text" size="60" value="" id="feedurl" /></p>
+      </div>
+      <div id="items">
+        <xsl:apply-templates select="//item"/>
+      </div>
+      <div id="footer">
+        <p><xsl:value-of select="/rss/channel/copyright"/></p>
+      </div>
+    </div>
+  </body>
+</html>
+</xsl:template>
+
+<!-- Item template -->
+<xsl:template match="item">
+  <div>
+    <h2><a href="{link}"><xsl:value-of select="title"/></a></h2>
+    <div class="item-content"><xsl:value-of select="description" /></div>
+  </div>
+</xsl:template>
+
+</xsl:stylesheet>
Index: inc/public/default-templates/search.html
===================================================================
--- inc/public/default-templates/search.html	(revision 0)
+++ inc/public/default-templates/search.html	(revision 0)
@@ -0,0 +1,153 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
+  
+  <title>{{tpl:lang Search}} - {{tpl:SysSearchString encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Search}} - {{tpl:SysSearchString encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
+  
+  <tpl:Entries no_content="1">
+    <tpl:EntriesHeader>
+      <tpl:Pagination>
+        <tpl:PaginationIf end="0">
+        <link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
+        </tpl:PaginationIf>
+        
+        <tpl:PaginationIf start="0">
+        <link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
+        </tpl:PaginationIf>
+      </tpl:Pagination>
+    </tpl:EntriesHeader>
+    
+    <link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
+  </tpl:Entries>
+  
+  <link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-search">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  
+  <div id="content-info">
+    <h2>{{tpl:lang Search}}</h2>
+    <tpl:SysIf search_count="==0">
+      <p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned no result."}}</p>
+    </tpl:SysIf>
+    <tpl:SysIf search_count="==1">
+      <p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> result."}}</p>
+    </tpl:SysIf>
+    <tpl:SysIf search_count="&gt;1">
+      <p>{{tpl:SysSearchString encode_html="1" string="Your search for <em>%1$s</em> returned <strong>%2$s</strong> results."}}</p>
+    </tpl:SysIf>
+  </div>
+  
+  <tpl:Entries>
+    <div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" xml:lang="{{tpl:EntryLang}}">
+    <!-- # New day date -->
+    <tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
+    
+    <h2 class="post-title"><a
+    href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
+    
+    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
+    {{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
+    <tpl:EntryIf has_category="1">
+    - <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
+    </tpl:EntryIf>
+    </p>
+    
+    <tpl:EntryTags>
+    <tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
+    <li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
+    <tpl:TagsFooter></ul></tpl:TagsFooter>
+    </tpl:EntryTags>
+    
+    <!-- # --BEHAVIOR-- publicEntryBeforeContent -->
+    {{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
+    
+    <!-- # Entry with an excerpt -->
+    <tpl:EntryIf extended="1">
+      <div class="post-content">{{tpl:EntryExcerpt}}</div>
+      <p class="read-it"><a href="{{tpl:EntryURL}}"
+      title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue
+      reading}}</a>...</p>
+    </tpl:EntryIf>
+    
+    <!-- # Entry without excerpt -->
+    <tpl:EntryIf extended="0">
+      <div class="post-content">{{tpl:EntryContent}}</div>
+    </tpl:EntryIf>
+    
+    <!-- # --BEHAVIOR-- publicEntryAfterContent -->
+    {{tpl:SysBehavior behavior="publicEntryAfterContent"}}
+    
+    <!-- # Number of comments, trackbacks and attachments -->
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      <p class="post-info-co">
+    </tpl:EntryIf>
+    <tpl:EntryIf show_comments="1">
+      <a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
+    </tpl:EntryIf>
+    <tpl:EntryIf show_pings="1">
+      <a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf has_attachment="1">
+      <a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      </p>
+    </tpl:EntryIf>
+    </div>
+    
+    <tpl:EntriesFooter>
+      <tpl:Pagination>
+        <p class="pagination"><tpl:PaginationIf end="0"><a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171;
+        {{tpl:lang previous entries}}</a> - </tpl:PaginationIf>
+        {{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
+        <tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}}
+        &#187;</a></tpl:PaginationIf></p>
+      </tpl:Pagination>
+    </tpl:EntriesFooter>
+  </tpl:Entries>
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/tag.html
===================================================================
--- inc/public/default-templates/tag.html	(revision 0)
+++ inc/public/default-templates/tag.html	(revision 0)
@@ -0,0 +1,154 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" />
+  
+  <title>{{tpl:lang Tag}} - {{tpl:TagID}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Tag}} - {{tpl:TagID}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
+  
+  <tpl:Entries no_content="1">
+    <tpl:EntriesHeader>
+      <tpl:Pagination>
+        <tpl:PaginationIf end="0">
+        <link rel="prev" title="{{tpl:lang previous entries}}" href="{{tpl:PaginationURL offset="1"}}" />
+        </tpl:PaginationIf>
+        
+        <tpl:PaginationIf start="0">
+        <link rel="next" title="{{tpl:lang next entries}}" href="{{tpl:PaginationURL offset="-1"}}" />
+        </tpl:PaginationIf>
+      </tpl:Pagination>
+    </tpl:EntriesHeader>
+    
+    <link rel="chapter" href="{{tpl:EntryURL}}" title="{{tpl:EntryTitle encode_html="1"}}" />
+  </tpl:Entries>
+  
+  <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:TagFeedURL type="atom"}}" />
+  <link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-tag">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  
+  <div id="content-info">
+    <h2>{{tpl:lang Tag}} - {{tpl:TagID}}</h2>
+    
+    <p><a type="application/atom+xml" href="{{tpl:TagFeedURL type="atom"}}"
+    title="{{tpl:lang This tag's entries Atom feed}}" class="feed">{{tpl:lang Entries feed}}</a>
+    
+    <tpl:SysIf operator="or" comments_active="1" pings_active="1">
+    - <a type="application/atom+xml" href="{{tpl:TagFeedURL type="atom"}}/comments"
+    title="{{tpl:lang This tag's comments Atom feed}}" class="feed">{{tpl:lang Comments feed}}</a>
+    </tpl:SysIf>
+    </p>
+  </div>
+  
+  <tpl:Entries>
+    <div id="p{{tpl:EntryID}}" class="post {{tpl:EntryIfOdd}} {{tpl:EntryIfFirst}}" lang="{{tpl:EntryLang}}" xml:lang="{{tpl:EntryLang}}">
+    <!-- # New day date -->
+    <tpl:DateHeader><p class="day-date">{{tpl:EntryDate}}</p></tpl:DateHeader>
+    
+    <h2 class="post-title"><a
+    href="{{tpl:EntryURL}}">{{tpl:EntryTitle encode_html="1"}}</a></h2>
+    
+    <p class="post-info">{{tpl:lang By}} {{tpl:EntryAuthorLink}}
+    {{tpl:lang on}} {{tpl:EntryDate}}, {{tpl:EntryTime}}
+    <tpl:EntryIf has_category="1">
+    - <a href="{{tpl:EntryCategoryURL}}">{{tpl:EntryCategory encode_html="1"}}</a>
+    </tpl:EntryIf>
+    </p>
+    
+    <tpl:EntryTags>
+    <tpl:TagsHeader><ul class="post-tags"></tpl:TagsHeader>
+    <li><a href="{{tpl:TagURL}}">{{tpl:TagID}}</a></li>
+    <tpl:TagsFooter></ul></tpl:TagsFooter>
+    </tpl:EntryTags>
+    
+    <!-- # --BEHAVIOR-- publicEntryBeforeContent -->
+    {{tpl:SysBehavior behavior="publicEntryBeforeContent"}}
+    
+    <!-- # Entry with an excerpt -->
+    <tpl:EntryIf extended="1">
+      <div class="post-content">{{tpl:EntryExcerpt}}</div>
+      <p class="read-it"><a href="{{tpl:EntryURL}}"
+      title="{{tpl:lang Continue reading}} {{tpl:EntryTitle encode_html="1"}}">{{tpl:lang Continue
+      reading}}</a>...</p>
+    </tpl:EntryIf>
+    
+    <!-- # Entry without excerpt -->
+    <tpl:EntryIf extended="0">
+      <div class="post-content">{{tpl:EntryContent}}</div>
+    </tpl:EntryIf>
+    
+    <!-- # --BEHAVIOR-- publicEntryAfterContent -->
+    {{tpl:SysBehavior behavior="publicEntryAfterContent"}}
+    
+    <!-- # Number of comments, trackbacks and attachments -->
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      <p class="post-info-co">
+    </tpl:EntryIf>
+    <tpl:EntryIf show_comments="1">
+      <a href="{{tpl:EntryURL}}#comments" class="comment_count">{{tpl:EntryCommentCount}}</a>
+    </tpl:EntryIf>
+    <tpl:EntryIf show_pings="1">
+      <a href="{{tpl:EntryURL}}#pings" class="ping_count">{{tpl:EntryPingCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf has_attachment="1">
+      <a href="{{tpl:EntryURL}}#attachments" class="attach_count">{{tpl:EntryAttachmentCount}}</a></tpl:EntryIf>
+    <tpl:EntryIf operator="or" show_comments="1" show_pings="1" has_attachment="1">
+      </p>
+    </tpl:EntryIf>
+    </div>
+    
+    <tpl:EntriesFooter>
+      <tpl:Pagination>
+        <p class="pagination"><tpl:PaginationIf end="0"><a href="{{tpl:PaginationURL offset="+1"}}" class="prev">&#171;
+        {{tpl:lang previous entries}}</a> - </tpl:PaginationIf>
+        {{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}}
+        <tpl:PaginationIf start="0"> - <a href="{{tpl:PaginationURL offset="-1"}}" class="next">{{tpl:lang next entries}}
+        &#187;</a></tpl:PaginationIf></p>
+      </tpl:Pagination>
+    </tpl:EntriesFooter>
+  </tpl:Entries>
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/tags.html
===================================================================
--- inc/public/default-templates/tags.html	(revision 0)
+++ inc/public/default-templates/tags.html	(revision 0)
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="MSSmartTagsPreventParsing" content="TRUE" />
+  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" />
+  
+  <title>{{tpl:lang Tags}} - {{tpl:BlogName encode_html="1"}}</title>
+  <meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  
+  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
+  <meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:lang Tags}} - {{tpl:BlogName encode_html="1"}}" />
+  <meta name="dc.language" content="{{tpl:BlogLanguage}}" />
+  <meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
+  <meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
+  <meta name="dc.date" scheme="W3CDTF" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
+  <meta name="dc.type" content="text" />
+  <meta name="dc.format" content="text/html" />
+  
+  <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
+  <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
+  
+  <link rel="meta" type="application/xbel+xml" title="Blogroll" href="{{tpl:BlogrollXbelLink}}" />
+  
+  {{tpl:include src="_head.html"}}
+</head>
+
+<body class="dc-tags">
+<div id="page">
+{{tpl:include src="_top.html"}}
+
+<div id="wrapper">
+
+<div id="main">
+  <div id="content">
+  
+  <div id="content-info">
+    <h2>{{tpl:lang Tags}}</h2>
+  </div>
+  
+  <div class="content-inner">  
+  <ul class="tags">
+    <tpl:Tags>
+      <li><a href="{{tpl:TagURL}}" class="tag{{tpl:TagRoundPercent}}">{{tpl:TagID}}</a></li>
+    </tpl:Tags>
+    </ul>
+  </div>
+  
+  </div>
+</div> <!-- End #main -->
+
+<div id="sidebar">
+  <div id="blognav">
+    {{tpl:Widgets type="nav"}}
+  </div> <!-- End #blognav -->
+  
+  <div id="blogextra">
+    {{tpl:Widgets type="extra"}}
+  </div> <!-- End #blogextra -->
+</div>
+
+</div> <!-- End #wrapper -->
+
+{{tpl:include src="_footer.html"}}
+</div> <!-- End #page -->
+</body>
+</html>
Index: inc/public/default-templates/user_head.html
===================================================================
--- inc/public/default-templates/user_head.html	(revision 0)
+++ inc/public/default-templates/user_head.html	(revision 0)
@@ -0,0 +1,1 @@
+<!-- # This template is included at the end of _head.html template -->
Index: inc/public/lib.tpl.context.php
===================================================================
--- inc/public/lib.tpl.context.php	(revision 3874)
+++ inc/public/lib.tpl.context.php	(revision 0)
@@ -1,588 +1,435 @@
 <?php
-/**
- * @package Dotclear
- * @subpackage Public
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
-
-if (!defined('DC_RC_PATH')) {return;}
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
+if (!defined('DC_RC_PATH')) { return; }
 
 class context
 {
-    public $stack = [];
-
-    public function __set($name, $var)
-    {
-        if ($var === null) {
-            $this->pop($name);
-        } else {
-            $this->stack[$name][] = &$var;
-            if ($var instanceof record) {
-                $this->stack['cur_loop'][] = &$var;
-            }
-        }
-    }
-
-    public function __get($name)
-    {
-        if (!isset($this->stack[$name])) {
-            return;
-        }
-
-        $n = count($this->stack[$name]);
-        if ($n > 0) {
-            return $this->stack[$name][($n - 1)];
-        }
-
-        return;
-    }
-
-    public function exists($name)
-    {
-        return isset($this->stack[$name][0]);
-    }
-
-    public function pop($name)
-    {
-        if (isset($this->stack[$name])) {
-            $v = array_pop($this->stack[$name]);
-            if ($v instanceof record) {
-                array_pop($this->stack['cur_loop']);
-            }
-            unset($v);
-        }
-    }
-
-    # Loop position tests
-    public function loopPosition($start, $length = null, $even = null, $modulo = null)
-    {
-        if (!$this->cur_loop) {
-            return false;
-        }
-
-        $index = $this->cur_loop->index();
-        $size  = $this->cur_loop->count();
-
-        $test = false;
-        if ($start >= 0) {
-            $test = $index >= $start;
-            if ($length !== null) {
-                if ($length >= 0) {
-                    $test = $test && $index < $start + $length;
-                } else {
-                    $test = $test && $index < $size + $length;
-                }
-            }
-        } else {
-            $test = $index >= $size + $start;
-            if ($length !== null) {
-                if ($length >= 0) {
-                    $test = $test && $index < $size + $start + $length;
-                } else {
-                    $test = $test && $index < $size + $length;
-                }
-            }
-        }
-
-        if ($even !== null) {
-            $test = $test && $index % 2 == $even;
-        }
-
-        if ($modulo !== null) {
-            $test = $test && ($index % $modulo == 0);
-        }
-
-        return $test;
-    }
-
-    /**
-    @deprecated since version 2.11 , use tpl_context::global_filters instead
-     */
-    public static function global_filter($str,
-        $encode_xml, $remove_html, $cut_string, $lower_case, $upper_case, $encode_url, $tag = '') {
-        return self::global_filters(
-            $str,
-            [0       => null,
-                'encode_xml'  => $encode_xml,
-                'remove_html' => $remove_html,
-                'cut_string'  => $cut_string,
-                'lower_case'  => $lower_case,
-                'upper_case'  => ($upper_case == 1 ? 1 : 0),
-                'capitalize'  => ($upper_case == 2 ? 1 : 0),
-                'encode_url'  => $encode_url],
-            $tag);
-    }
-
-    private static function default_filters($filter, $str, $arg)
-    {
-        switch ($filter) {
-            case 'strip_tags':
-                return self::strip_tags($str);
-
-            case 'remove_html':
-                return preg_replace('/\s+/', ' ', self::remove_html($str));
-
-            case 'encode_xml':
-            case 'encode_html':
-                return self::encode_xml($str);
-
-            case 'cut_string':
-                return self::cut_string($str, (integer) $arg);
-
-            case 'lower_case':
-                return self::lower_case($str);
-
-            case 'capitalize':
-                return self::capitalize($str);
-
-            case 'upper_case':
-                return self::upper_case($str);
-
-            case 'encode_url':
-                return self::encode_url($str);
-        }
-        return $str;
-    }
-
-    public static function global_filters($str, $args, $tag = '')
-    {
-        $filters = [
-            'strip_tags',                             // Removes HTML tags (mono line)
-            'remove_html',                            // Removes HTML tags
-            'encode_xml', 'encode_html',              // Encode HTML entities
-            'cut_string',                             // Cut string (length in $args['cut_string'])
-            'lower_case', 'capitalize', 'upper_case', // Case transformations
-            'encode_url'                             // URL encode (as for insert in query string)
-        ];
-
-        $args[0] = &$str;
-
-        # --BEHAVIOR-- publicBeforeContentFilter
-        $res = $GLOBALS['core']->callBehavior('publicBeforeContentFilter', $GLOBALS['core'], $tag, $args);
-        $str = $args[0];
-
-        foreach ($filters as $filter) {
-            # --BEHAVIOR-- publicContentFilter
-            switch ($GLOBALS['core']->callBehavior('publicContentFilter', $GLOBALS['core'], $tag, $args, $filter)) {
-                case '1':
-                    // 3rd party filter applied and must stop
-                    break;
-                case '0':
-                default:
-                    // 3rd party filter applied and should continue
-                    // Apply default filter
-                    if ($args[$filter]) {
-                        $str = self::default_filters($filter, $str, $args[$filter]);
-                    }
-            }
-        }
-
-        # --BEHAVIOR-- publicAfterContentFilter
-        $res = $GLOBALS['core']->callBehavior('publicAfterContentFilter', $GLOBALS['core'], $tag, $args);
-        $str = $args[0];
-
-        return $str;
-    }
-
-    public static function encode_url($str)
-    {
-        return urlencode($str);
-    }
-
-    public static function cut_string($str, $l)
-    {
-        return text::cutString($str, $l);
-    }
-
-    public static function encode_xml($str)
-    {
-        return html::escapeHTML($str);
-    }
-
-    public static function remove_html($str)
-    {
-        return html::decodeEntities(html::clean($str));
-    }
-
-    public static function strip_tags($str)
-    {
-        return trim(preg_replace('/ {2,}/', ' ', str_replace(["\r", "\n", "\t"], ' ', html::clean($str))));
-    }
-
-    public static function lower_case($str)
-    {
-        return mb_strtolower($str);
-    }
-
-    public static function upper_case($str)
-    {
-        return mb_strtoupper($str);
-    }
-
-    public static function capitalize($str)
-    {
-        if ($str != '') {
-            $str[0] = mb_strtoupper($str[0]);
-        }
-        return $str;
-    }
-
-    public static function categoryPostParam(&$p)
-    {
-        $not = substr($p['cat_url'], 0, 1) == '!';
-        if ($not) {
-            $p['cat_url'] = substr($p['cat_url'], 1);
-        }
-
-        $p['cat_url'] = preg_split('/\s*,\s*/', $p['cat_url'], -1, PREG_SPLIT_NO_EMPTY);
-
-        foreach ($p['cat_url'] as &$v) {
-            if ($not) {
-                $v .= ' ?not';
-            }
-            if ($GLOBALS['_ctx']->exists('categories') && preg_match('/#self/', $v)) {
-                $v = preg_replace('/#self/', $GLOBALS['_ctx']->categories->cat_url, $v);
-            } elseif ($GLOBALS['_ctx']->exists('posts') && preg_match('/#self/', $v)) {
-                $v = preg_replace('/#self/', $GLOBALS['_ctx']->posts->cat_url, $v);
-            }
-        }
-    }
-
-    # Static methods for pagination
-    public static function PaginationNbPages()
-    {
-        global $_ctx;
-
-        if ($_ctx->pagination === null) {
-            return false;
-        }
-
-        $nb_posts = $_ctx->pagination->f(0);
-        if (($GLOBALS['core']->url->type == 'default') || ($GLOBALS['core']->url->type == 'default-page')) {
-            $nb_pages = ceil(($nb_posts - $_ctx->nb_entry_first_page) / $_ctx->nb_entry_per_page + 1);
-        } else {
-            $nb_pages = ceil($nb_posts / $_ctx->nb_entry_per_page);
-        }
-
-        return $nb_pages;
-    }
-
-    public static function PaginationPosition($offset = 0)
-    {
-        if (isset($GLOBALS['_page_number'])) {
-            $p = $GLOBALS['_page_number'];
-        } else {
-            $p = 1;
-        }
-
-        $p = $p + $offset;
-
-        $n = self::PaginationNbPages();
-        if (!$n) {
-            return $p;
-        }
-
-        if ($p > $n || $p <= 0) {
-            return 1;
-        } else {
-            return $p;
-        }
-    }
-
-    public static function PaginationStart()
-    {
-        if (isset($GLOBALS['_page_number'])) {
-            return self::PaginationPosition() == 1;
-        }
-
-        return true;
-    }
-
-    public static function PaginationEnd()
-    {
-        if (isset($GLOBALS['_page_number'])) {
-            return self::PaginationPosition() == self::PaginationNbPages();
-        }
-
-        return false;
-    }
-
-    public static function PaginationURL($offset = 0)
-    {
-        $args = $_SERVER['URL_REQUEST_PART'];
-
-        $n = self::PaginationPosition($offset);
-
-        $args = preg_replace('#(^|/)page/([0-9]+)$#', '', $args);
-
-        $url = $GLOBALS['core']->blog->url . $args;
-
-        if ($n > 1) {
-            $url = preg_replace('#/$#', '', $url);
-            $url .= '/page/' . $n;
-        }
-
-        # If search param
-        if (!empty($_GET['q'])) {
-            $s = strpos($url, '?') !== false ? '&amp;' : '?';
-            $url .= $s . 'q=' . rawurlencode($_GET['q']);
-        }
-        return $url;
-    }
-
-    # Robots policy
-    public static function robotsPolicy($base, $over)
-    {
-        $pol  = ['INDEX' => 'INDEX', 'FOLLOW' => 'FOLLOW', 'ARCHIVE' => 'ARCHIVE'];
-        $base = array_flip(preg_split('/\s*,\s*/', $base));
-        $over = array_flip(preg_split('/\s*,\s*/', $over));
-
-        foreach ($pol as $k => &$v) {
-            if (isset($base[$k]) || isset($base['NO' . $k])) {
-                $v = isset($base['NO' . $k]) ? 'NO' . $k : $k;
-            }
-            if (isset($over[$k]) || isset($over['NO' . $k])) {
-                $v = isset($over['NO' . $k]) ? 'NO' . $k : $k;
-            }
-        }
-
-        if ($pol['ARCHIVE'] == 'ARCHIVE') {
-            unset($pol['ARCHIVE']);
-        }
-
-        return implode(', ', $pol);
-    }
-
-    # Smilies static methods
-    public static function getSmilies($blog)
-    {
-        $path = [];
-        if (isset($GLOBALS['__theme'])) {
-            $path[] = $GLOBALS['__theme'];
-            if (isset($GLOBALS['__parent_theme'])) {
-                $path[] = $GLOBALS['__parent_theme'];
-            }
-        }
-        $path[]     = 'default';
-        $definition = $blog->themes_path . '/%s/smilies/smilies.txt';
-        $base_url   = $blog->settings->system->themes_url . '/%s/smilies/';
-
-        $res = [];
-
-        foreach ($path as $t) {
-            if (file_exists(sprintf($definition, $t))) {
-                $base_url = sprintf($base_url, $t);
-                return self::smiliesDefinition(sprintf($definition, $t), $base_url);
-            }
-        }
-        return false;
-    }
-
-    public static function smiliesDefinition($f, $url)
-    {
-        $def = file($f);
-
-        $res = [];
-        foreach ($def as $v) {
-            $v = trim($v);
-            if (preg_match('|^([^\t\s]*)[\t\s]+(.*)$|', $v, $matches)) {
-                $r = '/(\G|[\s]+|>)(' . preg_quote($matches[1], '/') . ')([\s]+|[<]|\Z)/ms';
-                $s = '$1<img src="' . $url . $matches[2] . '" ' .
-                    'alt="$2" class="smiley" />$3';
-                $res[$r] = $s;
-            }
-        }
-
-        return $res;
-    }
-
-    public static function addSmilies($str)
-    {
-        if (!isset($GLOBALS['__smilies']) || !is_array($GLOBALS['__smilies'])) {
-            return $str;
-        }
-
-        # Process part adapted from SmartyPants engine (J. Gruber et al.) :
-
-        $tokens = self::tokenizeHTML($str);
-        $result = '';
-        $in_pre = 0; # Keep track of when we're inside <pre> or <code> tags.
-
-        foreach ($tokens as $cur_token) {
-            if ($cur_token[0] == "tag") {
-                # Don't mess with quotes inside tags.
-                $result .= $cur_token[1];
-                if (preg_match('@<(/?)(?:pre|code|kbd|script|math)[\s>]@', $cur_token[1], $matches)) {
-                    $in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
-                }
-            } else {
-                $t = $cur_token[1];
-                if (!$in_pre) {
-                    $t = preg_replace(array_keys($GLOBALS['__smilies']), array_values($GLOBALS['__smilies']), $t);
-                }
-                $result .= $t;
-            }
-        }
-
-        return $result;
-    }
-
-    private static function tokenizeHTML($str)
-    {
-        # Function from SmartyPants engine (J. Gruber et al.)
-        #
-        #   Parameter:  String containing HTML markup.
-        #   Returns:    An array of the tokens comprising the input
-        #               string. Each token is either a tag (possibly with nested,
-        #               tags contained therein, such as <a href="<MTFoo>">, or a
-        #               run of text between tags. Each element of the array is a
-        #               two-element array; the first is either 'tag' or 'text';
-        #               the second is the actual value.
-        #
-        #
-        #   Regular expression derived from the _tokenize() subroutine in
-        #   Brad Choate's MTRegex plugin.
-        #   <http://www.bradchoate.com/past/mtregex.php>
-        #
-        $index  = 0;
-        $tokens = [];
-
-        $match = '(?s:<!(?:--.*?--\s*)+>)|' . # comment
-        '(?s:<\?.*?\?>)|' . # processing instruction
-        # regular tags
-        '(?:<[/!$]?[-a-zA-Z0-9:]+\b(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*>)';
-
-        $parts = preg_split("{($match)}", $str, -1, PREG_SPLIT_DELIM_CAPTURE);
-
-        foreach ($parts as $part) {
-            if (++$index % 2 && $part != '') {
-                $tokens[] = ['text', $part];
-            } else {
-                $tokens[] = ['tag', $part];
-            }
-
-        }
-        return $tokens;
-    }
-
-    # First post image helpers
-    public static function EntryFirstImageHelper($size, $with_category, $class = "", $no_tag = false, $content_only = false, $cat_only = false)
-    {
-        global $core, $_ctx;
-
-        try {
-            $media = new dcMedia($core);
-            $sizes = implode('|', array_keys($media->thumb_sizes)) . '|o';
-            if (!preg_match('/^' . $sizes . '$/', $size)) {
-                $size = 's';
-            }
-            $p_url  = $core->blog->settings->system->public_url;
-            $p_site = preg_replace('#^(.+?//.+?)/(.*)$#', '$1', $core->blog->url);
-            $p_root = $core->blog->public_path;
-
-            $pattern = '(?:' . preg_quote($p_site, '/') . ')?' . preg_quote($p_url, '/');
-            $pattern = sprintf('/<img.+?src="%s(.*?\.(?:jpg|jpeg|gif|png))"[^>]+/msui', $pattern);
-
-            $src = '';
-            $alt = '';
-
-            # We first look in post content
-            if (!$cat_only && $_ctx->posts) {
-                $subject = ($content_only ? '' : $_ctx->posts->post_excerpt_xhtml) . $_ctx->posts->post_content_xhtml;
-                if (preg_match_all($pattern, $subject, $m) > 0) {
-                    foreach ($m[1] as $i => $img) {
-                        if (($src = self::ContentFirstImageLookup($p_root, $img, $size)) !== false) {
-                            $dirname = str_replace('\\', '/', dirname($img));
-                            $src     = $p_url . ($dirname != '/' ? $dirname : '') . '/' . $src;
-                            if (preg_match('/alt="([^"]+)"/', $m[0][$i], $malt)) {
-                                $alt = $malt[1];
-                            }
-                            break;
-                        }
-                    }
-                }
-            }
-
-            # No src, look in category description if available
-            if (!$src && $with_category && $_ctx->posts->cat_desc) {
-                if (preg_match_all($pattern, $_ctx->posts->cat_desc, $m) > 0) {
-                    foreach ($m[1] as $i => $img) {
-                        if (($src = self::ContentFirstImageLookup($p_root, $img, $size)) !== false) {
-                            $dirname = str_replace('\\', '/', dirname($img));
-                            $src     = $p_url . ($dirname != '/' ? $dirname : '') . '/' . $src;
-                            if (preg_match('/alt="([^"]+)"/', $m[0][$i], $malt)) {
-                                $alt = $malt[1];
-                            }
-                            break;
-                        }
-                    }
-                };
-            }
-
-            if ($src) {
-                if ($no_tag) {
-                    return $src;
-                } else {
-                    return '<img alt="' . $alt . '" src="' . $src . '" class="' . $class . '" />';
-                }
-            }
-
-        } catch (Exception $e) {
-            $core->error->add($e->getMessage());
-        }
-    }
-
-    private static function ContentFirstImageLookup($root, $img, $size)
-    {
-        global $core;
-
-        # Get base name and extension
-        $info = path::info($img);
-        $base = $info['base'];
-
-        try {
-            $media = new dcMedia($core);
-            $sizes = implode('|', array_keys($media->thumb_sizes));
-            if (preg_match('/^\.(.+)_(' . $sizes . ')$/', $base, $m)) {
-                $base = $m[1];
-            }
-
-            $res = false;
-            if ($size != 'o' && file_exists($root . '/' . $info['dirname'] . '/.' . $base . '_' . $size . '.jpg')) {
-                $res = '.' . $base . '_' . $size . '.jpg';
-            } elseif ($size != 'o' && file_exists($root . '/' . $info['dirname'] . '/.' . $base . '_' . $size . '.png')) {
-                $res = '.' . $base . '_' . $size . '.png';
-            } else {
-                $f = $root . '/' . $info['dirname'] . '/' . $base;
-                if (file_exists($f . '.' . $info['extension'])) {
-                    $res = $base . '.' . $info['extension'];
-                } elseif (file_exists($f . '.jpg')) {
-                    $res = $base . '.jpg';
-                } elseif (file_exists($f . '.jpeg')) {
-                    $res = $base . '.jpeg';
-                } elseif (file_exists($f . '.png')) {
-                    $res = $base . '.png';
-                } elseif (file_exists($f . '.gif')) {
-                    $res = $base . '.gif';
-                } elseif (file_exists($f . '.JPG')) {
-                    $res = $base . '.JPG';
-                } elseif (file_exists($f . '.JPEG')) {
-                    $res = $base . '.JPEG';
-                } elseif (file_exists($f . '.PNG')) {
-                    $res = $base . '.PNG';
-                } elseif (file_exists($f . '.GIF')) {
-                    $res = $base . '.GIF';
-                }
-            }
-        } catch (Exception $e) {
-            $core->error->add($e->getMessage());
-        }
-
-        if ($res) {
-            return $res;
-        }
-        return false;
-    }
+	public $stack = array();
+	
+	public function __set($name,$var)
+	{
+		if ($var === null) {
+			$this->pop($name);
+		} else {
+			$this->stack[$name][] =& $var;
+			if ($var instanceof record) {
+				$this->stack['cur_loop'][] =& $var;
+			}
+		}
+	}
+	
+	public function __get($name)
+	{
+		if (!isset($this->stack[$name])) {
+			return null;
+		}
+		
+		$n = count($this->stack[$name]);
+		if ($n > 0) {
+			return $this->stack[$name][($n-1)];
+		}
+		
+		return null;
+	}
+	
+	public function exists($name)
+	{
+		return isset($this->stack[$name][0]);
+	}
+	
+	public function pop($name)
+	{
+		if (isset($this->stack[$name])) {
+			$v = array_pop($this->stack[$name]);
+			if ($v instanceof record) {
+				array_pop($this->stack['cur_loop']);
+			}
+			unset($v);
+		}
+	}
+	
+	# Loop position tests
+	public function loopPosition($start,$length=null,$even=null)
+	{
+		if (!$this->cur_loop) {
+			return false;
+		}
+		
+		$index = $this->cur_loop->index();
+		$size = $this->cur_loop->count();
+		
+		$test = false;
+		if ($start >= 0)
+		{
+			$test = $index >= $start;
+			if ($length !== null) {
+				if ($length >= 0) {
+					$test = $test && $index < $start + $length;
+				} else {
+					$test = $test && $index < $size + $length;
+				}
+			}
+		}
+		else
+		{
+			$test = $index >= $size + $start;
+			if ($length !== null) {
+				if ($length >= 0) {
+					$test = $test && $index < $size + $start + $length;
+				} else {
+					$test = $test && $index < $size + $length;
+				}
+			}
+		}
+		
+		if ($even !== null) {
+			$test = $test && $index%2 == $even;
+		}
+		
+		return $test;
+	}
+	
+	# Static methods
+	public static function global_filter($str,
+	$encode_xml, $remove_html, $cut_string, $lower_case, $upper_case ,$tag='')
+	{
+		$args = func_get_args();
+		array_pop($args);
+		$args[0] =& $str;
+		
+		# --BEHAVIOR-- publicBeforeContentFilter
+		$res = $GLOBALS['core']->callBehavior('publicBeforeContentFilter',$GLOBALS['core'],$tag,$args);
+		
+		if ($remove_html) {
+			$str = self::remove_html($str);
+			$str = preg_replace('/\s+/',' ',$str);
+		}
+		
+		if ($encode_xml) {
+			$str = self::encode_xml($str);
+		}
+		
+		if ($cut_string) {
+			$str = self::cut_string($str,(integer) $cut_string);
+		}
+		
+		if ($lower_case) {
+			$str = self::lower_case($str);
+		} elseif ($upper_case) {
+			$str = self::upper_case($str);
+		}
+		
+		# --BEHAVIOR-- publicAfterContentFilter
+		$res = $GLOBALS['core']->callBehavior('publicAfterContentFilter',$GLOBALS['core'],$tag,$args);
+		
+		return $str;
+	}
+	
+	
+	public static function cut_string($str,$l)
+	{
+		return text::cutString($str,$l);
+	}
+	
+	public static function encode_xml($str)
+	{
+		return html::escapeHTML($str);
+	}
+	
+	public static function remove_html($str)
+	{
+		return html::decodeEntities(html::clean($str));
+	}
+	
+	public static function lower_case($str)
+	{
+		return mb_strtolower($str);
+	}
+	
+	public static function upper_case($str)
+	{
+		return mb_strtoupper($str);
+	}
+	
+	public static function categoryPostParam(&$p)
+	{
+		$not = substr($p['cat_url'],0,1) == '!';
+		if ($not) {
+			$p['cat_url'] = substr($p['cat_url'],1);
+		}
+		
+		$p['cat_url'] = preg_split('/\s*,\s*/',$p['cat_url'],-1,PREG_SPLIT_NO_EMPTY);
+		
+		foreach ($p['cat_url'] as &$v)
+		{
+			if ($not) {
+				$v .= ' ?not';
+			}
+			if ($GLOBALS['_ctx']->exists('categories') && preg_match('/#self/',$v)) {
+				$v = preg_replace('/#self/',$GLOBALS['_ctx']->categories->cat_url,$v);
+			} elseif ($GLOBALS['_ctx']->exists('posts') && preg_match('/#self/',$v)) {
+				$v = preg_replace('/#self/',$GLOBALS['_ctx']->posts->cat_url,$v);
+			}
+		}
+	}
+	
+	# Static methods for pagination
+	public static function PaginationNbPages()
+	{
+		global $_ctx;
+		
+		if ($_ctx->pagination === null) {
+			return false;
+		}
+		
+		$nb_posts = $_ctx->pagination->f(0);
+		$nb_per_page = $_ctx->post_params['limit'][1];
+		
+		$nb_pages = ceil($nb_posts/$nb_per_page);
+		
+		return $nb_pages;
+	}
+	
+	public static function PaginationPosition($offset=0)
+	{
+		if (isset($GLOBALS['_page_number'])) {
+			$p = $GLOBALS['_page_number'];
+		} else {
+			$p = 1;
+		}
+		
+		$p = $p+$offset;
+		
+		$n = self::PaginationNbPages();
+		if (!$n) {
+			return $p;
+		}
+		
+		if ($p > $n || $p <= 0) {
+			return 1;
+		} else {
+			return $p;
+		}
+	}
+	
+	public static function PaginationStart()
+	{
+		if (isset($GLOBALS['_page_number'])) {
+			return self::PaginationPosition() == 1;
+		}
+		
+		return true;
+	}
+	
+	public static function PaginationEnd()
+	{
+		if (isset($GLOBALS['_page_number'])) {
+			return self::PaginationPosition() == self::PaginationNbPages();
+		}
+		
+		return false;
+	}
+	
+	public static function PaginationURL($offset=0)
+	{
+		$args = $_SERVER['URL_REQUEST_PART'];
+		
+		$n = self::PaginationPosition($offset);
+		
+		$args = preg_replace('#(^|/)page/([0-9]+)$#','',$args);
+		
+		$url = $GLOBALS['core']->blog->url.$args;
+		
+		if ($n > 1) {
+			$url = preg_replace('#/$#','',$url);
+			$url .= '/page/'.$n;
+		}
+		
+		# If search param
+		if (!empty($_GET['q'])) {
+			$s = strpos($url,'?') !== false ? '&amp;' : '?';
+			$url .= $s.'q='.rawurlencode($_GET['q']);
+		}
+		return $url;
+	}
+	
+	# Robots policy
+	public static function robotsPolicy($base,$over)
+	{
+		$pol = array('INDEX' => 'INDEX','FOLLOW' => 'FOLLOW', 'ARCHIVE' => 'ARCHIVE');
+		$base = array_flip(preg_split('/\s*,\s*/',$base));
+		$over = array_flip(preg_split('/\s*,\s*/',$over));
+		
+		foreach ($pol as $k => &$v)
+		{
+			if (isset($base[$k]) || isset($base['NO'.$k])) {
+				$v = isset($base['NO'.$k]) ? 'NO'.$k : $k;
+			}
+			if (isset($over[$k]) || isset($over['NO'.$k])) {
+				$v = isset($over['NO'.$k]) ? 'NO'.$k : $k;
+			}
+		}
+		
+		if ($pol['ARCHIVE'] == 'ARCHIVE') {
+			unset($pol['ARCHIVE']);
+		}
+		
+		return implode(', ',$pol);
+	}
+	
+	# Smilies static methods
+	public static function getSmilies($blog)
+	{
+		$path = array();
+		if (isset($GLOBALS['__theme'])) {
+			$path[] = $GLOBALS['__theme'];
+		}
+		$path[] = 'default';
+		$definition = $blog->themes_path.'/%s/smilies/smilies.txt';
+		$base_url = $blog->settings->system->themes_url.'/%s/smilies/';
+		
+		$res = array();
+		
+		foreach ($path as $t)
+		{
+			if (file_exists(sprintf($definition,$t))) {
+				$base_url = sprintf($base_url,$t);
+				return self::smiliesDefinition(sprintf($definition,$t),$base_url);
+			}
+		}
+		return false;
+	}
+	
+	public static function smiliesDefinition($f,$url)
+	{
+		$def = file($f);
+			
+		$res = array();
+		foreach($def as $v)
+		{
+			$v = trim($v);
+			if (preg_match('|^([^\t]*)[\t]+(.*)$|',$v,$matches))
+			{
+				$r = '/(\A|[\s]+|>)('.preg_quote($matches[1],'/').')([\s]+|[<]|\Z)/ms';
+				$s = '$1<img src="'.$url.$matches[2].'" '.
+				'alt="$2" class="smiley" />$3';
+				$res[$r] = $s;
+			}
+		}
+		
+		return $res;
+	}
+	
+	public static function addSmilies($str)
+	{
+		if (!isset($GLOBALS['__smilies']) || !is_array($GLOBALS['__smilies'])) {
+			return $str;
+		}
+		
+		return preg_replace(array_keys($GLOBALS['__smilies']),array_values($GLOBALS['__smilies']),$str);
+	}
+	
+	# First post image helpers
+	public static function EntryFirstImageHelper($size,$with_category,$class="")
+	{
+		if (!preg_match('/^sq|t|s|m|o$/',$size)) {
+			$size = 's';
+		}
+		
+		global $core, $_ctx;
+		
+		$p_url = $core->blog->settings->system->public_url;
+		$p_site = preg_replace('#^(.+?//.+?)/(.*)$#','$1',$core->blog->url);
+		$p_root = $core->blog->public_path;
+		
+		$pattern = '(?:'.preg_quote($p_site,'/').')?'.preg_quote($p_url,'/');
+		$pattern = sprintf('/<img.+?src="%s(.*?\.(?:jpg|gif|png))"[^>]+/msu',$pattern);
+		
+		$src = '';
+		$alt = '';
+		
+		# We first look in post content
+		if ($_ctx->posts)
+		{
+			$subject = $_ctx->posts->post_excerpt_xhtml.$_ctx->posts->post_content_xhtml.$_ctx->posts->cat_desc;
+			if (preg_match_all($pattern,$subject,$m) > 0)
+			{
+				foreach ($m[1] as $i => $img) {
+					if (($src = self::ContentFirstImageLookup($p_root,$img,$size)) !== false) {
+						$src = $p_url.(dirname($img) != '/' ? dirname($img) : '').'/'.$src;
+						if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) {
+							$alt = $malt[1];
+						}
+						break;
+					}
+				}
+			}
+		}
+		
+		# No src, look in category description if available
+		if (!$src && $with_category && $_ctx->categories)
+		{
+			if (preg_match_all($pattern,$_ctx->categories->cat_desc,$m) > 0)
+			{
+				foreach ($m[1] as $i => $img) {
+					if (($src = self::ContentFirstImageLookup($p_root,$img,$size)) !== false) {
+						$src = $p_url.(dirname($img) != '/' ? dirname($img) : '').'/'.$src;
+						if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) {
+							$alt = $malt[1];
+						}
+						break;
+					}
+				}
+			};
+		}
+		
+		if ($src) {
+			return '<img alt="'.$alt.'" src="'.$src.'" class="'.$class.'" />';
+		}
+	}
+	
+	private static function ContentFirstImageLookup($root,$img,$size)
+	{
+		# Get base name and extension
+		$info = path::info($img);
+		$base = $info['base'];
+		
+		if (preg_match('/^\.(.+)_(sq|t|s|m)$/',$base,$m)) {
+			$base = $m[1];
+		}
+		
+		$res = false;
+		if ($size != 'o' && file_exists($root.'/'.$info['dirname'].'/.'.$base.'_'.$size.'.jpg'))
+		{
+			$res = '.'.$base.'_'.$size.'.jpg';
+		}
+		else
+		{
+			$f = $root.'/'.$info['dirname'].'/'.$base;
+			if (file_exists($f.'.'.$info['extension'])) {
+				$res = $base.'.'.$info['extension'];
+			} elseif (file_exists($f.'.jpg')) {
+				$res = $base.'.jpg';
+			} elseif (file_exists($f.'.png')) {
+				$res = $base.'.png';
+			} elseif (file_exists($f.'.gif')) {
+				$res = $base.'.gif';
+			}
+		}
+		
+		if ($res) {
+			return $res;
+		}
+		return false;
+	}
 }
+?>
Index: inc/public/lib.urlhandlers.php
===================================================================
--- inc/public/lib.urlhandlers.php	(revision 3925)
+++ inc/public/lib.urlhandlers.php	(revision 0)
@@ -1,720 +1,638 @@
 <?php
-/**
- * @package Dotclear
- * @subpackage Public
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
-
-if (!defined('DC_RC_PATH')) {return;}
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
+if (!defined('DC_RC_PATH')) { return; }
 
 class dcUrlHandlers extends urlHandler
 {
-    public $args;
+	public $args;
+	
+	public static function p404()
+	{
+		throw new Exception ("Page not found",404);
+	}
+	
+	public static function default404($args,$type,$e)
+	{
+		if ($e->getCode() != 404) {
+			throw $e;
+		}
+		$_ctx =& $GLOBALS['_ctx'];
+		$core = $GLOBALS['core'];
+		
+		header('Content-Type: text/html; charset=UTF-8');
+		http::head(404,'Not Found');
+		$core->url->type = '404';
+		$_ctx->current_tpl = '404.html';
+		$_ctx->content_type = 'text/html';
+		
+		echo $core->tpl->getData($_ctx->current_tpl);
+		
+		# --BEHAVIOR-- publicAfterDocument
+		$core->callBehavior('publicAfterDocument',$core);
+		exit;
+	}
+	
+	protected static function getPageNumber(&$args)
+	{
+		if (preg_match('#(^|/)page/([0-9]+)$#',$args,$m)) {
+			$n = (integer) $m[2];
+			if ($n > 0) {
+				$args = preg_replace('#(^|/)page/([0-9]+)$#','',$args);
+				return $n;
+			}
+		}
+		
+		return false;
+	}
+	
+	protected static function serveDocument($tpl,$content_type='text/html',$http_cache=true,$http_etag=true)
+	{
+		$_ctx =& $GLOBALS['_ctx'];
+		$core =& $GLOBALS['core'];
+		
+		if ($_ctx->nb_entry_per_page === null) {
+			$_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_page;
+		}
+		
+		$tpl_file = $core->tpl->getFilePath($tpl);
+		
+		if (!$tpl_file) {
+			throw new Exception('Unable to find template ');
+		}
+		
+		$result = new ArrayObject;
+		
+		$_ctx->current_tpl = $tpl;
+		$_ctx->content_type = $content_type;
+		$_ctx->http_cache = $http_cache;
+		$_ctx->http_etag = $http_etag;
+		$core->callBehavior('urlHandlerBeforeGetData',$_ctx);
+		
+		if ($_ctx->http_cache) {
+			$GLOBALS['mod_files'][] = $tpl_file;
+			http::cache($GLOBALS['mod_files'],$GLOBALS['mod_ts']);
+		}
 
-    public function getURLFor($type, $value = '')
-    {
-        $core = &$GLOBALS['core'];
-        $url  = $core->callBehavior("publicGetURLFor", $type, $value);
-        if (!$url) {
-            $url = $this->getBase($type);
-            if ($value) {
-                if ($url) {
-                    $url .= '/';
-                }
-                $url .= $value;
-            }
-        }
-        return $url;
-    }
-
-    public function register($type, $url, $representation, $handler)
-    {
-        $core = &$GLOBALS['core'];
-        $t    = new ArrayObject([$type, $url, $representation, $handler]);
-        $core->callBehavior("publicRegisterURL", $t);
-        parent::register($t[0], $t[1], $t[2], $t[3]);
-    }
-
-    public static function p404()
-    {
-        throw new Exception("Page not found", 404);
-    }
-
-    public static function default404($args, $type, $e)
-    {
-        if ($e->getCode() != 404) {
-            throw $e;
-        }
-        $_ctx = &$GLOBALS['_ctx'];
-        $core = $GLOBALS['core'];
-
-        header('Content-Type: text/html; charset=UTF-8');
-        http::head(404, 'Not Found');
-        $core->url->type    = '404';
-        $_ctx->current_tpl  = '404.html';
-        $_ctx->content_type = 'text/html';
-
-        echo $core->tpl->getData($_ctx->current_tpl);
-
-        # --BEHAVIOR-- publicAfterDocument
-        $core->callBehavior('publicAfterDocument', $core);
-        exit;
-    }
-
-    protected static function getPageNumber(&$args)
-    {
-        if (preg_match('#(^|/)page/([0-9]+)$#', $args, $m)) {
-            $n = (integer) $m[2];
-            if ($n > 0) {
-                $args = preg_replace('#(^|/)page/([0-9]+)$#', '', $args);
-                return $n;
-            }
-        }
-
-        return false;
-    }
-
-    protected static function serveDocument($tpl, $content_type = 'text/html', $http_cache = true, $http_etag = true)
-    {
-        $_ctx = &$GLOBALS['_ctx'];
-        $core = &$GLOBALS['core'];
-
-        if ($_ctx->nb_entry_per_page === null) {
-            $_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_page;
-        }
-        if ($_ctx->nb_entry_first_page === null) {
-            $_ctx->nb_entry_first_page = $_ctx->nb_entry_per_page;
-        }
-
-        $tpl_file = $core->tpl->getFilePath($tpl);
-
-        if (!$tpl_file) {
-            throw new Exception('Unable to find template ');
-        }
-
-        $result = new ArrayObject;
-
-        $_ctx->current_tpl  = $tpl;
-        $_ctx->content_type = $content_type;
-        $_ctx->http_cache   = $http_cache;
-        $_ctx->http_etag    = $http_etag;
-        $core->callBehavior('urlHandlerBeforeGetData', $_ctx);
-
-        if ($_ctx->http_cache) {
-            $GLOBALS['mod_files'][] = $tpl_file;
-            http::cache($GLOBALS['mod_files'], $GLOBALS['mod_ts']);
-        }
-
-        header('Content-Type: ' . $_ctx->content_type . '; charset=UTF-8');
-
-        // Additional headers
-        $headers = new ArrayObject;
-        if ($core->blog->settings->system->prevents_clickjacking) {
-            if ($_ctx->exists('xframeoption')) {
-                $url    = parse_url($_ctx->xframeoption);
-                $header = sprintf('X-Frame-Options: %s',
-                    is_array($url) ? ("ALLOW-FROM " . $url['scheme'] . '://' . $url['host']) : 'SAMEORIGIN');
-            } else {
-                                                         // Prevents Clickjacking as far as possible
-                $header = 'X-Frame-Options: SAMEORIGIN'; // FF 3.6.9+ Chrome 4.1+ IE 8+ Safari 4+ Opera 10.5+
-            }
-            $headers[] = $header;
-        }
-        # --BEHAVIOR-- urlHandlerServeDocumentHeaders
-        $core->callBehavior('urlHandlerServeDocumentHeaders', $headers);
-
-        // Send additional headers if any
-        foreach ($headers as $header) {
-            header($header);
-        }
-
-        $result['content']      = $core->tpl->getData($_ctx->current_tpl);
-        $result['content_type'] = $_ctx->content_type;
-        $result['tpl']          = $_ctx->current_tpl;
-        $result['blogupddt']    = $core->blog->upddt;
-        $result['headers']      = $headers;
-
-        # --BEHAVIOR-- urlHandlerServeDocument
-        $core->callBehavior('urlHandlerServeDocument', $result);
-
-        if ($_ctx->http_cache && $_ctx->http_etag) {
-            http::etag($result['content'], http::getSelfURI());
-        }
-        echo $result['content'];
-    }
-
-    public function getDocument()
-    {
-        $core = &$GLOBALS['core'];
-
-        $type = $args = '';
-
-        if ($this->mode == 'path_info') {
-            $part = substr($_SERVER['PATH_INFO'], 1);
-        } else {
-            $part = '';
-
-            $qs = $this->parseQueryString();
-
-            # Recreates some _GET and _REQUEST pairs
-            if (!empty($qs)) {
-                foreach ($_GET as $k => $v) {
-                    if (isset($_REQUEST[$k])) {
-                        unset($_REQUEST[$k]);
-                    }
-                }
-                $_GET     = $qs;
-                $_REQUEST = array_merge($qs, $_REQUEST);
-
-                foreach ($qs as $k => $v) {
-                    if ($v === null) {
-                        $part = $k;
-                        unset($_GET[$k]);
-                        unset($_REQUEST[$k]);
-                    }
-                    break;
-                }
-            }
-        }
-
-        $_SERVER['URL_REQUEST_PART'] = $part;
-
-        $this->getArgs($part, $type, $this->args);
-
-        # --BEHAVIOR-- urlHandlerGetArgsDocument
-        $core->callBehavior('urlHandlerGetArgsDocument', $this);
-
-        if (!$type) {
-            $this->type = 'default';
-            $this->callDefaultHandler($this->args);
-        } else {
-            $this->type = $type;
-            $this->callHandler($type, $this->args);
-        }
-    }
-
-    public static function home($args)
-    {
-        $n = self::getPageNumber($args);
-
-        if ($args && !$n) {
-            # "Then specified URL went unrecognized by all URL handlers and
-            # defaults to the home page, but is not a page number.
-            self::p404();
-        } else {
-            $_ctx = &$GLOBALS['_ctx'];
-            $core = &$GLOBALS['core'];
-
-            if ($n) {
-                $GLOBALS['_page_number'] = $n;
-                $core->url->type         = $n > 1 ? 'default-page' : 'default';
-            }
-
-            if (empty($_GET['q'])) {
-                if ($core->blog->settings->system->nb_post_for_home !== null) {
-                    $_ctx->nb_entry_first_page = $core->blog->settings->system->nb_post_for_home;
-                }
-                self::serveDocument('home.html');
-                $core->blog->publishScheduledEntries();
-            } else {
-                self::search();
-            }
-        }
-    }
-
-    public static function search()
-    {
-        $_ctx = &$GLOBALS['_ctx'];
-        $core = &$GLOBALS['core'];
-
-        if ($core->blog->settings->system->no_search) {
-
-            # Search is disabled for this blog.
-            self::p404();
-
-        } else {
-
-            $core->url->type = 'search';
-
-            $GLOBALS['_search'] = !empty($_GET['q']) ? html::escapeHTML(rawurldecode($_GET['q'])) : '';
-            if ($GLOBALS['_search']) {
-                $params = new ArrayObject(['search' => $GLOBALS['_search']]);
-                $core->callBehavior('publicBeforeSearchCount', $params);
-                $GLOBALS['_search_count'] = $core->blog->getPosts($params, true)->f(0);
-            }
-
-            self::serveDocument('search.html');
-        }
-    }
-
-    public static function lang($args)
-    {
-        $_ctx = &$GLOBALS['_ctx'];
-        $core = &$GLOBALS['core'];
-
-        $n      = self::getPageNumber($args);
-        $params = new ArrayObject([
-            'lang' => $args]);
-
-        $core->callBehavior('publicLangBeforeGetLangs', $params, $args);
-
-        $_ctx->langs = $core->blog->getLangs($params);
-
-        if ($_ctx->langs->isEmpty()) {
-            # The specified language does not exist.
-            self::p404();
-        } else {
-            if ($n) {
-                $GLOBALS['_page_number'] = $n;
-            }
-            $_ctx->cur_lang = $args;
-            self::home(null);
-        }
-    }
-
-    public static function category($args)
-    {
-        $_ctx = &$GLOBALS['_ctx'];
-        $core = &$GLOBALS['core'];
-
-        $n = self::getPageNumber($args);
-
-        if ($args == '' && !$n) {
-            # No category was specified.
-            self::p404();
-        } else {
-            $params = new ArrayObject([
-                'cat_url'       => $args,
-                'post_type'     => 'post',
-                'without_empty' => false]);
-
-            $core->callBehavior('publicCategoryBeforeGetCategories', $params, $args);
-
-            $_ctx->categories = $core->blog->getCategories($params);
-
-            if ($_ctx->categories->isEmpty()) {
-                # The specified category does no exist.
-                self::p404();
-            } else {
-                if ($n) {
-                    $GLOBALS['_page_number'] = $n;
-                }
-                self::serveDocument('category.html');
-            }
-        }
-    }
-
-    public static function archive($args)
-    {
-        $_ctx = &$GLOBALS['_ctx'];
-        $core = &$GLOBALS['core'];
-
-        $year = $month = $cat_url = null;
-        # Nothing or year and month
-        if ($args == '') {
-            self::serveDocument('archive.html');
-        } elseif (preg_match('|^/([0-9]{4})/([0-9]{2})$|', $args, $m)) {
-            $params = new ArrayObject([
-                'year'  => $m[1],
-                'month' => $m[2],
-                'type'  => 'month']);
-
-            $core->callBehavior('publicArchiveBeforeGetDates', $params, $args);
-
-            $_ctx->archives = $core->blog->getDates($params);
-
-            if ($_ctx->archives->isEmpty()) {
-                # There is no entries for the specified period.
-                self::p404();
-            } else {
-                self::serveDocument('archive_month.html');
-            }
-        } else {
-            # The specified URL is not a date.
-            self::p404();
-        }
-    }
-
-    public static function post($args)
-    {
-        if ($args == '') {
-            # No entry was specified.
-            self::p404();
-        } else {
-            $_ctx = &$GLOBALS['_ctx'];
-            $core = &$GLOBALS['core'];
-
-            $core->blog->withoutPassword(false);
-
-            $params = new ArrayObject([
-                'post_url' => $args]);
-
-            $core->callBehavior('publicPostBeforeGetPosts', $params, $args);
-
-            $_ctx->posts = $core->blog->getPosts($params);
-
-            $_ctx->comment_preview               = new ArrayObject();
-            $_ctx->comment_preview['content']    = '';
-            $_ctx->comment_preview['rawcontent'] = '';
-            $_ctx->comment_preview['name']       = '';
-            $_ctx->comment_preview['mail']       = '';
-            $_ctx->comment_preview['site']       = '';
-            $_ctx->comment_preview['preview']    = false;
-            $_ctx->comment_preview['remember']   = false;
-
-            $core->blog->withoutPassword(true);
-
-            if ($_ctx->posts->isEmpty()) {
-                # The specified entry does not exist.
-                self::p404();
-            } else {
-                $post_id       = $_ctx->posts->post_id;
-                $post_password = $_ctx->posts->post_password;
-
-                # Password protected entry
-                if ($post_password != '' && !$_ctx->preview) {
-                    # Get passwords cookie
-                    if (isset($_COOKIE['dc_passwd'])) {
-                        $pwd_cookie = json_decode($_COOKIE['dc_passwd']);
-                        if ($pwd_cookie === null) {
-                            $pwd_cookie = [];
-                        } else {
-                            $pwd_cookie = (array) $pwd_cookie;
-                        }
-                    } else {
-                        $pwd_cookie = [];
-                    }
-
-                    # Check for match
-                    # Note: We must prefix post_id key with '#'' in pwd_cookie array in order to avoid integer conversion
-                    # because MyArray["12345"] is treated as MyArray[12345]
-                    if ((!empty($_POST['password']) && $_POST['password'] == $post_password)
-                        || (isset($pwd_cookie['#' . $post_id]) && $pwd_cookie['#' . $post_id] == $post_password)) {
-                        $pwd_cookie['#' . $post_id] = $post_password;
-                        setcookie('dc_passwd', json_encode($pwd_cookie), 0, '/');
-                    } else {
-                        self::serveDocument('password-form.html', 'text/html', false);
-                        return;
-                    }
-                }
-
-                $post_comment =
-                isset($_POST['c_name']) && isset($_POST['c_mail']) &&
-                isset($_POST['c_site']) && isset($_POST['c_content']) &&
-                $_ctx->posts->commentsActive();
-
-                # Posting a comment
-                if ($post_comment) {
-                    # Spam trap
-                    if (!empty($_POST['f_mail'])) {
-                        http::head(412, 'Precondition Failed');
-                        header('Content-Type: text/plain');
-                        echo "So Long, and Thanks For All the Fish";
-                        # Exits immediately the application to preserve the server.
-                        exit;
-                    }
-
-                    $name    = $_POST['c_name'];
-                    $mail    = $_POST['c_mail'];
-                    $site    = $_POST['c_site'];
-                    $content = $_POST['c_content'];
-                    $preview = !empty($_POST['preview']);
-
-                    if ($content != '') {
-                        # --BEHAVIOR-- publicBeforeCommentTransform
-                        $buffer = $core->callBehavior('publicBeforeCommentTransform', $content);
-                        if ($buffer != '') {
-                            $content = $buffer;
-                        } else {
-                            if ($core->blog->settings->system->wiki_comments) {
-                                $core->initWikiComment();
-                            } else {
-                                $core->initWikiSimpleComment();
-                            }
-                            $content = $core->wikiTransform($content);
-                        }
-                        $content = $core->HTMLfilter($content);
-                    }
-
-                    $_ctx->comment_preview['content']    = $content;
-                    $_ctx->comment_preview['rawcontent'] = $_POST['c_content'];
-                    $_ctx->comment_preview['name']       = $name;
-                    $_ctx->comment_preview['mail']       = $mail;
-                    $_ctx->comment_preview['site']       = $site;
-
-                    if ($preview) {
-                        # --BEHAVIOR-- publicBeforeCommentPreview
-                        $core->callBehavior('publicBeforeCommentPreview', $_ctx->comment_preview);
-
-                        $_ctx->comment_preview['preview'] = true;
-                    } else {
-                        # Post the comment
-                        $cur                  = $core->con->openCursor($core->prefix . 'comment');
-                        $cur->comment_author  = $name;
-                        $cur->comment_site    = html::clean($site);
-                        $cur->comment_email   = html::clean($mail);
-                        $cur->comment_content = $content;
-                        $cur->post_id         = $_ctx->posts->post_id;
-                        $cur->comment_status  = $core->blog->settings->system->comments_pub ? 1 : -1;
-                        $cur->comment_ip      = http::realIP();
-
-                        $redir = $_ctx->posts->getURL();
-                        $redir .= $core->blog->settings->system->url_scan == 'query_string' ? '&' : '?';
-
-                        try
-                        {
-                            if (!text::isEmail($cur->comment_email)) {
-                                throw new Exception(__('You must provide a valid email address.'));
-                            }
-
-                            # --BEHAVIOR-- publicBeforeCommentCreate
-                            $core->callBehavior('publicBeforeCommentCreate', $cur);
-                            if ($cur->post_id) {
-                                $comment_id = $core->blog->addComment($cur);
-
-                                # --BEHAVIOR-- publicAfterCommentCreate
-                                $core->callBehavior('publicAfterCommentCreate', $cur, $comment_id);
-                            }
-
-                            if ($cur->comment_status == 1) {
-                                $redir_arg = 'pub=1';
-                            } else {
-                                $redir_arg = 'pub=0';
-                            }
-
-                            header('Location: ' . $redir . $redir_arg);
-                        } catch (Exception $e) {
-                            $_ctx->form_error = $e->getMessage();
-                            $_ctx->form_error;
-                        }
-                    }
-                }
-
-                # The entry
-                if ($_ctx->posts->trackbacksActive()) {
-                    header('X-Pingback: ' . $core->blog->url . $core->url->getURLFor("xmlrpc", $core->blog->id));
-                    header('Link: <' . $core->blog->url . $core->url->getURLFor('webmention') . '>; rel="webmention"');
-                }
-                self::serveDocument('post.html');
-            }
-        }
-    }
-
-    public static function preview($args)
-    {
-        $core = $GLOBALS['core'];
-        $_ctx = $GLOBALS['_ctx'];
-
-        if (!preg_match('#^(.+?)/([0-9a-z]{40})/(.+?)$#', $args, $m)) {
-            # The specified Preview URL is malformed.
-            self::p404();
-        } else {
-            $user_id  = $m[1];
-            $user_key = $m[2];
-            $post_url = $m[3];
-            if (!$core->auth->checkUser($user_id, null, $user_key)) {
-                # The user has no access to the entry.
-                self::p404();
-            } else {
-                $_ctx->preview = true;
-                if (defined("DC_ADMIN_URL")) {
-                    $_ctx->xframeoption = DC_ADMIN_URL;
-                }
-                self::post($post_url);
-            }
-        }
-    }
-
-    public static function feed($args)
-    {
-        $type     = null;
-        $comments = false;
-        $cat_url  = false;
-        $post_id  = null;
-        $subtitle = '';
-
-        $mime = 'application/xml';
-
-        $_ctx = &$GLOBALS['_ctx'];
-        $core = &$GLOBALS['core'];
-
-        if (preg_match('!^([a-z]{2}(-[a-z]{2})?)/(.*)$!', $args, $m)) {
-            $params = new ArrayObject(['lang' => $m[1]]);
-
-            $args = $m[3];
-
-            $core->callBehavior('publicFeedBeforeGetLangs', $params, $args);
-
-            $_ctx->langs = $core->blog->getLangs($params);
-
-            if ($_ctx->langs->isEmpty()) {
-                # The specified language does not exist.
-                self::p404();
-                return;
-            } else {
-                $_ctx->cur_lang = $m[1];
-            }
-        }
-
-        if (preg_match('#^rss2/xslt$#', $args, $m)) {
-            # RSS XSLT stylesheet
-            self::serveDocument('rss2.xsl', 'text/xml');
-            return;
-        } elseif (preg_match('#^(atom|rss2)/comments/([0-9]+)$#', $args, $m)) {
-            # Post comments feed
-            $type     = $m[1];
-            $comments = true;
-            $post_id  = (integer) $m[2];
-        } elseif (preg_match('#^(?:category/(.+)/)?(atom|rss2)(/comments)?$#', $args, $m)) {
-            # All posts or comments feed
-            $type     = $m[2];
-            $comments = !empty($m[3]);
-            if (!empty($m[1])) {
-                $cat_url = $m[1];
-            }
-        } else {
-            # The specified Feed URL is malformed.
-            self::p404();
-            return;
-        }
-
-        if ($cat_url) {
-            $params = new ArrayObject([
-                'cat_url'   => $cat_url,
-                'post_type' => 'post']);
-
-            $core->callBehavior('publicFeedBeforeGetCategories', $params, $args);
-
-            $_ctx->categories = $core->blog->getCategories($params);
-
-            if ($_ctx->categories->isEmpty()) {
-                # The specified category does no exist.
-                self::p404();
-                return;
-            }
-
-            $subtitle = ' - ' . $_ctx->categories->cat_title;
-        } elseif ($post_id) {
-            $params = new ArrayObject([
-                'post_id'   => $post_id,
-                'post_type' => '']);
-
-            $core->callBehavior('publicFeedBeforeGetPosts', $params, $args);
-
-            $_ctx->posts = $core->blog->getPosts($params);
-
-            if ($_ctx->posts->isEmpty()) {
-                # The specified post does not exist.
-                self::p404();
-                return;
-            }
-
-            $subtitle = ' - ' . $_ctx->posts->post_title;
-        }
-
-        $tpl = $type;
-        if ($comments) {
-            $tpl .= '-comments';
-            $_ctx->nb_comment_per_page = $core->blog->settings->system->nb_comment_per_feed;
-        } else {
-            $_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_feed;
-            $_ctx->short_feed_items  = $core->blog->settings->system->short_feed_items;
-        }
-        $tpl .= '.xml';
-
-        if ($type == 'atom') {
-            $mime = 'application/atom+xml';
-        }
-
-        $_ctx->feed_subtitle = $subtitle;
-
-        header('X-Robots-Tag: ' . context::robotsPolicy($core->blog->settings->system->robots_policy, ''));
-        self::serveDocument($tpl, $mime);
-        if (!$comments && !$cat_url) {
-            $core->blog->publishScheduledEntries();
-        }
-    }
-
-    public static function trackback($args)
-    {
-        if (!preg_match('/^[0-9]+$/', $args)) {
-            # The specified trackback URL is not an number
-            self::p404();
-        } else {
-            $core = &$GLOBALS['core'];
-
-            // Save locally post_id from args
-            $post_id = (integer) $args;
-
-            if (!is_array($args)) {
-                $args = [];
-            }
-
-            $args['post_id'] = $post_id;
-            $args['type']    = 'trackback';
-
-            # --BEHAVIOR-- publicBeforeReceiveTrackback
-            $core->callBehavior('publicBeforeReceiveTrackback', $core, $args);
-
-            $tb = new dcTrackback($core);
-            $tb->receiveTrackback($post_id);
-        }
-    }
-
-    public static function webmention($args)
-    {
-        $core = &$GLOBALS['core'];
-        if (!is_array($args)) {
-            $args = [];
-        }
-
-        $args['type'] = 'webmention';
-
-        # --BEHAVIOR-- publicBeforeReceiveTrackback
-        $core->callBehavior('publicBeforeReceiveTrackback', $core, $args);
-
-        $tb = new dcTrackback($core);
-        $tb->receiveWebmention();
-    }
-
-    public static function rsd($args)
-    {
-        $core = &$GLOBALS['core'];
-        http::cache($GLOBALS['mod_files'], $GLOBALS['mod_ts']);
-
-        header('Content-Type: text/xml; charset=UTF-8');
-        echo
-        '<?xml version="1.0" encoding="UTF-8"?>' . "\n" .
-        '<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">' . "\n" .
-        "<service>\n" .
-        "  <engineName>Dotclear</engineName>\n" .
-        "  <engineLink>http://www.dotclear.org/</engineLink>\n" .
-        '  <homePageLink>' . html::escapeHTML($core->blog->url) . "</homePageLink>\n";
-
-        if ($core->blog->settings->system->enable_xmlrpc) {
-            $u = sprintf(DC_XMLRPC_URL, $core->blog->url, $core->blog->id);
-
-            echo
-                "  <apis>\n" .
-                '    <api name="WordPress" blogID="1" preferred="true" apiLink="' . $u . '"/>' . "\n" .
-                '    <api name="Movable Type" blogID="1" preferred="false" apiLink="' . $u . '"/>' . "\n" .
-                '    <api name="MetaWeblog" blogID="1" preferred="false" apiLink="' . $u . '"/>' . "\n" .
-                '    <api name="Blogger" blogID="1" preferred="false" apiLink="' . $u . '"/>' . "\n" .
-                "  </apis>\n";
-        }
-
-        echo
-            "</service>\n" .
-            "</rsd>\n";
-    }
-
-    public static function xmlrpc($args)
-    {
-        $core    = &$GLOBALS['core'];
-        $blog_id = preg_replace('#^([^/]*).*#', '$1', $args);
-        $server  = new dcXmlRpc($core, $blog_id);
-        $server->serve();
-    }
+		header('Content-Type: '.$_ctx->content_type.'; charset=UTF-8');
+		$result['content'] = $core->tpl->getData($_ctx->current_tpl);
+		$result['content_type'] = $_ctx->content_type;
+		$result['tpl'] = $_ctx->current_tpl;
+		$result['blogupddt'] = $core->blog->upddt;
+		
+		# --BEHAVIOR-- urlHandlerServeDocument
+		$core->callBehavior('urlHandlerServeDocument',$result);
+		
+		if ($_ctx->http_cache && $_ctx->http_etag) {
+			http::etag($result['content'],http::getSelfURI());
+		}
+		echo $result['content'];
+	}
+	
+	public function getDocument()
+	{
+		$core =& $GLOBALS['core'];
+		
+		$type = $args = '';
+		
+		if ($this->mode == 'path_info')
+		{
+			$part = substr($_SERVER['PATH_INFO'],1);
+		}
+		else
+		{
+			$part = '';
+			
+			$qs = $this->parseQueryString();
+			
+			# Recreates some _GET and _REQUEST pairs
+			if (!empty($qs))
+			{
+				foreach ($_GET as $k => $v) {
+					if (isset($_REQUEST[$k])) {
+						unset($_REQUEST[$k]);
+					}
+				}
+				$_GET = $qs;
+				$_REQUEST = array_merge($qs,$_REQUEST);
+				
+				list($k,$v) = each($qs);
+				if ($v === null) {
+					$part = $k;
+					unset($_GET[$k]);
+					unset($_REQUEST[$k]);
+				}
+			}
+		}
+		
+		$_SERVER['URL_REQUEST_PART'] = $part;
+		
+		$this->getArgs($part,$type,$this->args);
+		
+		# --BEHAVIOR-- urlHandlerGetArgsDocument
+		$core->callBehavior('urlHandlerGetArgsDocument',$this);
+		
+		if (!$type)
+		{
+			$this->type = 'default';
+			$this->callDefaultHandler($this->args);
+		}
+		else
+		{
+			$this->type = $type;
+			$this->callHandler($type,$this->args);
+		}
+	}
+	
+	public static function home($args)
+	{
+		$n = self::getPageNumber($args);
+		
+		if ($args && !$n)
+		{
+			# "Then specified URL went unrecognized by all URL handlers and 
+			# defaults to the home page, but is not a page number.
+			self::p404();
+		}
+		else
+		{
+			$core =& $GLOBALS['core'];
+			
+			if ($n) {
+				$GLOBALS['_page_number'] = $n;
+				$core->url->type = $n > 1 ? 'default-page' : 'default';
+			}
+			
+			if (empty($_GET['q'])) {
+				self::serveDocument('home.html');
+				$core->blog->publishScheduledEntries();
+			} else {
+				self::search();
+			}
+		}
+	}
+	
+	public static function search()
+	{
+		$_ctx =& $GLOBALS['_ctx'];
+		$core =& $GLOBALS['core'];
+		
+		$core->url->type='search';
+		
+		$GLOBALS['_search'] = !empty($_GET['q']) ? rawurldecode($_GET['q']) : '';
+		if ($GLOBALS['_search']) {
+			$params = new ArrayObject(array('search' => $GLOBALS['_search']));
+			$core->callBehavior('publicBeforeSearchCount',$params);
+			$GLOBALS['_search_count'] = $core->blog->getPosts($params,true)->f(0);
+		}
+		
+		self::serveDocument('search.html');
+	}
+	
+	public static function lang($args)
+	{
+		$_ctx =& $GLOBALS['_ctx'];
+		$core =& $GLOBALS['core'];
+		
+		$n = self::getPageNumber($args);
+		
+		$params['lang'] = $args;
+		$_ctx->langs = $core->blog->getLangs($params);
+		
+		if ($_ctx->langs->isEmpty()) {
+			# The specified language does not exist.
+			self::p404();
+		}
+		else
+		{
+			if ($n) {
+				$GLOBALS['_page_number'] = $n;
+			}
+			$_ctx->cur_lang = $args;
+			self::home(null);
+		}
+	}
+	
+	public static function category($args)
+	{
+		$_ctx =& $GLOBALS['_ctx'];
+		$core =& $GLOBALS['core'];
+		
+		$n = self::getPageNumber($args);
+		
+		if ($args == '' && !$n) {
+			# No category was specified.
+			self::p404();
+		}
+		else
+		{
+			$params['cat_url'] = $args;
+			$params['post_type'] = 'post';
+			
+			$_ctx->categories = $core->blog->getCategories($params);
+			
+			if ($_ctx->categories->isEmpty()) {
+				# The specified category does no exist.
+				self::p404();
+			}
+			else
+			{
+				if ($n) {
+					$GLOBALS['_page_number'] = $n;
+				}
+				self::serveDocument('category.html');
+			}
+		}
+	}
+	
+	public static function archive($args)
+	{
+		$_ctx =& $GLOBALS['_ctx'];
+		$core =& $GLOBALS['core'];
+		
+		$year = $month = $cat_url = null;
+		# Nothing or year and month
+		if ($args == '')
+		{
+			self::serveDocument('archive.html');
+		}
+		elseif (preg_match('|^/([0-9]{4})/([0-9]{2})$|',$args,$m))
+		{
+			$params['year'] = $m[1];
+			$params['month'] = $m[2];
+			$params['type'] = 'month';
+			$_ctx->archives = $core->blog->getDates($params);
+			
+			if ($_ctx->archives->isEmpty()) {
+				# There is no entries for the specified period.
+				self::p404();
+			}
+			else
+			{
+				self::serveDocument('archive_month.html');
+			}
+		}
+		else {
+			# The specified URL is not a date.
+			self::p404();
+		}
+	}
+	
+	public static function post($args)
+	{
+		if ($args == '') {
+			# No entry was specified.
+			self::p404();
+		}
+		else
+		{
+			$_ctx =& $GLOBALS['_ctx'];
+			$core =& $GLOBALS['core'];
+			
+			$core->blog->withoutPassword(false);
+			
+			$params = new ArrayObject();
+			$params['post_url'] = $args;
+			
+			$_ctx->posts = $core->blog->getPosts($params);
+			
+			$_ctx->comment_preview = new ArrayObject();
+			$_ctx->comment_preview['content'] = '';
+			$_ctx->comment_preview['rawcontent'] = '';
+			$_ctx->comment_preview['name'] = '';
+			$_ctx->comment_preview['mail'] = '';
+			$_ctx->comment_preview['site'] = '';
+			$_ctx->comment_preview['preview'] = false;
+			$_ctx->comment_preview['remember'] = false;
+			
+			$core->blog->withoutPassword(true);
+			
+			if ($_ctx->posts->isEmpty())
+			{
+				# The specified entry does not exist.
+				self::p404();
+			}
+			else
+			{
+				$post_id = $_ctx->posts->post_id;
+				$post_password = $_ctx->posts->post_password;
+				
+				# Password protected entry
+				if ($post_password != '' && !$_ctx->preview)
+				{
+					# Get passwords cookie
+					if (isset($_COOKIE['dc_passwd'])) {
+						$pwd_cookie = unserialize($_COOKIE['dc_passwd']);
+					} else {
+						$pwd_cookie = array();
+					}
+					
+					# Check for match
+					if ((!empty($_POST['password']) && $_POST['password'] == $post_password)
+					|| (isset($pwd_cookie[$post_id]) && $pwd_cookie[$post_id] == $post_password))
+					{
+						$pwd_cookie[$post_id] = $post_password;
+						setcookie('dc_passwd',serialize($pwd_cookie),0,'/');
+					}
+					else
+					{
+						self::serveDocument('password-form.html','text/html',false);
+						return;
+					}
+				}
+				
+				$post_comment =
+					isset($_POST['c_name']) && isset($_POST['c_mail']) &&
+					isset($_POST['c_site']) && isset($_POST['c_content']) &&
+					$_ctx->posts->commentsActive();
+				
+				# Posting a comment
+				if ($post_comment)
+				{
+					# Spam trap
+					if (!empty($_POST['f_mail'])) {
+						http::head(412,'Precondition Failed');
+						header('Content-Type: text/plain');
+						echo "So Long, and Thanks For All the Fish";
+						# Exits immediately the application to preserve the server.
+						exit;
+					}
+					
+					$name = $_POST['c_name'];
+					$mail = $_POST['c_mail'];
+					$site = $_POST['c_site'];
+					$content = $_POST['c_content'];
+					$preview = !empty($_POST['preview']);
+					
+					if ($content != '')
+					{
+						if ($core->blog->settings->system->wiki_comments) {
+							$core->initWikiComment();
+						} else {
+							$core->initWikiSimpleComment();
+						}
+						$content = $core->wikiTransform($content);
+						$content = $core->HTMLfilter($content);
+					}
+					
+					$_ctx->comment_preview['content'] = $content;
+					$_ctx->comment_preview['rawcontent'] = $_POST['c_content'];
+					$_ctx->comment_preview['name'] = $name;
+					$_ctx->comment_preview['mail'] = $mail;
+					$_ctx->comment_preview['site'] = $site;
+					
+					if ($preview)
+					{
+						# --BEHAVIOR-- publicBeforeCommentPreview
+						$core->callBehavior('publicBeforeCommentPreview',$_ctx->comment_preview);
+						
+						$_ctx->comment_preview['preview'] = true;
+					}
+					else
+					{
+						# Post the comment
+						$cur = $core->con->openCursor($core->prefix.'comment');
+						$cur->comment_author = $name;
+						$cur->comment_site = html::clean($site);
+						$cur->comment_email = html::clean($mail);
+						$cur->comment_content = $content;
+						$cur->post_id = $_ctx->posts->post_id;
+						$cur->comment_status = $core->blog->settings->system->comments_pub ? 1 : -1;
+						$cur->comment_ip = http::realIP();
+						
+						$redir = $_ctx->posts->getURL();
+						$redir .= strpos($redir,'?') !== false ? '&' : '?';
+						
+						try
+						{
+							if (!text::isEmail($cur->comment_email)) {
+								throw new Exception(__('You must provide a valid email address.'));
+							}
+							
+							# --BEHAVIOR-- publicBeforeCommentCreate
+							$core->callBehavior('publicBeforeCommentCreate',$cur);
+							if ($cur->post_id) {					
+								$comment_id = $core->blog->addComment($cur);
+								
+								# --BEHAVIOR-- publicAfterCommentCreate
+								$core->callBehavior('publicAfterCommentCreate',$cur,$comment_id);
+							}
+							
+							if ($cur->comment_status == 1) {
+								$redir_arg = 'pub=1';
+							} else {
+								$redir_arg = 'pub=0';
+							}
+							
+							header('Location: '.$redir.$redir_arg);
+						}
+						catch (Exception $e)
+						{
+							$_ctx->form_error = $e->getMessage();
+							$_ctx->form_error;
+						}
+					}
+				}
+				
+				# The entry
+				self::serveDocument('post.html');
+			}
+		}
+	}
+	
+	public static function preview($args)
+	{
+		$core = $GLOBALS['core'];
+		$_ctx = $GLOBALS['_ctx'];
+		
+		if (!preg_match('#^(.+?)/([0-9a-z]{40})/(.+?)$#',$args,$m)) {
+			# The specified Preview URL is malformed.
+			self::p404();
+		}
+		else
+		{
+			$user_id = $m[1];
+			$user_key = $m[2];
+			$post_url = $m[3];
+			if (!$core->auth->checkUser($user_id,null,$user_key)) {
+				# The user has no access to the entry.
+				self::p404();
+			}
+			else
+			{
+				$_ctx->preview = true;
+				self::post($post_url);
+			}
+		}
+	}
+	
+	public static function feed($args)
+	{
+		$type = null;
+		$comments = false;
+		$cat_url = false;
+		$post_id = null;
+		$params = array();
+		$subtitle = '';
+		
+		$mime = 'application/xml';
+		
+		$_ctx =& $GLOBALS['_ctx'];
+		$core =& $GLOBALS['core'];
+		
+		if (preg_match('!^([a-z]{2}(-[a-z]{2})?)/(.*)$!',$args,$m)) {
+			$params['lang'] = $m[1];
+			$args = $m[3];
+			
+			$_ctx->langs = $core->blog->getLangs($params);
+			
+			if ($_ctx->langs->isEmpty()) {
+				# The specified language does not exist.
+				self::p404();
+				return;
+			} else {
+				$_ctx->cur_lang = $m[1];
+			}
+		}
+		
+		if (preg_match('#^rss2/xslt$#',$args,$m))
+		{
+			# RSS XSLT stylesheet
+			self::serveDocument('rss2.xsl','text/xml');
+			return;
+		}
+		elseif (preg_match('#^(atom|rss2)/comments/([0-9]+)$#',$args,$m))
+		{
+			# Post comments feed
+			$type = $m[1];
+			$comments = true;
+			$post_id = (integer) $m[2];
+		}
+		elseif (preg_match('#^(?:category/(.+)/)?(atom|rss2)(/comments)?$#',$args,$m))
+		{
+			# All posts or comments feed
+			$type = $m[2];
+			$comments = !empty($m[3]);
+			if (!empty($m[1])) {
+				$cat_url = $m[1];
+			}
+		}
+		else
+		{
+			# The specified Feed URL is malformed.
+			self::p404();
+			return;
+		}
+		
+		if ($cat_url)
+		{
+			$params['cat_url'] = $cat_url;
+			$params['post_type'] = 'post';
+			$_ctx->categories = $core->blog->getCategories($params);
+			
+			if ($_ctx->categories->isEmpty()) {
+				# The specified category does no exist.
+				self::p404();
+				return;
+			}
+			
+			$subtitle = ' - '.$_ctx->categories->cat_title;
+		}
+		elseif ($post_id)
+		{
+			$params['post_id'] = $post_id;
+			$params['post_type'] = '';
+			$_ctx->posts = $core->blog->getPosts($params);
+			
+			if ($_ctx->posts->isEmpty()) {
+				# The specified post does not exist.
+				self::p404();
+				return;
+			}
+			
+			$subtitle = ' - '.$_ctx->posts->post_title;
+		}
+		
+		$tpl = $type;
+		if ($comments) {
+			$tpl .= '-comments';
+			$_ctx->nb_comment_per_page = $core->blog->settings->system->nb_comment_per_feed;
+		} else {
+			$_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_feed;
+			$_ctx->short_feed_items = $core->blog->settings->system->short_feed_items;
+		}
+		$tpl .= '.xml';
+		
+		if ($type == 'atom') {
+			$mime = 'application/atom+xml';
+		}
+		
+		$_ctx->feed_subtitle = $subtitle;
+		
+		header('X-Robots-Tag: '.context::robotsPolicy($core->blog->settings->system->robots_policy,''));
+		self::serveDocument($tpl,$mime);
+		if (!$comments && !$cat_url) {
+			$core->blog->publishScheduledEntries();
+		}
+	}
+	
+	public static function trackback($args)
+	{
+		if (!preg_match('/^[0-9]+$/',$args)) {
+			# The specified trackback URL is not an number
+			self::p404();
+		} else {
+			$tb = new dcTrackback($GLOBALS['core']);
+			$tb->receive($args);
+		}
+	}
+	
+	public static function rsd($args)
+	{
+		$core =& $GLOBALS['core'];
+		http::cache($GLOBALS['mod_files'],$GLOBALS['mod_ts']);
+		
+		header('Content-Type: text/xml; charset=UTF-8');
+		echo
+		'<?xml version="1.0" encoding="UTF-8"?>'."\n".
+		'<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">'."\n".
+		"<service>\n".
+		"  <engineName>Dotclear</engineName>\n".
+		"  <engineLink>http://www.dotclear.org/</engineLink>\n".
+		'  <homePageLink>'.html::escapeHTML($core->blog->url)."</homePageLink>\n";
+		
+		if ($core->blog->settings->system->enable_xmlrpc)
+		{
+			$u = sprintf(DC_XMLRPC_URL,$core->blog->url,$core->blog->id);
+			
+			echo
+			"  <apis>\n".
+			'    <api name="WordPress" blogID="1" preferred="true" apiLink="'.$u.'"/>'."\n".
+			'    <api name="Movable Type" blogID="1" preferred="false" apiLink="'.$u.'"/>'."\n".
+			'    <api name="MetaWeblog" blogID="1" preferred="false" apiLink="'.$u.'"/>'."\n".
+			'    <api name="Blogger" blogID="1" preferred="false" apiLink="'.$u.'"/>'."\n".
+			"  </apis>\n";
+		}
+		
+		echo
+		"</service>\n".
+		"</rsd>\n";
+	}
+	
+	public static function xmlrpc($args)
+	{
+		$core =& $GLOBALS['core'];
+		$blog_id = preg_replace('#^([^/]*).*#','$1',$args);
+		$server = new dcXmlRpc($core,$blog_id);
+		$server->serve();
+	}
 }
+?>
Index: inc/public/prepend.php
===================================================================
--- inc/public/prepend.php	(revision 3874)
+++ inc/public/prepend.php	(revision 0)
@@ -1,58 +1,56 @@
 <?php
-/**
- * @package Dotclear
- * @subpackage Public
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
 
 if (!empty($_GET['pf'])) {
-    require dirname(__FILE__) . '/../load_plugin_file.php';
-    exit;
-}
-
-if (!empty($_GET['vf'])) {
-    require dirname(__FILE__) . '/../load_var_file.php';
-    exit;
+	require dirname(__FILE__).'/../load_plugin_file.php';
+	exit;
 }
 
 if (!isset($_SERVER['PATH_INFO'])) {
-    $_SERVER['PATH_INFO'] = '';
+	$_SERVER['PATH_INFO'] = '';
 }
 
-require_once dirname(__FILE__) . '/../prepend.php';
-require_once dirname(__FILE__) . '/rs.extension.php';
+require_once dirname(__FILE__).'/../prepend.php';
+require_once dirname(__FILE__).'/rs.extension.php';
 
 # Loading blog
 if (defined('DC_BLOG_ID')) {
-    try {
-        $core->setBlog(DC_BLOG_ID);
-    } catch (Exception $e) {
-        init_prepend_l10n();
-        __error(__('Database problem')
-            , DC_DEBUG ?
-            __('The following error was encountered while trying to read the database:') . '</p><ul><li>' . $e->getMessage() . '</li></ul>' :
-            __('Something went wrong while trying to read the database.')
-            , 620);
-    }
+	try {
+		$core->setBlog(DC_BLOG_ID);
+	} catch (Exception $e) {
+		init_prepend_l10n();
+		__error(__('Database problem')
+			,DC_DEBUG ?
+				__('The following error was encountered while trying to read the database:').'</p><ul><li>'.$e->getMessage().'</li></ul>' :
+				__('Something went wrong while trying to read the database.')
+			,20);
+	}
 }
 
 if ($core->blog->id == null) {
-    __error(__('Blog is not defined.')
-        , __('Did you change your Blog ID?')
-        , 630);
+	__error(__('Blog is not defined.')
+		,__('Did you change your Blog ID?')
+		,30);
 }
 
-if ((boolean) !$core->blog->status) {
-    $core->unsetBlog();
-    __error(__('Blog is offline.')
-        , __('This blog is offline. Please try again later.')
-        , 670);
+if ((boolean)!$core->blog->status) {
+	$core->unsetBlog();
+	__error(__('Blog is offline.')
+		,__('This blog is offline. Please try again later.')
+		,70);
 }
 
 # Loading media
 try {
-    $core->media = new dcMedia($core);
+	$core->media = new dcMedia($core);
 } catch (Exception $e) {}
 
@@ -60,28 +58,24 @@
 $_ctx = new context();
 try {
-    $core->tpl = new dcTemplate(DC_TPL_CACHE, '$core->tpl', $core);
+	$core->tpl = new dcTemplate(DC_TPL_CACHE,'$core->tpl',$core);
 } catch (Exception $e) {
-    __error(__('Can\'t create template files.')
-        , $e->getMessage()
-        , 640);
+	__error(__('Can\'t create template files.')
+		,$e->getMessage()
+		,40);
 }
 
 # Loading locales
 $_lang = $core->blog->settings->system->lang;
-$_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/', $_lang) ? $_lang : 'en';
+$_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$_lang) ? $_lang : 'en';
 
-l10n::lang($_lang);
-if (l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/date') === false && $_lang != 'en') {
-    l10n::set(dirname(__FILE__) . '/../../locales/en/date');
+if (l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/date') === false && $_lang != 'en') {
+	l10n::set(dirname(__FILE__).'/../../locales/en/date');
 }
-l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/public');
-l10n::set(dirname(__FILE__) . '/../../locales/' . $_lang . '/plugins');
-
-// Set lexical lang
-dcUtils::setlexicalLang('public', $_lang);
+l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/public');
+l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/plugins');
 
 # Loading plugins
 try {
-    $core->plugins->loadModules(DC_PLUGINS_ROOT, 'public', $_lang);
+	$core->plugins->loadModules(DC_PLUGINS_ROOT,'public',$_lang);
 } catch (Exception $e) {}
 
@@ -92,75 +86,65 @@
 # Defining theme if not defined
 if (!isset($__theme)) {
-    $__theme = $core->blog->settings->system->theme;
+	$__theme = $core->blog->settings->system->theme;
 }
 
 if (!$core->themes->moduleExists($__theme)) {
-    $__theme = $core->blog->settings->system->theme = 'default';
+	$__theme = $core->blog->settings->system->theme = 'default';
 }
 
-$__parent_theme = $core->themes->moduleInfo($__theme, 'parent');
+$__parent_theme = $core->themes->moduleInfo($__theme,'parent');
 if ($__parent_theme) {
-    if (!$core->themes->moduleExists($__parent_theme)) {
-        $__theme        = $core->blog->settings->system->theme        = 'default';
-        $__parent_theme = null;
-    }
+	if (!$core->themes->moduleExists($__parent_theme)) {
+		$__theme = $core->blog->settings->system->theme = 'default';
+		$__parent_theme = null;
+	}
 }
-
+	
 # If theme doesn't exist, stop everything
 if (!$core->themes->moduleExists($__theme)) {
-    __error(__('Default theme not found.')
-        , __('This either means you removed your default theme or set a wrong theme ' .
-            'path in your blog configuration. Please check theme_path value in ' .
-            'about:config module or reinstall default theme. (' . $__theme . ')')
-        , 650);
+	__error(__('Default theme not found.')
+		,__('This either means you removed your default theme or set a wrong theme '.
+		'path in your blog configuration. Please check theme_path value in '.
+		'about:config module or reinstall default theme. ('.$__theme.')')
+		,50);
 }
 
 # Loading _public.php file for selected theme
-$core->themes->loadNsFile($__theme, 'public');
-
-# Loading translations for selected theme
-if ($__parent_theme) {
-    $core->themes->loadModuleL10N($__parent_theme, $_lang, 'main');
-}
-$core->themes->loadModuleL10N($__theme, $_lang, 'main');
+$core->themes->loadNsFile($__theme,'public');
 
 # --BEHAVIOR-- publicPrepend
-$core->callBehavior('publicPrepend', $core);
+$core->callBehavior('publicPrepend',$core);
 
 # Prepare the HTTP cache thing
 $mod_files = get_included_files();
-$mod_ts    = [];
-$mod_ts[]  = $core->blog->upddt;
+$mod_ts = array();
+$mod_ts[] = $core->blog->upddt;
 
-$__theme_tpl_path = [
-    $core->blog->themes_path . '/' . $__theme . '/tpl'
-];
+$__theme_tpl_path = array(
+	$core->blog->themes_path.'/'.$__theme.'/tpl'
+);
 if ($__parent_theme) {
-    $__theme_tpl_path[] = $core->blog->themes_path . '/' . $__parent_theme . '/tpl';
+	$__theme_tpl_path[] = $core->blog->themes_path.'/'.$__parent_theme.'/tpl';
 }
-$tplset = $core->themes->moduleInfo($core->blog->settings->system->theme, 'tplset');
-if (!empty($tplset) && is_dir(dirname(__FILE__) . '/default-templates/' . $tplset)) {
-    $core->tpl->setPath(
-        $__theme_tpl_path,
-        dirname(__FILE__) . '/default-templates/' . $tplset,
-        $core->tpl->getPath());
-} else {
-    $core->tpl->setPath(
-        $__theme_tpl_path,
-        $core->tpl->getPath());
-}
+
+$core->tpl->setPath(
+	$__theme_tpl_path,
+	dirname(__FILE__).'/default-templates',
+	$core->tpl->getPath());
+
 $core->url->mode = $core->blog->settings->system->url_scan;
 
 try {
-    # --BEHAVIOR-- publicBeforeDocument
-    $core->callBehavior('publicBeforeDocument', $core);
-
-    $core->url->getDocument();
-
-    # --BEHAVIOR-- publicAfterDocument
-    $core->callBehavior('publicAfterDocument', $core);
+	# --BEHAVIOR-- publicBeforeDocument
+	$core->callBehavior('publicBeforeDocument',$core);
+	
+	$core->url->getDocument();
+	
+	# --BEHAVIOR-- publicAfterDocument
+	$core->callBehavior('publicAfterDocument',$core);
 } catch (Exception $e) {
-    __error($e->getMessage()
-        , __('Something went wrong while loading template file for your blog.')
-        , 660);
+	__error($e->getMessage()
+		,__('Something went wrong while loading template file for your blog.')
+		,60);
 }
+?>
Index: inc/public/rs.extension.php
===================================================================
--- inc/public/rs.extension.php	(revision 3874)
+++ inc/public/rs.extension.php	(revision 0)
@@ -1,87 +1,93 @@
 <?php
-/**
- * @package Dotclear
- * @subpackage Public
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
+if (!defined('DC_RC_PATH')) { return; }
 
-if (!defined('DC_RC_PATH')) {return;}
-
-$core->addBehavior('coreBlogGetPosts', ['rsExtendPublic', 'coreBlogGetPosts']);
-$core->addBehavior('coreBlogGetComments', ['rsExtendPublic', 'coreBlogGetComments']);
+$core->addBehavior('coreBlogGetPosts',array('rsExtendPublic','coreBlogGetPosts'));
+$core->addBehavior('coreBlogGetComments',array('rsExtendPublic','coreBlogGetComments'));
 
 class rsExtendPublic
 {
-    public static function coreBlogGetPosts($rs)
-    {
-        $rs->extend('rsExtPostPublic');
-    }
-
-    public static function coreBlogGetComments($rs)
-    {
-        $rs->extend('rsExtCommentPublic');
-    }
+	public static function coreBlogGetPosts($rs)
+	{
+		$rs->extend('rsExtPostPublic');
+	}
+	
+	public static function coreBlogGetComments($rs)
+	{
+		$rs->extend('rsExtCommentPublic');
+	}
 }
 
 class rsExtPostPublic extends rsExtPost
 {
-    public static function getContent($rs, $absolute_urls = false)
-    {
-        # Not very nice hack but it does the job :)
-        if (isset($GLOBALS['_ctx']) && $GLOBALS['_ctx']->short_feed_items === true) {
-            $_ctx = &$GLOBALS['_ctx'];
-            $c    = parent::getContent($rs, $absolute_urls);
-            $c    = context::remove_html($c);
-            $c    = context::cut_string($c, 350);
-
-            $c =
-            '<p>' . $c . '... ' .
-            '<a href="' . $rs->getURL() . '"><em>' . __('Read') . '</em> ' .
-            html::escapeHTML($rs->post_title) . '</a></p>';
-
-            return $c;
-        }
-
-        if ($rs->core->blog->settings->system->use_smilies) {
-            return self::smilies(parent::getContent($rs, $absolute_urls), $rs->core->blog);
-        }
-
-        return parent::getContent($rs, $absolute_urls);
-    }
-
-    public static function getExcerpt($rs, $absolute_urls = false)
-    {
-        if ($rs->core->blog->settings->system->use_smilies) {
-            return self::smilies(parent::getExcerpt($rs, $absolute_urls), $rs->core->blog);
-        }
-
-        return parent::getExcerpt($rs, $absolute_urls);
-    }
-
-    protected static function smilies($c, $blog)
-    {
-        if (!isset($GLOBALS['__smilies'])) {
-            $GLOBALS['__smilies'] = context::getSmilies($blog);
-        }
-        return context::addSmilies($c);
-    }
+	public static function getContent($rs,$absolute_urls=false)
+	{
+		# Not very nice hack but it does the job :)
+		if (isset($GLOBALS['_ctx']) && $GLOBALS['_ctx']->short_feed_items === true) {
+			$_ctx =& $GLOBALS['_ctx'];
+			$c = parent::getContent($rs,$absolute_urls);
+			$c = context::remove_html($c);
+			$c = context::cut_string($c,350);
+			
+			$c =
+			'<p>'.$c.'... '.
+			'<a href="'.$rs->getURL().'"><em>'.__('Read').'</em> '.
+			html::escapeHTML($rs->post_title).'</a></p>';
+			
+			return $c;
+		}
+		
+		if ($rs->core->blog->settings->system->use_smilies)
+		{
+			return self::smilies(parent::getContent($rs,$absolute_urls),$rs->core->blog);
+		}
+		
+		return parent::getContent($rs,$absolute_urls);
+	}
+	
+	public static function getExcerpt($rs,$absolute_urls=false)
+	{
+		if ($rs->core->blog->settings->system->use_smilies)
+		{
+			return self::smilies(parent::getExcerpt($rs,$absolute_urls),$rs->core->blog);
+		}
+		
+		return parent::getExcerpt($rs,$absolute_urls);
+	}
+	
+	protected static function smilies($c,$blog)
+	{
+		if (!isset($GLOBALS['__smilies'])) {
+			$GLOBALS['__smilies'] = context::getSmilies($blog);
+		}
+		return context::addSmilies($c);
+	}
 }
 
 class rsExtCommentPublic extends rsExtComment
 {
-    public static function getContent($rs, $absolute_urls = false)
-    {
-        if ($rs->core->blog->settings->system->use_smilies) {
-            $c = parent::getContent($rs, $absolute_urls);
-
-            if (!isset($GLOBALS['__smilies'])) {
-                $GLOBALS['__smilies'] = context::getSmilies($rs->core->blog);
-            }
-            return context::addSmilies($c);
-        }
-
-        return parent::getContent($rs, $absolute_urls);
-    }
+	public static function getContent($rs,$absolute_urls=false)
+	{
+		if ($rs->core->blog->settings->system->use_smilies)
+		{
+			$c = parent::getContent($rs,$absolute_urls);
+			
+			if (!isset($GLOBALS['__smilies'])) {
+				$GLOBALS['__smilies'] = context::getSmilies($rs->core->blog);
+			}
+			return context::addSmilies($c);
+		}
+		
+		return parent::getContent($rs,$absolute_urls);
+	}
 }
+?>
