1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-10 04:55:43 +02:00

Tweaked the search results on 'Pages'.

This commit is contained in:
Cameron 2015-01-28 00:06:18 -08:00
parent 6cd866db2d
commit 9618771f43

View File

@ -111,16 +111,31 @@ class page_search extends e_search // include plugin-folder in the name.
{
$row['page_sef'] = '--sef-not-assigned--';
}
if($row['page_chapter'] == 0) // Page without category.
{
$route = 'page/view/other';
$pre = '';
}
else // Page with book/chapter
{
$route = 'page/view/index';
$pre = $tp->toHtml($this->getName($book),false,'TITLE').' » '. $tp->toHtml($this->getName($row['page_chapter']),false,'TITLE'). " | ";
}
$res = array();
$res['link'] = str_replace('///','/', e107::getUrl()->create('page/view', $row, array('allow' => 'page_sef,page_title,page_id,chapter_sef,book_sef')));
$res['pre_title'] = $tp->toHtml($this->getName($book),false,'TITLE').' - '. $tp->toHtml($this->getName($row['page_chapter']),false,'TITLE'). " | ";
$res['link'] = e107::getUrl()->create($route, $row, array('allow' => 'page_sef,page_title,page_id,chapter_sef,book_sef'));
$res['pre_title'] = $pre;
$res['title'] = $tp->toHtml($row['page_title'], false, 'TITLE');
$res['summary'] = (!empty($row['page_metadscr'])) ? $row['page_metadscr'] : $row['page_text'];
$res['detail'] = LAN_SEARCH_3.$tp->toDate($row['page_datestamp'], "long");
$res['image'] = $row['menu_image'];
return $res;
}