Example #1
0
        	See if this message is new or not
        	If so, highlite it in bold
        */
        $bold_begin = '';
        $bold_end = '';
        if ($f->getSavedDate() < $msg->getPostDate()) {
            $bold_begin = '<strong>';
            $bold_end = '</strong>';
        }
        /*
        	show the subject and poster
        */
        $ret_val .= $bold_begin . $msg->getSubject() . $bold_end . $ah_end . '</td>' . '<td>' . $msg->getPosterRealName() . '</td>' . '<td>' . date(_('Y-m-d H:i'), $msg->getPostDate()) . '</td></tr>';
        if ($msg->hasFollowups()) {
            $ret_val .= $fh->showSubmessages($msg_arr, $msg->getID(), 1);
        }
        $i++;
    }
    $ret_val .= $GLOBALS['HTML']->listTableBottom();
    echo $ret_val;
    /*
    	Show post followup form
    */
    //	echo '<p>&nbsp;<p>';
    echo '<div align="center"><h3>' . _('Post a followup to this message') . '</h3></div>';
    $fh->showPostForm($fm->getThreadID(), $msg_id, $fm->getSubject());
} else {
    forum_header(array('title' => _('Must Choose A Message First')));
    echo '<h1>' . _('You Must Choose A Message First') . '</h1>';
}
forum_footer(array());
Example #2
0
            forum_footer(array());
        } else {
            exit_permission_denied();
        }
    } else {
        //		if ($forum_id=="A") {
        //all messages
        //			if (!$fa->isGroupAdmin()) {
        //				exit_permission_denied();
        //			}
        //		} else {
        if (!$fa->isForumAdmin($forum_id)) {
            exit_permission_denied();
        }
        //		}
        forum_header(array('title' => _('Forums: Administration')));
        if (getStringFromRequest("Go")) {
            $fa->ExecuteAction("view_pending");
        } else {
            $fa->ExecuteAction($action);
        }
        forum_footer(array());
    }
} else {
    //manage auth errors
    if ($fa->isGroupIdError()) {
        exit_no_group();
    } elseif ($fa->isPermissionDeniedError()) {
        exit_permission_denied();
    }
}
Example #3
0
require_once $gfcommon . 'forum/ForumFactory.class.php';
require_once $gfcommon . 'forum/ForumMessageFactory.class.php';
require_once $gfcommon . 'forum/ForumMessage.class.php';
require_once $gfcommon . 'include/TextSanitizer.class.php';
// to make the HTML input by the user safe to store
$group_id = getIntFromRequest('group_id');
$group_forum_id = getIntFromRequest('group_forum_id');
$g = group_get_object($group_id);
$f = new Forum($g, $group_forum_id);
if (!$f || !is_object($f)) {
    exit_error('Error', 'Could Not Get Forum Object');
} elseif ($f->isError()) {
    exit_error('Error', $f->getErrorMessage());
} elseif (!$f->userIsAdmin()) {
    exit_permission_denied();
}
forum_header(array('title' => _('Add forum')));
$sql = "select users.user_id,users.user_name, users.email, users.realname from\nusers,forum_monitored_forums fmf where fmf.user_id=users.user_id and\nfmf.forum_id ='{$group_forum_id}' order by users.user_id;";
$res = db_query($sql);
$head = array();
$head[] = 'User';
$head[] = 'Email';
$head[] = 'Realname';
echo $HTML->listTableTop($head);
while ($arr = db_fetch_array($res)) {
    echo '<tr ' . $HTML->boxGetAltRowStyle($j) . '><td>' . $arr['user_name'] . '</td>
	<td>' . $arr['email'] . '</td>
	<td>' . $arr['realname'] . '</td></tr>';
}
echo $HTML->listTableBottom();
forum_footer(array());
Example #4
0
        	If they are NOT, then insert a row into the db
        */
        $sql = "SELECT * FROM forum_monitored_forums WHERE user_id='" . user_getid() . "' AND forum_id='{$forum_id}';";
        $result = db_query($sql);
        if (!$result || db_numrows($result) < 1) {
            /*
            	User is not already monitoring thread, so 
            	insert a row so monitoring can begin
            */
            $sql = "INSERT INTO forum_monitored_forums (forum_id,user_id) VALUES ('{$forum_id}','" . user_getid() . "')";
            $result = db_query($sql);
            if (!$result) {
                exit_error("ERROR", "ERROR - could not insert into database");
            } else {
                header("Location: /forum/forum.php?forum_id={$forum_id}&feedback=" . urlencode("Forum Is Now Being Monitored"));
            }
        } else {
            $sql = "DELETE FROM forum_monitored_forums WHERE user_id='" . user_getid() . "' AND forum_id='{$forum_id}';";
            $result = db_query($sql);
            header("Location: /forum/forum.php?forum_id={$forum_id}&feedback=" . urlencode("Forum Monitoring Deactivated"));
        }
        forum_footer(array());
    } else {
        forum_header(array('title' => 'Choose a forum First'));
        echo '
			<H1>Error - Choose a forum First</H1>';
        forum_footer(array());
    }
} else {
    exit_not_logged_in();
}
Example #5
0
    $g =& group_get_object($group_id);
    if (!$g || !is_object($g) || $g->isError()) {
        exit_no_group();
    }
    $f = new Forum($g, $forum_id);
    if (!$f || !is_object($f)) {
        exit_error('Error', 'Error Getting Forum');
    } elseif ($f->isError()) {
        exit_error('Error', $f->getErrorMessage());
    }
    $fh = new ForumHTML($f);
    if (!$fh || !is_object($fh)) {
        exit_error('Error', 'Error Getting ForumHTML');
    } elseif ($fh->isError()) {
        exit_error('Error', $fh->getErrorMessage());
    }
    if (session_loggedin() || $f->allowAnonymous()) {
        if (!$f->allowAnonymous() && !$f->savePlace()) {
            exit_error('Error', $f->getErrorMessage());
        } else {
            forum_header(array('title' => $f->getName(), 'forum_id' => $forum_id));
            echo '<div align="center"><h3>' . _('Start New Thread') . '</h3></div>';
            $fh->showPostForm();
            forum_footer(array());
        }
    } else {
        exit_not_logged_in();
    }
} else {
    exit_missing_param();
}
Example #6
0
         //add new one
         $attachok = $am->attach($attach, $group_id, $attachid, $msg_id);
         if ($attachok != false) {
             $fm->fetchData($msg_id);
             $fm->sendAttachNotice($attachok);
         }
     }
     foreach ($am->Getmessages() as $item) {
         $feedback .= "<br>" . $item;
     }
     echo '<p><p><center><form method="post"><input type="button" value="Close Window" onclick="window.close()"></form></center>';
     forum_footer(array());
     exit;
 } else {
     //show the form to edit the attach
     forum_header(array('title' => _('Attachments')));
     $fh = new ForumHTML($f);
     if (!$fh || !is_object($fh)) {
         exit_error(_('Error'), _('Error getting new ForumHTML'));
     } elseif ($fh->isError()) {
         exit_error(_('Error'), $fh->getErrorMessage());
     }
     if (!db_result($res, 0, 'filename')) {
         $filename = "No attach found";
     } else {
         $filename = db_result($res, 0, 'filename');
     }
     echo $fh->LinkAttachEditForm($filename, $group_id, $forum_id, $attachid, $msg_id);
     forum_footer(array());
     exit;
 }
