Index: admin/_charte.php
===================================================================
--- admin/_charte.php	(revision 2504)
+++ admin/_charte.php	(revision 2501)
@@ -31,5 +31,4 @@
 	<script type="text/javascript" src="js/jquery/jquery.js"></script>
 	<script type="text/javascript" src="js/jquery/jquery-ui.custom.js"></script>
-	<script type="text/javascript" src="js/jquery/jquery.ui.touch-punch.js"></script>
 	<script type="text/javascript" src="js/jquery/jquery.pageTabs.js"></script>
 	<script type="text/javascript" src="js/jquery/jquery.biscuit.js"></script>
Index: admin/categories.php
===================================================================
--- admin/categories.php	(revision 2496)
+++ admin/categories.php	(revision 2464)
@@ -109,5 +109,4 @@
 	&& $rs->count()>1) {
 		$starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js');
-		$starting_script .= dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js');
 		$starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js');
 }
Index: dmin/js/jquery/jquery.ui.touch-punch.js
===================================================================
--- admin/js/jquery/jquery.ui.touch-punch.js	(revision 2495)
+++ 	(revision )
@@ -1,160 +1,0 @@
-/*!
- * jQuery UI Touch Punch 0.2.2
- *
- * Copyright 2011, Dave Furfero
- * Dual licensed under the MIT or GPL Version 2 licenses.
- *
- * Depends:
- *  jquery.ui.widget.js
- *  jquery.ui.mouse.js
- */
-(function ($) {
-
-  // Detect touch support
-  $.support.touch = 'ontouchend' in document;
-
-  // Ignore browsers without touch support
-  if (!$.support.touch) {
-    return;
-  }
-
-  var mouseProto = $.ui.mouse.prototype,
-      _mouseInit = mouseProto._mouseInit,
-      touchHandled;
-
-  /**
-   * Simulate a mouse event based on a corresponding touch event
-   * @param {Object} event A touch event
-   * @param {String} simulatedType The corresponding mouse event
-   */
-  function simulateMouseEvent (event, simulatedType) {
-
-    // Ignore multi-touch events
-    if (event.originalEvent.touches.length > 1) {
-      return;
-    }
-
-    event.preventDefault();
-
-    var touch = event.originalEvent.changedTouches[0],
-        simulatedEvent = document.createEvent('MouseEvents');
-    
-    // Initialize the simulated mouse event using the touch event's coordinates
-    simulatedEvent.initMouseEvent(
-      simulatedType,    // type
-      true,             // bubbles                    
-      true,             // cancelable                 
-      window,           // view                       
-      1,                // detail                     
-      touch.screenX,    // screenX                    
-      touch.screenY,    // screenY                    
-      touch.clientX,    // clientX                    
-      touch.clientY,    // clientY                    
-      false,            // ctrlKey                    
-      false,            // altKey                     
-      false,            // shiftKey                   
-      false,            // metaKey                    
-      0,                // button                     
-      null              // relatedTarget              
-    );
-
-    // Dispatch the simulated event to the target element
-    event.target.dispatchEvent(simulatedEvent);
-  }
-
-  /**
-   * Handle the jQuery UI widget's touchstart events
-   * @param {Object} event The widget element's touchstart event
-   */
-  mouseProto._touchStart = function (event) {
-
-    var self = this;
-
-    // Ignore the event if another widget is already being handled
-    if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
-      return;
-    }
-
-    // Set the flag to prevent other widgets from inheriting the touch event
-    touchHandled = true;
-
-    // Track movement to determine if interaction was a click
-    self._touchMoved = false;
-
-    // Simulate the mouseover event
-    simulateMouseEvent(event, 'mouseover');
-
-    // Simulate the mousemove event
-    simulateMouseEvent(event, 'mousemove');
-
-    // Simulate the mousedown event
-    simulateMouseEvent(event, 'mousedown');
-  };
-
-  /**
-   * Handle the jQuery UI widget's touchmove events
-   * @param {Object} event The document's touchmove event
-   */
-  mouseProto._touchMove = function (event) {
-
-    // Ignore event if not handled
-    if (!touchHandled) {
-      return;
-    }
-
-    // Interaction was not a click
-    this._touchMoved = true;
-
-    // Simulate the mousemove event
-    simulateMouseEvent(event, 'mousemove');
-  };
-
-  /**
-   * Handle the jQuery UI widget's touchend events
-   * @param {Object} event The document's touchend event
-   */
-  mouseProto._touchEnd = function (event) {
-
-    // Ignore event if not handled
-    if (!touchHandled) {
-      return;
-    }
-
-    // Simulate the mouseup event
-    simulateMouseEvent(event, 'mouseup');
-
-    // Simulate the mouseout event
-    simulateMouseEvent(event, 'mouseout');
-
-    // If the touch interaction did not move, it should trigger a click
-    if (!this._touchMoved) {
-
-      // Simulate the click event
-      simulateMouseEvent(event, 'click');
-    }
-
-    // Unset the flag to allow other widgets to inherit the touch event
-    touchHandled = false;
-  };
-
-  /**
-   * A duck punch of the $.ui.mouse _mouseInit method to support touch events.
-   * This method extends the widget with bound touch event handlers that
-   * translate touch events to mouse events and pass them to the widget's
-   * original mouse event handling methods.
-   */
-  mouseProto._mouseInit = function () {
-    
-    var self = this;
-
-    // Delegate the touch handlers to the widget's element
-    self.element
-      .bind('touchstart', $.proxy(self, '_touchStart'))
-      .bind('touchmove', $.proxy(self, '_touchMove'))
-      .bind('touchend', $.proxy(self, '_touchEnd'));
-
-    // Call the original $.ui.mouse init method
-    _mouseInit.call(self);
-  };
-
-})(jQuery);
Index: admin/preferences.php
===================================================================
--- admin/preferences.php	(revision 2496)
+++ admin/preferences.php	(revision 2449)
@@ -47,6 +47,6 @@
 $default_tab = !empty($_GET['tab']) ? html::escapeHTML($_GET['tab']) : 'user-profile';
 
