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