| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | if(is_numeric($token[2]) ) |
|---|
| 26 | { |
|---|
| 27 | $_SMARTY['Title'] = 'Community members'; |
|---|
| 28 | |
|---|
| 29 | $community['info'] = $db->getRow('SELECT id_comm, id, community.name as name, community.description as description, moderated, country, date, nb_members, community_cat.name as category FROM community LEFT JOIN community_cat USING(id_cat) WHERE id_comm=?', array($token[2])); |
|---|
| 30 | |
|---|
| 31 | $community['logo'] = build_logo_url($community['info']['id'], $token[2]); |
|---|
| 32 | |
|---|
| 33 | $members = $db->getCol('SELECT id FROM user_comm WHERE id_comm=? AND status=?', 0, array($community['info']['id_comm'], 'ok')); |
|---|
| 34 | |
|---|
| 35 | foreach($members as $member) |
|---|
| 36 | $community['member'][$member] = get_cache_user_info($member); |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | $leftmenu["/communities/view/".$community['info']['id_comm']] = 'Return to community'; |
|---|
| 42 | |
|---|
| 43 | if($_SESSION['my_id'] != $community['info']['id']) |
|---|
| 44 | if($_SESSION['my_communities_id'] && in_array($community['info']['id_comm'], $_SESSION['my_communities_id']) ) |
|---|
| 45 | $leftmenu["/communities/unjoin/".$token[2]] = 'Unjoin'; |
|---|
| 46 | else |
|---|
| 47 | $leftmenu["/communities/join/".$token[2]] = 'Join'; |
|---|
| 48 | else |
|---|
| 49 | $leftmenu["/communities/edit/".$token[2]] = 'Edit'; |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | $leftmenu["/communities/events/".$token[2]] = 'View events'; |
|---|
| 53 | $leftmenu["/communities/invite/".$token[2]] = 'Invite friends'; |
|---|
| 54 | |
|---|
| 55 | $_SMARTY['leftmenu'] = $leftmenu; |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | $_SMARTY['community'] = $community; |
|---|
| 61 | |
|---|
| 62 | } |
|---|
| 63 | else |
|---|
| 64 | { |
|---|
| 65 | header('Location: /communities'); |
|---|
| 66 | exit(); |
|---|
| 67 | } |
|---|
| 68 | ?> |
|---|