4 * Description: Shows lists of community pages
6 * Author: Michael Vogel <ike@piratenpartei.de>
10 function pages_install() {
11 register_hook('page_end', 'addon/pages/pages.php', 'pages_page_end');
14 function pages_uninstall() {
15 unregister_hook('page_end', 'addon/pages/pages.php', 'pages_page_end');
18 function pages_page_end($a,&$b) {
19 if (($a->module != "network") OR ($a->user['uid'] == 0))
22 $pages = '<div id="pages-sidebar" class="widget"><h3>'.t("Community").'</h3><ul>';
23 $contacts = q("SELECT `contact`.`id`, `contact`.`url`, `contact`.`Name` FROM `contact`, `user`
24 WHERE `network`= 'dfrn' AND `duplex`
25 AND `contact`.`nick`=`user`.`nickname`
26 AND `user`.`page-flags`= %d
27 AND `contact`.`uid` = %d",
28 intval(PAGE_COMMUNITY),
29 intval($a->user['uid']));
30 foreach($contacts as $contact) {
31 $pages .= '<li class="tool"><a href="'.$contact["url"].'">'.$contact["Name"]."</a></li>";
34 if (sizeof($contacts) > 0)
35 $a->page['aside'] = $pages.$a->page['aside'];