-if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) ||
-	!empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) ||
+if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || 
+	!empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) || 
 	!empty($_GET['db-updated'])) {
 	$default_tab = 'user-favorites';
@@ -84,11 +84,11 @@
 	{
 		$pwd_check = !empty($_POST['cur_pwd']) && $core->auth->checkPassword(crypt::hmac(DC_MASTER_KEY,$_POST['cur_pwd']));
-
+		
 		if ($core->auth->allowPassChange() && !$pwd_check && $user_email != $_POST['user_email']) {
 			throw new Exception(__('If you want to change your email or password you must provide your current password.'));
 		}
-
+		
 		$cur = $core->con->openCursor($core->prefix.'user');
-
+		
 		$cur->user_name = $user_name = $_POST['user_name'];
 		$cur->user_firstname = $user_firstname = $_POST['user_firstname'];
@@ -100,5 +100,5 @@
 
 		$cur->user_options = new ArrayObject($user_options);
-
+		
 		if ($core->auth->allowPassChange() && !empty($_POST['new_pwd']))
 		{
@@ -106,21 +106,21 @@
 				throw new Exception(__('If you want to change your email or password you must provide your current password.'));
 			}
-
+			
 			if ($_POST['new_pwd'] != $_POST['new_pwd_c']) {
 				throw new Exception(__("Passwords don't match"));
 			}
-
+			
 			$cur->user_pwd = $_POST['new_pwd'];
 		}
-
+		
 		# --BEHAVIOR-- adminBeforeUserUpdate
 		$core->callBehavior('adminBeforeUserProfileUpdate',$cur,$core->auth->userID());
-
+		
 		# Udate user
 		$core->updUser($core->auth->userID(),$cur);
-
+		
 		# --BEHAVIOR-- adminAfterUserUpdate
 		$core->callBehavior('adminAfterUserProfileUpdate',$cur,$core->auth->userID());
-
+		
 		dcPage::addSuccessNotice(__('Personal information has been successfully updated.'));
 
@@ -134,10 +134,10 @@
 
 # Update user options
-if (isset($_POST['user_post_format']))
+if (isset($_POST['user_post_format'])) 
 {
 	try
 	{
 		$cur = $core->con->openCursor($core->prefix.'user');
-
+		
 		$cur->user_name = $user_name;
 		$cur->user_firstname = $user_firstname;
@@ -149,5 +149,5 @@
 
 		$cur->user_post_status = $user_post_status = $_POST['user_post_status'];
-
+		
 		$user_options['edit_size'] = (integer) $_POST['user_edit_size'];
 		if ($user_options['edit_size'] < 1) {
@@ -156,10 +156,10 @@
 		$user_options['post_format'] = $_POST['user_post_format'];
 		$user_options['enable_wysiwyg'] = !empty($_POST['user_wysiwyg']);
-
+		
 		$cur->user_options = new ArrayObject($user_options);
-
+		
 		# --BEHAVIOR-- adminBeforeUserOptionsUpdate
 		$core->callBehavior('adminBeforeUserOptionsUpdate',$cur,$core->auth->userID());
-
+		
 		# Update user prefs
 		$core->auth->user_prefs->accessibility->put('nodragdrop',!empty($_POST['user_acc_nodragdrop']),'boolean');
@@ -170,11 +170,11 @@
 		}
 		$core->auth->user_prefs->interface->put('media_by_page',(integer)$_POST['user_ui_media_by_page'],'integer');
-
+		
 		# Udate user
 		$core->updUser($core->auth->userID(),$cur);
-
+		
 		# --BEHAVIOR-- adminAfterUserOptionsUpdate
 		$core->callBehavior('adminAfterUserOptionsUpdate',$cur,$core->auth->userID());
-
+		
 		dcPage::addSuccessNotice(__('Personal options has been successfully updated.'));
 		http::redirect('preferences.php#user-options');
@@ -192,5 +192,5 @@
 		# --BEHAVIOR-- adminBeforeUserOptionsUpdate
 		$core->callBehavior('adminBeforeDashboardOptionsUpdate',$core->auth->userID());
-
+		
 		# Update user prefs
 		$core->auth->user_prefs->dashboard->put('doclinks',!empty($_POST['user_dm_doclinks']),'boolean');
@@ -199,8 +199,8 @@
 		$core->auth->user_prefs->interface->put('iconset',(!empty($_POST['user_ui_iconset']) ? $_POST['user_ui_iconset'] : ''));
 		$core->auth->user_prefs->interface->put('nofavmenu',empty($_POST['user_ui_nofavmenu']),'boolean');
-
+		
 		# --BEHAVIOR-- adminAfterUserOptionsUpdate
 		$core->callBehavior('adminAfterDashboardOptionsUpdate',$core->auth->userID());
-
+		
 		dcPage::addSuccessNotice(__('Dashboard options has been successfully updated.'));
 		http::redirect('preferences.php#user-favorites');
@@ -213,5 +213,5 @@
 
 # Add selected favorites
-if (!empty($_POST['appendaction']))
+if (!empty($_POST['appendaction'])) 
 {
 	try {
@@ -280,5 +280,5 @@
 			unset($order[$k]);
 		}
-	}
+	}	
 	$core->favs->setFavoriteIDs($order,false);
 	if (!$core->error->flag()) {
@@ -305,5 +305,4 @@
 	($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')).
 	dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-	dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
 	dcPage::jsLoad('js/jquery/jquery.pwstrength.js').
 		'<script type="text/javascript">'."\n".
@@ -321,5 +320,5 @@
 	dcPage::jsPageTabs($default_tab).
 	dcPage::jsConfirmClose('user-form').
-
+	
 	# --BEHAVIOR-- adminPreferencesHeaders
 	$core->callBehavior('adminPreferencesHeaders'),
@@ -387,5 +386,5 @@
 	echo
 	'<h4 class="vertical-separator pretty-title">'.__('Change my password').'</h4>'.
-
+	
 	'<div class="pw-table">'.
 	'<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'.
@@ -396,8 +395,8 @@
 	'</div>'.
 	'</div>'.
-
+	
 	'<p><label for="new_pwd_c">'.__('Confirm new password:').'</label>'.
 	form::password('new_pwd_c',20,255).'</p>'.
-
+	
 	'<p><label for="cur_pwd">'.__('Your current password:').'</label>'.
 	form::password('cur_pwd',20,255).'</p>'.
@@ -590,5 +589,5 @@
 
 if (count($iconsets_combo) > 1) {
-	echo
+	echo 
 		'<div class="fieldset">'.
 		'<h4>'.__('Dashboard icons').'</h4>'.
Index: admin/style/default.css
===================================================================
--- admin/style/default.css	(revision 2519)
+++ admin/style/default.css	(revision 2523)
@@ -2371,4 +2371,5 @@
 	}
 .nav_prevnext a, a.back {
+	color: #2373A8;
 	border: 1px solid #dfdfdf;
 	padding: 2px 1.5em;
Index: inc/core/class.dc.blog.php
===================================================================
--- inc/core/class.dc.blog.php	(revision 2521)
+++ inc/core/class.dc.blog.php	(revision 2318)
@@ -27,5 +27,5 @@
 	/** @var string Database table prefix */
 	public $prefix;
-
+	
 	/** @var string Blog ID */
 	public $id;
@@ -46,5 +46,5 @@
 	/** @var string Blog status */
 	public $status;
-
+	
 	/** @var dcSettings dcSettings object */
 	public $settings;
@@ -53,16 +53,16 @@
 	/** @var string Blog public path */
 	public $public_path;
-
+	
 	private $post_status = array();
 	private $comment_status = array();
-
+	
 	private $categories;
-
+	
 	/** @var boolean Disallow entries password protection */
 	public $without_password = true;
-
+	
 	/**
 	Inits dcBlog object
-
+	
 	@param	core		<b>dcCore</b>		Dotclear core reference
 	@param	id		<b>string</b>		Blog ID
@@ -73,5 +73,5 @@
 		$this->prefix = $core->prefix;
 		$this->core =& $core;
-
+		
 		if (($b = $this->core->getBlog($id)) !== false)
 		{
@@ -85,25 +85,25 @@
 			$this->upddt = strtotime($b->blog_upddt);
 			$this->status = $b->blog_status;
-
+			
 			$this->settings = new dcSettings($this->core,$this->id);
-
+			
 			$this->themes_path = path::fullFromRoot($this->settings->system->themes_path,DC_ROOT);
 			$this->public_path = path::fullFromRoot($this->settings->system->public_path,DC_ROOT);
-
+			
 			$this->post_status['-2'] = __('Pending');
 			$this->post_status['-1'] = __('Scheduled');
 			$this->post_status['0'] = __('Unpublished');
 			$this->post_status['1'] = __('Published');
-
+			
 			$this->comment_status['-2'] = __('Junk');
 			$this->comment_status['-1'] = __('Pending');
 			$this->comment_status['0'] = __('Unpublished');
 			$this->comment_status['1'] = __('Published');
-
+			
 			# --BEHAVIOR-- coreBlogConstruct
 			$this->core->callBehavior('coreBlogConstruct',$this);
 		}
 	}
-
+	
 	/// @name Common public methods
 	//@{
@@ -116,12 +116,12 @@
 			return $this->url.'?';
 		}
-
+		
 		return $this->url;
 	}
-
+	
 	/**
 	Returns an entry status name given to a code. Status are translated, never
 	use it for tests. If status code does not exist, returns <i>unpublished</i>.
-
+	
 	@param	s	<b>integer</b> Status code
 	@return	<b>string</b> Blog status name
@@ -134,8 +134,8 @@
 		return $this->post_status['0'];
 	}
-
+	
 	/**
 	Returns an array of available entry status codes and names.
-
+	
 	@return	<b>array</b> Simple array with codes in keys and names in value
 	*/
@@ -144,8 +144,8 @@
 		return $this->post_status;
 	}
-
+	
 	/**
 	Returns an array of available comment status codes and names.
-
+	
 	@return	<b>array</b> Simple array with codes in keys and names in value
 	*/
@@ -154,9 +154,9 @@
 		return $this->comment_status;
 	}
-
+	
 	/**
 	Disallows entries password protection. You need to set it to
 	<var>false</var> while serving a public blog.
-
+	
 	@param	v		<b>boolean</b>
 	*/
@@ -166,5 +166,5 @@
 	}
 	//@}
-
+	
 	/// @name Triggers methods
 	//@{
@@ -176,17 +176,17 @@
 	{
 		$cur = $this->con->openCursor($this->prefix.'blog');
-
+		
 		$cur->blog_upddt = date('Y-m-d H:i:s');
-
+		
 		$cur->update("WHERE blog_id = '".$this->con->escape($this->id)."' ");
-
+		
 		# --BEHAVIOR-- coreBlogAfterTriggerBlog
 		$this->core->callBehavior('coreBlogAfterTriggerBlog',$cur);
 	}
-
+	
 	/**
 	Updates comment and trackback counters in post table. Should be called
 	every time a comment or trackback is added, removed or changed its status.
-
+	
 	@param	id		<b>integer</b>		Comment ID
 	@param	del		<b>boolean</b>		If comment is delete, set this to true
@@ -196,9 +196,9 @@
 		$this->triggerComments($id,$del);
 	}
-
+	
 	/**
 	Updates comments and trackbacks counters in post table. Should be called
 	every time comments or trackbacks are added, removed or changed their status.
-
+	
 	@param	ids		<b>mixed</b>		Comment(s) ID(s)
 	@param	del		<b>boolean</b>		If comment is delete, set this to true
@@ -208,15 +208,15 @@
 	{
 		$comments_ids = dcUtils::cleanIds($ids);
-
+		
 		# Get posts affected by comments edition
 		if (empty($affected_posts)) {
-			$strReq =
+			$strReq = 
 				'SELECT post_id '.
 				'FROM '.$this->prefix.'comment '.
 				'WHERE comment_id'.$this->con->in($comments_ids).
 				'GROUP BY post_id';
-
+			
 			$rs = $this->con->select($strReq);
-
+			
 			$affected_posts = array();
 			while ($rs->fetch()) {
@@ -224,11 +224,11 @@
 			}
 		}
-
+		
 		if (!is_array($affected_posts) || empty($affected_posts)) {
 			return;
 		}
-
+		
 		# Count number of comments if exists for affected posts
-		$strReq =
+		$strReq = 
 			'SELECT post_id, COUNT(post_id) AS nb_comment, comment_trackback '.
 			'FROM '.$this->prefix.'comment '.
@@ -236,7 +236,7 @@
 			'AND post_id'.$this->con->in($affected_posts).
 			'GROUP BY post_id,comment_trackback';
-
+		
 		$rs = $this->con->select($strReq);
-
+		
 		$posts = array();
 		while ($rs->fetch()) {
@@ -247,5 +247,5 @@
 			}
 		}
-
+		
 		# Update number of comments on affected posts
 		$cur = $this->con->openCursor($this->prefix.'post');
@@ -253,5 +253,5 @@
 		{
 			$cur->clean();
-
+			
 			if (!array_key_exists($post_id,$posts)) {
 				$cur->nb_trackback = 0;
@@ -261,10 +261,10 @@
 				$cur->nb_comment = empty($posts[$post_id]['comment']) ? 0 : $posts[$post_id]['comment'];
 			}
-
+			
 			$cur->update('WHERE post_id = '.$post_id);
 		}
 	}
 	//@}
-
+	
 	/// @name Categories management methods
 	//@{
@@ -274,12 +274,12 @@
 			$this->categories = new dcCategories($this->core);
 		}
-
+		
 		return $this->categories;
 	}
-
+	
 	/**
 	Retrieves categories. <var>$params</var> is an associative array which can
 	take the following parameters:
-
+	
 	- post_type: Get only entries with given type (default "post")
 	- cat_url: filter on cat_url field
@@ -287,5 +287,5 @@
 	- start: start with a given category
 	- level: categories level to retrieve
-
+	
 	@param	params	<b>array</b>		Parameters
 	@return	<b>record</b>
@@ -299,5 +299,5 @@
 		}
 		$counter = $this->getCategoriesCounter($c_params);
-
+		
 		if (isset($params['without_empty']) && ($params['without_empty'] == false)) {
 			$without_empty = false;
@@ -305,10 +305,10 @@
 			$without_empty = $this->core->auth->userID() == false; # Get all categories if in admin display
 		}
-
+		
 		$start = isset($params['start']) ? (integer) $params['start'] : 0;
 		$l = isset($params['level']) ? (integer) $params['level'] : 0;
-
+		
 		$rs = $this->categories()->getChildren($start,null,'desc');
-
+		
 		# Get each categories total posts count
 		$data = array();
@@ -319,5 +319,5 @@
 		{
 			$nb_post = isset($counter[$rs->cat_id]) ? (integer) $counter[$rs->cat_id] : 0;
-
+			
 			if ($rs->level > $level) {
 				$nb_total = $nb_post;
@@ -335,11 +335,11 @@
 				unset($stack[$rs->level+1]);
 			}
-
+			
 			if ($nb_total == 0 && $without_empty) {
 				continue;
 			}
-
+			
 			$level = $rs->level;
-
+			
 			$t = array();
 			foreach ($cols as $c) {
@@ -348,10 +348,10 @@
 			$t['nb_post'] = $nb_post;
 			$t['nb_total'] = $nb_total;
-
+			
 			if ($l == 0 || ($l > 0 && $l == $rs->level)) {
 				array_unshift($data,$t);
 			}
 		}
-
+		
 		# We need to apply filter after counting
 		if (isset($params['cat_id']) && $params['cat_id'] !== '')
@@ -369,6 +369,6 @@
 			}
 		}
-
-		if (isset($params['cat_url']) && ($params['cat_url'] !== '')
+		
+		if (isset($params['cat_url']) && ($params['cat_url'] !== '') 
 			&& !isset($params['cat_id']))
 		{
@@ -385,11 +385,11 @@
 			}
 		}
-
+		
 		return staticRecord::newFromArray($data);
 	}
-
+	
 	/**
 	Retrieves a category by its ID.
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@return	<b>record</b>
@@ -399,8 +399,8 @@
 		return $this->getCategories(array('cat_id' => $id));
 	}
-
+	
 	/**
 	Retrieves parents of a given category.
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@return	<b>record</b>
@@ -410,8 +410,8 @@
 		return $this->categories()->getParents($id);
 	}
-
+	
 	/**
 	Retrieves first parent of a given category.
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@return	<b>record</b>
@@ -421,8 +421,8 @@
 		return $this->categories()->getParent($id);
 	}
-
+	
 	/**
 	Retrieves all category's first children
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@return	<b>record</b>
@@ -432,5 +432,5 @@
 		return $this->getCategories(array('start' => $id,'level' => $id == 0 ? 1 : 2));
 	}
-
+	
 	private function getCategoriesCounter($params=array())
 	{
@@ -440,15 +440,15 @@
 		'JOIN '.$this->prefix."post P ON (C.cat_id = P.cat_id AND P.blog_id = '".$this->con->escape($this->id)."' ) ".
 		"WHERE C.blog_id = '".$this->con->escape($this->id)."' ";
-
+		
 		if (!$this->core->auth->userID()) {
 			$strReq .= 'AND P.post_status = 1 ';
 		}
-
+		
 		if (!empty($params['post_type'])) {
 			$strReq .= 'AND P.post_type '.$this->con->in($params['post_type']);
 		}
-
+		
 		$strReq .= 'GROUP BY C.cat_id ';
-
+		
 		$rs = $this->con->select($strReq);
 		$counters = array();
@@ -456,12 +456,12 @@
 			$counters[$rs->cat_id] = $rs->nb_post;
 		}
-
+		
 		return $counters;
 	}
-
+	
 	/**
 	Creates a new category. Takes a cursor as input and returns the new category
 	ID.
-
+	
 	@param	cur		<b>cursor</b>		Category cursor
 	@return	<b>integer</b>		New category ID
@@ -472,5 +472,5 @@
 			throw new Exception(__('You are not allowed to add categories'));
 		}
-
+		
 		$url = array();
 		if ($parent != 0)
@@ -483,5 +483,5 @@
 			}
 		}
-
+		
 		if ($cur->cat_url == '') {
 			$url[] = text::tidyURL($cur->cat_title,false);
@@ -489,13 +489,13 @@
 			$url[] = $cur->cat_url;
 		}
-
+		
 		$cur->cat_url = implode('/',$url);
-
+		
 		$this->getCategoryCursor($cur);
 		$cur->blog_id = (string) $this->id;
-
+		
 		# --BEHAVIOR-- coreBeforeCategoryCreate
 		$this->core->callBehavior('coreBeforeCategoryCreate',$this,$cur);
-
+		
 		$id = $this->categories()->addNode($cur,$parent);
 		# Update category's cursor
@@ -505,15 +505,15 @@
 			$cur->cat_rgt = $rs->cat_rgt;
 		}
-
+		
 		# --BEHAVIOR-- coreAfterCategoryCreate
 		$this->core->callBehavior('coreAfterCategoryCreate',$this,$cur);
 		$this->triggerBlog();
-
+		
 		return $cur->cat_id;
 	}
-
+	
 	/**
 	Updates an existing category.
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@param	cur		<b>cursor</b>		Category cursor
@@ -524,5 +524,5 @@
 			throw new Exception(__('You are not allowed to update categories'));
 		}
-
+		
 		if ($cur->cat_url == '')
 		{
@@ -534,22 +534,22 @@
 				}
 			}
-
-
+			
+			
 			$url[] = text::tidyURL($cur->cat_title,false);
 			$cur->cat_url = implode('/',$url);
 		}
-
+		
 		$this->getCategoryCursor($cur,$id);
-
+		
 		# --BEHAVIOR-- coreBeforeCategoryUpdate
 		$this->core->callBehavior('coreBeforeCategoryUpdate',$this,$cur);
-
+		
 		$cur->update(
 		'WHERE cat_id = '.(integer) $id.' '.
 		"AND blog_id = '".$this->con->escape($this->id)."' ");
-
+		
 		# --BEHAVIOR-- coreAfterCategoryUpdate
 		$this->core->callBehavior('coreAfterCategoryUpdate',$this,$cur);
-
+		
 		$this->triggerBlog();
 	}
@@ -567,9 +567,9 @@
                 $this->triggerBlog();
         }
-
+	
 	/**
 	DEPRECATED METHOD. Use dcBlog::setCategoryParent and dcBlog::moveCategory
 	instead.
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@param	order	<b>integer</b>		Category position
@@ -579,8 +579,8 @@
 		return;
 	}
-
+	
 	/**
 	Set a category parent
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@param	parent	<b>integer</b>		Parent Category ID
@@ -591,8 +591,8 @@
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Set category position
-
+	
 	@param	id		<b>integer</b>		Category ID
 	@param	sibling	<b>integer</b>		Sibling Category ID
@@ -604,8 +604,8 @@
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Deletes a category.
-
+	
 	@param	id		<b>integer</b>		Category ID
 	*/
@@ -615,20 +615,20 @@
 			throw new Exception(__('You are not allowed to delete categories'));
 		}
-
+		
 		$strReq = 'SELECT COUNT(post_id) AS nb_post '.
 				'FROM '.$this->prefix.'post '.
 				'WHERE cat_id = '.(integer) $id.' '.
 				"AND blog_id = '".$this->con->escape($this->id)."' ";
-
+		
 		$rs = $this->con->select($strReq);
-
+		
 		if ($rs->nb_post > 0) {
 			throw new Exception(__('This category is not empty.'));
 		}
-
+		
 		$this->categories()->deleteNode($id,true);
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Reset categories order and relocate them to first level
@@ -639,13 +639,13 @@
 			throw new Exception(__('You are not allowed to reset categories order'));
 		}
