X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ftwitapisearchjson.php;h=c628ee624a2a3498d7ff4a24cf329f6663a127f8;hb=70fc32c5b93a6cd71cf33212ac792c38632bbdb3;hp=b50aa86b7ac119a2200d0522671660fc4f50cabe;hpb=bab3e1b8586f42bc1f0a5f96b6990d67c6b74446;p=quix0rs-gnu-social.git diff --git a/actions/twitapisearchjson.php b/actions/twitapisearchjson.php index b50aa86b7a..c628ee624a 100644 --- a/actions/twitapisearchjson.php +++ b/actions/twitapisearchjson.php @@ -1,8 +1,8 @@ . * * @category Search - * @package Laconica - * @author Zach Copley - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,10 +38,10 @@ require_once INSTALLDIR.'/lib/jsonsearchresultslist.php'; * Action handler for Twitter-compatible API search * * @category Search - * @package Laconica - * @author Zach Copley + * @package StatusNet + * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see TwitterapiAction */ @@ -114,7 +114,7 @@ class TwitapisearchjsonAction extends TwitterapiAction function showResults() { - // TODO: Support search operators like from: and to: + // TODO: Support search operators like from: and to:, boolean, etc. $notice = new Notice(); @@ -124,8 +124,11 @@ class TwitapisearchjsonAction extends TwitterapiAction $search_engine = $notice->getSearchEngine('identica_notices'); $search_engine->set_sort_mode('chron'); $search_engine->limit(($this->page - 1) * $this->rpp, $this->rpp + 1, true); - $search_engine->query($q); - $cnt = $notice->find(); + if (false === $search_engine->query($q)) { + $cnt = 0; + } else { + $cnt = $notice->find(); + } // TODO: since_id, lang, geocode @@ -137,13 +140,13 @@ class TwitapisearchjsonAction extends TwitterapiAction } /** - * This is a read-only action + * Do we need to write to the database? * * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } -} \ No newline at end of file +}