root/elgg/trunk/mod/community/lib/communities_owned.php

Revision 218, 1.2 kB (checked in by cedenoj, 9 months ago)

refs #2828 added a link to create a new community as well as to list all communities in the right sidebar
Submitting this changeset again since I had committed into a branch instead of trunk before

Line 
1 <?php
2
3 global $page_owner;
4
5 if ($page_owner != -1) {
6     if (user_type($page_owner) == "person") {
7         if ($result = get_records_select('users',"owner = ? AND user_type = ?",array($page_owner,'community'))) {
8             $body = "<ul>";
9             foreach($result as $row) {
10                     $row->name = run("profile:display:name",$row->ident);
11                     $body .= "<li><a href=\"" . url . $row->username . "/\">" . $row->name . "</a></li>";
12             }
13             $body .= "</ul>";
14             $body .= "<p><a href=\"" . url . $_SESSION['username'] . "/communities/owned#create_community\">[Create Communities]</a></p>";
15             // $run_result .= $body;
16             $run_result .= "<li id=\"community_owned\">";
17             $run_result .= templates_draw(array(
18                                                 'context' => 'sidebarholder',
19                                                 'title' => __gettext("Owned communities"),
20                                                 'body' => $body
21                                                 )
22                                           );
23             $run_result .= "</li>";
24         } else {
25             $run_result .= "";
26         }
27     }
28 }
29
30 ?>
31
Note: See TracBrowser for help on using the browser.