5 * Copyright 1999-2001, Tim Perdue - Sourceforge
6 * Copyright 2002, Tim Perdue - GForge, LLC
7 * Copyright 2010 (c) Franck Villaume - Capgemini
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.'forum/include/ForumHTML.class.php';
28 require_once $gfcommon.'forum/Forum.class.php';
29 require_once $gfwww.'forum/include/AttachManager.class.php';
32 User obviously has to be logged in to save place
35 $forum_id = getIntFromRequest('forum_id');
36 $group_id = getIntFromRequest('group_id');
37 if ($forum_id && $group_id) {
39 // Set up local objects
41 $g = group_get_object($group_id);
42 if (!$g || !is_object($g) || $g->isError()) {
46 $f=new Forum($g,$forum_id);
47 if (!$f || !is_object($f)) {
48 exit_error(_('Error Getting Forum'),'forums');
49 } elseif ($f->isError()) {
50 exit_error($f->getErrorMessage(),'forums');
53 $fh=new ForumHTML($f);
54 if (!$fh || !is_object($fh)) {
55 exit_error(_('Error Getting ForumHTML'),'forums');
56 } elseif ($fh->isError()) {
57 exit_error($fh->getErrorMessage(),'forums');
60 if (session_loggedin() || $f->allowAnonymous()) {
61 if (!$f->allowAnonymous() && !$f->savePlace()) {
62 exit_error($f->getErrorMessage(),'forums');
64 forum_header(array('title'=> _('Start New Thread for: ') . $f->getName(),'forum_id'=>$forum_id));
66 forum_footer(array());
72 exit_missing_param('',array(_('Forum ID'),_('Project ID')),'forums');