3 * Exports: Export project news as HTML
7 * limit - number of items to export
8 * show_summaries - 0 to show only headlines, 1 to also show
10 * flat - 1 to use minimal HTML formatting
12 * Copyright 2004 (c) Tim Perdue - GForge LLC
13 * http://fusionforge.org
15 * This file is part of FusionForge. FusionForge is free software;
16 * you can redistribute it and/or modify it under the terms of the
17 * GNU General Public License as published by the Free Software
18 * Foundation; either version 2 of the Licence, or (at your option)
21 * FusionForge is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License along
27 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
28 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 require_once('../env.inc.php');
32 require_once $gfcommon.'include/pre.php';
33 require_once $gfwww.'news/news_utils.php';
35 $group_name = getStringFromRequest('group_name');
36 $group_id = getIntFromRequest('group_id');
37 $limit = getIntFromRequest('limit', 20);
38 $show_summaries = getStringFromRequest('show_summaries');
39 $flat = getStringFromRequest('flat');
45 $group = group_get_object_by_name($group_name);
47 $group = group_get_object($group_id);
50 if (!$group || !is_object($group)) {
52 } elseif ($group->isError()) {
53 exit_error($group->getErrorMessage(),'home');
57 // Get the group_id from the object
60 $group_id=$group->getID();
64 // Add checks to see if they have perms to view this
66 session_require_perm ('project_read', $group_id);
68 if ($limit>20 || $limit < 1) {
72 echo $HTML->boxTop(_('Latest News'));
73 echo news_show_latest($group_id,$limit,$show_summaries,false,$flat);
74 echo $HTML->boxBottom();