diff options
author | friendica <info@friendica.com> | 2015-01-26 18:27:03 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-26 18:27:03 -0800 |
commit | ac594183c6fdc6cf4d5a2a29ade7478a17336397 (patch) | |
tree | d38f73727da4d8697b00d2102ae10b501d1909ce /mod/search.php | |
parent | e6bfe3f2c10e851ed5ba49886ec8d0a9a9de2296 (diff) | |
parent | 9f5bfca28dde23893156ad36682e20ca2fc0dd45 (diff) | |
download | volse-hubzilla-ac594183c6fdc6cf4d5a2a29ade7478a17336397.tar.gz volse-hubzilla-ac594183c6fdc6cf4d5a2a29ade7478a17336397.tar.bz2 volse-hubzilla-ac594183c6fdc6cf4d5a2a29ade7478a17336397.zip |
Merge branch 'master' into tres and add some work on the item_deleted flag refactor
Conflicts:
include/attach.php
include/onedirsync.php
include/zot.php
mod/locs.php
Diffstat (limited to 'mod/search.php')
-rw-r--r-- | mod/search.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mod/search.php b/mod/search.php index 2ea6ad86f..5b15b0593 100644 --- a/mod/search.php +++ b/mod/search.php @@ -21,6 +21,10 @@ function search_content(&$a,$update = 0, $load = false) { require_once('include/conversation.php'); require_once('include/items.php'); + $format = (($_REQUEST['format']) ? $_REQUEST['format'] : ''); + if($format !== '') { + $update = $load = 1; + } $observer = $a->get_observer(); $observer_hash = (($observer) ? $observer['xchan_hash'] : ''); @@ -179,6 +183,19 @@ function search_content(&$a,$update = 0, $load = false) { $items = array(); } + + if($format == 'json') { + $result = array(); + require_once('include/conversation.php'); + foreach($items as $item) { + $item['html'] = bbcode($item['body']); + $x = encode_item($item); + $x['html'] = prepare_text($item['body'],$item['mimetype']); + $result[] = $x; + } + json_return_and_die(array('success' => true,'messages' => $result)); + } + if($tag) $o .= '<h2>Items tagged with: ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8') . '</h2>'; else |