5 * Copyright 2004 (c) Dominik Haas, GForge Team
6 * http://fusionforge.org
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 require_once $gfwww.'search/include/renderers/HtmlGroupSearchRenderer.class.php';
25 require_once $gfcommon.'search/NewsSearchQuery.class.php';
27 class NewsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
32 * @param string $words words we are searching for
33 * @param int $offset offset
34 * @param boolean $isExact if we want to search for all the words or if only one matching the query is sufficient
35 * @param int $groupId group id
36 * @param array $sections array of all sections to search in (array of strings)
39 function NewsHtmlSearchRenderer($words, $offset, $isExact, $groupId) {
40 $this->groupId = $groupId;
42 $searchQuery = new NewsSearchQuery($words, $offset, $isExact, $groupId);
44 //init the searchrendererr
45 $this->HtmlGroupSearchRenderer(SEARCH__TYPE_IS_NEWS, $words, $isExact, $searchQuery, $groupId, 'news');
47 $this->tableHeaders = array(
55 * getRows - get the html output for result rows
57 * @return string html output
60 $rowsCount = $this->searchQuery->getRowsCount();
61 $result =& $this->searchQuery->getResult();
62 $dateFormat = _('Y-m-d H:i');
65 for($i = 0; $i < $rowsCount; $i++) {
66 $return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'
67 . '<td><a href="'.util_make_url ('/forum/forum.php?forum_id='. db_result($result, $i, 'forum_id')).'">'
68 . html_image('ic/msg.png', '10', '12')
69 . ' '.db_result($result, $i, 'summary').'</a></td>
70 <td width="15%">'.db_result($result, $i, 'realname').'</td>
71 <td width="15%">'.date($dateFormat, db_result($result, $i, 'post_date')).'</td></tr>';
79 // c-file-style: "bsd"