-
+		
 		$this->categories()->resetOrder();
 		$this->triggerBlog();
 	}
-
+	
 	private function checkCategory($title,$url,$id=null)
 	{
 		# Let's check if URL is taken...
-		$strReq =
+		$strReq = 
 			'SELECT cat_url FROM '.$this->prefix.'category '.
 			"WHERE cat_url = '".$this->con->escape($url)."' ".
@@ -653,7 +653,7 @@
 			"AND blog_id = '".$this->con->escape($this->id)."' ".
 			'ORDER BY cat_url DESC';
-
+		
 		$rs = $this->con->select($strReq);
-
+		
 		if (!$rs->isEmpty())
 		{
@@ -665,5 +665,5 @@
 				$clause = "LIKE '".$this->con->escape($url)."%'";
 			}
-			$strReq =
+			$strReq = 
 				'SELECT cat_url FROM '.$this->prefix.'category '.
 				"WHERE cat_url ".$clause.' '.
@@ -671,5 +671,5 @@
 				"AND blog_id = '".$this->con->escape($this->id)."' ".
 				'ORDER BY cat_url DESC ';
-
+			
 			$rs = $this->con->select($strReq);
 			$a = array();
@@ -677,8 +677,8 @@
 				$a[] = $rs->cat_url;
 			}
-
+			
 			natsort($a);
 			$t_url = end($a);
-
+			
 			if (preg_match('/(.*?)([0-9]+)$/',$t_url,$m)) {
 				$i = (integer) $m[2];
@@ -687,16 +687,16 @@
 				$i = 1;
 			}
-
+			
 			return $url.($i+1);
 		}
-
+		
 		# URL is empty?
 		if ($url == '') {
 			throw new Exception(__('Empty category URL'));
 		}
-
+		
 		return $url;
 	}
-
+	
 	private function getCategoryCursor($cur,$id=null)
 	{
@@ -704,10 +704,10 @@
 			throw new Exception(__('You must provide a category title'));
 		}
-
+		
 		# If we don't have any cat_url, let's do one
 		if ($cur->cat_url == '') {
 			$cur->cat_url = text::tidyURL($cur->cat_title,false);
 		}
-
+		
 		# Still empty ?
 		if ($cur->cat_url == '') {
@@ -716,8 +716,8 @@
 			$cur->cat_url = text::tidyURL($cur->cat_url,true);
 		}
-
+		
 		# Check if title or url are unique
 		$cur->cat_url = $this->checkCategory($cur->cat_title,$cur->cat_url,$id);
-
+		
 		if ($cur->cat_desc !== null) {
 			$cur->cat_desc = $this->core->HTMLfilter($cur->cat_desc);
@@ -725,5 +725,5 @@
 	}
 	//@}
-
+	
 	/// @name Entries management methods
 	//@{
@@ -731,5 +731,5 @@
 	Retrieves entries. <b>$params</b> is an array taking the following
 	optionnal parameters:
-
+	
 	- no_content: Don't retrieve entry content (excerpt and content)
 	- post_type: Get only entries with given type (default "post", array for many types and '' for no type)
@@ -755,8 +755,8 @@
 	- sql_only : return the sql request instead of results. Only ids are selected
 	- exclude_post_id : (integer or array) Exclude entries with given post_id
-
+	
 	Please note that on every cat_id or cat_url, you can add ?not to exclude
 	the category and ?sub to get subcategories.
-
+	
 	@param	params		<b>array</b>		Parameters
 	@param	count_only	<b>boolean</b>		Only counts results
@@ -773,5 +773,5 @@
 			$strReq = 'SELECT count(DISTINCT P.post_id) ';
 		}
-		elseif (!empty($params['sql_only']))
+		elseif (!empty($params['sql_only'])) 
 		{
 			$strReq = 'SELECT P.post_id ';
@@ -786,9 +786,9 @@
 				'post_content, post_content_xhtml, post_notes, ';
 			}
-
+			
 			if (!empty($params['columns']) && is_array($params['columns'])) {
 				$content_req .= implode(', ',$params['columns']).', ';
 			}
-
+			
 
 			$strReq =
@@ -802,5 +802,5 @@
 			'C.cat_title, C.cat_url, C.cat_desc ';
 		}
-
+		
 		$strReq .=
 		'FROM '.$this->prefix.'post P '.
@@ -811,16 +811,16 @@
 			$strReq .= $params['from'].' ';
 		}
-
+		
 		$strReq .=
 		"WHERE P.blog_id = '".$this->con->escape($this->id)."' ";
-
+		
 		if (!$this->core->auth->check('contentadmin',$this->id)) {
 			$strReq .= 'AND ((post_status = 1 ';
-
+			
 			if ($this->without_password) {
 				$strReq .= 'AND post_password IS NULL ';
 			}
 			$strReq .= ') ';
-
+			
 			if ($this->core->auth->userID()) {
 				$strReq .= "OR P.user_id = '".$this->con->escape($this->core->auth->userID())."')";
@@ -829,5 +829,5 @@
 			}
 		}
-
+		
 		#Adding parameters
 		if (isset($params['post_type']))
@@ -841,5 +841,5 @@
 			$strReq .= "AND post_type = 'post' ";
 		}
