Index: admin/auth.php
===================================================================
--- admin/auth.php	(revision 3110)
+++ admin/auth.php	(revision 3103)
@@ -62,5 +62,5 @@
 	# If we have a remember cookie, go through auth process with user_key
 	$user_id = substr($_COOKIE['dc_admin'],40);
-	$user_id = trim(@unpack('a32',@pack('H*',$user_id)));
+	$user_id = @unpack('a32',@pack('H*',$user_id));
 	if (is_array($user_id))
 	{
@@ -149,5 +149,5 @@
 		{
 			$user_id = substr($data['cookie_admin'],40);
-			$user_id = trim(@unpack('a32',@pack('H*',$user_id)));
+			$user_id = @unpack('a32',@pack('H*',$user_id));
 			if (is_array($user_id))
 			{
Index: admin/blog_pref.php
===================================================================
--- admin/blog_pref.php	(revision 3030)
+++ admin/blog_pref.php	(revision 3112)
@@ -180,4 +180,10 @@
 	$media_img_m_size = abs((integer) $_POST['media_img_m_size']);
 	if ($media_img_m_size < 0) { $media_img_m_size = 448; }
+
+	$media_video_width = abs((integer) $_POST['media_video_width']);
+	if ($media_video_width < 0) { $media_video_width = 400; }
+	
+	$media_video_height = abs((integer) $_POST['media_video_height']);
+	if ($media_video_height < 0) { $media_video_height = 300; }
 
 	$nb_post_for_home = abs((integer) $_POST['nb_post_for_home']);
@@ -256,4 +262,6 @@
 		$blog_settings->system->put('media_img_s_size',$media_img_s_size);
 		$blog_settings->system->put('media_img_m_size',$media_img_m_size);
+		$blog_settings->system->put('media_video_width',$media_video_width);
+		$blog_settings->system->put('media_video_height',$media_video_height);
 		$blog_settings->system->put('media_img_title_pattern',$_POST['media_img_title_pattern']);
 		$blog_settings->system->put('media_img_use_dto_first',!empty($_POST['media_img_use_dto_first']));
@@ -587,12 +595,19 @@
 	'<div class="col">'.
 	'<h5>'.__('Generated image sizes (in pixels)').'</h5>'.
-	'<p class="field"><label for="media_img_t_size">Thumbnail</label> '.
+	'<p class="field"><label for="media_img_t_size">'.__('Thumbnail').'</label> '.
 	form::field('media_img_t_size',3,3,$blog_settings->system->media_img_t_size).'</p>'.
 
-	'<p class="field"><label for="media_img_s_size">Small</label> '.
+	'<p class="field"><label for="media_img_s_size">'.__('Small').'</label> '.
 	form::field('media_img_s_size',3,3,$blog_settings->system->media_img_s_size).'</p>'.
 
-	'<p class="field"><label for="media_img_m_size">Medium</label> '.
+	'<p class="field"><label for="media_img_m_size">'.__('Medium').'</label> '.
 	form::field('media_img_m_size',3,3,$blog_settings->system->media_img_m_size).'</p>'.
+
+	'<h5>'.__('Default size of the inserted video (in pixels)').'</h5>'.
+	'<p class="field"><label for="media_video_width">'.__('Width').'</label> '.
+	form::field('media_video_width',3,3,$blog_settings->system->media_video_width).'</p>'.
+
+	'<p class="field"><label for="media_video_height">'.__('Height').'</label> '.
+	form::field('media_video_height',3,3,$blog_settings->system->media_video_height).'</p>'.
 	'</div>'.
 
@@ -704,5 +719,5 @@
 
 		# Sort users list on user_id key
-		ksort($blog_users);
+		dcUtils::lexicalKeySort($blog_users);
 
 		$post_type = $core->getPostTypes();
Index: admin/blogs.php
===================================================================
--- admin/blogs.php	(revision 3046)
+++ admin/blogs.php	(revision 3106)
@@ -66,4 +66,11 @@
 	$rs = $core->getBlogs($params);
 	$nb_blog = $counter->f(0);
+	$rsStatic = $rs->toStatic();
+	if ($sortby != 'blog_upddt') {
+		// Sort blog list using lexical order if necessary
+		$rsStatic->extend('rsExtUser');
+		$rsStatic = $rsStatic->toExtStatic();
+		$rsStatic->lexicalSort(($sortby == 'UPPER(blog_name)' ? 'blog_name' : 'blog_id'),$order);
+	}
 } catch (Exception $e) {
 	$core->error->add($e->getMessage());
@@ -163,6 +170,6 @@
 		'</tr>';
 
-		while ($rs->fetch()) {
-			echo blogLine($rs);
+		while ($rsStatic->fetch()) {
+			echo blogLine($rsStatic);
 		}
 
Index: admin/comments.php
===================================================================
--- admin/comments.php	(revision 3053)
+++ admin/comments.php	(revision 3091)
@@ -245,5 +245,5 @@
 	'<p><label for="order" class="ib">'.__('Sort:').'</label> '.
 	form::combo('order',$order_combo,$order).'</p>'.
-	'<p><span class="label ib">Afficher</span> <label for="nb" class="classic">'.
+	'<p><span class="label ib">'.__('Show').'</span> <label for="nb" class="classic">'.
 	form::field('nb',3,3,$nb_per_page).' '.
 	__('comments per page').'</label></p>'.
Index: admin/media.php
===================================================================
--- admin/media.php	(revision 3034)
+++ admin/media.php	(revision 3101)
@@ -44,5 +44,5 @@
 }
 
-# We set session information about directory and page
+# We set session information about directory, page and display mode
 if ($d) {
 	$_SESSION['media_manager_dir'] = $d;
@@ -55,4 +55,7 @@
 	unset($_SESSION['media_manager_page']);
 }
+
+# Get query in any
+$q = isset($_REQUEST['q']) ? $_REQUEST['q'] : null;
 
 # Sort combo
@@ -64,8 +67,14 @@
 	);
 
+if (!empty($_GET['file_mode'])) {
+	$_SESSION['media_file_mode'] = $_GET['file_mode'];
+}
+$file_mode = !empty($_SESSION['media_file_mode']) ? $_SESSION['media_file_mode'] : false;
+
 if (!empty($_GET['file_sort']) && in_array($_GET['file_sort'],$sort_combo)) {
 	$_SESSION['media_file_sort'] = $_GET['file_sort'];
 }
 $file_sort = !empty($_SESSION['media_file_sort']) ? $_SESSION['media_file_sort'] : null;
+
 $nb_per_page = !empty($_SESSION['nb_per_page']) ? (integer)$_SESSION['nb_per_page'] : $nb_per_page;
 if (!empty($_GET['nb_per_page']) && (integer)$_GET['nb_per_page'] > 0) {
@@ -81,4 +90,7 @@
 if ($plugin_id != '') {
 	$page_url_params['plugin_id'] = $plugin_id;
+}
+if ($q) {
+	$page_url_params['q'] = $q;
 }
 
@@ -100,6 +112,15 @@
 		$core->media->setFileSort($file_sort);
 	}
-	$core->media->chdir($d);
-	$core->media->getDir();
+	$query = false;
+	if ($q) {
+		$query = $core->media->searchMedia($q);
+	}
+	if (!$query) {
+		$core->media->chdir($d);
+		$core->media->getDir();
+	} else {
+		$d = null;
+		$core->media->chdir($d);
+	}
 	$core_media_writable = $core->media->writable();
 	$dir =& $core->media->dir;
@@ -170,5 +191,5 @@
 				'name' => $upfile['name'],
 				'size' => $upfile['size'],
-				'html' => mediaItemLine($core->media->getFile($new_file_id), 1)
+				'html' => mediaItemLine($core->media->getFile($new_file_id),1,$query)
 			);
 		} catch (Exception $e) {
@@ -187,5 +208,5 @@
 			$f_private = (isset($_POST['upfilepriv']) ? $_POST['upfilepriv'] : false);
 
-			$core->media->uploadFile($upfile['tmp_name'], $upfile['name'], $f_title, $f_private);
+			$core->media->uploadFile($upfile['tmp_name'],$upfile['name'],$f_title,$f_private);
 
 			dcPage::addSuccessNotice(__('Files have been successfully uploaded.'));
@@ -273,4 +294,5 @@
 	' &nbsp; <input type="submit" name="rmyes" value="'.__('Yes').'" />'.
 	form::hidden('d',$d).
+	form::hidden('q',$q).
 	$core->adminurl->getHiddenFormFields('admin.media',$page_url_params).
 	$core->formNonce().
@@ -296,31 +318,46 @@
 	);
 } else {
-	$temp_params = $page_url_params;
-	$temp_params['d']='%s';
-	$bc_template = $core->adminurl->get('admin.media',$temp_params,'&amp;',true);
-	$breadcrumb_media = $core->media->breadCrumb($bc_template,'<span class="page-title">%s</span>');
-	if ($breadcrumb_media == '') {
+	if ($query || (!$query && $q)) {
+		$count = $query ? count($dir['files']) : 0;
+		$home_params = $page_url_params;
+		$home_params['d']='';
+		$home_params['q']='';
 		$breadcrumb = dcPage::breadcrumb(
 			array(
 				html::escapeHTML($core->blog->name) => '',
-				__('Media manager') => ''
+				__('Media manager') => $core->adminurl->get('admin.media',$home_params),
+				__('Search:').' '.$q.' ('.sprintf(__('%s file found','%s files found',$count),$count).')' => ''
 			),
 			array('home_link' => !$popup)
 		);
 	} else {
-		$home_params = $page_url_params;
-		$home_params['d']='';
-
-		$breadcrumb = dcPage::breadcrumb(
-			array(
-				html::escapeHTML($core->blog->name) => '',
-				__('Media manager') => $core->adminurl->get('admin.media',$home_params),
-				$breadcrumb_media => ''
-			),
-			array(
-				'home_link' => !$popup,
-				'hl' => false
-			)
-		);
+		$temp_params = $page_url_params;
+		$temp_params['d']='%s';
+		$bc_template = $core->adminurl->get('admin.media',$temp_params,'&amp;',true);
+		$breadcrumb_media = $core->media->breadCrumb($bc_template,'<span class="page-title">%s</span>');
+		if ($breadcrumb_media == '') {
+			$breadcrumb = dcPage::breadcrumb(
+				array(
+					html::escapeHTML($core->blog->name) => '',
+					__('Media manager') => ''
+				),
+				array('home_link' => !$popup)
+			);
+		} else {
+			$home_params = $page_url_params;
+			$home_params['d']='';
+
+			$breadcrumb = dcPage::breadcrumb(
+				array(
+					html::escapeHTML($core->blog->name) => '',
+					__('Media manager') => $core->adminurl->get('admin.media',$home_params),
+					$breadcrumb_media => ''
+				),
+				array(
+					'home_link' => !$popup,
+					'hl' => false
+				)
+			);
+		}
 	}
 }
@@ -371,11 +408,19 @@
 
 if ($post_id) {
-	echo '<div class="form-note info"><p>'.sprintf(__('Choose a file to attach to entry %s by clicking on %s.'),
+	echo '<div class="form-note info"><p>'.sprintf(__('Choose a file to attach to entry %s by clicking on %s'),
 		'<a href="'.$core->getPostAdminURL($post_type,$post_id).'">'.html::escapeHTML($post_title).'</a>',
-		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</p></div>';
+		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />');
+	if ($core_media_writable) {
+		echo ' '.__('or').' '.sprintf('<a href="#fileupload">%s</a>',__('upload a new file'));
+	}
+	echo '</p></div>';
 }
 if ($popup) {
-	echo '<div class="info"><p>'.sprintf(__('Choose a file to insert into entry by clicking on %s.'),
-		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</p></div>';
+	echo '<div class="info"><p>'.sprintf(__('Choose a file to insert into entry by clicking on %s'),
+		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />');
+	if ($core_media_writable) {
+		echo ' '.__('or').' '.sprintf('<a href="#fileupload">%s</a>',__('upload a new file'));
+	}
+	echo '</p></div>';
 }
 
@@ -394,5 +439,9 @@
 $fmt_form_media = '<form action="'.$core->adminurl->get("admin.media").'" method="post" id="form-medias">'.
 	'<div class="files-group">%s</div>'.
-	'<p class="hidden">'.$core->formNonce() . form::hidden(array('d'),$d).form::hidden(array('plugin_id'),$plugin_id).'</p>';
+	'<p class="hidden">'.$core->formNonce().
+	form::hidden(array('d'),$d).
+	form::hidden(array('q'),$q).
+	form::hidden(array('plugin_id'),$plugin_id).
+	'</p>';
 
 if (!$popup) {
@@ -418,8 +467,26 @@
 
 	echo
+	'<form action="'.$core->adminurl->get("admin.media").'" method="get" id="search-form">'.
+	'<p><label for="search" class="classic">'.__('Search:').'</label> '.
+	form::field('q',20,255,$q).' '.
+	'<input type="submit" value="'.__('OK').'" />'.' '.
+	'<span class="form-note">'.__('Will search into media filename (including path), title and description').'</span>'.
+	form::hidden(array('popup'),$popup).
+	form::hidden(array('plugin_id'),$plugin_id).
+	form::hidden(array('post_id'),$post_id).
+	'</p>'.
+	'</form>'.
 	'<form action="'.$core->adminurl->get("admin.media").'" method="get" id="filters-form">'.
-	'<p class="two-boxes"><label for="file_sort" class="classic">'.__('Sort files:').'</label> '.
+	'<span class="media-file-mode">'.
+	'<a href="'.$core->adminurl->get("admin.media",array_merge($page_url_params,array('file_mode' => 'grid'))).'" title="'.__('Grid display mode').'">'.
+	'<img src="images/grid-'.($file_mode == 'grid' ? 'on' : 'off').'.png" alt="'.__('Grid display mode').'" />'.
+	'</a>'.
+	'<a href="'.$core->adminurl->get("admin.media",array_merge($page_url_params,array('file_mode' => 'list'))).'" title="'.__('List display mode').'">'.
+	'<img src="images/list-'.($file_mode == 'list' ? 'on' : 'off').'.png" alt="'.__('List display mode').'" />'.
+	'</a>'.
+	'</span>'.
+	'<p class="three-boxes"><label for="file_sort" class="classic">'.__('Sort files:').'</label> '.
 	form::combo('file_sort',$sort_combo,$file_sort).'</p>'.
-	'<p class="two-boxes"><label for="nb_per_page" class="classic">'.__('Number of elements displayed per page:').'</label> '.
+	'<p class="three-boxes"><label for="nb_per_page" class="classic">'.__('Number of elements displayed per page:').'</label> '.
 	form::field('nb_per_page',5,3,(integer) $nb_per_page).' '.
 	'<input type="submit" value="'.__('OK').'" />'.
@@ -427,22 +494,50 @@
 	form::hidden(array('plugin_id'),$plugin_id).
 	form::hidden(array('post_id'),$post_id).
+	form::hidden(array('q'),$q).
 	'</p>'.
 	'</form>'.
 	$pager->getLinks();
 
-	$dgroup = '';
-	$fgroup = '';
-	for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++,$j++)
-	{
-		if ($items[$i]->d) {
-			$dgroup .= mediaItemLine($items[$i],$j);
-		} else {
-			$fgroup .= mediaItemLine($items[$i],$j);
-		}
-	}
-
-	echo
-	($dgroup != '' ? '<div class="folders-group">'.$dgroup.'</div>' : '').
-	sprintf($fmt_form_media,$fgroup,'');
+	if ($file_mode == 'list') {
+		$table =
+		'<div class="table-outer">'.
+		'<table>'.
+		'<caption class="hidden">'.__('Media list').'</caption>'.
+		'<tr>'.
+		'<th colspan="2" class="first">'.__('Name').'</th>'.
+		'<th scope="col">'.__('Date').'</th>'.
+		'<th scope="col">'.__('Size').'</th>'.
+		'</tr>';
+
+		$dlist = '';
+		$flist = '';
+		for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++,$j++)
+		{
+			if ($items[$i]->d) {
+				$dlist .= mediaItemLine($items[$i],$j,$query,true);
+			} else {
+				$flist .= mediaItemLine($items[$i],$j,$query,true);
+			}
+		}
+		$table .= $dlist.$flist;
+
+		$table .=
+		'</table></div>';
+		echo sprintf($fmt_form_media,$table,'');
+	} else {
+		$dgroup = '';
+		$fgroup = '';
+		for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++,$j++)
+		{
+			if ($items[$i]->d) {
+				$dgroup .= mediaItemLine($items[$i],$j,$query);
+			} else {
+				$fgroup .= mediaItemLine($items[$i],$j,$query);
+			}
+		}
+		echo
+		($dgroup != '' ? '<div class="folders-group">'.$dgroup.'</div>' : '').
+		sprintf($fmt_form_media,$fgroup,'');
+	}
 
 	echo $pager->getLinks();
@@ -458,5 +553,5 @@
 	!(count($items) == 0 || (count($items) == 1 && $items[0]->parent));
 
-if ($core_media_writable || $core_media_archivable) {
+if ((!$query) && ($core_media_writable || $core_media_archivable)) {
 	echo
 	'<div class="vertical-separator">'.
@@ -464,5 +559,5 @@
 }
 
-if ($core_media_writable || $core_media_archivable) {
+if ((!$query) && ($core_media_writable || $core_media_archivable)) {
 	echo
 	'<div class="two-boxes odd">';
@@ -500,5 +595,5 @@
 }
 
-if ($core_media_writable)
+if (!$query && $core_media_writable)
 {
 	echo
@@ -561,9 +656,10 @@
 form::hidden('rmyes',1).form::hidden('d',html::escapeHTML($d)).
 form::hidden(array('plugin_id'),$plugin_id).form::hidden('remove','').
+form::hidden(array('q'),$q).
 $core->formNonce().
 '</div>'.
 '</form>';
 
-if ($core_media_writable || $core_media_archivable) {
+if ((!$query) && ($core_media_writable || $core_media_archivable)) {
 	echo
 	'</div>';
@@ -578,11 +674,12 @@
 
 /* ----------------------------------------------------- */
-function mediaItemLine($f,$i)
+function mediaItemLine($f,$i,$query,$table=false)
 {
 	global $core, $page_url, $popup, $post_id, $plugin_id,$page_url_params;
 
 	$fname = $f->basename;
-
-	$class = 'media-item media-col-'.($i%2);
+	$file = $query ? $f->relname : $f->basename;
+
+	$class = $table ? '' : 'media-item media-col-'.($i%2);
 
 	if ($f->d) {
@@ -615,23 +712,8 @@
 		$fname = substr($fname, 0, $maxchars-4).'...'.($f->d ? '' : files::getExtension($fname));
 	}
-	$res =
-	'<div class="'.$class.'"><p><a class="media-icon media-link" href="'.rawurldecode($link).'">'.
-	'<img src="'.$f->media_icon.'" alt="" />'.$fname.'</a></p>';
-
-	$lst = '';
-
-	if (!$f->d) {
-		$lst .=
-		'<li>'.$f->media_title.'</li>'.
-		'<li>'.
-		$f->media_dtstr.' - '.
-		files::size($f->size).' - '.
-		'<a href="'.$f->file_url.'">'.__('open').'</a>'.
-		'</li>';
-	}
 
 	$act = '';
-
 	if ($post_id && !$f->d) {
+		// Media attachment button
 		$act .=
 		'<a class="attach-media" title="'.__('Attach this file to entry').'" href="'.
@@ -641,33 +723,60 @@
 		'</a>';
 	}
-
 	if ($popup && !$f->d) {
+		// Media insertion button
 		$act .= '<a href="'.$link.'"><img src="images/plus.png" alt="'.__('Insert this file into entry').'" '.
 		'title="'.__('Insert this file into entry').'" /></a> ';
 	}
-
 	if ($f->del) {
+		// Deletion button or checkbox
 		if (!$popup && !$f->d) {
-			$act .= form::checkbox(array('medias[]', 'media_'.rawurlencode($f->basename)),rawurlencode($f->basename));
+			$act .= form::checkbox(array('medias[]', 'media_'.rawurlencode($file)),$file);
 		} else {
 			$act .= '<a class="media-remove" '.
-			'href="'.html::escapeURL($page_url).'&amp;plugin_id='.$plugin_id.'&amp;d='.
-			rawurlencode($GLOBALS['d']).'&amp;remove='.rawurlencode($f->basename).'">'.
+			'href="'.html::escapeURL($page_url).
+			'&amp;plugin_id='.$plugin_id.
+			'&amp;d='.rawurlencode($GLOBALS['d']).
+			'&amp;q='.rawurlencode($GLOBALS['q']).
+			'&amp;remove='.rawurlencode($file).'">'.
 			'<img src="images/trash.png" alt="'.__('Delete').'" title="'.__('delete').'" /></a>';
 		}
 	}
 
-	$lst .= ($act != '' ? '<li class="media-action">&nbsp;'.$act.'</li>' : '');
-
-	// Show player if relevant
-	$file_type = explode('/',$f->type);
-	if ($file_type[0] == 'audio')
-	{
-		$lst .= '<li>'.dcMedia::audioPlayer($f->type,$f->file_url,$core->adminurl->get("admin.home",array('pf' => 'player_mp3.swf'))).'</li>';
-	}
-
-	$res .=	($lst != '' ? '<ul>'.$lst.'</ul>' : '');
-
-	$res .= '</div>';
+	if (!$table) {
+		$res =
+		'<div class="'.$class.'"><p><a class="media-icon media-link" href="'.rawurldecode($link).'">'.
+		'<img src="'.$f->media_icon.'" alt="" />'.($query ? $file : $fname).'</a></p>';
+
+		$lst = '';
+		if (!$f->d) {
+			$lst .=
+			'<li>'.$f->media_title.'</li>'.
+			'<li>'.
+			$f->media_dtstr.' - '.
+			files::size($f->size).' - '.
+			'<a href="'.$f->file_url.'">'.__('open').'</a>'.
+			'</li>';
+		}
+		$lst .= ($act != '' ? '<li class="media-action">&nbsp;'.$act.'</li>' : '');
+
+		// Show player if relevant
+		$file_type = explode('/',$f->type);
+		if ($file_type[0] == 'audio')
+		{
+			$lst .= '<li>'.dcMedia::audioPlayer($f->type,$f->file_url,$core->adminurl->get("admin.home",array('pf' => 'player_mp3.swf'))).'</li>';
+		}
+
+		$res .=	($lst != '' ? '<ul>'.$lst.'</ul>' : '');
+		$res .= '</div>';
+	} else {
+		$res = '<tr class="'.$class.'">';
+		$res .= '<td class="media-action">'.$act.'</td>';
+		$res .= '<td class="maximal" scope="row"><a class="media-flag media-link" href="'.rawurldecode($link).'">'.
+				'<img src="'.$f->media_icon.'" alt="" />'.($query ? $file : $fname).'</a>'.
+				'<br />'.($f->d ? '' : $f->media_title).'</td>';
+		$res .= '<td class="nowrap count">'.($f->d ? '' : $f->media_dtstr).'</td>';
+		$res .= '<td class="nowrap count">'.($f->d ? '' : files::size($f->size).' - '.'<a href="'.$f->file_url.'">'.__('open').'</a>').'</td>';
+		$res .= '</tr>';
+	}
 
 	return $res;
Index: admin/media_item.php
===================================================================
--- admin/media_item.php	(revision 2889)
+++ admin/media_item.php	(revision 3112)
@@ -394,7 +394,7 @@
 		'<h3>'.__('Video size').'</h3>'.
 		'<p><label for="video_w" class="classic">'.__('Width:').'</label> '.
-		form::field('video_w',3,4,400).'  '.
+		form::field('video_w',3,4,$core->blog->settings->system->media_video_width).'  '.
 		'<label for="video_h" class="classic">'.__('Height:').'</label> '.
-		form::field('video_h',3,4,300).
+		form::field('video_h',3,4,$core->blog->settings->system->media_video_height).
 		'</p>'.
 		'</div>';
@@ -498,4 +498,22 @@
 	echo '<a href="'.$core->adminurl->get('admin.media.item',array_merge($page_url_params,array("size" => "o","tab"=>"media-details-tab"))).'">'.__('original').'</a>';
 	echo '</p>';
+
+	if ($thumb_size != 'o' && isset($file->media_thumb[$thumb_size])) {
+		$p = path::info($file->file);
+		$alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG');
+		$thumb = sprintf(($alpha ? $core->media->thumb_tp_alpha : $core->media->thumb_tp),$p['dirname'],$p['base'],'%s');
+		$thumb_file = sprintf($thumb,$thumb_size);
+		$T = getimagesize($thumb_file);
+		$stats = stat($thumb_file);
+		echo
+		'<h3>'.__('Thumbnail details').'</h3>'.
+		'<ul>'.
+		'<li><strong>'.__('Image width:').'</strong> '.$T[0].' px</li>'.
+		'<li><strong>'.__('Image height:').'</strong> '.$T[1].' px</li>'.
+		'<li><strong>'.__('File size:').'</strong> '.files::size($stats[7]).'</li>'.
+		'<li><strong>'.__('File URL:').'</strong> <a href="'.$file->media_thumb[$thumb_size].'">'.
+			$file->media_thumb[$thumb_size].'</a></li>'.
+		'</ul>';
+	}
 }
 
@@ -514,5 +532,14 @@
 '<ul>'.
 	'<li><strong>'.__('File owner:').'</strong> '.$file->media_user.'</li>'.
-	'<li><strong>'.__('File type:').'</strong> '.$file->type.'</li>'.
+	'<li><strong>'.__('File type:').'</strong> '.$file->type.'</li>';
+if ($file->media_image)
+{
+	$S = getimagesize($file->file);
+	echo
+	'<li><strong>'.__('Image width:').'</strong> '.$S[0].' px</li>'.
+	'<li><strong>'.__('Image height:').'</strong> '.$S[1].' px</li>';
+	unset($S);
+}
+echo
 	'<li><strong>'.__('File size:').'</strong> '.files::size($file->size).'</li>'.
 	'<li><strong>'.__('File URL:').'</strong> <a href="'.$file->file_url.'">'.$file->file_url.'</a></li>'.
Index: admin/posts.php
===================================================================
--- admin/posts.php	(revision 3033)
+++ admin/posts.php	(revision 3105)
@@ -47,7 +47,9 @@
 {
 	# Filter form we'll put in html_block
+	$users_combo = dcAdminCombos::getUsersCombo($users);
+	dcUtils::lexicalKeySort($users_combo);
 	$users_combo = array_merge(
 		array('-' => ''),
-		dcAdminCombos::getUsersCombo($users)
+		$users_combo
 	);
 
Index: admin/style/default.css
===================================================================
--- admin/style/default.css	(revision 2796)
+++ admin/style/default.css	(revision 3101)
@@ -1845,4 +1845,13 @@
 	}
 /* ------------------------------------------------------------------ media.php */
+span.media-file-mode {
+	margin-right: 1em;
+}
+.media-file-mode a {
+	border-bottom: none;
+}
+.media-file-mode img {
+	margin-right: 1em;
+}
 .media-item {
 	position: relative;
@@ -1880,4 +1889,11 @@
 	display: block;
 	}
+a.media-flag {
+	border-bottom: none;
+}
+.media-flag img {
+	float: left;
+	margin-right: .5em;
+}
 .media-link {
 	font-size: 1.1em;
@@ -1927,4 +1943,7 @@
 	border-color: #eee;
 	}
+tr.media-folder {
+	background: transparent;
+}
 .media-folder-up {
 	border-color: #fff;
Index: admin/users.php
===================================================================
--- admin/users.php	(revision 2720)
+++ admin/users.php	(revision 3105)
@@ -84,5 +84,12 @@
 	$rs = $core->getUsers($params);
 	$counter = $core->getUsers($params,1);
-	$user_list = new adminUserList($core,$rs,$counter->f(0));
+	$rsStatic = $rs->toStatic();
+	if ($sortby != 'nb_post') {
+		// Sort user list using lexical order if necessary
+		$rsStatic->extend('rsExtUser');
+		$rsStatic = $rsStatic->toExtStatic();
+		$rsStatic->lexicalSort($sortby,$order);
+	}
+	$user_list = new adminUserList($core,$rsStatic,$counter->f(0));
 } catch (Exception $e) {
 	$core->error->add($e->getMessage());
