5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * http://fusionforge.org/
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 require_once '../env.inc.php';
26 require_once $gfcommon.'include/pre.php';
27 require_once $gfwww.'news/news_utils.php';
28 require_once $gfcommon.'forum/Forum.class.php';
32 $group_id = getIntFromRequest('group_id');
33 $limit = getIntFromRequest('limit');
34 $offset = getIntFromRequest('offset');
36 news_header(array('title'=>_('News')));
38 plugin_hook("blocks", "news index");
40 echo '<p>' . _('Choose a News item and you can browse, search, and post messages.') . '</p>';
43 Put the result set (list of forums for this group) into a column with folders
45 if ( !$group_id || $group_id < 0 || !is_numeric($group_id) ) {
48 if ( !$offset || $offset < 0 || !is_numeric($offset) ) {
51 if ( !$limit || $limit < 0 || $limit > 50 || !is_numeric($limit) ) {
55 if ($group_id && ($group_id != GROUP_IS_NEWS)) {
56 $result = db_query_params ('SELECT * FROM news_bytes WHERE group_id=$1 AND is_approved <> 4 ORDER BY post_date DESC',
61 $result = db_query_params ('SELECT * FROM news_bytes WHERE is_approved=1 ORDER BY post_date DESC',
65 $rows=db_numrows($result);
74 echo $HTML->information(sprintf(_('No News Found for %s'),group_getname($group_id)));
76 echo $HTML->information(_('No news found.'));
80 echo news_show_latest($group_id,10,true,false,false,-1, true);
87 // c-file-style: "bsd"