5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('../env.inc.php');
27 require_once $gfwww.'include/pre.php';
28 require_once $gfwww.'news/news_utils.php';
29 require_once $gfcommon.'forum/Forum.class.php';
31 $group_id = getIntFromRequest('group_id');
32 $limit = getIntFromRequest('limit');
33 $offset = getIntFromRequest('offset');
35 news_header(array('title'=>_('News')));
37 echo _('<p>Choose a News item and you can browse, search, and post messages.</p>');
40 Put the result set (list of forums for this group) into a column with folders
42 if ( !$group_id || $group_id < 0 || !is_numeric($group_id) ) {
45 if ($group_id && ($group_id != $sys_news_group)) {
46 $sql="SELECT * FROM news_bytes WHERE group_id='$group_id' AND is_approved <> '4' ORDER BY post_date DESC";
48 $sql="SELECT * FROM news_bytes WHERE is_approved='1' ORDER BY post_date DESC";
51 if ( !$offset || $offset < 0 || !is_numeric($offset) ) {
54 if ( !$limit || $limit < 0 || $limit > 50 || !is_numeric($limit) ) {
58 $result=db_query($sql,$limit+1,$offset);
59 $rows=db_numrows($result);
68 echo '<h2>'.sprintf(_('No News Found For %s'),group_getname($group_id)).'</h2>';
70 echo '<h2>'._('No News Found').'</h2>';
73 <p>' . _('No items were found') . '</p>';
76 echo news_show_latest($group_id,10,true,false,false,-1, true);
83 // c-file-style: "bsd"