<?php

#############################################################################
#                              WIZZ FORUM
#  Wizz Forum is a KISS Forum: Keep It Small and Simple.
#
# About the Wizz Forum:
# Original Idea & PHP coding: Mike Kroger (mikek@icon.co.za),
# who granted permission to put Wizz forum uder the GNU GPL.  
# Code adaptations and modularization for Site@School:
# Fred Stuurman (fc.stuurman@hccnet.nl)
############################################################################
# forumreply.php: last changed 05/10/2006  version 2.4.10
#                 by Fred Stuurman (fc.stuurman@hccnet.nl)
#$Id: forumreply.php,v 1.2 2006/10/15 19:08:54 fstuurman Exp $
############################################################################
#                        LICENSE INFORMATION
# Copyright (C) 2006, Rosa Boekdrukker Primary School, Holland.
#
# This program is free software; you can 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 should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
##############################################################################
if (!defined('IN_SAS'))
{
	die("Hacking attempt");
}

print "<SCRIPT Language = \"JavaScript\">
    function checkLen(Target) {
        StrLen = Target.value.length;
        document.PostReply.charstyped.value = StrLen;
    }
</SCRIPT>";

if (IsSet ($_GET['topicid']))
{
	$topicid = intval($_GET['topicid']);
}
if (IsSet ($_GET['forumid']))
{
	$forumid = intval($_GET['forumid']);
}

$result2 = mysql_query("SELECT name FROM $forumcat_table WHERE cat_index = '" . $forumid . "'");

if (mysql_num_rows($result2) > 0) //get the forum title 
{
	$forum_title = mysql_result($result2, 0);
}

$result = mysql_query("SELECT * FROM $forumtopics_table WHERE topic_index = '" . $topicid . "'");
$row = mysql_fetch_array($result);

print "<table border='0' cellpadding='2' cellspacing='0' width='100%'>
	   <tr>
	   <td width='100%'>
	   <font face='Arial' size='4'>$sas_lang[forum_post_reply]&nbsp;$forum_title</font></td>
	   </tr>
	   </table><p>
	   <form method='POST' action='index.php?option=postreply&section=$section&page=$page&forumid=$forumid' name='PostReply'>
	   <input type='hidden' name='topicid' value='$topicid'>
	   <input type='hidden' name='topictitle' value='$row[topictitle]'>
	   <center>
	   <table border='1' cellpadding='0' cellspacing='0' width='80%' bordercolor='" . $sas_lang['forum_bordercolor'] . "'>
	   <tr>
	   <td width='100%'>
	   <table border='0' cellpadding='3' cellspacing='0' width='100%'>
	   <tr>
	   <td  align='center' width='50%' bgcolor='$OddBackgroundColor'>
	   <font face='Arial' size='2'>$sas_lang[forum_topic_title]</font>
	   <font face='Arial' size='2'><b>$row[topictitle]</b></font></td>
	   </tr>
	   <tr>
	   <td width='100%' colspan='2' bgcolor='$EvenBackgroundColor'>
	   <font face='Arial' size='2'><b>$sas_lang[forum_reply]:</b></font></td></tr>
	   <tr><td align='center'><textarea tabindex='1' WRAP='VIRTUAL' rows='6' name='replydetail' cols='50' onFocus='checkLen(this);'
	   onKeydown='checkLen(this);' onKeyup='checkLen(this);' onKeyPress='checkLen(this);'
	   onBlur='checkLen(this);' onChange='checkLen(this);' onClick='checkLen(this);'></textarea></td></tr>
	   <tr><td align='center'><font face='Arial' size='2'></font>
	   <input type='text' name='charstyped' size='4' value='0'><font face='Arial' size='2'>&nbsp;$sas_lang[forum_char_typed] </font>(<font color='$sas_lang[forum_noticecolor]'>Max. $MaxReplyBody</font>)</td>
	   </tr>
	   <tr><td width='100%' align='center' colspan='2' bgcolor='$OddBackgroundColor'>
	   <input type='submit' tabindex='4' value='$sas_lang[forum_send]' name='B1'></td>
	   </tr>
	   </table>
	   </td></tr>
	   </table>
	   </center>
	   </form>
	   <p><table cellspacing=\"0\" cellpadding=\"0\"><tr height=\"25\">
	   <td background=\"$cmsdir/modules/sn_forum/left.gif\" width=\"10\">&nbsp;</td>
	   <td background=\"$cmsdir/modules/sn_forum/middle.gif\" align=\"center\">
	   <a href='index.php?section=$section&page=$page&option=forum&forumid=$forumid'><b>$sas_lang[forum_main_page]</b></a></td>
	   <td background=\"$cmsdir/modules/sn_forum/right.gif\" width=\"10\">&nbsp;</td>
	   </tr></table></p>";
?>