Index: inc/core/class.dc.auth.php
===================================================================
--- inc/core/class.dc.auth.php	(revision 333)
+++ inc/core/class.dc.auth.php	(revision 3)
@@ -13,52 +13,37 @@
 
 /**
-* @ingroup DC_CORE
-* @nosubgrouping
-* @brief Authentication and user credentials management
-* 
-* dcAuth is a class used to handle everything related to user authentication
-* and credentials. Object is provided by dcCore $auth property.
+@ingroup DC_CORE
+@nosubgrouping
+@brief Authentication and user credentials management
+
+dcAuth is a class used to handle everything related to user authentication
+and credentials. Object is provided by dcCore $auth property.
 */
 class dcAuth
 {
-	/** @var dcCore dcCore instance */
-	protected $core;
-	/** @var connection Database connection object */
-	protected $con;
-	
-	/** @var string User table name */
-	protected $user_table;
-	/** @var string Perm table name */
-	protected $perm_table;
-	
-	/** @var string Current user ID */
-	protected $user_id;
-	/** @var array Array with user information */
-	protected $user_info = array();
-	/** @var array Array with user options */
-	protected $user_options = array();
-	/** @var boolean User must change his password after login */
-	protected $user_change_pwd;
-	/** @var boolean User is super admin */
-	protected $user_admin;
-	/** @var array Permissions for each blog */
-	protected $permissions = array();
-	/** @var boolean User can change its password */
-	protected $allow_pass_change = true;
-	/** @var array List of blogs on which the user has permissions */
-	protected $blogs = array();
-	/** @var integer Count of user blogs */
-	public $blog_count = null;
-	
-	/** @var array Permission types */
-	protected $perm_types;
-	
-	/** @var dcPrefs dcPrefs object */
-	public $user_prefs;
-	
-	/**
-	* Class constructor. Takes dcCore object as single argument.
-	* 
-	* @param dcCore	$core		dcCore object
+	protected $core;		///< <b>dcCore</b> dcCore instance
+	protected $con;		///< <b>connection</b> Database connection object
+	
+	protected $user_table;	///< <b>string</b>	User table name
+	protected $perm_table;	///< <b>string</b>	Perm table name
+	
+	protected $user_id;					///< <b>string</b>		Current user ID
+	protected $user_info = array();		///< <b>array</b>		Array with user information
+	protected $user_options = array();		///< <b>array</b>		Array with user options
+	protected $user_change_pwd;			///< <b>boolean</b>		User must change his password after login
+	protected $user_admin;				///< <b>boolean</b>		User is super admin
+	protected $permissions = array();		///< <b>array</b>		Permissions for each blog
+	protected $allow_pass_change = true;	///< <b>boolean</b>		User can change its password
+	protected $blogs = array();			///< <b>array</b>		List of blogs on which the user has permissions
+	public $blog_count = null;				///< <b>integer</b>		Count of user blogs
+	
+	protected $perm_types;	///< <b>array</b> Permission types
+	
+	public $user_prefs;	///< <b>dcPrefs</b>	dcPrefs object
+	
+	/**
+	Class constructor. Takes dcCore object as single argument.
+	
+	@param	core		<b>dcCore</b>		dcCore object
 	*/
 	public function __construct($core)
@@ -85,15 +70,14 @@
 	//@{
 	/**
-	* Checks if user exists and can log in. <var>$pwd</var> argument is optionnal
-	* while you may need to check user without password. This method will create
-	* credentials and populate all needed object properties.
-	* 
-	* @param string	$user_id		User ID
-	* @param string	$pwd			User password
-	* @param string	$user_key		User key check
-	* @param boolean	$check_blog	checks if user is associated to a blog or not.
-	* @return boolean
-	*/
-	public function checkUser($user_id, $pwd=null, $user_key=null, $check_blog=true)
+	Checks if user exists and can log in. <var>$pwd</var> argument is optionnal
+	while you may need to check user without password. This method will create
+	credentials and populate all needed object properties.
+	
+	@param	user_id	<b>string</b>		User ID
+	@param	pwd		<b>string</b>		User password
+	@param	user_key	<b>string</b>		User key check
+	@return	<b>boolean</b>
+	*/
+	public function checkUser($user_id, $pwd=null, $user_key=null)
 	{
 		# Check user and password
@@ -157,5 +141,5 @@
 		
 		# Get permissions on blogs
-		if ($check_blog && ($this->findUserBlog() === false)) {
+		if ($this->findUserBlog() === false) {
 			return false;
 		}
@@ -164,8 +148,8 @@
 	
 	/**
-	* This method only check current user password.
-	* 
-	* @param string	$pwd			User password
-	* @return boolean
+	This method only check current user password.
+	
+	@param	pwd		<b>string</b>		User password
+	@return	<b>boolean</b>
 	*/
 	public function checkPassword($pwd)
@@ -179,7 +163,7 @@
 	
 	/**
-	* This method checks if user session cookie exists
-	* 
-	* @return boolean
+	This method checks if user session cookie exists
+	
+	@return	<b>boolean</b>
 	*/
 	public function sessionExists()
@@ -189,7 +173,7 @@
 	
 	/**
-	* This method checks user session validity.
-	* 
-	* @return boolean
+	This method checks user session validity.
+	
+	@return	<b>boolean</b>
 	*/
 	public function checkSession($uid=null)
@@ -228,7 +212,7 @@
 	
 	/**
-	* Checks if user is super admin
-	* 
-	* @return boolean
+	Checks if user is super admin
+	
+	@return	<b>boolean</b>
 	*/
 	public function isSuperAdmin()
@@ -238,11 +222,11 @@
 	
 	/**
-	* Checks if user has permissions given in <var>$permissions</var> for blog
-	* <var>$blog_id</var>. <var>$permissions</var> is a coma separated list of
-	* permissions.
-	* 
-	* @param string	$permissions	Permissions list
-	* @param string	$blog_id		Blog ID
-	* @return boolean
+	Checks if user has permissions given in <var>$permissions</var> for blog
+	<var>$blog_id</var>. <var>$permissions</var> is a coma separated list of
+	permissions.
+	
+	@param	permissions	<b>string</b>		Permissions list
+	@param	blog_id		<b>string</b>		Blog ID
+	@return	<b>boolean</b>
 	*/
 	public function check($permissions,$blog_id)
@@ -273,7 +257,7 @@
 	
 	/**
-	* Returns true if user is allowed to change its password.
-	* 
-	* @return	boolean
+	Returns true if user is allowed to change its password.
+	
+	@return	<b>boolean</b>
 	*/
 	public function allowPassChange()
@@ -328,9 +312,8 @@
 	//@{
 	/**
-	* Calls $f function with super admin rights.
-	* Returns the function result.
-	* 
-	* @param callback	$f			Callback function
-	* @return mixed
+	Calls <var>$f</var> function with super admin rights.
+	
+	@param	f		<b>callback</b>	Callback function
+	@return	<b>mixed</b> Function result
 	*/
 	public function sudo($f)
@@ -363,12 +346,11 @@
 	//@{
 	/**
-	* Returns user permissions for a blog as an array which looks like:
-	* 
-	*  - [blog_id]
-	*    - [permission] => true
-	*    - ...
-	* 
-	* @param string	$blog_id		Blog ID
-	* @return array
+	Returns user permissions for a blog as an array which looks like:
+	
+	 - [blog_id]
+	   - [permission] => true
+	   - ...
+	
+	@return	<b>array</b>
 	*/
 	public function getPermissions($blog_id)
@@ -440,7 +422,7 @@
 	
 	/**
-	* Returns current user ID
-	* 
-	* @return string
+	Returns current user ID
+	
+	@return	<b>string</b>
 	*/
 	public function userID()
@@ -450,8 +432,8 @@
 	
 	/**
-	* Returns information about a user .
-	* 
-	* @param string	$n			Information name
-	* @return string
+	Returns information about a user .
+	
+	@param	n		<b>string</b>		Information name
+	@return	<b>string</b> Information value
 	*/
 	public function getInfo($n)
@@ -465,8 +447,8 @@
 	
 	/**
-	* Returns a specific user option
-	* 
-	* @param string	$n			Option name
-	* @return string
+	Returns a specific user option
+	
+	@param	n		<b>string</b>		Option name
+	@return	<b>string</b> Option value
 	*/
 	public function getOption($n)
@@ -479,7 +461,7 @@
 	
 	/**
-	* Returns all user options in an associative array.
-	* 
-	* @return array
+	Returns all user options in an associative array.
+	
+	@return	<b>array</b>
 	*/
 	public function getOptions()
@@ -492,8 +474,8 @@
 	//@{
 	/**
-	* Returns an array with permissions parsed from the string <var>$level</var>
-	* 
-	* @param string	$level		Permissions string
-	* @return array
+	Returns an array with permissions parsed from the string <var>$level</var>
+	
+	@param	level	<b>string</b>		Permissions string
+	@return	<b>array</b>
 	*/
 	public function parsePermissions($level)
@@ -510,7 +492,7 @@
 	
 	/**
-	* Returns <var>perm_types</var> property content.
-	* 
-	* @return array
+	Returns <var>perm_types</var> property content.
+	
+	@return	<b>array</b>
 	*/
 	public function getPermissionsTypes()
@@ -520,8 +502,8 @@
 	
 	/**
-	* Adds a new permission type.
-	* 
-	* @param string	$name		Permission name
-	* @param string	$title		Permission title
+	Adds a new permission type.
+	
+	@param	name		<b>string</b>		Permission name
+	@param	title	<b>string</b>		Permission title
 	*/
 	public function setPermissionType($name,$title)
@@ -534,10 +516,10 @@
 	//@{
 	/**
-	* Add a recover key to a specific user identified by its email and
-	* password.
-	* 
-	* @param string	$user_id		User ID
-	* @param string	$user_email	User Email
-	* @return string
+	Add a recover key to a specific user identified by its email and
+	password.
+	
+	@param	user_id		<b>string</b>		User ID
+	@param	user_email	<b>string</b>		User Email
+	@return	<b>string</b> Recover key
 	*/
 	public function setRecoverKey($user_id,$user_email)
@@ -565,12 +547,12 @@
 	
 	/**
-	* Creates a new user password using recovery key. Returns an array:
-	* 
-	* - user_email
-	* - user_id
-	* - new_pass
-	* 
-	* @param string	$recover_key	Recovery key
-	* @return array
+	Creates a new user password using recovery key. Returns an array:
+	
+	- user_email
+	- user_id
+	- new_pass
+	
+	@param	recover_key	<b>string</b>		Recovery key
+	@return	<b>array</b>
 	*/
 	public function recoverUserPassword($recover_key)
@@ -608,22 +590,22 @@
 	
 	/**
-	* Called after core->addUser
-	* @see dcCore::addUser
-	* @param cursor	$cur			User cursor
+	Called after core->addUser
+	@see		dcCore::addUser
+	@param	cur		<b>cursor</b>		User cursor
 	*/
 	public function afterAddUser($cur) {}
 	
 	/**
-	* Called after core->updUser
-	* @see dcCore::updUser
-	* @param string	$id			User ID
-	* @param cursor	$cur			User cursor
+	Called after core->updUser
+	@see		dcCore::updUser
+	@param	id		<b>string</b>		User ID
+	@param	cur		<b>cursor</b>		User cursor
 	*/
 	public function afterUpdUser($id,$cur) {}
 	
 	/**
-	* Called after core->delUser
-	* @see dcCore::delUser
-	* @param string	$id			User ID
+	Called after core->delUser
+	@see		dcCore::delUser
+	@param	id		<b>string</b>		User ID
 	*/
 	public function afterDelUser($id) {}
Index: inc/core/class.dc.blog.php
===================================================================
--- inc/core/class.dc.blog.php	(revision 407)
+++ inc/core/class.dc.blog.php	(revision 417)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -21,36 +21,21 @@
 class dcBlog
 {
-	/** @var dcCore dcCore instance */
-	protected $core;
-	/** @var connection Database connection object */
-	public $con;
-	/** @var string Database table prefix */
-	public $prefix;
-	
-	/** @var string Blog ID */
-	public $id;
-	/** @var string Blog unique ID */
-	public $uid;
-	/** @var string Blog name */
-	public $name;
-	/** @var string Blog description */
-	public $desc;
-	/** @var string Blog URL */
-	public $url;
-	/** @var string Blog host */
-	public $host;
-	/** @var string Blog creation date */
-	public $creadt;
-	/** @var string Blog last update date */
-	public $upddt;
-	/** @var string Blog status */
-	public $status;
-	
-	/** @var dcSettings dcSettings object */
-	public $settings;
-	/** @var string Blog theme path */
-	public $themes_path;
-	/** @var string Blog public path */
-	public $public_path;
+	protected $core;	///< <b>dcCore</b> dcCore instance
+	public $con;		///< <b>connection</b>	Database connection object
+	public $prefix;	///< <b>string</b>		Database table prefix
+	
+	public $id;		///< <b>string</b>		Blog ID
+	public $uid;		///< <b>string</b>		Blog unique ID
+	public $name;		///< <b>string</b>		Blog name
+	public $desc;		///< <b>string</b>		Blog description
+	public $url;		///< <b>string</b>		Blog URL
+	public $host;		///< <b>string</b>		Blog host
+	public $creadt;	///< <b>string</b>		Blog creation date
+	public $upddt;		///< <b>string</b>		Blog last update date
+	public $status;	///< <b>string</b>		Blog status
+	
+	public $settings;		///< <b>dcSettings</b>	dcSettings object
+	public $themes_path;	///< <b>string</b>		Blog theme path
+	public $public_path;	///< <b>string</b>		Blog public path
 	
 	private $post_status = array();
@@ -59,6 +44,5 @@
 	private $categories;
 	
-	/** @var boolean Disallow entries password protection */
-	public $without_password = true;
+	public $without_password = true;	///< <b>boolean</b> Disallow entries password protection
 	
 	/**
@@ -407,5 +391,5 @@
 		
 		if (!empty($params['post_type'])) {
-			$strReq .= 'AND P.post_type '.$this->con->in($params['post_type']);
+			$strReq .= "AND post_type = '".$this->con->escape($params['post_type'])."' ";
 		}
 		
@@ -727,6 +711,8 @@
 		if (isset($params['post_type']))
 		{
-			if (is_array($params['post_type']) || $params['post_type'] != '') {
+			if (is_array($params['post_type']) && !empty($params['post_type'])) {
 				$strReq .= 'AND post_type '.$this->con->in($params['post_type']);
+			} elseif ($params['post_type'] != '') {
+				$strReq .= "AND post_type = '".$this->con->escape($params['post_type'])."' ";
 			}
 		}
@@ -750,5 +736,10 @@
 		
 		if (!empty($params['user_id'])) {
-			$strReq .= "AND U.user_id = '".$this->con->escape($params['user_id'])."' ";
+			if (!empty($params['user_id_not'])) {
+				$not = "NOT ";
+			} else {
+				$not = "";
+			}
+			$strReq .= "AND U.user_id ".$not.$this->con->in($params['user_id'])." ";
 		}
 		
@@ -872,11 +863,11 @@
 		
 		if($dir > 0) {
-			$sign = '>';
-			$order = 'ASC';
-		}
-		else {
-			$sign = '<';
-			$order = 'DESC';
-		}
+               $sign = '>';
+               $order = 'ASC';
+          }
+          else {
+               $sign = '<';
+               $order = 'DESC';
+          }
 		
 		$params['post_type'] = $post->post_type;
@@ -1039,5 +1030,5 @@
 			$strReq .= "AND post_type = 'post' ";
 		}
-		
+				
 		if (!empty($params['year'])) {
 			$strReq .= 'AND '.$this->con->dateFormat('post_dt','%Y')." = '".sprintf('%04d',$params['year'])."' ";
@@ -1179,5 +1170,5 @@
 		$cur->post_upddt = date('Y-m-d H:i:s');
 		
-		#If user is only "usage", we need to check the post's owner
+		#�If user is only "usage", we need to check the post's owner
 		if (!$this->core->auth->check('contentadmin',$this->id))
 		{
@@ -1782,5 +1773,9 @@
 		if (!empty($params['post_type']))
 		{
-			$strReq .= 'AND post_type '.$this->con->in($params['post_type']);
+			if (is_array($params['post_type']) && !empty($params['post_type'])) {
+				$strReq .= 'AND post_type '.$this->con->in($params['post_type']);
+			} else {
+				$strReq .= "AND post_type = '".$this->con->escape($params['post_type'])."' ";
+			}
 		}
 		
Index: inc/core/class.dc.categories.php
===================================================================
--- inc/core/class.dc.categories.php	(revision 270)
+++ inc/core/class.dc.categories.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.core.php
===================================================================
--- inc/core/class.dc.core.php	(revision 407)
+++ inc/core/class.dc.core.php	(revision 136)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -27,5 +27,5 @@
 {
 	public $con;		///< <b>connection</b>		Database connection object
-	public $prefix;		///< <b>string</b>			Database tables prefix
+	public $prefix;	///< <b>string</b>			Database tables prefix
 	public $blog;		///< <b>dcBlog</b>			dcBlog object
 	public $error;		///< <b>dcError</b>			dcError object
@@ -36,6 +36,5 @@
 	public $plugins;	///< <b>dcModules</b>		dcModules object
 	public $media;		///< <b>dcMedia</b>			dcMedia object
-	public $postmedia;	///< <b>dcPostMedia</b>		dcPostMedia object
-	public $rest;		///< <b>dcRestServer</b>	dcRestServer object
+	public $rest;		///< <b>dcRestServer</b>		dcRestServer object
 	public $log;		///< <b>dcLog</b>			dcLog object
 	
@@ -64,16 +63,4 @@
 		if ($this->con instanceof mysqlConnection) {
 			mysqlConnection::$weak_locks = true;
-		}
-		
-		# define searchpath for postgresql
-		if ($this->con instanceof pgsqlConnection)
-		{
-			$searchpath = explode ('.',$prefix,2);
-			if (count($searchpath) > 1)
-			{
-				$prefix = $searchpath[1];
-				$sql = 'SET search_path TO '.$searchpath[0].',public;';
-				$this->con->execute($sql);
-			}
 		}
 		
Index: inc/core/class.dc.error.php
===================================================================
--- inc/core/class.dc.error.php	(revision 334)
+++ inc/core/class.dc.error.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -13,24 +13,20 @@
 
 /**
-* @ingroup DC_CORE
-* @brief Error class
-* 
-* dcError is a very simple error class, with a stack. Call dcError::add to
-* add an error in stack. In administration area, errors are automatically
-* displayed.
+@ingroup DC_CORE
+@brief Error class
+
+dcError is a very simple error class, with a stack. Call dcError::add to
+add an error in stack. In administration area, errors are automatically
+displayed.
 */
 class dcError
 {
-	/** @var array Errors stack */
-	protected $errors = array();
-	/** @var boolean True if stack is not empty */
-	protected $flag = false;
-	/** @var string HTML errors list pattern */
-	protected $html_list = "<ul>\n%s</ul>\n";
-	/** @var string HTML error item pattern */
-	protected $html_item = "<li>%s</li>\n";
+	protected $errors = array();				///< <b>array</b>	Errors stack
+	protected $flag = false;					///< <b>boolean</b>	True if stack is not empty
+	protected $html_list = "<ul>\n%s</ul>\n";	///< <b>string</b>	HTML errors list pattern
+	protected $html_item = "<li>%s</li>\n";	///< <b>string</b>	HTML error item pattern
 	
 	/**
-	* Object constructor.
+	Object constructor.
 	*/
 	public function __construct()
@@ -41,7 +37,7 @@
 	
 	/**
-	* Object string representation. Returns errors stack.
-	* 
-	* @return string
+	Object string representation. Returns errors stack.
+	
+	@return	<b>string</b>
 	*/
 	public function __toString()
@@ -58,7 +54,7 @@
 	
 	/**
-	* Adds an error to stack.
-	* 
-	* @param string	$msg			Error message
+	Adds an error to stack.
+	
+	@param	msg		<b>string</b>		Error message
 	*/
 	public function add($msg)
@@ -69,7 +65,7 @@
 	
 	/**
-	* Returns the value of <var>flag</var> property. True if errors stack is not empty
-	* 
-	* @return boolean
+	Returns the value of <var>flag</var> property.
+	
+	@return	<b>boolean</b> True if errors stack is not empty
 	*/
 	public function flag()
@@ -79,5 +75,5 @@
 	
 	/**
-	* Resets errors stack.
+	Resets errors stack.
 	*/
 	public function reset()
@@ -88,7 +84,7 @@
 	
 	/**
-	* Returns <var>errors</var> property.
-	* 
-	* @return array
+	Returns <var>errors</var> property.
+	
+	@return	<b>array</b>
 	*/
 	public function getErrors()
@@ -98,8 +94,8 @@
 	
 	/**
-	* Sets <var>list</var> and <var>item</var> properties.
-	* 
-	* @param string	$list		HTML errors list pattern
-	* @param string	$item		HTML error item pattern
+	Sets <var>list</var> and <var>item</var> properties.
+	
+	@param	list		<b>string</b>		HTML errors list pattern
+	@param	item		<b>string</b>		HTML error item pattern
 	*/
 	public function setHTMLFormat($list,$item)
@@ -110,7 +106,7 @@
 	
 	/**
-	* Returns errors stack as HTML.
-	* 
-	* @return string
+	Returns errors stack as HTML.
+	
+	@return	<b>string</b>
 	*/
 	public function toHTML()
Index: inc/core/class.dc.log.php
===================================================================
--- inc/core/class.dc.log.php	(revision 270)
+++ inc/core/class.dc.log.php	(revision 126)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.media.php
===================================================================
--- inc/core/class.dc.media.php	(revision 407)
+++ inc/core/class.dc.media.php	(revision 40)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -23,6 +23,6 @@
 	protected $con;		///< <b>connection</b> Database connection
 	protected $table;		///< <b>string</b> Media table name
+	protected $table_ref;	///< <b>string</b> Post-media relation table name
 	protected $type;		///< <b>string</b> Media type filter
-	protected $postmedia;
 	protected $file_sort = 'name-asc';
 	
@@ -57,5 +57,4 @@
 		$this->core =& $core;
 		$this->con =& $core->con;
-		$this->postmedia = new dcPostMedia($core);
 		
 		if ($this->core->blog == null) {
@@ -64,4 +63,5 @@
 		
 		$this->table = $this->core->prefix.'media';
+		$this->table_ref = $this->core->prefix.'post_media';
 		$root = $this->core->blog->public_path;
 		
@@ -494,12 +494,19 @@
 	public function getPostMedia($post_id,$media_id=null)
 	{
-		$params = array(
-			'post_id' => $post_id,
-			'media_path' => $this->path
-		);
+		$post_id = (integer) $post_id;
+		
+		$strReq =
+		'SELECT media_file, M.media_id, media_path, media_title, media_meta, media_dt, '.
+		'media_creadt, media_upddt, media_private, user_id '.
+		'FROM '.$this->table.' M '.
+		'INNER JOIN '.$this->table_ref.' PM ON (M.media_id = PM.media_id) '.
+		"WHERE media_path = '".$this->path."' ".
+		'AND post_id = '.$post_id.' ';
+		
 		if ($media_id) {
-			$params['media_id'] = (integer) $media_id;
-		}
-		$rs = $this->postmedia->getPostMedia($params);
+			$strReq .= 'AND M.media_id = '.(integer) $media_id.' ';
+		}
+		
+		$rs = $this->con->select($strReq);
 		
 		$res = array();
@@ -516,19 +523,45 @@
 	
 	/**
-	@deprecated since version 2.4
-	@see dcPostMedia::addPostMedia
+	Attaches a media to a post.
+	
+	@param	post_id	<b>integer</b>		Post ID
+	@param	media_id	<b>integer</b>		Optionnal media ID
 	*/
 	public function addPostMedia($post_id,$media_id)
 	{
-		$this->postmedia->addPostMedia($post_id,$media_id);
-	}
-	
-	/**
-	@deprecated since version 2.4
-	@see dcPostMedia::removePostMedia
+		$post_id = (integer) $post_id;
+		$media_id = (integer) $media_id;
+		
+		$f = $this->getPostMedia($post_id,$media_id);
+		
+		if (!empty($f)) {
+			return;
+		}
+		
+		$cur = $this->con->openCursor($this->table_ref);
+		$cur->post_id = $post_id;
+		$cur->media_id = $media_id;
+		
+		$cur->insert();
+		$this->core->blog->triggerBlog();
+	}
+	
+	/**
+	Detaches a media from a post.
+	
+	@param	post_id	<b>integer</b>		Post ID
+	@param	media_id	<b>integer</b>		Optionnal media ID
 	*/
 	public function removePostMedia($post_id,$media_id)
 	{
-		$this->postmedia->removePostMedia($post_id,$media_id,"attachment");
+		$post_id = (integer) $post_id;
+		$media_id = (integer) $media_id;
+		
+		$strReq = 'DELETE FROM '.$this->table_ref.' '.
+				'WHERE post_id = '.$post_id.' '.
+				'AND media_id = '.$media_id.' ';
+		
+		$this->con->execute($strReq);
+		$this->core->blog->triggerBlog();
 	}
 	
Index: inc/core/class.dc.meta.php
===================================================================
--- inc/core/class.dc.meta.php	(revision 270)
+++ inc/core/class.dc.meta.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.modules.php
===================================================================
--- inc/core/class.dc.modules.php	(revision 270)
+++ inc/core/class.dc.modules.php	(revision 43)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.namespace.php
===================================================================
--- inc/core/class.dc.namespace.php	(revision 270)
+++ inc/core/class.dc.namespace.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.postmedia.php
===================================================================
--- inc/core/class.dc.postmedia.php	(revision 407)
+++ 	(revision )
@@ -1,172 +1,0 @@
-<?php
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-if (!defined('DC_RC_PATH')) { return; }
-
-class dcPostMedia
-{
-	protected $core;		///< <b>dcCore</b> dcCore instance
-	protected $con;		///< <b>connection</b> Database connection
-	protected $table;		///< <b>string</b> Post-Media table name
-	
-	/**
-	Object constructor.
-	
-	@param	core		<b>dcCore</b>		dcCore instance
-	@param	type		<b>string</b>		Media type filter
-	*/
-	public function __construct($core,$type='')
-	{
-		$this->core =& $core;
-		$this->con =& $core->con;
-		$this->table = $this->core->prefix.'post_media';
-	}
-	
-	/**
-	Returns media items attached to a blog post. Result is an array containing
-	fileItems objects.
-	
-	@param	post_id	<b>integer</b>		Post ID
-	@param	media_id	<b>integer</b>		Optionnal media ID
-	@return	<b>array</b> Array of fileItems
-	*/
-	public function getPostMedia($params=array())
-	{
-		$strReq =
-		'SELECT M.media_file, M.media_id, M.media_path, M.media_title, M.media_meta, M.media_dt, '.
-		'M.media_creadt, M.media_upddt, M.media_private, M.user_id, PM.post_id ';
-		
-		if (!empty($params['columns']) && is_array($params['columns'])) {
-			$strReq .= implode(', ',$params['columns']).', ';
-		}
-		
-		$strReq .=
-		'FROM '.$this->core->prefix.'media M '.
-		'INNER JOIN '.$this->table.' PM ON (M.media_id = PM.media_id) ';
-		
-		if (!empty($params['from'])) {
-			$strReq .= $params['from'].' ';
-		}
-		
-		$where='';
-		if (isset($params['post_id'])) {
-			$where[]="PM.post_id ".$this->con->in($params['post_id']);
-		}
-		if (isset($params['media_id'])) {
-			$where[]="M.media_id ".$this->con->in($params['media_id']);
-		}
-		if (isset($params['media_path'])) {
-			$where[]="M.media_path ".$this->con->in($params['media_path']);
-		}
-		if (isset($params['link_type'])) {
-			$where[]="PM.link_type ".$this->con->in($params['link_type']);
-		} else {
-			$where[]="PM.link_type='attachment'";
-		}
-
-		$strReq .= 'WHERE '.join('AND ',$where).' ';
-
-		if (isset($params['sql'])) {
-			$strReq .= $params['sql'];
-		}
-	//echo $strReq; exit;
-		$rs = $this->con->select($strReq);
-		
-		return $rs;
-	}
-
-	/**
-	Attaches a media to a post.
-	
-	@param	post_id	<b>integer</b>		Post ID
-	@param	media_id	<b>integer</b>		Optionnal media ID
-	*/
-	public function addPostMedia($post_id,$media_id,$link_type='attachment')
-	{
-		$post_id = (integer) $post_id;
-		$media_id = (integer) $media_id;
-		
-		$f = $this->getPostMedia(array('post_id'=>$post_id,'media_id'=>$media_id,'link_type'=>$link_type));
-		
-		if (!$f->isEmpty()) {
-			return;
-		}
-		
-		$cur = $this->con->openCursor($this->table);
-		$cur->post_id = $post_id;
-		$cur->media_id = $media_id;
-		$cur->link_type = $link_type;
-		
-		$cur->insert();
-		$this->core->blog->triggerBlog();
-	}
-	
-	/**
-	Detaches a media from a post.
-	
-	@param	post_id	<b>integer</b>		Post ID
-	@param	media_id	<b>integer</b>		Optionnal media ID
-	*/
-	public function removePostMedia($post_id,$media_id,$link_type=null)
-	{
-		$post_id = (integer) $post_id;
-		$media_id = (integer) $media_id;
-		
-		$strReq = 'DELETE FROM '.$this->table.' '.
-				'WHERE post_id = '.$post_id.' '.
-				'AND media_id = '.$media_id.' ';
-		if ($link_type != null) {
-			$strReq .= "AND link_type = '".$this->con->escape($link_type)."'";
-		}
-		$this->con->execute($strReq);
-		$this->core->blog->triggerBlog();
-	}
-	
-	/**
-	Returns media items attached to a blog post. Result is an array containing
-	fileItems objects.
-	
-	@param	post_id	<b>integer</b>		Post ID
-	@param	media_id	<b>integer</b>		Optionnal media ID
-	@return	<b>array</b> Array of fileItems
-	*/
-	public function getLegacyPostMedia($post_id,$media_id=null)
-	{
-		$post_id = (integer) $post_id;
-		
-		$strReq =
-		'SELECT media_file, M.media_id, media_path, media_title, media_meta, media_dt, '.
-		'media_creadt, media_upddt, media_private, user_id '.
-		'FROM '.$this->table.' M '.
-		'INNER JOIN '.$this->table_ref.' PM ON (M.media_id = PM.media_id) '.
-		"WHERE media_path = '".$this->path."' ".
-		'AND post_id = '.$post_id.' ';
-		
-		if ($media_id) {
-			$strReq .= 'AND M.media_id = '.(integer) $media_id.' ';
-		}
-		
-		$rs = $this->con->select($strReq);
-		
-		$res = array();
-		
-		while ($rs->fetch()) {
-			$f = $this->fileRecord($rs);
-			if ($f !== null) {
-				$res[] = $f;
-			}
-		}
-		
-		return $res;
-	}
-	
-}
-?>
Index: inc/core/class.dc.rest.php
===================================================================
--- inc/core/class.dc.rest.php	(revision 270)
+++ inc/core/class.dc.rest.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.rs.extensions.php
===================================================================
--- inc/core/class.dc.rs.extensions.php	(revision 270)
+++ inc/core/class.dc.rs.extensions.php	(revision 0)
@@ -3,5 +3,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.settings.php
===================================================================
--- inc/core/class.dc.settings.php	(revision 301)
+++ inc/core/class.dc.settings.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -308,77 +308,4 @@
 	}
 
-	/**
-	Returns a list of settings matching given criteria, for any blog.
-	<b>$params</b> is an array taking the following
-	optionnal parameters:
-	
-	- ns : retrieve setting from given namespace
-	- id : retrieve only settings corresponding to the given id
-	
-	@param	params		<b>array</b>		Parameters
-	@return	<b>record</b>	A record 
-	*/
-	public function getGlobalSettings($params=array())
-	{
-		$strReq = "SELECT * from ".$this->table." ";
-		$where = array();
-		if (!empty($params['ns'])) {
-			$where[] = "setting_ns = '".$this->con->escape($params['ns'])."'";
-		}
-		if (!empty($params['id'])) {
-			$where[] = "setting_id = '".$this->con->escape($params['id'])."'";
-		}
-		if (isset($params['blog_id'])) {
-			if (!empty($params['blog_id'])) {
-				$where[] = "blog_id = '".$this->con->escape($params['blog_id'])."'";
-			} else {
-				$where[] = "blog_id IS NULL";
-			}
-		}
-		if (count($where) != 0) {
-			$strReq .= " WHERE ".join(" AND ", $where);
-		}
-		$strReq .= " ORDER by blog_id";
-		return $this->con->select($strReq);
-	}
-
-	/**
-	Updates a setting from a given record
-	
-	@param	rs		<b>record</b>		the setting to update
-	*/
-	public function updateSetting($rs) 
-	{
-		$cur = $this->con->openCursor($this->table);
-		$cur->setting_id = $rs->setting_id;
-		$cur->setting_value = $rs->setting_value;
-		$cur->setting_type = $rs->setting_type;
-		$cur->setting_label = $rs->setting_label;
-		$cur->blog_id = $rs->blog_id;
-		$cur->setting_ns = $rs->setting_ns;
-		if ($cur->blog_id == null) {
-				$where = 'WHERE blog_id IS NULL ';
-		} else {
-			$where = "WHERE blog_id = '".$this->con->escape($cur->blog_id)."' ";
-		}
-		$cur->update($where."AND setting_id = '".$this->con->escape($cur->setting_id)."' AND setting_ns = '".$this->con->escape($cur->setting_ns)."' ");
-	}
-	
-	/**
-	Drops a setting from a given record
-	
-	@param	rs		<b>record</b>		the setting to drop
-	@return	int		number of deleted records (0 if setting does not exist)
-	*/
-	public function dropSetting($rs) {
-		$strReq = "DELETE FROM ".$this->table.' ';
-		if ($rs->blog_id == null) {
-			$strReq .= 'WHERE blog_id IS NULL ';
-		} else {
-			$strReq .= "WHERE blog_id = '".$this->con->escape($rs->blog_id)."' ";
-		}
-		$strReq .= "AND setting_id = '".$this->con->escape($rs->setting_id)."' AND setting_ns = '".$this->con->escape($rs->setting_ns)."' ";
-		return $this->con->execute($strReq);
-	}
 }
 ?>
Index: inc/core/class.dc.themes.php
===================================================================
--- inc/core/class.dc.themes.php	(revision 270)
+++ inc/core/class.dc.themes.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.trackback.php
===================================================================
--- inc/core/class.dc.trackback.php	(revision 270)
+++ inc/core/class.dc.trackback.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.update.php
===================================================================
--- inc/core/class.dc.update.php	(revision 270)
+++ inc/core/class.dc.update.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.utils.php
===================================================================
--- inc/core/class.dc.utils.php	(revision 270)
+++ inc/core/class.dc.utils.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: inc/core/class.dc.xmlrpc.php
===================================================================
--- inc/core/class.dc.xmlrpc.php	(revision 270)
+++ inc/core/class.dc.xmlrpc.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
