Location: PHPKode > projects > ACollab > forums/include/new_thread.inc.php
<?php
/****************************************************************************************/
/* ACollab                                                                              */
/****************************************************************************************/
/* Copyright (c) 2002-2003  Adaptive Technology Resource Centre / University of Toronto */
/*                                                                                      */
/* http://atutor.ca/acollab                                                             */
/*                                                                                      */
/* This program is free software. You may redistribute it and/or                        */
/* modify it under the terms of the GNU General Public License                          */
/* as published by the Free Software Foundation; either version 2 of the License,       */
/* or (at your option) any later version.                                               */
/*                                                                                      */
/* This program is distributed in the hope that it will be useful, but                  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of                           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                                 */
/* See the GNU General Public License for more details.                                 */
/*                                                                                      */
/* You may access the GNU General Public License at:                                    */
/* http://www.opensource.org/licenses/gpl-license.php                                   */
/*                                                                                      */
/* You may contact the Adaptive Technology Resource Centre at                           */
/* Robarts Library, University of Toronto                                               */
/* 130 St. George Street, Toronto, Ontario, Canada M5S 1A5                              */
/* Further contact information is available at http://www.utoronto.ca/atrc/             */
/****************************************************************************************/
/* Programmer:                                                                          */
/* Joel Kronenberg - ATRC                                                               */
/****************************************************************************************/

if ($_POST['submit']) {
	$subject	= $_POST['subject'];
	$body		= $_POST['body'];
	$parent_id	= $_POST['parent_id'];
	$parent_name	= $_POST['parent_name'];
} else if (isset($_GET['reply'])) {
	$subject = $saved_post['subject'];
}

if ($parent_id == 0) {
	if (!authenticate_forum($forum_info['regular_rights'],FORUM_START)) {
		echo '<p align="center">'._AC('cannot_start_thread').'</p>';
		return;
	}
} else {
	if (!authenticate_forum($forum_info['regular_rights'], FORUM_REPLY)) {
		echo '<p align="center">'._AC('cannot_reply_forum').'</p>';
		return;
	}
}

if ($errors) {
	print_errors($errors);
}

?>
<a name="post"></a><form action="forums/new_thread.php" method="post" name="form"><input name="parent_id" type="hidden" value="<?php echo $parent_id; ?>" />
	<input name="fid" type="hidden" value="<?php echo $fid; ?>" />
	<input name="reply" type="hidden" value="<?php echo $_GET['reply']; ?>" />
	<input name="page" type="hidden" value="<?php echo $_GET['page']; ?>" />
	<input name="parent_name" type="hidden" value="<?php echo $parent_name; ?>" />
	<table border="0" cellspacing="0" cellpadding="2" align="center" class="box2">
	<tr>
		<th colspan="5" class="box"><h3><?php
			if ($parent_id == 0) {
				echo _AC('new_thread');
			} else {
				echo _AC('reply');
			} ?></h3></th>
	</tr>
	<tr>
		<td class="row1">&nbsp;</td>
		<td colspan="3" class="row1"><img src="images/clr.gif" height="1" width="1" alt="" /><br /><?php
			echo _AC('denotes_required', '<img src="images/required.gif" height="14" width="14" alt="'._AC('required_field').'" />');
		?><br /></td>
		<td class="row1">&nbsp;</td>
	</tr>
	<tr bgcolor="white">
		<td class="row1">&nbsp;</td>
		<td class="row1" align="right"><label for="subject"><b><?php echo _AC('subject'); ?>:</b></label></td>
		<td class="row1"><img src="images/required.gif" height="14" width="14" alt="<?php echo _AC('required_field'); ?>" /></td>
		<td class="row1"><input type="text" name="subject" class="input" size="30" maxlength="80" id="subject" value="<?php echo $subject; ?>" onfocus="this.className='input highlight'" onblur="this.className='input'" /></td>
		<td class="row1">&nbsp;</td>
	</tr>
	<tr bgcolor="white">
		<td class="row1">&nbsp;</td>
		<td class="row1" align="right" valign="top"><label for="body"><b><?php echo _AC('message'); ?>:</b></label></td>
		<td class="row1" valign="top"><img src="images/required.gif" height="14" width="14" alt="<?php echo _AC('required_field'); ?>" class="img" /></td>
		<td class="row1"><textarea class="input" cols="55" name="body" rows="13" id="body" onfocus="this.className='input highlight'" onblur="this.className='input'"><?php echo $body; ?></textarea><br />
		<small>&middot; <?php echo _AC('forum_links'); ?><br />
		&middot; <?php echo _AC('forum_html_disabled'); ?></small></td>
		<td class="row1">&nbsp;</td>
	</tr>

	<?php
		if (isset($_GET['reply'])) {
	?>
	<tr bgcolor="white">
		<td class="row1">&nbsp;</td>
		<td class="row1" align="right" valign="top"><label for="repbody"><b><?php echo _AC('replying_to'); ?>:</b></label></td>
		<td class="row1">&nbsp;</td>
		<td class="row1"><textarea class="input" cols="45" name="replytext" id="repbody" rows="5" onfocus="this.className='input highlight'" onblur="this.className='input'" /><?php echo $saved_post['body']; ?></textarea></td>
		<td class="row1">&nbsp;</td>
	</tr>
	<?php
		} /* end if ($_GET['reply']) */
	?>
	<tr>
		<td class="row1">&nbsp;</td>
		<td colspan="3" class="row1"><a href="<?php echo $_SERVER['REQUEST_URI']; ?>#jumpcodes" title="<?php echo _AC('jump_codes'); ?>"><img src="images/clr.gif" height="1" width="1" alt="<?php echo _AC('jump_codes'); ?>" border="0" /></a><?php require('include/code_picker.inc.php'); ?></td>
		<td class="row1"><a name="jumpcodes"></a>&nbsp;</td>
	</tr>
	<tr bgcolor="white">
		<td class="row1">&nbsp;</td>
		<td class="row1" colspan="3" align="right"><br /><input type="submit" name="submit" value="<?php echo _AC('submit'); ?>" class="submitY" onfocus="this.className='submitY highlight'" onblur="this.className='submitY'" /> &nbsp; <input type="submit" name="cancel" value="<?php echo _AC('cancel'); ?>" class="submitN" onfocus="this.className='submitN highlight'" onblur="this.className='submitN'" /><br /><br /></td>
		<td class="row1">&nbsp;</td>
	</tr>
	</table>
</form>
Return current item: ACollab