Index: inc/public/class.dc.template.php
===================================================================
--- inc/public/class.dc.template.php	(revision 848)
+++ inc/public/class.dc.template.php	(revision 851)
@@ -68,17 +68,4 @@
 		$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'));
-		
 		# Entries
 		$this->addBlock('DateFooter',array($this,'DateFooter'));
@@ -95,9 +82,4 @@
 		$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('EntryContent',array($this,'EntryContent'));
 		$this->addValue('EntryDate',array($this,'EntryDate'));
@@ -458,5 +440,4 @@
 	<!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 --
@@ -473,8 +454,4 @@
 		}
 		
-		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";
@@ -483,12 +460,4 @@
 		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";
 		}
 		
@@ -851,179 +820,4 @@
 	}
 	
-	/* 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 .= $this->core->callBehavior("templatePrepareParams", 
-			array("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
-	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']));
-			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.' ""'; 
-		} 
-		
-		$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').'; ?>';
-	}
-	
 	/* Entries -------------------------------------------- */
 	/*dtd
@@ -1032,6 +826,4 @@
 	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)
@@ -1072,14 +864,4 @@
 		}
 		
-		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";
@@ -1097,12 +879,4 @@
 				'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; ".
 				"}\n";
 			}
@@ -1185,5 +959,4 @@
 	<!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)
@@ -1191,5 +964,4 @@
 	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)
 	operator	(and|or)	#IMPLIED	-- combination of conditions, if more than 1 specifiec (default: and)
@@ -1201,5 +973,4 @@
 		$if = new ArrayObject();
 		$extended = null;
-		$hascategory = null;
 		
 		$operator = isset($attr['operator']) ? $this->getOperator($attr['operator']) : '&&';
@@ -1221,14 +992,4 @@
 		}
 		
-		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'] ? '=' : '!';
@@ -1249,9 +1010,4 @@
 			$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';
 		}
 		
@@ -1430,52 +1186,4 @@
 	
 	/*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 -->
 	*/
@@ -1491,5 +1199,4 @@
 	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)
 	>
 	*/
@@ -1500,5 +1207,5 @@
 		$with_category = !empty($attr['with_category']) ? 'true' : 'false';
 		
-		return "<?php echo context::EntryFirstImageHelper('".addslashes($size)."',".$with_category.",'".addslashes($class)."'); ?>";
+		return "<?php echo context::EntryFirstImageHelper('".addslashes($size)."','".addslashes($class)."'); ?>";
 	}
 	
@@ -1529,5 +1236,4 @@
 	<!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)
 	>
@@ -1877,5 +1583,4 @@
 	<!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
@@ -1894,9 +1599,4 @@
 		
 		$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'])) {
Index: inc/public/lib.tpl.context.php
===================================================================
--- inc/public/lib.tpl.context.php	(revision 839)
+++ inc/public/lib.tpl.context.php	(revision 851)
@@ -162,26 +162,4 @@
 	}
 	
-	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()
@@ -341,5 +319,5 @@
 	
 	# First post image helpers
-	public static function EntryFirstImageHelper($size,$with_category,$class="")
+	public static function EntryFirstImageHelper($size,$class="")
 	{
 		global $core, $_ctx;
@@ -378,21 +356,4 @@
 		}
 		
-		# 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.'" />';
Index: inc/public/lib.urlhandlers.php
===================================================================
--- inc/public/lib.urlhandlers.php	(revision 848)
+++ inc/public/lib.urlhandlers.php	(revision 851)
@@ -245,39 +245,4 @@
 			$_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(array(
-				'cat_url' => $args,
-				'post_type' => 'post'));
-			
-			$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');
-			}
 		}
 	}
