Ok, here is the solution I found. I inserted this php script in an article (using jumi or addphp). It's not very elegant but it works !
Code:
<?php
//liste des noms et prénoms des professeurs :
$sql= "SELECT firstname, lastname, cb_fonction FROM #__comprofiler WHERE cb_fonction = 'Professeur'";
$database=& JFactory::getDBO();
$database->setQuery( $sql);
$profs = $database->loadAssocList();
//pour chaque professeur, récupérer la liste :
foreach($profs as $prof)
{
$sql="SELECT listid, filterfields FROM jos_comprofiler_lists WHERE filterfields = 's(`cb_directeur` =\\'".$prof['firstname']."%20".$prof['lastname']."\\')'";
$database=& JFactory::getDBO();
$database->setQuery( $sql);
$listid=$database->loadAssoc();
//pour chaque professeur, vérifier qu'il a des doctorants :
$sql="SELECT * FROM jos_comprofiler WHERE cb_directeur = '".$prof['firstname']." ".$prof['lastname']."'";
$database=& JFactory::getDBO();
$database->setQuery( $sql);
$database->query();
$doctorants=$database->getNumRows();
if ($doctorants >0 )
{
//afficher
ob_start();
$_GET['listid']=$listid['listid'];
usersList( $_CB_framework->myId() );
if (!is_null($oldignoreuserabort)) ignore_user_abort($oldignoreuserabort);
// echo $_CB_framework->getAllJsPageCodes();
$html = ob_get_contents();
ob_end_clean();
echo $html;
}
}
?>