2
Make a new block and set the "Content Type" for "PHP Script" and put this function in your block:
Quote:
function ExibeGrupos ($grupoNome,$numero)
{
global $xoopsUser;
$conecta =& Database::getInstance();
$myts =& MyTextSanitizer::getInstance();
$result = $conecta->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM ".$conecta->prefix("groups_users_link")." l LEFT JOIN ".$conecta->prefix("users")." u ON l.uid=u.uid LEFT JOIN ".$conecta->prefix("groups")." g ON l.groupid=g.groupid WHERE g.name='".$grupoNome."' ORDER BY RAND() limit ".$numero."");
if ($conecta->getRowsNum($result) > 0) {
echo '';
}else{
echo 'O grupo selecionado não existe ou não contém nenhum membro.';
}
}
After put the function in your block, call:
echo ExibeGrupos("Group Name","Number of users in the block")
Sample:
echo ExibeGrupos("Webmasters","10");
This will show in the block 10 users of the Webmasters group (Order By RAND()).
Powered By
XOOPS Brasil - The different community - Brazil
Visit:
http://www.xoops.net.br (In the first steps, but walking!)