Index: inc/admin/lib.dc.page.php
===================================================================
--- inc/admin/lib.dc.page.php	(revision 1462)
+++ inc/admin/lib.dc.page.php	(revision 1188)
@@ -160,5 +160,5 @@
 		if ($core->error->flag()) {
 			echo
-			'<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'.
+			'<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</p></strong>'.
 			$core->error->toHTML().
 			'</div>';
@@ -466,6 +466,4 @@
 		self::jsVar('dotclear.msg.confirm_delete_theme',
 			__('Are you sure you want to delete "%s" theme?')).
-		self::jsVar('dotclear.msg.confirm_delete_backup',
-			__('Are you sure you want to delete this backup?')).
 		self::jsVar('dotclear.msg.zip_file_content',
 			__('Zip file content')).
@@ -478,6 +476,4 @@
 		self::jsVar('dotclear.msg.confirm_change_post_format',
 			__('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')).
-		self::jsVar('dotclear.msg.confirm_change_post_format_noconvert',
-			__("Warning: post format change will not convert existing content. You will need to apply new format by yourself. Proceed anyway?")).
 		self::jsVar('dotclear.msg.load_enhanced_uploader',
 			__('Loading enhanced uploader, please wait.')).
Index: inc/admin/lib.pager.php
===================================================================
--- inc/admin/lib.pager.php	(revision 1364)
+++ inc/admin/lib.pager.php	(revision 1179)
@@ -87,5 +87,5 @@
 			html::escapeHTML($this->rs->cat_title));
 		} else {
-			$cat_title = __('(No cat)');
+			$cat_title = __('None');
 		}
 		
Index: inc/config.php.in
===================================================================
--- inc/config.php.in	(revision 1535)
+++ inc/config.php.in	(revision 1179)
@@ -50,5 +50,5 @@
 
 // Template cache directory
-define('DC_TPL_CACHE',path::real(dirname(__FILE__).'/..').'/cache');
+define('DC_TPL_CACHE',dirname(__FILE__).'/../cache');
 
 
Index: inc/core/class.dc.blog.php
===================================================================
--- inc/core/class.dc.blog.php	(revision 1429)
+++ inc/core/class.dc.blog.php	(revision 1540)
@@ -203,26 +203,22 @@
 	@param	ids		<b>mixed</b>		Comment(s) ID(s)
 	@param	del		<b>boolean</b>		If comment is delete, set this to true
-	@param	affected_posts		<b>mixed</b>		Posts(s) ID(s)
-	*/
-	public function triggerComments($ids, $del=false, $affected_posts=null)
+	*/
+	public function triggerComments($ids,$del=false)
 	{
 		$co_ids = dcUtils::cleanIds($ids);
-		$a_ids = dcUtils::cleanIds($affected_posts);
-		$a_tbs = array();
 		
 		# a) Retrieve posts affected by comments edition
-		if (empty($a_ids)) {
-			$strReq = 
-				'SELECT post_id, comment_trackback '.
-				'FROM '.$this->prefix.'comment '.
-				'WHERE comment_id'.$this->con->in($co_ids).
-				'GROUP BY post_id,comment_trackback';
-			
-			$rs = $this->con->select($strReq);
-			
-			while ($rs->fetch()) {
-				$a_ids[] = (integer) $rs->post_id;
-				$a_tbs[] = (integer) $rs->comment_trackback;
-			}
+		$strReq = 
+			'SELECT post_id, comment_trackback '.
+			'FROM '.$this->prefix.'comment '.
+			'WHERE comment_id'.$this->con->in($co_ids).
+			'GROUP BY post_id,comment_trackback';
+		
+		$rs = $this->con->select($strReq);
+		
+		$a_ids = $a_tbs = array();
+		while ($rs->fetch()) {
+			$a_ids[] = (integer) $rs->post_id;
+			$a_tbs[] = (integer) $rs->comment_trackback;
 		}
 		
@@ -259,5 +255,4 @@
 		{
 			$nb_comment = $nb_trackback = 0;
-			//$cur->nb_comment = $nb_comment;
 			foreach($b_ids as $b_key => $b_id)
 			{
@@ -510,11 +505,5 @@
 		$this->core->callBehavior('coreBeforeCategoryCreate',$this,$cur);
 		
-		$id = $this->categories()->addNode($cur,$parent);
-		# Update category's cursor
-		$rs = $this->getCategory($id);
-		if (!$rs->isEmpty()) {
-			$cur->cat_lft = $rs->cat_lft;
-			$cur->cat_rgt = $rs->cat_rgt;
-		}
+		$this->categories()->addNode($cur,$parent);
 		
 		# --BEHAVIOR-- coreAfterCategoryCreate
@@ -645,55 +634,18 @@
 	private function checkCategory($title,$url,$id=null)
 	{
-		# Let's check if URL is taken...
-		$strReq = 
-			'SELECT cat_url FROM '.$this->prefix.'category '.
-			"WHERE cat_url = '".$this->con->escape($url)."' ".
-			($id ? 'AND cat_id <> '.(integer) $id. ' ' : '').
-			"AND blog_id = '".$this->con->escape($this->id)."' ".
-			'ORDER BY cat_url DESC';
+		$strReq = 'SELECT cat_id '.
+				'FROM '.$this->prefix.'category '.
+				"WHERE cat_url = '".$this->con->escape($url)."' ".
+				"AND blog_id = '".$this->con->escape($this->id)."' ";
+		
+		if ($id !== null) {
+			$strReq .= 'AND cat_id <> '.(integer) $id.' ';
+		}
 		
 		$rs = $this->con->select($strReq);
 		
-		if (!$rs->isEmpty())
-		{
-			if ($this->con->driver() == 'mysql') {
-				$clause = "REGEXP '^".$this->con->escape($url)."[0-9]+$'";
-			} elseif ($this->con->driver() == 'pgsql') {
-				$clause = "~ '^".$this->con->escape($url)."[0-9]+$'";
-			} else {
-				$clause = "LIKE '".$this->con->escape($url)."%'";
-			}
-			$strReq = 
-				'SELECT cat_url FROM '.$this->prefix.'category '.
-				"WHERE cat_url ".$clause.' '.
-				($id ? 'AND cat_id <> '.(integer) $id. ' ' : '').
-				"AND blog_id = '".$this->con->escape($this->id)."' ".
-				'ORDER BY cat_url DESC ';
-			
-			$rs = $this->con->select($strReq);
-			$a = array();
-			while ($rs->fetch()) {
-				$a[] = $rs->cat_url;
-			}
-			
-			natsort($a);
-			$t_url = end($a);
-			
-			if (preg_match('/(.*?)([0-9]+)$/',$t_url,$m)) {
-				$i = (integer) $m[2];
-				$url = $m[1];
-			} else {
-				$i = 1;
-			}
-			
-			return $url.($i+1);
-		}
-		
-		# URL is empty?
-		if ($url == '') {
-			throw new Exception(__('Empty category URL'));
-		}
-		
-		return $url;
+		if (!$rs->isEmpty()) {
+			throw new Exception(__('Category URL must be unique.'));
+		}
 	}
 	
@@ -717,5 +669,5 @@
 		
 		# Check if title or url are unique
-		$cur->cat_url = $this->checkCategory($cur->cat_title,$cur->cat_url,$id);
+		$this->checkCategory($cur->cat_title,$cur->cat_url,$id);
 		
 		if ($cur->cat_desc !== null) {
@@ -753,4 +705,5 @@
 	- limit: Limit parameter
 	- sql_only : return the sql request instead of results. Only ids are selected
+	- exclude_id : (array) Exclude entries with given post_id
 	
 	Please note that on every cat_id or cat_url, you can add ?not to exclude
@@ -846,4 +799,8 @@
 			}
 			$strReq .= 'AND P.post_id '.$this->con->in($params['post_id']);
+		}
+		
+		if (!empty($params['exclude_id'])) {
+			$strReq .= 'AND post_id not in ('.implode(', ',$params['exclude_id']).') ';
 		}
 		
@@ -2229,19 +2186,6 @@
 		$co_ids = dcUtils::cleanIds($ids);
 		
-		if (empty($co_ids)) {
+		if (empty($ids)) {
 			throw new Exception(__('No such comment ID'));
-		}
-		
-		# Retrieve posts affected by comments edition
-		$affected_posts = array();
-		$strReq =
-			'SELECT distinct(post_id) '.
-			'FROM '.$this->prefix.'comment '.
-			'WHERE comment_id'.$this->con->in($co_ids);
-		
-		$rs = $this->con->select($strReq);
-		
-		while ($rs->fetch()) {
-			$affected_posts[] = (integer) $rs->post_id;
 		}
 		
@@ -2273,5 +2217,5 @@
 		
 		$this->con->execute($strReq);
-		$this->triggerComments($co_ids, true, $affected_posts);
+		$this->triggerComments($co_ids,true);
 		$this->triggerBlog();
 	}
Index: inc/core/class.dc.media.php
===================================================================
--- inc/core/class.dc.media.php	(revision 1381)
+++ inc/core/class.dc.media.php	(revision 1220)
@@ -30,5 +30,4 @@
 	
 	public $thumb_tp = '%s/.%s_%s.jpg';	///< <b>string</b> Thumbnail file pattern
-	public $thumb_tp_alpha = '%s/.%s_%s.png'; ///< <b>string</b> Thumbnail file pattern (with alpha layer)
 	
 	/**
@@ -299,7 +298,6 @@
 			$f->media_thumb = array();
 			$p = path::info($f->relname);
-			$alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG');
-			$thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root.'/'.$p['dirname'],$p['base'],'%s');
-			$thumb_url = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root_url.$p['dirname'],$p['base'],'%s');
+			$thumb = sprintf($this->thumb_tp,$this->root.'/'.$p['dirname'],$p['base'],'%s');
+			$thumb_url = sprintf($this->thumb_tp,$this->root_url.$p['dirname'],$p['base'],'%s');
 			
 			# Cleaner URLs
@@ -499,8 +497,7 @@
 	@param	post_id	<b>integer</b>		Post ID
 	@param	media_id	<b>integer</b>		Optionnal media ID
-	@param	return_rs	<b>boolean</b>		Whether to return a resultset (true) or an array (false, default value).
-	@return	<b>array</b> Array or ResultSet of fileItems
-	*/
-	public function getPostMedia($post_id,$media_id=null,$return_rs=false)
+	@return	<b>array</b> Array of fileItems
+	*/
+	public function getPostMedia($post_id,$media_id=null)
 	{
 		$params = array(
@@ -518,9 +515,9 @@
 			$f = $this->fileRecord($rs);
 			if ($f !== null) {
-				$res[] = $return_rs ? new ArrayObject($f) : $f;
-			}
-		}
-		
-		return $return_rs ? staticRecord::newFromArray($res) : $res;
+				$res[] = new ArrayObject($f);
+			}
+		}
+		
+		return $res;
 	}
 	
@@ -923,6 +920,5 @@
 		
 		$p = path::info($file);
-		$alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG');
-		$thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s');
+		$thumb = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s');
 		
 		try
@@ -943,5 +939,5 @@
 					$rate = ($s[0] < 100 ? 95 : ($s[0] < 600 ? 90 : 85));
 					$img->resize($s[0],$s[0],$s[1]);
-					$img->output(($alpha ? 'png' : 'jpeg'),$thumb_file,$rate);
+					$img->output('jpeg',$thumb_file,$rate);
 					$img->loadImage($file);
 				}
@@ -962,10 +958,8 @@
 		{
 			$p = path::info($file->relname);
-			$alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG');
-			$thumb_old = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s');
+			$thumb_old = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s');
 			
 			$p = path::info($newFile->relname);
-			$alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG');
-			$thumb_new = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s');
+			$thumb_new = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s');
 			
 			foreach ($this->thumb_sizes as $suffix => $s) {
@@ -980,6 +974,5 @@
 	{
 		$p = path::info($f);
-		$alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG');
-		$thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),'',$p['base'],'%s');
+		$thumb = sprintf($this->thumb_tp,'',$p['base'],'%s');
 		
 		foreach ($this->thumb_sizes as $suffix => $s) {
Index: inc/load_plugin_file.php
===================================================================
--- inc/load_plugin_file.php	(revision 1241)
+++ inc/load_plugin_file.php	(revision 1179)
@@ -86,5 +86,5 @@
 }
 
-http::$cache_max_age = (!defined('DC_CACHE_MAX_AGE') ? 604800 : DC_CACHE_MAX_AGE);
+http::$cache_max_age = 7200;
 http::cache(array_merge(array($PF),get_included_files()));
 
Index: inc/prepend.php
===================================================================
--- inc/prepend.php	(revision 1352)
+++ inc/prepend.php	(revision 1233)
@@ -123,5 +123,5 @@
 # Constants
 define('DC_ROOT',path::real(dirname(__FILE__).'/..'));
-define('DC_VERSION','2.5.3-dev');
+define('DC_VERSION','2.5.2-dev');
 define('DC_DIGESTS',dirname(__FILE__).'/digests');
 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales');
Index: inc/public/class.dc.template.php
===================================================================
--- inc/public/class.dc.template.php	(revision 1249)
+++ inc/public/class.dc.template.php	(revision 1179)
@@ -67,5 +67,4 @@
 		$this->addValue('BlogLanguage',array($this,'BlogLanguage'));
 		$this->addValue('BlogThemeURL',array($this,'BlogThemeURL'));
-		$this->addValue('BlogParentThemeURL',array($this,'BlogParentThemeURL'));
 		$this->addValue('BlogUpdateDate',array($this,'BlogUpdateDate'));
 		$this->addValue('BlogID',array($this,'BlogID'));
@@ -840,5 +839,5 @@
 	
 	/*dtd
-	<!ELEMENT tpl:BlogThemeURL - O -- Blog's current Theme URL -->
+	<!ELEMENT tpl:BlogThemeURL - O -- Blog's current Themei URL -->
 	*/
 	public function BlogThemeURL($attr)
@@ -846,14 +845,4 @@
 		$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)').'; ?>';
 	}
     
Index: inc/public/lib.tpl.context.php
===================================================================
--- inc/public/lib.tpl.context.php	(revision 1537)
+++ inc/public/lib.tpl.context.php	(revision 1179)
@@ -416,67 +416,62 @@
 		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)
+		$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)
 			{
-				$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;
+				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;
+		}
+		
+		# 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());
+			};
+		}
+		
+		if ($src) {
+			if ($no_tag) {
+				return $src;
+			} else {
+				return '<img alt="'.$alt.'" src="'.$src.'" class="'.$class.'" />';
+			}
 		}
 	}
@@ -490,41 +485,37 @@
 		$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';
-			}
-			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());
+		$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';
+		}
+		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';
+			}
 		}
 		