Example #7
0
            }
            $ret_val .= '<script language="JavaScript">
		    	<!--
				function checkAll(val) {
			      al=document.thread_monitor;
			      len = al.elements.length;
                  var i=0;
                  for(i=0 ; i<len ; i++) {
                      if (al.elements[i].name==\'mthread[]\') {al.elements[i].checked=val;}
                  }
			    }
		       //-->
		       </script>';
            $ret_val .= '
		    	    <TR class="' . util_get_alt_row_color($i) . '">' . '<TD align="center"><FORM NAME="thread_monitor" action="?" METHOD="POST">' . '<INPUT TYPE="hidden" NAME="thread_id" VALUE="' . $thr_id . '">' . '<INPUT TYPE="hidden" NAME="user_id" VALUE="' . user_getid() . '">' . '<INPUT TYPE="hidden" NAME="forum_id" VALUE="' . $forum_id . '">' . '<INPUT TYPE="checkbox" ' . $disabled . ' NAME="mthread[]" VALUE="' . $thr_id . '" ' . $monitored . '></TD>' . '<TD><A HREF="/forum/message.php?msg_id=' . db_result($result, $i, 'msg_id') . '">' . '<IMG SRC="' . util_get_image_theme("msg.png") . '" BORDER=0 HEIGHT=12 WIDTH=10> ';
            $monitorer = UserManager::instance()->getUserByUserName(db_result($result, $i, 'user_name'));
            $ret_val .= db_result($result, $i, 'subject') . '</A></TD>' . '<TD>' . UserHelper::instance()->getLinkOnUser($monitorer) . '</TD>' . '<TD>' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), db_result($result, $i, 'date')) . '</TD></TR>';
            $i++;
        }
        $ret_val .= '</TABLE><a href="javascript:checkAll(1)">' . $GLOBALS['Language']->getText('tracker_include_report', 'check_all_items') . '</a>' . ' - <a href="javascript:checkAll(0)">' . $GLOBALS['Language']->getText('tracker_include_report', 'clear_all_items') . ' </a>' . '<P><INPUT TYPE="submit" ' . $disabled . ' NAME="submit"></FORM>';
    }
    echo $ret_val;
    if (user_monitor_forum($forum_id, user_getid())) {
        $GLOBALS['feedback'] .= $GLOBALS['Language']->getText('forum_monitor_thread', 'notice');
    }
    forum_footer($params);
} else {
    forum_header(array('title' => $GLOBALS['Language']->getText('global', 'error')));
    $GLOBALS['feedback'] .= $GLOBALS['Language']->getText('forum_forum', 'choose_forum_first');
    forum_footer(array());
}
Example #8
0
					<TR class="' . util_get_alt_row_color($i) . '"><TD COLSPAN="4">
						<B>' . $Language->getText('forum_admin_index', 'forum_name') . ':</B><BR>
						<INPUT TYPE="TEXT" NAME="forum_name" VALUE="' . db_result($result, $i, 'forum_name') . '" SIZE="30" MAXLENGTH="50"><BR>
						<B>' . $Language->getText('forum_admin_index', 'description') . ':</B><BR>
						<INPUT TYPE="TEXT" NAME="description" VALUE="' . db_result($result, $i, 'description') . '" SIZE="60" MAXLENGTH="255"><BR>
					</TD></TR></FORM>';
                    }
                    echo '</TABLE>';
                }
                forum_footer(array());
            } else {
                /*
                	Show main page for choosing 
                	either moderotor or delete
                */
                forum_header(array('title' => $Language->getText('forum_admin_index', 'forum_admin'), 'help' => 'communication.html#web-forums'));
                echo '
			<H2>' . $Language->getText('forum_admin_index', 'forum_admin') . '</H2>
			<P>
			<A HREF="?group_id=' . $group_id . '&add_forum=1">' . $Language->getText('forum_admin_index', 'add_forum') . '</A><BR>
			<A HREF="?group_id=' . $group_id . '&delete=1">' . $Language->getText('forum_admin_index', 'del_msg') . '</A><BR>
			<A HREF="?group_id=' . $group_id . '&change_status=1">' . $Language->getText('forum_admin_index', 'update_forum_status') . '</A>';
                forum_footer(array());
            }
        }
    }
} else {
    /*
    	Not logged in or insufficient privileges
    */
    if (!$request->valid($vGroupId)) {
Example #9
0
require_once 'pre.php';
require_once '../forum/forum_utils.php';
$request =& HTTPRequest::instance();
if (!$request->valid(new Valid_GroupId())) {
    exit_no_group();
} else {
    $group_id = $request->get('group_id');
}
if ($request->valid(new Valid_Pv())) {
    $pv = $request->get('pv');
} else {
    $pv = 0;
}
$pm = ProjectManager::instance();
$params = array('title' => $Language->getText('forum_index', 'forums_for', $pm->getProject($group_id)->getPublicName()), 'help' => 'communication.html#web-forums', 'pv' => isset($pv) ? $pv : false);
forum_header($params);
if (user_isloggedin() && user_ismember($group_id)) {
    $public_flag = '<3';
} else {
    $public_flag = '=1';
}
$sql = "SELECT g.group_forum_id,g.forum_name, g.description, famc.count as total\n    FROM forum_group_list g\n    LEFT JOIN forum_agg_msg_count famc USING (group_forum_id)\n    WHERE g.group_id='{$group_id}' AND g.is_public {$public_flag};";
$result = db_query($sql);
$rows = db_numrows($result);
if (!$result || $rows < 1) {
    $pm = ProjectManager::instance();
    echo '<H1>' . $Language->getText('forum_index', 'no_forums', $pm->getProject($group_id)->getPublicName()) . '</H1>';
    echo db_error();
    forum_footer($params);
    exit;
}
Example #10
0
					<TR class="' . util_get_alt_row_color($i) . '"><TD COLSPAN="4">
						<B>' . $Language->getText('forum_admin_index', 'forum_name') . ':</B><BR>
						<INPUT TYPE="TEXT" NAME="forum_name" VALUE="' . db_result($result, $i, 'forum_name') . '" SIZE="30" MAXLENGTH="50"><BR>
						<B>' . $Language->getText('forum_admin_index', 'description') . ':</B><BR>
						<INPUT TYPE="TEXT" NAME="description" VALUE="' . db_result($result, $i, 'description') . '" SIZE="60" MAXLENGTH="255"><BR>
					</TD></TR></FORM>';
                    }
                    echo '</TABLE>';
                }
                forum_footer(array());
            } else {
                /*
                	Show main page for choosing 
                	either moderotor or delete
                */
                forum_header(array('title' => $Language->getText('forum_admin_index', 'forum_admin'), 'help' => 'WebForums.html'));
                echo '
			<H2>' . $Language->getText('forum_admin_index', 'forum_admin') . '</H2>
			<P>
			<A HREF="?group_id=' . $group_id . '&add_forum=1">' . $Language->getText('forum_admin_index', 'add_forum') . '</A><BR>
			<A HREF="?group_id=' . $group_id . '&delete=1">' . $Language->getText('forum_admin_index', 'del_msg') . '</A><BR>
			<A HREF="?group_id=' . $group_id . '&change_status=1">' . $Language->getText('forum_admin_index', 'update_forum_status') . '</A>';
                forum_footer(array());
            }
        }
    }
} else {
    /*
    	Not logged in or insufficient privileges
    */
    if (!$request->valid($vGroupId)) {
Example #11
0
                    $pv_param = "&pv=" . $pv;
                } else {
                    $pv_param = "";
                }
                $ret_val .= '<B><span>
                     <A HREF="/forum/forum.php?max_rows=' . $max_rows . '&style=' . $style . '&offset=' . ($offset + $i) . '&forum_id=' . $forum_id . '' . $pv_param . '">
                     <B>' . $Language->getText('forum_forum', 'next_msg') . ' <IMG SRC="' . util_get_image_theme("t.png") . '" HEIGHT=15 WIDTH=15 BORDER=0 ALIGN=center></A></span>';
            } else {
                $ret_val .= '&nbsp;';
            }
            $ret_val .= '</TD></TABLE>';
        }
    }
    echo $ret_val;
    $crossref_fact = new CrossReferenceFactory($forum_id, ReferenceManager::REFERENCE_NATURE_FORUM, $group_id);
    $crossref_fact->fetchDatas();
    if ($crossref_fact->getNbReferences() > 0) {
        echo '<b> ' . $Language->getText('cross_ref_fact_include', 'references') . '</b>';
        $crossref_fact->DisplayCrossRefs();
    }
    if (!isset($pv) || !$pv) {
        echo '<P>&nbsp;<P>';
        echo '<h3>' . $Language->getText('forum_forum', 'start_new_thread') . ':</H3><a name="start_new_thread"></a>';
        show_post_form($forum_id);
    }
    forum_footer($params);
} else {
    forum_header(array('title' => $Language->getText('global', 'error')));
    echo '<H1' . $Language->getText('forum_forum', 'choose_forum_first') . '</H1>';
    forum_footer(array());
}
Example #12
0
        return 'message not found.\\n';
    }
    $title_arr = array();
    $title_arr[] = 'Message: ' . $msg_id;
    echo html_build_list_table_top($title_arr);
    echo "<TR><TD BGCOLOR=\"E3E3E3\">\n";
    echo "BY: " . db_result($result, 0, "user_name") . "<BR>";
    echo "DATE: " . date($sys_datefmt, db_result($result, 0, "date")) . "<BR>";
    echo "SUBJECT: " . db_result($result, 0, "subject") . "<P>";
    // correct making links with anchor tag - helix 2003-11-19
    //	echo util_make_links(nl2br(db_result($result,0, 'body')));
    echo nl2br(util_make_links(db_result($result, 0, 'body')));
    echo "</TD></TR></TABLE>";
    /*
    	Show entire thread
    */
    echo '<BR>&nbsp;<P><H3>Thread View</H3>';
    //highlight the current message in the thread list
    $current_message = $msg_id;
    echo show_thread(db_result($result, 0, 'thread_id'));
    /*
    	Show post followup form
    */
    echo '<P>&nbsp;<P>';
    echo '<CENTER><h3>Post a followup to this message</h3></CENTER>';
    show_post_form(db_result($result, 0, 'group_forum_id'), db_result($result, 0, 'thread_id'), $msg_id, db_result($result, 0, 'subject'));
} else {
    forum_header(array('title' => 'Must choose a message first'));
    echo '<h1>You must choose a message first</H1>';
}
forum_footer(array());
Example #13
0
             $style = $_pref_arr[0];
             $max_rows = $_pref_arr[1];
         } else {
             //no saved pref and we're not setting
             //one because this is all default settings
         }
     }
 }
 if (!$style || $style != 'ultimate' && $style != 'flat' && $style != 'nested' && $style != 'threaded') {
     $style = 'nested';
 }
 if (!$max_rows || $max_rows < 25) {
     $max_rows = 25;
 }
 //echo "<P>style: $style";
 forum_header(array('title' => $forum_name));
 /**
  *
  *	Forum styles include Nested, threaded, flat, ultimate
  *
  *	threaded indents and shows subjects/authors of all messages/followups
  *	nested indents and shows the entirety of all messages/followups
  *	flat shows entiretly of messages in date order descending
  *	ultimate is based roughly on "Ultimate BB"
  *
  */
 //
 //	Don't show the forum view prefs in thread mode
 //
 if (!$thread_id) {
     //create a pop-up select box listing the forums for this project
Example #14
0
<?php

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: index.php,v 1.3 2004/01/13 13:15:24 helix Exp $
require 'pre.php';
require '../forum/forum_utils.php';
if ($group_id) {
    forum_header(array('title' => 'Forums for ' . group_getname($group_id)));
    if (user_isloggedin() && user_ismember($group_id)) {
        $public_flag = '0,1';
    } else {
        $public_flag = '1';
    }
    $sql = "SELECT g.group_forum_id,g.forum_name, g.description, count(*) as total " . " FROM forum_group_list g " . " LEFT JOIN forum f USING (group_forum_id) " . " WHERE g.group_id='{$group_id}' AND g.is_public IN ({$public_flag})" . " group by g.group_forum_id, g.forum_name, g.description";
    //echo "<p>$sql\n";
    $result = db_query($sql);
    $rows = db_numrows($result);
    if (!$result || $rows < 1) {
        echo '<H1>No forums found for ' . group_getname($group_id) . '</H1>';
        echo db_error();
        forum_footer(array());
        exit;
    }
    echo '<H2>Discussion Forums</H2>
		<P>Choose a forum and you can browse, search, and post messages.<P>';
    /*
    	Put the result set (list of forums for this group) into a column with folders
Example #15
0
                                                <INPUT TYPE="TEXT" NAME="send_all_posts_to" VALUE="' . db_result($result, $i, 'send_all_posts_to') . '" SIZE="30" MAXLENGTH="50">
					</TD></TR>
					<TR BGCOLOR="' . html_get_alt_row_color($i) . '"><TD COLSPAN="3">
						<B>Description:</B><BR>
						<INPUT TYPE="TEXT" NAME="description" VALUE="' . db_result($result, $i, 'description') . '" SIZE="40" MAXLENGTH="80"><BR>
					</TD></TR></FORM>';
                    }
                    echo '</TABLE>';
                }
                forum_footer(array());
            } else {
                /*
                	Show main page for choosing 
                	either moderotor or delete
                */
                forum_header(array('title' => 'Forum Administration'));
                echo '
			<H2>Forum Administration</H2>
			<P>
			<A HREF="' . $PHP_SELF . '?group_id=' . $group_id . '&add_forum=1">Add Forum</A><BR>
			<A HREF="' . $PHP_SELF . '?group_id=' . $group_id . '&delete=1">Delete Message</A><BR>
			<A HREF="' . $PHP_SELF . '?group_id=' . $group_id . '&change_status=1">Update Forum Info/Status</A>';
                forum_footer(array());
            }
        }
    }
} else {
    /*
    	Not logged in or insufficient privileges
    */
    if (!$group_id) {
Example #16
0
        }
        /*
        	Set up navigation vars
        */
        $result = db_query("SELECT group_id,forum_name,is_public FROM forum_group_list WHERE group_forum_id=" . db_ei($forum_id));
        $group_id = db_result($result, 0, 'group_id');
        $forum_name = db_result($result, 0, 'forum_name');
        forum_header(array('title' => $Language->getText('forum_monitor', 'monitor')));
        echo '
			<H2>' . $Language->getText('forum_monitor', 'monitor') . '</H2>';
        if (user_monitor_forum($forum_id, user_getid())) {
            echo "<span class=\"highlight\"><H3>" . $Language->getText('forum_monitor', 'now_monitoring') . "</H3></span>";
            echo '<P>' . $Language->getText('forum_monitor', 'get_followups') . '</p>';
            echo '<P>' . $Language->getText('forum_monitor', 'to_turn_monitor_off') . '</p>';
        } else {
            echo "<span class=\"highlight\"><H3>" . $Language->getText('forum_monitor', 'monitor_off') . "</H3></span>";
            echo '<P>' . $Language->getText('forum_monitor', 'no_mails_anymore') . '</p>';
        }
        if ($forum_monitor_error) {
            echo "<span class=\"highlight\">" . $Language->getText('forum_forum_utils', 'insert_err') . "</span>";
        }
        forum_footer(array());
    } else {
        forum_header(array('title' => $Language->getText('forum_monitor', 'choose_forum_first')));
        echo '
			<H1>' . $Language->getText('forum_forum', 'choose_forum_first') . '</H1>';
        forum_footer(array());
    }
} else {
    exit_not_logged_in();
}
Example #17
0
$user_id = user_getid();
$group_id = getIntFromRequest("group_id");
//get the user monitored forums
$sql = "SELECT mon.forum_id, fg.group_id FROM forum_monitored_forums mon,forum_group_list fg where mon.user_id='{$user_id}' and fg.group_forum_id=mon.forum_id";
$result = db_query($sql);
if (!$result || db_numrows($result) < 1) {
    exit_error(_('You have no monitored forums'), _('You are not monitoring any forums.') . ' ' . db_error(), 'forums');
}
//now, i need to create a forum object per each forum that the user is monitoring
$monitored_forums = array();
for ($i = 0; $i < db_numrows($result); $i++) {
    $monitored_forums[$i] = db_fetch_array($result);
}
//if the link comes from the project, display the project header. If it comes from the user page, display the normal site header
if ($group_id) {
    forum_header(array('title' => _('My Monitored Forums')));
} else {
    site_header(array('title' => _('My Monitored Forums'), 'user_id' => $user_id));
}
echo "<h4>" . _('My Monitored Forums') . "</h4></p>";
$tablearr = array(_('Project'), _('Forum'), _('Description'), _('Threads'), _('Posts'), _('Last Post'), _('New Content?'));
echo $HTML->listTableTop($tablearr);
$i = 0;
$f = array();
//CHECK : if we won�t ever be needing to store each forum/fmf, etc for each pass, don�t use an array and use the same variable like $fmf instead of $fmf[$i], etc
for ($i = 0; $i < sizeof($monitored_forums); $i++) {
    $g =& group_get_object($monitored_forums[$i]["group_id"]);
    if (!$g || !is_object($g) || $g->isError()) {
        exit_no_group();
    }
    $f = new Forum($g, $monitored_forums[$i]["forum_id"]);
Example #18
0
require_once $gfwww . 'forum/admin/ForumAdmin.class.php';
require_once $gfcommon . 'forum/Forum.class.php';
require_once $gfcommon . 'forum/ForumMessage.class.php';
$msg_id = getIntFromRequest("msg_id");
$group_id = getIntFromRequest('group_id');
$forum_id = getIntFromRequest("forum_id");
global $HTML;
$fa = new ForumAdmin();
if (!$forum_id || !$group_id || !$msg_id) {
    exit_missing_param();
}
if ($fa->Authorized($group_id)) {
    //user authorized, continue check
    if ($fa->isForumAdmin($forum_id)) {
        //print the message
        forum_header(array());
        $g =& $fa->GetGroupObject();
        $f = new Forum($g, $forum_id);
        if (!$f || !is_object($f)) {
            exit_error(_('Error'), "Error getting new Forum");
        } elseif ($f->isError()) {
            exit_error(_('Error'), $f->getErrorMessage());
        }
        $fm = new ForumMessage($f, $msg_id, false, true);
        //create the pending message
        if (!$fm || !is_object($fm)) {
            exit_error(_('Error'), "Error getting new ForumMessage");
        } elseif ($fm->isError()) {
            exit_error(_('Error'), "Error getting new ForumMessage: " . $fm->getErrorMessage());
        }
        $fhtml = new ForumHTML($f);
Example #19
0
$group_id = getIntFromRequest('group_id');
if ($group_id) {
    $g =& group_get_object($group_id);
    if (!$g || !is_object($g) || $g->isError()) {
        exit_no_group();
    }
    $ff = new ForumFactory($g);
    if (!$ff || !is_object($ff) || $ff->isError()) {
        exit_error(_('Error'), $ff->getErrorMessage());
    }
    $farr =& $ff->getForums();
    if ($farr !== false && count($farr) == 1) {
        Header("Location: " . util_make_url("/forum/forum.php?forum_id=" . $farr[0]->getID()));
        exit;
    }
    forum_header(array('title' => sprintf(_('Forums for %1$s'), $g->getPublicName())));
    if ($ff->isError() || count($farr) < 1) {
        echo '<h1>' . sprintf(_('No Forums Found For %1$s'), $g->getPublicName()) . '</h1>';
        if ($ff->isError()) {
            echo $ff->getErrorMessage();
        }
        forum_footer(array());
        exit;
    }
    //	echo _('<p>Choose a forum and you can browse, search, and post messages.<p>');
    echo $HTML->subMenu(array("My Monitored Forums"), array("/forum/myforums.php?group_id={$group_id}"));
    $tablearr = array(_('Forum'), _('Description'), _('Threads'), _('Posts'), _('Last Post'), _('Moderation Level'));
    echo $HTML->listTableTop($tablearr);
    /*
    	Put the result set (list of forums for this group) into a column with folders
    */