1
Hey all,
i'm trying to modify a page i got from the brazilianpack, i try to make a sort of usergroup overview. the thing is, when i've got more than 10 users in a group i would like to show only 10 on the first page and than link to the next 10. in the same way the XOOPS modules (forum and news) work. can any body help me?
here is the code:
// by Fernando Santos (topet05) 11/02/2004
function ExibeGrupos ($groupName,$number)
{
global $xoopsUser;
$connect =& Database::getInstance();
$myts =& MyTextSanitizer::getInstance();
$result = $connect->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, u.user_occ,
g.name AS groupname FROM ".$connect->prefix("groups_users_link")." l LEFT JOIN "
.$connect->prefix("users")." u ON l.uid=u.uid LEFT JOIN ".$connect->prefix("groups").
" g ON l.groupid=g.groupid WHERE g.name='".$groupName."' ORDER BY uname limit ".$number."");
if ($connect->getRowsNum($result) > 0) {
echo '';
echo '
';
$user_group = 0;
while ($user_profile = $connect->fetchArray($result)) {
if ($user_group == 0){
echo''.$myts->htmlSpecialChars($user_profile['groupname']).' |
';
$user_group = 1;
}
if ($xoopsUser != '') {
echo' '.$myts->htmlspecialchars($user_profile['uname']).' | '.$myts->htmlSpecialChars($user_profile['user_occ']).' | |
';
}else{
//if annonimous user
if ($user_profile['user_viewemail']) {
echo' '.$myts->htmlspecialchars($user_profile['uname']).' | '.$myts->htmlSpecialChars($user_profile['user_occ']).' | E-mail deze gebruiker |
';
}else{
echo' '.$myts->htmlspecialchars($user_profile['uname']).' | '.$myts->htmlSpecialChars($user_profile['user_occ']).' | Helaas Kunt u met deze gebruiker geen contact opnemen! |
';
// end if annonimous user
}
}
}
echo'
';
}else{
echo 'O grupo selecionado não existe ou não contém nenhum membro.';
}
}
?>
You can see the code working at
HDCFhelp wil be much apreciated,
thanks Ben