12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class NoticesearchrssAction extends Rss10Action
- {
- protected function getNotices()
- {
- $q = $this->trimmed('q');
- $notices = array();
- $notice = new Notice();
- $search_engine = $notice->getSearchEngine('notice');
- $search_engine->set_sort_mode('chron');
- $search_engine->limit(0, $this->limit, true);
- if (false === $search_engine->query($q)) {
- $cnt = 0;
- } else {
- $cnt = $notice->find();
- }
- if ($cnt > 0) {
- while ($notice->fetch()) {
- $notices[] = clone($notice);
- }
- }
- return $notices;
- }
- function getChannel()
- {
- $q = $this->trimmed('q');
- $c = array('url' => common_local_url('noticesearchrss', array('q' => $q)),
-
- 'title' => sprintf(_('Updates with "%s"'), $q),
- 'link' => common_local_url('noticesearch', array('q' => $q)),
-
-
- 'description' => sprintf(_('Updates matching search term "%1$s" on %2$s.'),
- $q, common_config('site', 'name')));
- return $c;
- }
- function getImage()
- {
- return null;
- }
- function isReadOnly($args)
- {
- return true;
- }
- }
|