Skip to Content Skip to Menu

Display multiple users lists on one page ?

12 years 6 months ago #195825 by marc.douguet
Display multiple users lists on one page ? was created by marc.douguet
Hello !
Is there any way to display several users lists on the same page, one under the other ? Something like :

Page title : members sorted out by continent.

Members from Europe





Members from Asia




Members from America



Thank you for your help !

Please Log in or Create an account to join the conversation.

12 years 6 months ago #195827 by marc.douguet
Replied by marc.douguet on topic Re: Display multiple users lists on one page ?
I tried the cb user list module, but it shows only last new/last connected/random users. Is there a module that shows a list of all users, filtered the way I want ?

Please Log in or Create an account to join the conversation.

12 years 6 months ago - 12 years 6 months ago #197777 by marc.douguet
Replied by marc.douguet on topic Re: Display multiple users lists on one page ?
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; } } ?>
Last edit: 12 years 6 months ago by marc.douguet.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum