1
bennie
how can i put navigation to the page?
  • 2004/4/8 8:31

  • bennie

  • Just popping in

  • Posts: 40

  • Since: 2003/7/3 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:

<?php
// 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 '</br></br>';
echo '<table class="outer" cellspacing="1">';
$user_group = 0;
while ($user_profile = $connect->fetchArray($result)) {
if ($user_group == 0){
echo'<tr><th colspan="3">'.$myts->htmlSpecialChars($user_profile['groupname']).'</th></tr>';
$user_group = 1;
}
if ($xoopsUser != '') {
echo'<tr><td class="even" valign="middle" align="center" width="20%"><img src="'.XOOPS_URL.'/uploads/'.$user_profile['user_avatar'].'" alt="" width="50" /><br /><a href="'.XOOPS_URL.'/userinfo.php?uid='.$user_profile['uid'].'">'.$myts->htmlspecialchars($user_profile['uname']).'</a></td><td class="odd" width="20%" align="left" valign="middle">'.$myts->htmlSpecialChars($user_profile['user_occ']).'</td><td class="even" width="20%" align="center" valign="middle"><a href="javascript:openWithSelfMain(\''.XOOPS_URL.'/pmlite.php?send2=1&to_userid='.$user_profile['uid'].'\',\'pmlite\',450,370);"><img src="'.XOOPS_URL.'/images/icons/pm_small.gif" border="0" width="27" height="17" alt="" /></a></td></tr>';
}else{
//if annonimous user
if ($user_profile['user_viewemail']) {
echo'<tr><td class="even" valign="middle" align="center" width="20%"><img src="'.XOOPS_URL.'/uploads/'.$user_profile['user_avatar'].'" alt="" width="50" /><br />'.$myts->htmlspecialchars($user_profile['uname']).'</a></td><td class="odd" width="20%" align="left" valign="middle">'.$myts->htmlSpecialChars($user_profile['user_occ']).'</td><td class="even" width="20%" align="center" valign="middle">E-mail deze gebruiker</br><a href="mailto:'.$user_profile['email'].'"></br><img src="'.XOOPS_URL.'/images/icons/em_small.gif" border="0" width="16" height="14" alt="" /></a></td></tr>';

}else{
echo'<tr><td class="even" valign="middle" align="center" width="20%"><img src="'.XOOPS_URL.'/uploads/'.$user_profile['user_avatar'].'" alt="" width="50" /><br />'.$myts->htmlspecialchars($user_profile['uname']).'</a></td><td class="odd" width="20%" align="left" valign="middle">'.$myts->htmlSpecialChars($user_profile['user_occ']).'</td><td class="even" align="center">Helaas Kunt u met deze gebruiker geen contact opnemen!</td></tr>';
// end if annonimous user
}
}
}
echo'</table>';

}else{
echo 'O grupo selecionado não existe ou não contém nenhum membro.';
}
}

?>

You can see the code working at
HDCF

help wil be much apreciated,

thanks Ben

Login

Who's Online

195 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 195


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits