Hello,
you have to edit Controler and View of the component :
(comments of my code are in french)
change administrator/components/com_profiler/admin.comprofiler.controller.php (at the line +- 1220):
[code:1]/**
modification pour ajouter un tri
____________________________________________________
OLD :
$query .= "\n WHERE aro.section_value = 'users' "
. (count( $where ) ? "\n AND " . implode( ' AND ', $where ) : ""«»)
. "\n LIMIT " . (int) $pageNav->limitstart . ", " . (int) $pageNav->limit
;
*/
//
// récupérer les paramètres
$order = trim( cbGetParam( $_REQUEST, 'order', null ) );
$by = trim( cbGetParam( $_REQUEST, 'orderby', null ) );
//
// défaut, protéger
if(empty($order) || is_null($order) || !is_string($order)) $order = 'asc';
if(empty($by) || is_null($by) || !is_string($by)) $by = 'name';
//
// controler
// on établit une liste de valeurs autorisées, et on regarde si la valeur est dans la liste. Par défaut, on utilisera le premier élément de la liste
$tAuthOrder = array ('ASC', 'DESC');
$tAuthBy = array ('name', 'email', 'username', 'id');
$order = strtoupper($order);
if(!in_array($order, $tAuthOrder)) $order = $tAuthOrder[0];
if(!in_array($by, $tAuthBy)) $by = $tAuthBy[0];
//
// ajouter le tri à la requete sql
$orderby = "\n ORDER BY a.$by $order";
$query .= "\n WHERE aro.section_value = 'users' "
. (count( $where ) ? "\n AND " . implode( ' AND ', $where ) : ""«»)
. $orderby
. "\n LIMIT " . (int) $pageNav->limitstart . ", " . (int) $pageNav->limit
;
/* end tri */[/code:1]
And administrator/components/com_profiler/admin.comprofiler.html.php (at the line +- 1640):
[code:1]
<?php
/**
modification tri des utilisateurs
______________________________________________________
OLD :
<th width="15%" class="title">Name</th>
*/
?>
<th width="15%" class="title">Name
(<a href="<?php echo $mosConfig_live_site; ?>index2.php?option=com_comprofiler&task=showusers&orderby=name&order=asc">asc</a>
/ <a href="<?php echo $mosConfig_live_site; ?>index2.php?option=com_comprofiler&task=showusers&orderby=name&order=desc">desc</a>«»)
</th>[/code:1]you can do it for the other <th>...
Enjoy !
Post edited by: Halleck, at: 2009/02/24 17:52