if ($cnt > 0) {
$terms = preg_split('/[\s,]+/', $q);
- common_element_start('ul', array('id' => 'notice'));
+ common_element_start('ul', array('id' => 'notices'));
for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
if ($notice->fetch()) {
$this->show_notice($notice, $terms);
$page, 'noticesearch', array('q' => $q));
}
+ function show_header($arr) {
+ if ($arr) {
+ $q = $arr[0];
+ }
+ if ($q) {
+ common_element('link', array('rel' => 'alternate',
+ 'href' => common_local_url('noticesearchrss',
+ array('q' => $q)),
+ 'type' => 'application/rss+xml',
+ 'title' => _t('Search Stream Feed')));
+ }
+ }
+
# XXX: refactor and combine with StreamAction::show_notice()
function show_notice($notice, $terms) {
# FIXME: URL, image, video, audio
common_element_start('p', array('class' => 'content'));
if ($notice->rendered) {
- common_raw($this->highlight($notice->rendered));
+ common_raw($this->highlight($notice->rendered, $terms));
} else {
# XXX: may be some uncooked notices in the DB,
# we cook them right now. This should probably disappear in future
# versions (>> 0.4.x)
- common_raw($this->highlight(common_render_content($notice->content, $notice)));
+ common_raw($this->highlight(common_render_content($notice->content, $notice), $terms));
}
common_element_end('p');
$noticeurl = common_local_url('shownotice', array('notice' => $notice->id));