From c86dfd2e0c1626003711194cdd4871790f1d6879 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 4 Aug 2013 21:20:03 -0700 Subject: directory server sitelist module (needed for public site list and building friend suggestions for new sites/channels with no known contacts) --- include/socgraph.php | 1 + mod/sitelist.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 mod/sitelist.php diff --git a/include/socgraph.php b/include/socgraph.php index 3970acd0d..ef1bab1d6 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -274,6 +274,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) { intval($limit) ); + /* $r = q("SELECT count(xlink.xchan) as `total`, gcontact.* from gcontact left join glink on glink.gcid = gcontact.id diff --git a/mod/sitelist.php b/mod/sitelist.php new file mode 100644 index 000000000..1e6d0fcfb --- /dev/null +++ b/mod/sitelist.php @@ -0,0 +1,51 @@ + false); + + $r = q("select count(site_url) as total from site where 1 $sql_extra "); + + if($r) + $result['total'] = intval($r[0]['total']); + + $result['start'] = $start; + $result['limit'] = $limit; + + $r = q("select * from site where true $sql_extra $sql_order $sql_limit"); + + $result['results'] = 0; + $result['entries'] = array(); + + if($r) { + $result['success'] = true; + $result['results'] = count($r); + + foreach($r as $rr) { + $result['entries'][] = array('url' => $rr['site_url']); + } + + } + + echo json_encode($result); + killme(); + + +} \ No newline at end of file -- cgit v1.2.3