3 * GForge Forums Facility
5 * Copyright 2002 GForge, LLC
13 By Tim Perdue, Sourceforge, 11/99
15 Massive rewrite by Tim Perdue 7/2000 (nested/views/save)
17 Complete OO rewrite by Tim Perdue 12/2002
20 require_once('../env.inc.php');
21 require_once $gfwww.'include/pre.php';
22 require_once $gfwww.'include/ForumHTML.class.php';
23 require_once $gfcommon.'forum/ForumFactory.class.php';
24 require_once $gfcommon.'forum/Forum.class.php';
26 $group_id = getIntFromRequest('group_id');
28 $g =& group_get_object($group_id);
29 if (!$g || !is_object($g) || $g->isError()) {
33 $ff=new ForumFactory($g);
34 if (!$ff || !is_object($ff) || $ff->isError()) {
35 exit_error(_('Error'),$ff->getErrorMessage());
38 $farr =& $ff->getForums();
40 if ( $farr !== false && count($farr) == 1 ) {
41 Header("Location: ".util_make_url ("/forum/forum.php?forum_id=".$farr[0]->getID()));
45 forum_header(array('title'=>sprintf(_('Forums for %1$s'), $g->getPublicName()) ));
47 if ($ff->isError() || count($farr) < 1) {
48 echo '<h1>'.sprintf(_('No Forums Found For %1$s'), $g->getPublicName()) .'</h1>';
50 echo $ff->getErrorMessage();
52 forum_footer(array());
57 // echo _('<p>Choose a forum and you can browse, search, and post messages.<p>');
59 echo $HTML->subMenu(array(_("My Monitored Forums")),array("/forum/myforums.php?group_id=$group_id"));
60 $tablearr=array(_('Forum'),_('Description'),_('Threads'),_('Posts'), _('Last Post'),_('Moderation Level'));
61 echo $HTML->listTableTop($tablearr);
64 Put the result set (list of forums for this group) into a column with folders
67 for ($j = 0; $j < count($farr); $j++) {
68 if (!is_object($farr[$j])) {
69 //just skip it - this object should never have been placed here
70 } elseif ($farr[$j]->isError()) {
71 echo $farr[$j]->getErrorMessage();
73 switch ($farr[$j]->getModerationLevel()) {
74 case 0 : $modlvl = _('No Moderation');break;
75 case 1 : $modlvl = _('Anonymous & Non Group Users');break;
76 case 2 : $modlvl = _('All Except Admins');break;
78 echo '<tr '. $HTML->boxGetAltRowStyle($j) . '><td><a href="forum.php?forum_id='. $farr[$j]->getID() .
79 '&group_id=' . $group_id . '">'.
80 html_image("ic/forum20w.png","20","20",array("border"=>"0")) .
82 $farr[$j]->getName() .'</a></td>
83 <td>'.$farr[$j]->getDescription().'</td>
84 <td style="text-align:center">'.$farr[$j]->getThreadCount().'</td>
85 <td style="text-align:center">'. $farr[$j]->getMessageCount() .'</td>
86 <td>'. date(_('Y-m-d H:i'),$farr[$j]->getMostRecentDate()) .'</td>
87 <td style="text-align:center">'. $modlvl .'</td></tr>';
90 echo $HTML->listTableBottom();
92 forum_footer(array());