aboutsummaryrefslogtreecommitdiffstats
path: root/mod/sitelist.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-18 20:38:38 -0700
committerredmatrix <git@macgirvin.com>2016-04-18 20:38:38 -0700
commit2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 (patch)
tree2376d950ba2bdc7753336a3e2b94865c95c238f2 /mod/sitelist.php
parent2a61817bad96526994c0499f1fc0a843a9cc9405 (diff)
downloadvolse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.tar.gz
volse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.tar.bz2
volse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.zip
module updates
Diffstat (limited to 'mod/sitelist.php')
-rw-r--r--mod/sitelist.php62
1 files changed, 0 insertions, 62 deletions
diff --git a/mod/sitelist.php b/mod/sitelist.php
deleted file mode 100644
index 30b2359ac..000000000
--- a/mod/sitelist.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php /** @file */
-
-function sitelist_init(&$a) {
-
- $start = (($_REQUEST['start']) ? intval($_REQUEST['start']) : 0);
- $limit = ((intval($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 30);
- $order = (($_REQUEST['order']) ? $_REQUEST['order'] : 'random');
- $open = (($_REQUEST['open']) ? intval($_REQUEST['open']) : false);
-
-
- $sql_order = " order by site_url ";
- $rand = db_getfunc('rand');
- if($order == 'random')
- $sql_order = " order by $rand ";
-
- $sql_limit = " LIMIT $limit OFFSET $start ";
-
- $sql_extra = "";
- if($open)
- $sql_extra = " and site_register = " . intval(REGISTER_OPEN) . " ";
-
- $realm = get_directory_realm();
- if($realm == DIRECTORY_REALM) {
- $sql_extra .= " and ( site_realm = '" . dbesc($realm) . "' or site_realm = '') ";
- }
- else
- $sql_extra .= " and site_realm = '" . dbesc($realm) . "' ";
-
- $result = array('success' => false);
-
- $r = q("select count(site_url) as total from site where site_type = %d $sql_extra ",
- intval(SITE_TYPE_ZOT)
- );
-
- if($r)
- $result['total'] = intval($r[0]['total']);
-
- $result['start'] = $start;
- $result['limit'] = $limit;
-
- $r = q("select * from site where site_type = %d $sql_extra $sql_order $sql_limit",
- intval(SITE_TYPE_ZOT)
- );
-
- $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