5 * Copyright 2004 (c) Dominik Haas, GForge Team
12 require_once('www/search/include/renderers/HtmlGroupSearchRenderer.class.php');
13 require_once('common/search/NewsSearchQuery.class.php');
15 class NewsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
20 * @param string $words words we are searching for
21 * @param int $offset offset
22 * @param boolean $isExact if we want to search for all the words or if only one matching the query is sufficient
23 * @param int $groupId group id
24 * @param array $sections array of all sections to search in (array of strings)
27 function NewsHtmlSearchRenderer($words, $offset, $isExact, $groupId) {
28 $this->groupId = $groupId;
30 $searchQuery = new NewsSearchQuery($words, $offset, $isExact, $groupId);
32 //init the searchrendererr
33 $this->HtmlGroupSearchRenderer(SEARCH__TYPE_IS_NEWS, $words, $isExact, $searchQuery, $groupId, 'news');
35 $this->tableHeaders = array(
43 * getRows - get the html output for result rows
45 * @return string html output
48 $rowsCount = $this->searchQuery->getRowsCount();
49 $result =& $this->searchQuery->getResult();
50 $dateFormat = _('Y-m-d H:i');
53 for($i = 0; $i < $rowsCount; $i++) {
54 $return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'
55 . '<td><a href="'.util_make_url ('/forum/forum.php?forum_id='. db_result($result, $i, 'forum_id')).'">'
56 . html_image('ic/msg.png', '10', '12', array('border' => '0'))
57 . ' '.db_result($result, $i, 'summary').'</a></td>
58 <td width="15%">'.db_result($result, $i, 'realname').'</td>
59 <td width="15%">'.date($dateFormat, db_result($result, $i, 'post_date')).'</td></tr>';
67 // c-file-style: "bsd"