diff --git a/page.tgz b/page.tgz new file mode 100644 index 000000000..c684499b2 Binary files /dev/null and b/page.tgz differ diff --git a/page/README b/page/README new file mode 100755 index 000000000..6ec314b70 --- /dev/null +++ b/page/README @@ -0,0 +1,3 @@ +Pages + +Shows lists of community pages diff --git a/page/page.php b/page/page.php new file mode 100755 index 000000000..3333bb24f --- /dev/null +++ b/page/page.php @@ -0,0 +1,60 @@ + + * based on pages plugin by + * Author: Michael Vogel + * + */ + +function page_install() { + register_hook('page_end', 'addon/page/page.php', 'page_page_end'); +} + +function page_uninstall() { + unregister_hook('page_end', 'addon/page/page.php', 'page_page_end'); +} + + +function page_getpage($uid) { + + + $pagelist = array(); + + $contacts = q("SELECT `id`, `url`, `name` FROM `contact` + WHERE `network`= 'dfrn' AND `forum` = 1 AND `uid` = %d", + intval($uid) + ); + + $page = array(); + + // Look if the profile is a community page + foreach($contacts as $contact) { + $page[] = array("url"=>$contact["url"], "name"=>$contact["name"], "id"=>$contact["id"]); + } + return($page); +} + +function page_page_end($a,&$b) { + // Only move on if if it's the "network" module and there is a logged on user + if (($a->module != "network") OR ($a->user['uid'] == 0)) + return; + + $page = '
+
+

'.t("Community Pages").'

+
"; + if (sizeof($contacts) > 0) + $a->page['aside'] = $page . $a->page['aside']; +} +?>