//Usergroups join request on Index START
$query = $db->query("
SELECT g.title, g.gid, g.type, COUNT(u.uid) AS users, COUNT(j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers
FROM ".TABLE_PREFIX."groupleaders l
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid)
WHERE l.uid='".$mybb->user['uid']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers
");
while($usergroup = $db->fetch_array($query))
{
if($usergroup['joinrequests'] > 0 && $usergroup['canmanagerequests'] == 1)
{
eval("\$newjoinrequest = \"".$templates->get("beitrittsanfrage")."\";");
}
}
//Usergroups join request on Index ENDE