5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 require_once('pre.php');
29 require_once('www/news/news_utils.php');
30 require_once('common/forum/Forum.class');
32 news_header(array('title'=>$Language->getText('news', 'title')));
34 echo $Language->getText('news', 'choose');
36 $group_id = getIntFromRequest('group_id');
37 $limit = getIntFromRequest('limit');
38 $offset = getIntFromRequest('offset');
41 Put the result set (list of forums for this group) into a column with folders
43 if ($group_id && ($group_id != $sys_news_group)) {
44 $sql="SELECT * FROM news_bytes WHERE group_id='$group_id' AND is_approved <> '4' ORDER BY post_date DESC";
46 $sql="SELECT * FROM news_bytes WHERE is_approved='1' ORDER BY post_date DESC";
49 if (!$limit || $limit>50) $limit=50;
50 $result=db_query($sql,$limit+1,$offset);
51 $rows=db_numrows($result);
60 echo '<h2>'.$Language->getText('news', 'nonewsfor', group_getname($group_id)).'</h2>';
62 echo '<h2>'.$Language->getText('news', 'nonews').'</h2>';
65 <p>' . $Language->getText('news', 'noitems') . '</p>';
68 echo '<table width="100%" border="0">
69 <tr><td valign="top">';
71 for ($j = 0; $j < $rows; $j++) {
73 <a href="/forum/forum.php?forum_id='.db_result($result, $j, 'forum_id').'">'.
74 html_image("ic/cfolder15.png","15","13",array("border"=>"0")) . ' '.
75 stripslashes(db_result($result, $j, 'summary')).'</a> ';
80 if (getStringFromRequest('more')) {
81 echo '<br /><a href="'
82 .'?group_id='.$group_id.'&limit='.$limit
83 .'&offset='. (string)($offset+$limit) .'">['.$Language->getText('news', 'olderheadlines').']</a>';