-
+		
 		if (isset($params['post_id']) && $params['post_id'] !== '') {
 			if (is_array($params['post_id'])) {
@@ -850,5 +850,5 @@
 			$strReq .= 'AND P.post_id '.$this->con->in($params['post_id']);
 		}
-
+		
 		if (isset($params['exclude_post_id']) && $params['exclude_post_id'] !== '') {
 			if (is_array($params['exclude_post_id'])) {
@@ -859,13 +859,13 @@
 			$strReq .= 'AND P.post_id NOT '.$this->con->in($params['exclude_post_id']);
 		}
-
+		
 		if (isset($params['post_url']) && $params['post_url'] !== '') {
 			$strReq .= "AND post_url = '".$this->con->escape($params['post_url'])."' ";
 		}
-
+		
 		if (!empty($params['user_id'])) {
 			$strReq .= "AND U.user_id = '".$this->con->escape($params['user_id'])."' ";
 		}
-
+		
 		if (isset($params['cat_id']) && $params['cat_id'] !== '')
 		{
@@ -888,37 +888,37 @@
 			$strReq .= 'AND '.$this->getPostsCategoryFilter($params['cat_url'],'cat_url').' ';
 		}
-
+		
 		/* Other filters */
 		if (isset($params['post_status'])) {
 			$strReq .= 'AND post_status = '.(integer) $params['post_status'].' ';
 		}
-
+		
 		if (isset($params['post_selected'])) {
 			$strReq .= 'AND post_selected = '.(integer) $params['post_selected'].' ';
 		}
-
+		
 		if (!empty($params['post_year'])) {
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt','%Y').' = '.
 			"'".sprintf('%04d',$params['post_year'])."' ";
 		}
-
+		
 		if (!empty($params['post_month'])) {
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt','%m').' = '.
 			"'".sprintf('%02d',$params['post_month'])."' ";
 		}
-
+		
 		if (!empty($params['post_day'])) {
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt','%d').' = '.
 			"'".sprintf('%02d',$params['post_day'])."' ";
 		}
-
+		
 		if (!empty($params['post_lang'])) {
 			$strReq .= "AND P.post_lang = '".$this->con->escape($params['post_lang'])."' ";
 		}
-
+		
 		if (!empty($params['search']))
 		{
 			$words = text::splitWords($params['search']);
-
+			
 			if (!empty($words))
 			{
@@ -927,5 +927,5 @@
 					$this->core->callBehavior('corePostSearch',$this->core,array(&$words,&$strReq,&$params));
 				}
-
+				
 				if ($words)
 				{
@@ -937,10 +937,10 @@
 			}
 		}
-
+		
 		if (isset($params['media'])) {
 			if ($params['media'] == '0') {
 				$strReq .= 'AND NOT ';
 			} else {
-				$strReq .= 'AND ';
+				$strReq .= 'AND ';				
 			}
 			$strReq .= 'EXISTS (SELECT M.post_id FROM '.$this->prefix.'post_media M '.
@@ -964,9 +964,9 @@
 			}
 		}
-
+		
 		if (!$count_only && !empty($params['limit'])) {
 			$strReq .= $this->con->limit($params['limit']);
 		}
-
+		
 		if (!empty($params['sql_only'])) {
 			return $strReq;
@@ -977,16 +977,16 @@
 		$rs->_nb_media = array();
 		$rs->extend('rsExtPost');
-
+		
 		# --BEHAVIOR-- coreBlogGetPosts
 		$this->core->callBehavior('coreBlogGetPosts',$rs);
-
+		
 		return $rs;
 	}
-
+	
 	/**
 	Returns a record with post id, title and date for next or previous post
 	according to the post ID.
 	$dir could be 1 (next post) or -1 (previous post).
-
+	
 	@param	post_id				<b>integer</b>		Post ID
 	@param	dir					<b>integer</b>		Search direction
@@ -999,5 +999,5 @@
 		$dt = $post->post_dt;
 		$post_id = (integer) $post->post_id;
-
+		
 		if($dir > 0) {
 			$sign = '>';
@@ -1008,5 +1008,5 @@
 			$order = 'DESC';
 		}
-
+		
 		$params['post_type'] = $post->post_type;
 		$params['limit'] = 1;
@@ -1017,31 +1017,31 @@
 		"	OR post_dt ".$sign." '".$this->con->escape($dt)."' ".
 		') ';
-
+		
 		if ($restrict_to_category) {
 			$params['sql'] .= $post->cat_id ? 'AND P.cat_id = '.(integer) $post->cat_id.' ' : 'AND P.cat_id IS NULL ';
 		}
-
+		
 		if ($restrict_to_lang) {
 			$params['sql'] .= $post->post_lang ? 'AND P.post_lang = \''. $this->con->escape($post->post_lang) .'\' ': 'AND P.post_lang IS NULL ';
 		}
-
+		
 		$rs = $this->getPosts($params);
-
+		
 		if ($rs->isEmpty()) {
 			return null;
 		}
-
+		
 		return $rs;
 	}
-
+	
 	/**
 	Retrieves different languages and post count on blog, based on post_lang
 	field. <var>$params</var> is an array taking the following optionnal
 	parameters:
-
+	
 	- post_type: Get only entries with given type (default "post", '' for no type)
 	- lang: retrieve post count for selected lang
 	- order: order statement (default post_lang DESC)
-
+	
 	@param	params	<b>array</b>		Parameters
 	@return	record
@@ -1054,13 +1054,13 @@
 				"AND post_lang <> '' ".
 				"AND post_lang IS NOT NULL ";
-
+		
 		if (!$this->core->auth->check('contentadmin',$this->id)) {
 			$strReq .= 'AND ((post_status = 1 ';
-
+			
 			if ($this->without_password) {
 				$strReq .= 'AND post_password IS NULL ';
 			}
 			$strReq .= ') ';
-
+			
 			if ($this->core->auth->userID()) {
 				$strReq .= "OR user_id = '".$this->con->escape($this->core->auth->userID())."')";
@@ -1069,5 +1069,5 @@
 			}
 		}
-
+		
 		if (isset($params['post_type'])) {
 			if ($params['post_type'] != '') {
@@ -1077,11 +1077,11 @@
 			$strReq .= "AND post_type = 'post' ";
 		}
-
+		
 		if (isset($params['lang'])) {
 			$strReq .= "AND post_lang = '".$this->con->escape($params['lang'])."' ";
 		}
-
+		
 		$strReq .= 'GROUP BY post_lang ';
-
+		
 		$order = 'desc';
 		if (!empty($params['order']) && preg_match('/^(desc|asc)$/i',$params['order'])) {
@@ -1089,12 +1089,12 @@
 		}
 		$strReq .= 'ORDER BY post_lang '.$order.' ';
-
+		
 		return $this->con->select($strReq);
 	}
-
+	
 	/**
 	Returns a record with all distinct blog dates and post count.
 	<var>$params</var> is an array taking the following optionnal parameters:
-
+	
 	- type: (day|month|year) Get days, months or years
 	- year: (integer) Get dates for given year
@@ -1107,5 +1107,5 @@
 	- previous: Get date before match
 	- order: Sort by date "ASC" or "DESC"
-
+	
 	@param	params	<b>array</b>		Parameters array
 	@return	record
@@ -1126,7 +1126,7 @@
 		$dt_f .= ' 00:00:00';
 		$dt_fc .= '000000';
-
+		
 		$cat_field = $catReq = $limit = '';
-
+		
 		if (isset($params['cat_id']) && $params['cat_id'] !== '') {
 			$catReq = 'AND P.cat_id = '.(integer) $params['cat_id'].' ';
@@ -1139,5 +1139,5 @@
 			$catReq = 'AND P.post_lang = \''. $params['post_lang'].'\' ';
 		}
-
+		
 		$strReq = 'SELECT DISTINCT('.$this->con->dateFormat('post_dt',$dt_f).') AS dt '.
 				$cat_field.
@@ -1147,13 +1147,13 @@
 				"WHERE P.blog_id = '".$this->con->escape($this->id)."' ".
 				$catReq;
-
+		
 		if (!$this->core->auth->check('contentadmin',$this->id)) {
 			$strReq .= 'AND ((post_status = 1 ';
-
+			
 			if ($this->without_password) {
 				$strReq .= 'AND post_password IS NULL ';
 			}
 			$strReq .= ') ';
-
+			
 			if ($this->core->auth->userID()) {
 				$strReq .= "OR P.user_id = '".$this->con->escape($this->core->auth->userID())."')";
@@ -1162,5 +1162,5 @@
 			}
 		}
-
+		
 		if (!empty($params['post_type'])) {
 			$strReq .= "AND post_type ".$this->con->in($params['post_type'])." ";
@@ -1168,17 +1168,17 @@
 			$strReq .= "AND post_type = 'post' ";
 		}
-
+		
 		if (!empty($params['year'])) {
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt','%Y')." = '".sprintf('%04d',$params['year'])."' ";
 		}
-
+		
 		if (!empty($params['month'])) {
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt','%m')." = '".sprintf('%02d',$params['month'])."' ";
 		}
-
+		
 		if (!empty($params['day'])) {
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt','%d')." = '".sprintf('%02d',$params['day'])."' ";
 		}
-
+		
 		# Get next or previous date
 		if (!empty($params['next']) || !empty($params['previous']))
@@ -1193,31 +1193,31 @@
 				$dt = $params['previous'];
 			}
-
+			
 			$dt = date('YmdHis',strtotime($dt));
-
+			
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt',$dt_fc).$pdir."'".$dt."' ";
 			$limit = $this->con->limit(1);
 		}
-
+		
 		$strReq .= 'GROUP BY dt '.$cat_field;
-
+		
 		$order = 'desc';
 		if (!empty($params['order']) && preg_match('/^(desc|asc)$/i',$params['order'])) {
 			$order = $params['order'];
 		}
-
+		
 		$strReq .=
 		'ORDER BY dt '.$order.' '.
 		$limit;
-
+		
 		$rs = $this->con->select($strReq);
 		$rs->extend('rsExtDates');
 		return $rs;
 	}
-
+	
 	/**
 	Creates a new entry. Takes a cursor as input and returns the new entry
 	ID.
-
+	
 	@param	cur		<b>cursor</b>		Post cursor
 	@return	<b>integer</b>		New post ID
@@ -1228,5 +1228,5 @@
 			throw new Exception(__('You are not allowed to create an entry'));
 		}
-
+		
 		$this->con->writeLock($this->prefix.'post');
 		try
@@ -1235,7 +1235,7 @@
 			$rs = $this->con->select(
 				'SELECT MAX(post_id) '.
-				'FROM '.$this->prefix.'post '
+				'FROM '.$this->prefix.'post ' 
 				);
-
+			
 			$cur->post_id = (integer) $rs->f(0) + 1;
 			$cur->blog_id = (string) $this->id;
@@ -1243,19 +1243,19 @@
 			$cur->post_upddt = date('Y-m-d H:i:s');
 			$cur->post_tz = $this->core->auth->getInfo('user_tz');
-
+			
 			# Post excerpt and content
 			$this->getPostContent($cur,$cur->post_id);
-
+			
 			$this->getPostCursor($cur);
-
+			
 			$cur->post_url = $this->getPostURL($cur->post_url,$cur->post_dt,$cur->post_title,$cur->post_id);
-
+			
 			if (!$this->core->auth->check('publish,contentadmin',$this->id)) {
 				$cur->post_status = -2;
 			}
-
+			
 			# --BEHAVIOR-- coreBeforePostCreate
 			$this->core->callBehavior('coreBeforePostCreate',$this,$cur);
-
+			
 			$cur->insert();
 			$this->con->unlock();
@@ -1266,16 +1266,16 @@
 			throw $e;
 		}
-
+		
 		# --BEHAVIOR-- coreAfterPostCreate
 		$this->core->callBehavior('coreAfterPostCreate',$this,$cur);
-
+		
 		$this->triggerBlog();
-
+		
 		return $cur->post_id;
 	}
-
+	
 	/**
 	Updates an existing post.
-
+	
 	@param	id		<b>integer</b>		Post ID
 	@param	cur		<b>cursor</b>		Post cursor
@@ -1286,26 +1286,26 @@
 			throw new Exception(__('You are not allowed to update entries'));
 		}
-
+		
 		$id = (integer) $id;
-
+		
 		if (empty($id)) {
 			throw new Exception(__('No such entry ID'));
 		}
-
+		
 		# Post excerpt and content
 		$this->getPostContent($cur,$id);
-
+		
 		$this->getPostCursor($cur);
-
+		
 		if ($cur->post_url !== null) {
 			$cur->post_url = $this->getPostURL($cur->post_url,$cur->post_dt,$cur->post_title,$id);
 		}
-
+		
 		if (!$this->core->auth->check('publish,contentadmin',$this->id)) {
 			$cur->unsetField('post_status');
 		}
-
+		
 		$cur->post_upddt = date('Y-m-d H:i:s');
-
+		
 		#If user is only "usage", we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
@@ -1315,26 +1315,26 @@
 					'WHERE post_id = '.$id.' '.
 					"AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
-
+			
 			$rs = $this->con->select($strReq);
-
+			
 			if ($rs->isEmpty()) {
 				throw new Exception(__('You are not allowed to edit this entry'));
 			}
 		}
-
+		
 		# --BEHAVIOR-- coreBeforePostUpdate
 		$this->core->callBehavior('coreBeforePostUpdate',$this,$cur);
-
+		
 		$cur->update('WHERE post_id = '.$id.' ');
-
+		
 		# --BEHAVIOR-- coreAfterPostUpdate
 		$this->core->callBehavior('coreAfterPostUpdate',$this,$cur);
-
+		
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Updates post status.
-
+	
 	@param	id		<b>integer</b>		Post ID
 	@param	status	<b>integer</b>		Post status
@@ -1344,8 +1344,8 @@
 		$this->updPostsStatus($id,$status);
 	}
-
+	
 	/**
 	Updates posts status.
-
+	
 	@param	ids		<b>mixed</b>		Post(s) ID(s)
 	@param	status	<b>integer</b>		Post status
@@ -1356,11 +1356,11 @@
 			throw new Exception(__('You are not allowed to change this entry status'));
 		}
-
+		
 		$posts_ids = dcUtils::cleanIds($ids);
 		$status = (integer) $status;
-
+		
 		$strReq = "WHERE blog_id = '".$this->con->escape($this->id)."' ".
 				"AND post_id ".$this->con->in($posts_ids);
-
+		
 		#If user can only publish, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
@@ -1368,17 +1368,17 @@
 			$strReq .= "AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
 		}
-
+		
 		$cur = $this->con->openCursor($this->prefix.'post');
-
+		
 		$cur->post_status = $status;
 		$cur->post_upddt = date('Y-m-d H:i:s');
-
+		
 		$cur->update($strReq);
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Updates post selection.
-
+	
 	@param	id		<b>integer</b>		Post ID
 	@param	selected	<b>integer</b>		Is selected post
@@ -1388,8 +1388,8 @@
 		$this->updPostsSelected($id,$selected);
 	}
-
+	
 	/**
 	Updates posts selection.
-
+	
 	@param	ids		<b>mixed</b>		Post(s) ID(s)
 	@param	selected	<b>integer</b>		Is selected post(s)
@@ -1400,11 +1400,11 @@
 			throw new Exception(__('You are not allowed to change this entry category'));
 		}
-
+		
 		$posts_ids = dcUtils::cleanIds($ids);
 		$selected = (boolean) $selected;
-
+		
 		$strReq = "WHERE blog_id = '".$this->con->escape($this->id)."' ".
 				"AND post_id ".$this->con->in($posts_ids);
-
+		
 		# If user is only usage, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
@@ -1412,17 +1412,17 @@
 			$strReq .= "AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
 		}
-
+		
 		$cur = $this->con->openCursor($this->prefix.'post');
-
+		
 		$cur->post_selected = (integer) $selected;
 		$cur->post_upddt = date('Y-m-d H:i:s');
-
+		
 		$cur->update($strReq);
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Updates post category. <var>$cat_id</var> can be null.
-
+	
 	@param	id		<b>integer</b>		Post ID
 	@param	cat_id	<b>integer</b>		Category ID
@@ -1432,8 +1432,8 @@
 		$this->updPostsCategory($id,$cat_id);
 	}
-
+	
 	/**
 	Updates posts category. <var>$cat_id</var> can be null.
-
+	
 	@param	ids		<b>mixed</b>		Post(s) ID(s)
 	@param	cat_id	<b>integer</b>		Category ID
@@ -1444,11 +1444,11 @@
 			throw new Exception(__('You are not allowed to change this entry category'));
 		}
-
+		
 		$posts_ids = dcUtils::cleanIds($ids);
 		$cat_id = (integer) $cat_id;
-
+		
 		$strReq = "WHERE blog_id = '".$this->con->escape($this->id)."' ".
 				"AND post_id ".$this->con->in($posts_ids);
-
+		
 		# If user is only usage, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
@@ -1456,17 +1456,17 @@
 			$strReq .= "AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
 		}
-
+		
 		$cur = $this->con->openCursor($this->prefix.'post');
-
+		
 		$cur->cat_id = ($cat_id ? $cat_id : null);
 		$cur->post_upddt = date('Y-m-d H:i:s');
-
+		
 		$cur->update($strReq);
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Updates posts category. <var>$new_cat_id</var> can be null.
-
+	
 	@param	old_cat_id	<b>integer</b>		Old category ID
 	@param	new_cat_id	<b>integer</b>		New category ID
@@ -1477,13 +1477,13 @@
 			throw new Exception(__('You are not allowed to change entries category'));
 		}
-
+		
 		$old_cat_id = (integer) $old_cat_id;
 		$new_cat_id = (integer) $new_cat_id;
-
+		
 		$cur = $this->con->openCursor($this->prefix.'post');
-
+		
 		$cur->cat_id = ($new_cat_id ? $new_cat_id : null);
 		$cur->post_upddt = date('Y-m-d H:i:s');
-
+		
 		$cur->update(
 			'WHERE cat_id = '.$old_cat_id.' '.
@@ -1492,8 +1492,8 @@
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Deletes a post.
-
+	
 	@param	id		<b>integer</b>		Post ID
 	*/
@@ -1502,8 +1502,8 @@
 		$this->delPosts($id);
 	}
