4 // Lists membership requests for a community
9 if (user_type($page_owner) == "community" && run("permissions:check",array("userdetails:change", $page_owner))) {
10 $title = run("profile:display:name") . " :: ". __gettext("Membership requests") ."";
12 if ($pending_requests = get_records_sql('SELECT fr.ident AS request_id, u.* FROM '.$CFG->prefix
.'friends_requests fr
13 LEFT JOIN '.$CFG->prefix
.'users u ON u.ident = fr.owner
14 WHERE fr.friend = ? ORDER BY u.name ASC',array($page_owner))) {
15 $body .= "<p>" . __gettext("The following users would like to join this community. They need your approval to do this (to change this setting, visit the 'community settings' page).") . "</p>";
17 foreach($pending_requests as $pending_user) {
19 $where = run("users:access_level_sql_where",$_SESSION['userid']);
20 if ($description = get_record_select('profile_data',"($where) AND name = 'minibio' and owner = " . $pending_user->ident
)) {
21 $description = "<p>" . stripslashes($description->value
) . "</p>";
23 $description = "<p> </p>";
26 $request_id = $pending_user->request_id
;
28 $pending_user->name
= run("profile:display:name",$pending_user->ident
);
30 $col1 = "<p><b>" . $pending_user->name
. "</b></p>" . $description;
32 $col1 .= '<a href="' . url
. $pending_user->username
. '/">' . __gettext("Profile") . "</a> | ";
33 $col1 .= '<a href="' . url
. $pending_user->username
. '/weblog/">' . __gettext("Blog") . "</a></p>";
34 $col2 = '<p><a href="' .url
. "_communities/requests.php?action=community:approve:request&request_id=$request_id&owner=$page_owner\">Approve</a> | <a href=\"" .url
. "_communities/requests.php?action=community:decline:request&request_id=$request_id&owner=$page_owner\">Decline</a></p>";
35 $ident = $pending_user->ident
;
37 $body .= templates_draw(array(
38 'context' => 'adminTable',
39 'name' => '<img src="' . url
. '_icon/user/' . $pending_user->icon
. '" />',
48 $body .= "<p>" . __gettext("You have no pending membership requests.") . "</p>";
51 $run_result = templates_draw( array(
52 'context' => 'contentholder',