So, SQL und Schleife mussten verändert werden, aber ich glaub', das isses:
Code: Alles auswählen
// select Users
$sql = 'SELECT usr_id, first_name.usd_value as first_name, last_name.usd_value as last_name,
email.usd_value as email, (SELECT count(1)
FROM '.TBL_MEMBERS.', '. TBL_ROLES. ', '. TBL_CATEGORIES. '
as temp
WHERE mem_usr_id = usr_id
AND mem_rol_id = rol_id
AND rol_cat_id = cat_id
AND cat_name_intern <> \'CONFIRMATION_OF_PARTICIPATION\'
AND ( mem_begin <= \''.DATE_NOW.'\'
AND mem_end >= \''.DATE_NOW.'\')) as mem_active
FROM '. TBL_MEMBERS. ', '. TBL_USERS. '
JOIN '. TBL_USER_DATA. ' as email
ON email.usd_usr_id = usr_id
AND LENGTH(email.usd_value) > 0
JOIN '.TBL_USER_FIELDS.' as field
ON field.usf_id = email.usd_usf_id
AND field.usf_type = \'EMAIL\'
LEFT JOIN '. TBL_USER_DATA. ' as last_name
ON last_name.usd_usr_id = usr_id
AND last_name.usd_usf_id = '. $gProfileFields->getProperty('LAST_NAME', 'usf_id'). '
LEFT JOIN '. TBL_USER_DATA. ' as first_name
ON first_name.usd_usr_id = usr_id
AND first_name.usd_usf_id = '. $gProfileFields->getProperty('FIRST_NAME', 'usf_id'). '
WHERE mem_usr_id = usr_id
AND usr_id <> '.$gCurrentUser->getValue('usr_id').'
AND usr_valid = 1
GROUP BY usr_id, first_name.usd_value, last_name.usd_value, email.usd_value
ORDER BY last_name, first_name';
$result = $gDb->query($sql);
while ($row = $gDb->fetch_array($result))
{
if ($row['mem_active'] == 0)
{
$passive_list[]= array($row['usr_id'], $row['last_name'].' '.$row['first_name']. ' ('.$row['email'].')', $gL10n->get('LST_FORMER_MEMBERS'));
}
else
{
$active_list[]= array($row['usr_id'], $row['last_name'].' '.$row['first_name']. ' ('.$row['email'].')', $gL10n->get('LST_ACTIVE_MEMBERS'));
}
}
$list = array_merge($list, $active_list, $passive_list);
Och Nöööö, da oben in den Rollen-Listen muss das ja auch noch korrigiert werden!! Wird nachgereicht.
Besten Gruß
Oliver