-
+	
 	/**
 	Deletes multiple posts.
-
+	
 	@param	ids		<b>mixed</b>		Post(s) ID(s)
 	*/
@@ -1513,15 +1513,15 @@
 			throw new Exception(__('You are not allowed to delete entries'));
 		}
-
+		
 		$posts_ids = dcUtils::cleanIds($ids);
-
+		
 		if (empty($posts_ids)) {
 			throw new Exception(__('No such entry ID'));
 		}
-
+		
 		$strReq = 'DELETE FROM '.$this->prefix.'post '.
 				"WHERE blog_id = '".$this->con->escape($this->id)."' ".
 				"AND post_id ".$this->con->in($posts_ids);
-
+		
 		#If user can only delete, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
@@ -1529,9 +1529,9 @@
 			$strReq .= "AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
 		}
-
+		
 		$this->con->execute($strReq);
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Publishes all entries flaged as "scheduled".
@@ -1543,7 +1543,7 @@
 				'WHERE post_status = -1 '.
 				"AND blog_id = '".$this->con->escape($this->id)."' ";
-
+		
 		$rs = $this->con->select($strReq);
-
+		
 		$now = dt::toUTC(time());
 		$to_change = new ArrayObject();
@@ -1552,13 +1552,13 @@
 			return;
 		}
-
+		
 		while ($rs->fetch())
 		{
 			# Now timestamp with post timezone
 			$now_tz = $now + dt::getTimeOffset($rs->post_tz,$now);
-
+			
 			# Post timestamp
 			$post_ts = strtotime($rs->post_dt);
-
+			
 			# If now_tz >= post_ts, we publish the entry
 			if ($now_tz >= $post_ts) {
@@ -1582,10 +1582,10 @@
 			$this->core->callBehavior('coreAfterScheduledEntriesPublish',$this,$to_change);
 		}
-
-	}
-
+		
+	}
+	
 	/**
 	Retrieves all users having posts on current blog.
-
+	
 	@param	post_type		<b>string</b>		post_type filter (post)
 	@return	record
@@ -1598,22 +1598,22 @@
 				'WHERE P.user_id = U.user_id '.
 				"AND blog_id = '".$this->con->escape($this->id)."' ";
-
+		
 		if ($post_type) {
 			$strReq .= "AND post_type = '".$this->con->escape($post_type)."' ";
 		}
-
+		
 		$strReq .= 'GROUP BY P.user_id, user_name, user_firstname, user_displayname, user_email ';
-
+		
 		return $this->con->select($strReq);
 	}
-
+	
 	private function getPostsCategoryFilter($arr,$field='cat_id')
 	{
 		$field = $field == 'cat_id' ? 'cat_id' : 'cat_url';
-
+		
 		$sub = array();
 		$not = array();
 		$queries = array();
-
+		
 		foreach ($arr as $v)
 		{
@@ -1622,5 +1622,5 @@
 			$id = array_shift($args);
 			$args = array_flip($args);
-
+			
 			if (isset($args['not'])) { $not[$id] = 1; }
 			if (isset($args['sub'])) { $sub[$id] = 1; }
@@ -1636,5 +1636,5 @@
 			}
 		}
-
+		
 		if (!empty($sub)) {
 			$rs = $this->con->select(
@@ -1643,10 +1643,10 @@
 				'AND '.$field.' '.$this->con->in(array_keys($sub))
 			);
-
+			
 			while ($rs->fetch()) {
 				$queries[$rs->f($field)] = '(C.cat_lft BETWEEN '.$rs->cat_lft.' AND '.$rs->cat_rgt.')';
 			}
 		}
-
+		
 		# Create queries
 		$sql = array(
@@ -1654,12 +1654,12 @@
 			1 => array()  # excluded categories
 		);
-
+		
 		foreach ($queries as $id => $q) {
 			$sql[(integer) isset($not[$id])][] = $q;
 		}
-
+		
 		$sql[0] = implode(' OR ',$sql[0]);
 		$sql[1] = implode(' OR ',$sql[1]);
-
+		
 		if ($sql[0]) {
 			$sql[0] = '('.$sql[0].')';
@@ -1667,5 +1667,5 @@
 			unset($sql[0]);
 		}
-
+		
 		if ($sql[1]) {
 			$sql[1] = '(P.cat_id IS NULL OR NOT('.$sql[1].'))';
@@ -1673,8 +1673,8 @@
 			unset($sql[1]);
 		}
-
+		
 		return implode(' AND ',$sql);
 	}
-
+	
 	private function getPostCursor($cur,$post_id=null)
 	{
@@ -1682,13 +1682,13 @@
 			throw new Exception(__('No entry title'));
 		}
-
+		
 		if ($cur->post_content == '') {
 			throw new Exception(__('No entry content'));
 		}
-
+		
 		if ($cur->post_password === '') {
 			$cur->post_password = null;
 		}
-
+		
 		if ($cur->post_dt == '') {
 			$offset = dt::getTimeOffset($this->core->auth->getInfo('user_tz'));
@@ -1696,11 +1696,11 @@
 			$cur->post_dt = date('Y-m-d H:i:00',$now);
 		}
-
+		
 		$post_id = is_int($post_id) ? $post_id : $cur->post_id;
-
+		
 		if ($cur->post_content_xhtml == '') {
 			throw new Exception(__('No entry content'));
 		}
-
+		
 		# Words list
 		if ($cur->post_title !== null && $cur->post_excerpt_xhtml !== null
@@ -1711,9 +1711,9 @@
 			$cur->post_excerpt_xhtml.' '.
 			$cur->post_content_xhtml;
-
+			
 			$cur->post_words = implode(' ',text::splitWords($words));
 		}
 	}
-
+	
 	private function getPostContent($cur,$post_id)
 	{
@@ -1722,5 +1722,5 @@
 		$post_content = $cur->post_content;
 		$post_content_xhtml = $cur->post_content_xhtml;
-
+		
 		$this->setPostContent(
 			$post_id,$cur->post_format,$cur->post_lang,
@@ -1728,5 +1728,5 @@
 			$post_content,$post_content_xhtml
 		);
-
+		
 		$cur->post_excerpt = $post_excerpt;
 		$cur->post_excerpt_xhtml = $post_excerpt_xhtml;
@@ -1734,8 +1734,8 @@
 		$cur->post_content_xhtml = $post_content_xhtml;
 	}
-
+	
 	/**
 	Creates post HTML content, taking format and lang into account.
-
+	
 	@param		post_id		<b>integer</b>		Post ID
 	@param		format		<b>string</b>		Post format
@@ -1771,5 +1771,5 @@
 			}
 		}
-
+		
 		if ($excerpt) {
 			$excerpt_xhtml = $this->core->callFormater($format,$excerpt);
@@ -1778,5 +1778,5 @@
 			$excerpt_xhtml = '';
 		}
-
+		
 		if ($content) {
 			$content_xhtml = $this->core->callFormater($format,$content);
@@ -1785,5 +1785,5 @@
 			$content_xhtml = '';
 		}
-
+		
 		# --BEHAVIOR-- coreAfterPostContentFormat
 		$this->core->callBehavior('coreAfterPostContentFormat',array(
@@ -1794,9 +1794,9 @@
 		));
 	}
-
+	
 	/**
 	Returns URL for a post according to blog setting <var>post_url_format</var>.
 	It will try to guess URL and append some figures if needed.
-
+	
 	@param	url			<b>string</b>		Origin URL, could be empty
 	@param	post_dt		<b>string</b>		Post date (in YYYY-MM-DD HH:mm:ss)
@@ -1808,5 +1808,5 @@
 	{
 		$url = trim($url);
-
+		
 		$url_patterns = array(
 		'{y}' => date('Y',strtotime($post_dt)),
@@ -1816,5 +1816,5 @@
 		'{id}' => (integer) $post_id
 		);
-
+		
 		# If URL is empty, we create a new one
 		if ($url == '')
@@ -1831,5 +1831,5 @@
 			$url = text::tidyURL($url);
 		}
-
+		
 		# Let's check if URL is taken...
 		$strReq = 'SELECT post_url FROM '.$this->prefix.'post '.
@@ -1838,7 +1838,7 @@
 				"AND blog_id = '".$this->con->escape($this->id)."' ".
 				'ORDER BY post_url DESC';
-
+		
 		$rs = $this->con->select($strReq);
-
+		
 		if (!$rs->isEmpty())
 		{
@@ -1855,5 +1855,5 @@
 					"AND blog_id = '".$this->con->escape($this->id)."' ".
 					'ORDER BY post_url DESC ';
-
+			
 			$rs = $this->con->select($strReq);
 			$a = array();
@@ -1861,8 +1861,8 @@
 				$a[] = $rs->post_url;
 			}
-
+			
 			natsort($a);
 			$t_url = end($a);
-
+			
 			if (preg_match('/(.*?)([0-9]+)$/',$t_url,$m)) {
 				$i = (integer) $m[2];
@@ -1871,17 +1871,17 @@
 				$i = 1;
 			}
-
+			
 			return $url.($i+1);
 		}
-
+		
 		# URL is empty?
 		if ($url == '') {
 			throw new Exception(__('Empty entry URL'));
 		}
-
+		
 		return $url;
 	}
 	//@}
-
+	
 	/// @name Comments management methods
 	//@{
@@ -1889,10 +1889,10 @@
 	Retrieves comments. <b>$params</b> is an array taking the following
 	optionnal parameters:
-
+	
 	- no_content: Don't retrieve comment content
-	- post_type: Get only entries with given type (default no type, array for many types)
+	- post_type: Get only entries with given type (default no type, array for many types) 
 	- post_id: (integer) Get comments belonging to given post_id
 	- cat_id: (integer or array) Get comments belonging to entries of given category ID
-	- comment_id: (integer or array) Get comment with given ID (or IDs)
+	- comment_id: (integer) Get comment with given ID
 	- comment_site: (string) Get comments with given comment_site
 	- comment_status: (integer) Get comments with given comment_status
@@ -1907,5 +1907,5 @@
 	- limit: Limit parameter
 	- sql_only : return the sql request instead of results. Only ids are selected
-
+	
 	@param	params		<b>array</b>		Parameters
 	@param	count_only	<b>boolean</b>		Only counts results
@@ -1918,5 +1918,5 @@
 			$strReq = 'SELECT count(comment_id) ';
 		}
-		elseif (!empty($params['sql_only']))
+		elseif (!empty($params['sql_only'])) 
 		{
 			$strReq = 'SELECT P.post_id ';
@@ -1929,9 +1929,9 @@
 				$content_req = 'comment_content, ';
 			}
-
+			
 			if (!empty($params['columns']) && is_array($params['columns'])) {
 				$content_req .= implode(', ',$params['columns']).', ';
 			}
-
+			
 			$strReq =
 			'SELECT C.comment_id, comment_dt, comment_tz, comment_upddt, '.
@@ -1942,25 +1942,25 @@
 			'P.post_dt, P.user_id, U.user_email, U.user_url ';
 		}
-
+		
 		$strReq .=
 		'FROM '.$this->prefix.'comment C '.
 		'INNER JOIN '.$this->prefix.'post P ON C.post_id = P.post_id '.
 		'INNER JOIN '.$this->prefix.'user U ON P.user_id = U.user_id ';
-
+		
 		if (!empty($params['from'])) {
 			$strReq .= $params['from'].' ';
 		}
-
+		
 		$strReq .=
 		"WHERE P.blog_id = '".$this->con->escape($this->id)."' ";
-
+		
 		if (!$this->core->auth->check('contentadmin',$this->id)) {
 			$strReq .= 'AND ((comment_status = 1 AND P.post_status = 1 ';
-
+			
 			if ($this->without_password) {
 				$strReq .= 'AND post_password IS NULL ';
 			}
 			$strReq .= ') ';
-
+			
 			if ($this->core->auth->userID()) {
 				$strReq .= "OR P.user_id = '".$this->con->escape($this->core->auth->userID())."')";
@@ -1969,59 +1969,54 @@
 			}
 		}
-
+		
 		if (!empty($params['post_type']))
 		{
 			$strReq .= 'AND post_type '.$this->con->in($params['post_type']);
 		}
-
+		
 		if (isset($params['post_id']) && $params['post_id'] !== '') {
 			$strReq .= 'AND P.post_id = '.(integer) $params['post_id'].' ';
 		}
-
+		
 		if (isset($params['cat_id']) && $params['cat_id'] !== '') {
 			$strReq .= 'AND P.cat_id = '.(integer) $params['cat_id'].' ';
 		}
-
+		
 		if (isset($params['comment_id']) && $params['comment_id'] !== '') {
-			if (is_array($params['comment_id'])) {
-				array_walk($params['comment_id'],create_function('&$v,$k','if($v!==null){$v=(integer)$v;}'));
-			} else {
-				$params['comment_id'] = array((integer) $params['comment_id']);
-			}
-			$strReq .= 'AND comment_id '.$this->con->in($params['comment_id']);
-		}
-
+			$strReq .= 'AND comment_id = '.(integer) $params['comment_id'].' ';
+		}
+		
 		if (isset($params['comment_site'])) {
 			$comment_site = $this->con->escape(str_replace('*','%',$params['comment_site']));
 			$strReq .= "AND comment_site LIKE '".$comment_site."' ";
 		}
-
+		
 		if (isset($params['comment_status'])) {
 			$strReq .= 'AND comment_status = '.(integer) $params['comment_status'].' ';
 		}
-
+		
 		if (!empty($params['comment_status_not']))
 		{
 			$strReq .= 'AND comment_status <> '.(integer) $params['comment_status_not'].' ';
 		}
-
+		
 		if (isset($params['comment_trackback'])) {
 			$strReq .= 'AND comment_trackback = '.(integer) (boolean) $params['comment_trackback'].' ';
 		}
-
+		
 		if (isset($params['comment_ip'])) {
 			$comment_ip = $this->con->escape(str_replace('*','%',$params['comment_ip']));
 			$strReq .= "AND comment_ip LIKE '".$comment_ip."' ";
 		}
-
+		
 		if (isset($params['q_author'])) {
 			$q_author = $this->con->escape(str_replace('*','%',strtolower($params['q_author'])));
 			$strReq .= "AND LOWER(comment_author) LIKE '".$q_author."' ";
 		}
-
+		
 		if (!empty($params['search']))
 		{
 			$words = text::splitWords($params['search']);
-
+			
 			if (!empty($words))
 			{
@@ -2030,5 +2025,5 @@
 					$this->core->callBehavior('coreCommentSearch',$this->core,array(&$words,&$strReq,&$params));
 				}
-
+				
 				if ($words)
 				{
@@ -2040,9 +2035,9 @@
 			}
 		}
-
+		
 		if (!empty($params['sql'])) {
 			$strReq .= $params['sql'].' ';
 		}
-
+		
 		if (!$count_only)
 		{
@@ -2053,5 +2048,5 @@
 			}
 		}
-
+		
 		if (!$count_only && !empty($params['limit'])) {
 			$strReq .= $this->con->limit($params['limit']);
@@ -2061,19 +2056,19 @@
 			return $strReq;
 		}
-
+		
 		$rs = $this->con->select($strReq);
 		$rs->core = $this->core;
 		$rs->extend('rsExtComment');
-
+		
 		# --BEHAVIOR-- coreBlogGetComments
 		$this->core->callBehavior('coreBlogGetComments',$rs);
-
+		
 		return $rs;
 	}
-
+	
 	/**
 	Creates a new comment. Takes a cursor as input and returns the new comment
 	ID.
-
+	
 	@param	cur		<b>cursor</b>		Comment cursor
 	@return	<b>integer</b>		New comment ID
@@ -2087,23 +2082,23 @@
 			$rs = $this->con->select(
 				'SELECT MAX(comment_id) '.
-				'FROM '.$this->prefix.'comment '
+				'FROM '.$this->prefix.'comment ' 
 			);
-
+			
 			$cur->comment_id = (integer) $rs->f(0) + 1;
 			$cur->comment_upddt = date('Y-m-d H:i:s');
-
+			
 			$offset = dt::getTimeOffset($this->settings->system->blog_timezone);
 			$cur->comment_dt = date('Y-m-d H:i:s',time() + $offset);
 			$cur->comment_tz = $this->settings->system->blog_timezone;
-
+			
 			$this->getCommentCursor($cur);
-
+			
 			if ($cur->comment_ip === null) {
 				$cur->comment_ip = http::realIP();
 			}
-
+			
 			# --BEHAVIOR-- coreBeforeCommentCreate
 			$this->core->callBehavior('coreBeforeCommentCreate',$this,$cur);
-
+			
 			$cur->insert();
 			$this->con->unlock();
@@ -2114,18 +2109,18 @@
 			throw $e;
 		}
-
+		
 		# --BEHAVIOR-- coreAfterCommentCreate
 		$this->core->callBehavior('coreAfterCommentCreate',$this,$cur);
-
+		
 		$this->triggerComment($cur->comment_id);
 		if ($cur->comment_status != -2) {
 			$this->triggerBlog();
-		}
+		}	
 		return $cur->comment_id;
 	}
-
+	
 	/**
 	Updates an existing comment.
-
+	
 	@param	id		<b>integer</b>		Comment ID
 	@param	cur		<b>cursor</b>		Comment cursor
@@ -2136,17 +2131,17 @@
 			throw new Exception(__('You are not allowed to update comments'));
 		}
-
+		
 		$id = (integer) $id;
-
+		
 		if (empty($id)) {
 			throw new Exception(__('No such comment ID'));
 		}
-
+		
 		$rs = $this->getComments(array('comment_id' => $id));
-
+		
 		if ($rs->isEmpty()) {
 			throw new Exception(__('No such comment ID'));
 		}
-
+		
 		#If user is only usage, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
@@ -2156,28 +2151,28 @@
 			}
 		}
-
+		
 		$this->getCommentCursor($cur);
-
+		
 		$cur->comment_upddt = date('Y-m-d H:i:s');
-
+		
 		if (!$this->core->auth->check('publish,contentadmin',$this->id)) {
 			$cur->unsetField('comment_status');
 		}
-
+		
 		# --BEHAVIOR-- coreBeforeCommentUpdate
 		$this->core->callBehavior('coreBeforeCommentUpdate',$this,$cur,$rs);
-
+		
 		$cur->update('WHERE comment_id = '.$id.' ');
-
+		
 		# --BEHAVIOR-- coreAfterCommentUpdate
 		$this->core->callBehavior('coreAfterCommentUpdate',$this,$cur,$rs);
-
+		
 		$this->triggerComment($id);
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Updates comment status.
-
+	
 	@param	id		<b>integer</b>		Comment ID
 	@param	status	<b>integer</b>		Comment status
@@ -2187,8 +2182,8 @@
 		$this->updCommentsStatus($id,$status);
 	}
-
+	
 	/**
 	Updates comments status.
-
+	
 	@param	ids		<b>mixed</b>		Comment(s) ID(s)
 	@param	status	<b>integer</b>		Comment status
@@ -2199,51 +2194,51 @@
 			throw new Exception(__("You are not allowed to change this comment's status"));
 		}
-
+		
 		$co_ids = dcUtils::cleanIds($ids);
 		$status = (integer) $status;
-
-		$strReq =
+		
+		$strReq = 
 			'UPDATE '.$this->prefix.'comment tc ';
-
+		
 		# mySQL uses "JOIN" synthax
 		if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') {
-			$strReq .=
+			$strReq .= 
 				'JOIN '.$this->prefix.'post tp ON tc.post_id = tp.post_id ';
 		}
-
-		$strReq .=
+		
+		$strReq .= 
 			'SET comment_status = '.$status.' ';
-
+		
 		# pgSQL uses "FROM" synthax
 		if ($this->con->driver() != 'mysql' && $this->con->driver() != 'mysqli') {
-			$strReq .=
+			$strReq .= 
 				'FROM '.$this->prefix.'post tp ';
 		}
-
+		
 		$strReq .=
 			"WHERE blog_id = '".$this->con->escape($this->id)."' ".
 			'AND comment_id'.$this->con->in($co_ids);
-
+		
 		# add pgSQL "WHERE" clause
 		if ($this->con->driver() != 'mysql' && $this->con->driver() != 'mysqli') {
-			$strReq .=
+			$strReq .= 
 				'AND tc.post_id = tp.post_id ';
 		}
-
+		
 		#If user is only usage, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
 		{
-			$strReq .=
+			$strReq .= 
 				"AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
 		}
-
+		
 		$this->con->execute($strReq);
 		$this->triggerComments($co_ids);
 		$this->triggerBlog();
 	}
-
+	
 	/**
 	Delete a comment
-
+	
 	@param	id		<b>integer</b>		Comment ID
 	*/
@@ -2252,8 +2247,8 @@
 		$this->delComments($id);
 	}
-
+	
 	/**
 	Delete comments
-
+	
 	@param	ids		<b>mixed</b>		Comment(s) ID(s)
 	*/
@@ -2263,11 +2258,11 @@
 			throw new Exception(__('You are not allowed to delete comments'));
 		}
-
+		
 		$co_ids = dcUtils::cleanIds($ids);
-
+		
 		if (empty($co_ids)) {
 			throw new Exception(__('No such comment ID'));
 		}
-
+		
 		# Retrieve posts affected by comments edition
 		$affected_posts = array();
@@ -2277,14 +2272,14 @@
 			'WHERE comment_id'.$this->con->in($co_ids).
 			'GROUP BY post_id';
-
+		
 		$rs = $this->con->select($strReq);
-
+		
 		while ($rs->fetch()) {
 			$affected_posts[] = (integer) $rs->post_id;
 		}
-
+		
 		# mySQL uses "INNER JOIN" synthax
 		if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') {
-			$strReq =
+			$strReq = 
 				'DELETE FROM tc '.
 				'USING '.$this->prefix.'comment tc '.
@@ -2293,21 +2288,21 @@
 		# pgSQL uses nothing special
 		else {
-			$strReq =
+			$strReq = 
 				'DELETE FROM '.$this->prefix.'comment tc '.
 				'USING '.$this->prefix.'post tp ';
 		}
-
-		$strReq .=
+		
+		$strReq .= 
 			'WHERE tc.post_id = tp.post_id '.
 			"AND tp.blog_id = '".$this->con->escape($this->id)."' ".
 			'AND comment_id'.$this->con->in($co_ids);
-
+		
 		#If user can only delete, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
 		{
-			$strReq .=
+			$strReq .= 
 				"AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
 		}
-
+		
 		$this->con->execute($strReq);
 		$this->triggerComments($co_ids, true, $affected_posts);
@@ -2320,8 +2315,8 @@
 			throw new Exception(__('You are not allowed to delete comments'));
 		}
-
+		
 		# mySQL uses "INNER JOIN" synthax
 		if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') {
-			$strReq =
+			$strReq = 
 				'DELETE FROM tc '.
 				'USING '.$this->prefix.'comment tc '.
@@ -2330,25 +2325,25 @@
 		# pgSQL uses nothing special
 		else {
-			$strReq =
+			$strReq = 
 				'DELETE FROM '.$this->prefix.'comment tc '.
 				'USING '.$this->prefix.'post tp ';
 		}
-
-		$strReq .=
+		
+		$strReq .= 
 			'WHERE tc.post_id = tp.post_id '.
 			"AND tp.blog_id = '".$this->con->escape($this->id)."' ".
 			'AND comment_status = -2';
-
+		
 		#If user can only delete, we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
 		{
-			$strReq .=
+			$strReq .= 
 				"AND user_id = '".$this->con->escape($this->core->auth->userID())."' ";
 		}
-
+		
 		$this->con->execute($strReq);
 		$this->triggerBlog();
 	}
-
+	
 	private function getCommentCursor($cur)
 	{
@@ -2356,13 +2351,13 @@
 			throw new Exception(__('You must provide a comment'));
 		}
-
+		
 		if ($cur->comment_author !== null && $cur->comment_author == '') {
 			throw new Exception(__('You must provide an author name'));
 		}
-
+		
 		if ($cur->comment_email != '' && !text::isEmail($cur->comment_email)) {
 			throw new Exception(__('Email address is not valid.'));
 		}
-
+		
 		if ($cur->comment_site !== null && $cur->comment_site != '') {
 			if (!preg_match('|^http(s?)://|i',$cur->comment_site, $matches)) {
@@ -2372,9 +2367,9 @@
 			}
 		}
-
+		
 		if ($cur->comment_status === null) {
 			$cur->comment_status = (integer) $this->settings->system->comments_pub;
 		}
-
+		
 		# Words list
 		if ($cur->comment_content !== null)
Index: inc/core/class.dc.namespace.php
===================================================================
--- inc/core/class.dc.namespace.php	(revision 2505)
+++ inc/core/class.dc.namespace.php	(revision 1179)
@@ -22,14 +22,14 @@
 	protected $table;		///< <b>string</b> Settings table name
 	protected $blog_id;		///< <b>string</b> Blog ID
-
+	
 	protected $global_settings = array();	///< <b>array</b> Global settings array
 	protected $local_settings = array();	///< <b>array</b> Local settings array
 	protected $settings = array();		///< <b>array</b> Associative settings array
 	protected $ns;			///< <b>string</b> Current namespace
-
+	
 	/**
 	Object constructor. Retrieves blog settings and puts them in $settings
 	array. Local (blog) settings have a highest priority than global settings.
-
+	
 	@param	name		<b>string</b>		ID for this namespace
 	*/
@@ -41,14 +41,14 @@
 			throw new Exception(sprintf(__('Invalid setting dcNamespace: %s'),$name));
 		}
-
+		
 		$this->con =& $core->con;
 		$this->table = $core->prefix.'setting';
 		$this->blog_id =& $blog_id;
-
+		
 		$this->getSettings($rs);
 	}
-
+	
 	private function getSettings($rs=null)
-	{
+	{	
 		if ($rs == null) {
 			$strReq = 'SELECT blog_id, setting_id, setting_value, '.
@@ -59,5 +59,5 @@
 					"AND setting_ns = '".$this->con->escape($this->ns)."' ".
 					'ORDER BY setting_id DESC ';
-
+		
 			try {
 				$rs = $this->con->select($strReq);
@@ -74,5 +74,5 @@
 			$value = $rs->f('setting_value');
 			$type = $rs->f('setting_type');
-
+			
 			if ($type == 'float' || $type == 'double') {
 				$type = 'float';
@@ -80,9 +80,9 @@
 				$type = 'string';
 			}
-
+			
 			settype($value,$type);
-
+			
 			$array = $rs->blog_id ? 'local' : 'global';
-
+			
 			$this->{$array.'_settings'}[$id] = array(
 				'ns' => $this->ns,
@@ -93,14 +93,14 @@
 			);
 		}
-
+		
 		$this->settings = $this->global_settings;
-
+		
 		foreach ($this->local_settings as $id => $v) {
 			$this->settings[$id] = $v;
 		}
-
+		
 		return true;
 	}
-
+	
 	private function settingExists($id,$global=false)
 	{
@@ -108,8 +108,8 @@
 		return isset($this->{$array.'_settings'}[$id]);
 	}
-
+	
 	/**
 	Returns setting value if exists.
-
+	
 	@param	n		<b>string</b>		Setting name
 	@return	<b>mixed</b>
@@ -120,38 +120,8 @@
 			return $this->settings[$n]['value'];
 		}
-
+		
 		return null;
 	}
-
-	/**
-	Returns global setting value if exists.
-
-	@param	n		<b>string</b>		setting name
-	@return	<b>mixed</b>
-	*/
-	public function getGlobal($n)
-	{
-		if (isset($this->global_settings[$n]['value'])) {
-			return $this->global_settings[$n]['value'];
-		}
-
-		return null;
-	}
-
-	/**
-	Returns local setting value if exists.
-
-	@param	n		<b>string</b>		setting name
-	@return	<b>mixed</b>
-	*/
-	public function getLocal($n)
-	{
-		if (isset($this->local_settings[$n]['value'])) {
-			return $this->local_settings[$n]['value'];
-		}
-
-		return null;
-	}
-
+	
 	/**
 	Magic __get method.
@@ -162,9 +132,9 @@
 		return $this->get($n);
 	}
-
+	
 	/**
 	Sets a setting in $settings property. This sets the setting for script
 	execution time only and if setting exists.
-
+	
 	@param	n		<b>string</b>		Setting name
 	@param	v		<b>mixed</b>		Setting value
@@ -176,5 +146,5 @@
 		}
 	}
-
+	
 	/**
 	Magic __set method.
@@ -185,14 +155,14 @@
 		$this->set($n,$v);
 	}
-
+	
 	/**
 	Creates or updates a setting.
-
+	
 	$type could be 'string', 'integer', 'float', 'boolean' or null. If $type is
 	null and setting exists, it will keep current setting type.
-
+	
 	$value_change allow you to not change setting. Useful if you need to change
 	a setting label or type and don't want to change its value.
-
+	
 	@param	id			<b>string</b>		Setting ID
 	@param	value		<b>mixed</b>		Setting value
@@ -207,5 +177,5 @@
 			throw new Exception(sprintf(__('%s is not a valid setting id'),$id));
 		}
-
+		
 		# We don't want to change setting value
 		if (!$value_change)
@@ -217,5 +187,5 @@
 			}
 		}
-
+		
 		# Setting type
 		if ($type == 'double')
@@ -237,5 +207,5 @@
 			$type = 'string';
 		}
-
+		
 		# We don't change label
 		if ($label == null)
@@ -247,12 +217,12 @@
 			}
 		}
-
+		
 		settype($value,$type);
-
+		
 		$cur = $this->con->openCursor($this->table);
 		$cur->setting_value = ($type == 'boolean') ? (string) (integer) $value : (string) $value;
 		$cur->setting_type = $type;
 		$cur->setting_label = $label;
-
+		
 		#If we are local, compare to global value
 		if (!$global && $this->settingExists($id,true))
@@ -261,5 +231,5 @@
 			$same_setting = $g['ns'] == $this->ns && $g['value'] == $value
 			&& $g['type'] == $type && $g['label'] == $label;
-
+			
 			# Drop setting if same value as global
 			if ($same_setting && $this->settingExists($id,false)) {
@@ -269,5 +239,5 @@
 			}
 		}
-
+		
 		if ($this->settingExists($id,$global) && $this->ns == $this->settings[$id]['ns'])
 		{
@@ -277,5 +247,5 @@
 				$where = "WHERE blog_id = '".$this->con->escape($this->blog_id)."' ";
 			}
-
+			
 			$cur->update($where."AND setting_id = '".$this->con->escape($id)."' AND setting_ns = '".$this->con->escape($this->ns)."' ");
 		}
@@ -285,5 +255,5 @@
 			$cur->blog_id = $global ? null : $this->blog_id;
 			$cur->setting_ns = $this->ns;
-
+			
 			$cur->insert();
 		}
@@ -302,5 +272,5 @@
 			throw new Exception(__('No namespace specified'));
 		}
-
+		
 		if (!array_key_exists($oldId,$this->settings) || array_key_exists($newId,$this->settings)) {
 			return false;
@@ -321,6 +291,6 @@
 
 	/**
-	Removes an existing setting in a Namespace
-
+	Removes an existing setting in a Namespace 
+	
 	@param	id		<b>string</b>		Setting ID
 	*/
@@ -330,7 +300,7 @@
 			throw new Exception(__('No namespace specified'));
 		}
-
+		
 		$strReq =	'DELETE FROM '.$this->table.' ';
-
+		
 		if ($this->blog_id === null) {
 			$strReq .= 'WHERE blog_id IS NULL ';
@@ -338,14 +308,14 @@
 			$strReq .= "WHERE blog_id = '".$this->con->escape($this->blog_id)."' ";
 		}
-
+		
 		$strReq .= "AND setting_id = '".$this->con->escape($id)."' ";
 		$strReq .= "AND setting_ns = '".$this->con->escape($this->ns)."' ";
-
+		
 		$this->con->execute($strReq);
 	}
