Index: /trunk/admin/rating.php
===================================================================
--- /trunk/admin/rating.php	(revision 1210)
+++ /trunk/admin/rating.php	(revision 1211)
@@ -62,30 +62,15 @@
 }
 
-$display_filter= '';
-if (isset($_GET['display_filter']))
-{
-  if ( $_GET['display_filter']=='user' )
-  {
-    $display_filter= ' AND r.user_id <> ' . $conf['guest_id'];
-    $template->assign_vars( array(
-        'DISPLAY_FILTER_USER_CHECKED'=>'checked="checked"'
-        )
-    );
-  }
-  elseif ( $_GET['display_filter']=='guest' )
-  {
-    $display_filter= ' AND r.user_id =' . $conf['guest_id'];
-    $template->assign_vars( array(
-        'DISPLAY_FILTER_GUEST_CHECKED'=>'checked="checked"'
-        )
-     );
-  }
-}
-if ($display_filter=='')
-{
-    $template->assign_vars( array(
-        'DISPLAY_FILTER_ALL_CHECKED'=>'checked="checked"'
-        )
-     );
+$page['user_filter'] = '';
+if (isset($_GET['users']))
+{
+  if ($_GET['users'] == 'user')
+  {
+    $page['user_filter'] = ' AND r.user_id <> '.$conf['guest_id'];
+  }
+  elseif ($_GET['users'] == 'guest')
+  {
+    $page['user_filter'] = ' AND r.user_id = '.$conf['guest_id'];
+  }
 }
 
@@ -122,5 +107,5 @@
 $query = 'SELECT COUNT(DISTINCT(i.id))
 FROM '.RATE_TABLE.' AS r, '.IMAGES_TABLE.' AS i
-WHERE r.element_id=i.id'. $display_filter .
+WHERE r.element_id=i.id'. $page['user_filter'] .
 ';';
 list($nb_images) = mysql_fetch_row(pwg_query($query));
@@ -173,4 +158,34 @@
       'CONTENT' => $available_order_by[$i][0],
       'SELECTED' => $i==$order_by_index ? 'SELECTED' : ''
+      )
+    );
+}
+
+$user_options = array(
+  array(
+    'value' => 'all',
+    'content' => l10n('All'),
+    ),
+  array(
+    'value' => 'user',
+    'content' => l10n('Users'),
+    ),
+  array(
+    'value' => 'guest',
+    'content' => l10n('Guests'),
+    ),
+  );
+
+foreach ($user_options as $user_option)
+{
+  $template->assign_block_vars(
+    'user_option',
+    array(
+      'VALUE' => $user_option['value'],
+      'CONTENT' => $user_option['content'],
+      'SELECTED' =>
+        (isset($_GET['users']) and $_GET['users'] == $user_option['value'])
+        ? 'selected="selected"'
+        : '',
       )
     );
@@ -190,5 +205,5 @@
   FROM '.RATE_TABLE.' AS r
     LEFT JOIN '.IMAGES_TABLE.' AS i ON r.element_id = i.id
-  WHERE 1 = 1 ' . $display_filter . '
+  WHERE 1 = 1 ' . $page['user_filter'] . '
   GROUP BY r.element_id
   ORDER BY ' . $available_order_by[$order_by_index][1] .'
Index: /trunk/template/yoga/admin/rating.tpl
===================================================================
--- /trunk/template/yoga/admin/rating.tpl	(revision 1210)
+++ /trunk/template/yoga/admin/rating.tpl	(revision 1211)
@@ -1,43 +1,36 @@
 <h2>{lang:Rating} [{NB_ELEMENTS} {lang:elements}]</h2>
 
-<form action="" method="GET" id="update">
-<fieldset>
-<legend></legend>
-<input type="hidden" name="page" value="rating" />
-<ul>
+<form action="{F_ACTION}" method="GET" id="update" class="filter">
+  <fieldset>
+    <legend>{lang:Filter}</legend>
 
-<li><label>{lang:elements per page}: <input type="text" name="display" size="2" value="{DISPLAY}"></label></li>
+    <label>
+      {lang:Sort by}
+      <select name="order_by">
+        <!-- BEGIN order_by -->
+        <option value="{order_by.VALUE}" {order_by.SELECTED}>{order_by.CONTENT}</option>
+        <!-- END order_by -->
+      </select>
+    </label>
 
-<li>
-<label>{lang:Sort by}:
-<select name="order_by">
-<!-- BEGIN order_by -->
-<option value="{order_by.VALUE}" {order_by.SELECTED}>{order_by.CONTENT}</option>
-<!-- END order_by -->
-</select>
-</label></li>
+    <label>
+      {lang:Users}
+      <select name="users">
+        <!-- BEGIN user_option -->
+        <option value="{user_option.VALUE}" {user_option.SELECTED}>{user_option.CONTENT}</option>
+        <!-- END user_option -->
+      </select>
+    </label>
 
-<li>{lang:Filter}:
-<label>
- <input type="radio" class="radio" name="display_filter" {DISPLAY_FILTER_ALL_CHECKED} value="all"/>
- {lang:users} & {lang:guest}
-</label>
-<label>
- <input type="radio" class="radio" name="display_filter" {DISPLAY_FILTER_USER_CHECKED} value="user"/>
- {lang:users}
-</label>
-<label>
- <input type="radio" class="radio" name="display_filter" {DISPLAY_FILTER_GUEST_CHECKED} value="guest"/>
- {lang:guest}
-</label>
-</li>
+    <label>
+      {lang:Number of items}
+      <input type="text" name="display" size="2" value="{DISPLAY}">
+    </label>
 
-</ul>
+    <input type="submit" name="submit_filter" value="{lang:Submit}" />
+  </fieldset>
+  <input type="hidden" name="page" value="rating" />
+</form>
 
-</fieldset>
-<p class="bottomButtons">
-<input type="submit" value="{lang:Submit}" {TAG_INPUT_ENABLED}/>
-</p>
-</form>
 <div class="navigationBar">{NAVBAR}</div>
 <table width="100%">
