aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Msearch.php
diff options
context:
space:
mode:
authorredmatrix <mike@macgirvin.com>2016-10-03 21:48:53 -0700
committerredmatrix <mike@macgirvin.com>2016-10-03 21:48:53 -0700
commitce6e81c68221a9f462af886626dc02fdfc26f8aa (patch)
tree9975c5271a35e532ee1e48a0e36bd4692945c4a6 /Zotlabs/Module/Msearch.php
parentc44acb35757700e52db5cc4a7093b8e4624dc3fa (diff)
downloadvolse-hubzilla-ce6e81c68221a9f462af886626dc02fdfc26f8aa.tar.gz
volse-hubzilla-ce6e81c68221a9f462af886626dc02fdfc26f8aa.tar.bz2
volse-hubzilla-ce6e81c68221a9f462af886626dc02fdfc26f8aa.zip
more backticks
Diffstat (limited to 'Zotlabs/Module/Msearch.php')
-rw-r--r--Zotlabs/Module/Msearch.php47
1 files changed, 0 insertions, 47 deletions
diff --git a/Zotlabs/Module/Msearch.php b/Zotlabs/Module/Msearch.php
deleted file mode 100644
index e96f78e16..000000000
--- a/Zotlabs/Module/Msearch.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-namespace Zotlabs\Module;
-
-
-class Msearch extends \Zotlabs\Web\Controller {
-
- function post() {
-
- $perpage = (($_POST['n']) ? $_POST['n'] : 80);
- $page = (($_POST['p']) ? intval($_POST['p'] - 1) : 0);
- $startrec = (($page+1) * $perpage) - $perpage;
-
- $search = $_POST['s'];
- if(! strlen($search))
- killme();
-
- $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 AND `user`.`hidewall` = 0 AND MATCH `keywords` AGAINST ('%s') ",
- dbesc($search)
- );
- if(count($r))
- $total = $r[0]['total'];
-
- $r = q("SELECT `keywords`, `username`, `nickname`, `user`.`uid` FROM `user` LEFT JOIN `profile` ON `user`.`uid` = `profile`.`uid` WHERE `is_default` = 1 AND `user`.`hidewall` = 0 AND MATCH `keywords` AGAINST ('%s') LIMIT %d , %d ",
- dbesc($search),
- intval($startrec),
- intval($perpage)
- );
-
- $results = array();
- if(count($r)) {
- foreach($r as $rr)
- $results[] = array(
- 'name' => $rr['name'],
- 'url' => z_root() . '/channel/' . $rr['nickname'],
- 'photo' => z_root() . '/photo/avatar/' . $rr['uid'],
- 'tags' => str_replace(array(',',' '),array(' ',' '),$rr['keywords'])
- );
- }
-
- $output = array('total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results);
-
- echo json_encode($output);
-
- killme();
-
- }
-}