-
-	/**
-	Removes all existing settings in a Namespace
-
+	
+	/**
+	Removes all existing settings in a Namespace 
+	
 	@param	force_global	<b>boolean</b>	Force global pref drop
 	*/
@@ -355,7 +325,7 @@
 			throw new Exception(__('No namespace specified'));
 		}
-
+		
 		$strReq =	'DELETE FROM '.$this->table.' ';
-
+		
 		if (($force_global) || ($this->blog_id === null)) {
 			$strReq .= 'WHERE blog_id IS NULL ';
@@ -365,20 +335,20 @@
 			$global = false;
 		}
-
+		
 		$strReq .= "AND setting_ns = '".$this->con->escape($this->ns)."' ";
-
+		
 		$this->con->execute($strReq);
-
+		
 		$array = $global ? 'global' : 'local';
 		unset($this->{$array.'_settings'});
 		$this->{$array.'_settings'} = array();
-
+		
 		$array = $global ? 'local' : 'global';
 		$this->settings = $this->{$array.'_settings'};
 	}
-
+	
 	/**
 	Returns $settings property content.
-
+	
 	@return	<b>array</b>
 	*/
@@ -387,8 +357,8 @@
 		return $this->settings;
 	}
-
+	
 	/**
 	Returns $global_settings property content.
-
+	
 	@return	<b>array</b>
 	*/
Index: inc/prepend.php
===================================================================
--- inc/prepend.php	(revision 2496)
+++ inc/prepend.php	(revision 2492)
@@ -135,5 +135,5 @@
 # Constants
 define('DC_ROOT',path::real(dirname(__FILE__).'/..'));
-define('DC_VERSION','2.7-dev');
+define('DC_VERSION','2.6-RC');
 define('DC_DIGESTS',dirname(__FILE__).'/digests');
 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales');
Index: plugins/antispam/filters/class.dc.filter.linkslookup.php
===================================================================
--- plugins/antispam/filters/class.dc.filter.linkslookup.php	(revision 2522)
+++ plugins/antispam/filters/class.dc.filter.linkslookup.php	(revision 1366)
@@ -15,17 +15,17 @@
 {
 	public $name = 'Links Lookup';
-
+	
 	private $server = 'multi.surbl.org';
-
+	
 	protected function setInfo()
 	{
 		$this->description = __('Checks links in comments against surbl.org');
 	}
-
+	
 	public function getStatusMessage($status,$comment_id)
 	{
 		return sprintf(__('Filtered by %1$s with server %2$s.'),$this->guiLink(),$status);
 	}
-
+	
 	public function isSpam($type,$author,$email,$site,$ip,$content,$post_id,&$status)
 	{
@@ -33,8 +33,8 @@
 			return;
 		}
-
+		
 		$urls = $this->getLinks($content);
 		array_unshift($urls,$site);
-
+		
 		foreach ($urls as $u)
 		{
@@ -48,8 +48,4 @@
 
 			$i = count($domain_elem) - 1;
-			if ($i == 0) {
-				// "domain" is 1 word long, don't check it
-				return false;
-			}
 			$host = $domain_elem[$i];
 			do
@@ -57,13 +53,13 @@
 				$host = $domain_elem[$i - 1].'.'.$host;
 				$i--;
-				if (substr(gethostbyname($host.'.'.$this->server),0,3) == "127" )
+				if (substr(gethostbyname($host.'.'.$this->server),0,3) == "127" ) 
 				{
 					$status = substr($domain,0,128);
 					return true;
-				}
+				}				
 			} while ($i > 0);
 		}
 	}
-
+	
 	private function getLinks($text)
 	{
Index: plugins/antispam/index.php
===================================================================
--- plugins/antispam/index.php	(revision 2495)
+++ plugins/antispam/index.php	(revision 2322)
@@ -117,5 +117,4 @@
 	echo
 		dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-		dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
 		dcPage::jsLoad('index.php?pf=antispam/antispam.js');
   }
Index: plugins/blogroll/index.php
===================================================================
--- plugins/blogroll/index.php	(revision 2495)
+++ plugins/blogroll/index.php	(revision 2256)
@@ -27,5 +27,5 @@
 {
 	$default_tab = 'import-links';
-
+	
 	try
 	{
@@ -35,5 +35,5 @@
 			throw new Exception(__('Unable to move uploaded file.'));
 		}
-
+		
 		require_once dirname(__FILE__).'/class.dc.importblogroll.php';
 		try {
@@ -44,6 +44,6 @@
 			throw $e;
 		}
-
-
+		
+		
 		if (empty($imported)) {
 			unset($imported);
@@ -69,12 +69,12 @@
 		}
 	}
-
+	
 	dcPage::addSuccessNotice(__('links have been successfully imported.'));
-	http::redirect($p_url);
+	http::redirect($p_url);	
 }
 
 if (!empty($_POST['cancel_import'])) {
 	$core->error->add(__('Import operation cancelled.'));
-	$default_tab = 'import-links';
+	$default_tab = 'import-links';	
 }
 
@@ -86,5 +86,5 @@
 	$link_desc = $_POST['link_desc'];
 	$link_lang = $_POST['link_lang'];
-
+	
 	try {
 		$blogroll->addLink($link_title,$link_href,$link_desc,$link_lang);
@@ -102,5 +102,5 @@
 {
 	$cat_title = $_POST['cat_title'];
-
+	
 	try {
 		$blogroll->addCategory($cat_title);
@@ -124,5 +124,5 @@
 		}
 	}
-
+	
 	if (!$core->error->flag()) {
 		dcPage::addSuccessNotice(__('Items have been successfully removed.'));
@@ -145,5 +145,5 @@
 	foreach ($order as $pos => $l) {
 		$pos = ((integer) $pos)+1;
-
+		
 		try {
 			$blogroll->updateOrder($l,$pos);
@@ -152,5 +152,5 @@
 		}
 	}
-
+	
 	if (!$core->error->flag()) {
 		dcPage::addSuccessNotice(__('Items order has been successfully updated'));
@@ -172,10 +172,9 @@
   <title><?php echo __('Blogroll'); ?></title>
   <?php echo dcPage::jsConfirmClose('links-form','add-link-form','add-category-form'); ?>
-  <?php
+  <?php 
 	$core->auth->user_prefs->addWorkspace('accessibility');
 	if (!$core->auth->user_prefs->accessibility->nodragdrop) {
 	echo
 		dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-		dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
 		dcPage::jsLoad('index.php?pf=blogroll/blogroll.js');
 	}
@@ -214,11 +213,11 @@
 {
 	$position = (string) $rs->index()+1;
-
+	
 	echo
 	'<tr class="line" id="l_'.$rs->link_id.'">'.
 	'<td class="handle minimal">'.form::field(array('order['.$rs->link_id.']'),2,5,$position,'position','',false,'title="'.__('position').'"').'</td>'.
 	'<td class="minimal">'.form::checkbox(array('remove[]'),$rs->link_id,'','','',false,'title="'.__('select this link').'"').'</td>';
-
-
+	
+	
 	if ($rs->is_cat)
 	{
@@ -236,5 +235,5 @@
 		'<td>'.html::escapeHTML($rs->link_lang).'</td>';
 	}
-
+	
 	echo '</tr>';
 }
@@ -246,5 +245,5 @@
 <p class="col">
 <?php
-	echo
+	echo 
 	form::hidden('links_order','').
 	form::hidden(array('p'),'blogroll').
@@ -253,5 +252,5 @@
 <input type="submit" name="saveorder" value="<?php echo __('Save order'); ?>" /></p>
 <p class="col right"><input type="submit" class="delete" name="removeaction"
-	 value="<?php echo __('Delete selected links'); ?>"
+	 value="<?php echo __('Delete selected links'); ?>" 
 	 onclick="return window.confirm('
 	 <?php echo html::escapeJS(__('Are you sure you want to delete selected links?')); ?>');" /></p>
@@ -331,5 +330,5 @@
 		'<th>'.__('Description').'</th>'.
 		'</tr>';
-
+		
 		$i = 0;
 		foreach ($imported as $entry) {
@@ -337,6 +336,6 @@
 			$title = html::escapeHTML($entry->title);
 			$desc  = html::escapeHTML($entry->desc);
-
-			echo
+			
+			echo 
 			'<tr><td>'.form::checkbox(array('entries[]'),$i,'','','').'</td>'.
 			'<td nowrap><a href="'.$url.'">'.$title.'</a>'.
@@ -346,5 +345,5 @@
 			'<td>'.$desc.
 			'<input type="hidden" name="desc['.$i.']" value="'.$desc.'" />'.
-			'</td></tr>'."\n";
+			'</td></tr>'."\n";			
 			$i++;
 		}
@@ -353,5 +352,5 @@
 		'<div class="two-cols">'.
 		'<p class="col checkboxes-helpers"></p>'.
-
+		
 		'<p class="col right">'.
 		form::hidden(array('p'),'blogroll').
Index: plugins/pages/list.php
===================================================================
--- plugins/pages/list.php	(revision 2496)
+++ plugins/pages/list.php	(revision 2442)
@@ -55,7 +55,5 @@
   <title><?php echo __('Pages'); ?></title>
   <?php
-  	echo
-  		dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-		dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
+  	echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
 		dcPage::jsLoad('index.php?pf=pages/list.js').
 		'<script type="text/javascript">'.
@@ -91,10 +89,10 @@
 	$post_list->display($page,$nb_per_page,
 	'<form action="plugin.php" method="post" id="form-entries">'.
-
+	
 	'%s'.
-
+	
 	'<div class="two-cols">'.
 	'<p class="col checkboxes-helpers"></p>'.
-
+	
 	'<p class="col right"><label for="action" class="classic">'.__('Selected pages action:').'</label> '.
 	form::combo('action',$pages_actions_page->getCombo()).
Index: plugins/simpleMenu/index.php
===================================================================
--- plugins/simpleMenu/index.php	(revision 2496)
+++ plugins/simpleMenu/index.php	(revision 2455)
@@ -347,5 +347,4 @@
 			echo
 				dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-				dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
 				dcPage::jsLoad('index.php?pf=simpleMenu/simplemenu.js');
 		}
Index: plugins/widgets/index.php
===================================================================
--- plugins/widgets/index.php	(revision 2520)
+++ plugins/widgets/index.php	(revision 2509)
@@ -218,5 +218,4 @@
 		echo
 			dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-			dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').
 			dcPage::jsLoad('index.php?pf=widgets/widgets.js');
   ?>
@@ -367,5 +366,5 @@
 		$altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"';
 		$altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"';
-		
+
 		$iname = 'w['.$pr.']['.$i.']';
 
Index: themes/ductile/_prepend.php
===================================================================
--- themes/ductile/_prepend.php	(revision 2495)
+++ themes/ductile/_prepend.php	(revision 1133)
@@ -26,6 +26,5 @@
 		if (!$core->auth->user_prefs->accessibility->nodragdrop) {
 			echo
-				dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-				dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js');
+				dcPage::jsLoad('js/jquery/jquery-ui.custom.js');
 				echo <<<EOT
 <script type="text/javascript">
