From 580bc49308415953be355f59a2e59b4dc95b1bc0 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 23 Mar 2012 01:18:45 -0700 Subject: [PATCH] "page" addon - higher performance version of "pages" addon --- page.tgz | Bin 0 -> 959 bytes page/README | 3 +++ page/page.php | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 page.tgz create mode 100755 page/README create mode 100755 page/page.php diff --git a/page.tgz b/page.tgz new file mode 100644 index 0000000000000000000000000000000000000000..c684499b2af20280efbbdc4cb584b219d2e57a3b GIT binary patch literal 959 zcmV;w13>&AiwFSEF>Fr&1MOBzZ`(!?)|LDf(}i17hD_=$!xfntv4S4rxNwT}U>Md) zTuBR4B)cT-Iz|3_XO^^VsVSU8JKiFl-8JZ-cvqX_@DDXeuKQ*{^6kwhwy=~#R>d^ z(?HUh$mdFCg-nwZ__#{%bBJYL5wX0WAxYAx&Is$fNa6=rr+0#e8tbHA;pDnrR=1X+K~!SlJc&r5 z>K4T5a#@{*G8f9WaIcH*kHXsgyWq)16D}@6E6MiC!Nxn-i2&M7B%sdzIStM@l6N4Z zfYHKHE+aAHiorbQc^+9k2$QASOm=R$TomsN0$b&)Kvn<}(p9z>5R722A{c$2{RNR+QW_YzozE?ar9T#y-cU z#4=>nU~Mu)4R)dGSM?+dB0ZO%MY?z@vk4*cO4VWBdgvWaO(n*m_6L8{(a^pL?XP|R z^+)J(a(Z??+1nlS;{U(?u)hDhqh5D}_kVXV9GUz7HK32IZNG56|JPX>7#J8B7#J8B h7#J8B7#J8B7#J8B7#J8B7#MsD{sJW}p*;X7007pc + * 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']; +} +?> -- 2.39.2