*/
function showResults($q, $page)
{
- if ($this->notice->N === 0) {
- $this->showEmptyResults($q, $page);
- }
-
if (Event::handle('StartNoticeSearchShowResults', array($this, $q, $this->notice))) {
- $terms = preg_split('/[\s,]+/', $q);
- $nl = new SearchNoticeList($this->notice, $this, $terms);
- $cnt = $nl->show();
- $this->pagination($page > 1,
- $cnt > NOTICES_PER_PAGE,
- $page,
- 'noticesearch',
- array('q' => $q));
+ if ($this->notice->N === 0) {
+ $this->showEmptyResults($q, $page);
+ } else {
+ $terms = preg_split('/[\s,]+/', $q);
+ $nl = new SearchNoticeList($this->notice, $this, $terms);
+ $cnt = $nl->show();
+ $this->pagination($page > 1,
+ $cnt > NOTICES_PER_PAGE,
+ $page,
+ 'noticesearch',
+ array('q' => $q));
+ }
Event::handle('EndNoticeSearchShowResults', array($this, $q, $this->notice));
}
}
function showContent()
{
// FIXME: URL, image, video, audio
- $this->out->elementStart('p', array('class' => 'entry-content'));
- if ($this->notice->rendered) {
- $this->out->raw($this->highlight($this->notice->rendered, $this->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)
- $this->out->raw($this->highlight(common_render_content($this->notice->content, $this->notice), $this->terms));
- }
+ $this->out->elementStart('p', array('class' => 'e-content'));
+ $this->out->raw($this->highlight($this->notice->getRendered(), $this->terms));
$this->out->elementEnd('p');
}