<?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)
############################################################################
# forumnewacc.php: last changed 05/10/2006  version 2.4.10
#                  by Fred Stuurman (fc.stuurman@hccnet.nl)
#$Id: forummodacc.php,v 1.2 2006/10/15 19:08:53 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");
}

if (IsSet ($_GET['forumid']))
{
	$forumid = intval($_GET['forumid']);
}
if (IsSet ($_SESSION['forum_username']))
{
	$forum_username = $_SESSION['forum_username'];
}
else
{
	$forum_username = "";
}

if (IsSet ($_SESSION[forum_userindex]))
{
	$forum_userindex = $_SESSION['forum_userindex'];
}

$result = mysql_query("SELECT * FROM $forumuser_table WHERE username = '$forum_username'");
if ($row = mysql_fetch_array($result))
{
	$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);
	}

	print "<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>      
	       <table border='0' cellpadding='2' cellspacing='0' width='100%'>
	       <tr>
	       <td width='100%' bgcolor='" . $TitleBackgroundColor . "' align='center'>
	       <font face='Arial' size='4'>$sas_lang[forum_update_account]</font></td>
	       </tr>
	       </table>
	       <form method='POST' action='index.php?option=verifyacc&page=$page&section$section&forumid=$forumid' name='ForumNewAccSubmit'>
	       <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 width='50%' align='right' bgcolor='$OddBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_userid]</font></td>
	       <td width='50%' bgcolor='$OddBackgroundColor'>
	       <font face='Arial' size='2'><b>$forum_username</b></font></td>
	       </tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='$EvenBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_password]</font></td>
	       <td width='50%' bgcolor='$EvenBackgroundColor'>
	       <input tabindex='1' type='password' name='password' size='30' value='$row[password]'></td>
	       </tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='$OddBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_password2]</font></td>
	       <td width='50%' bgcolor='$OddBackgroundColor'>
	       <input tabindex='2' type='password' name='password2' size='30' value='$row[password]'></td>
	       </tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='$EvenBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_firstname]</font></td>
	       <td width='50%' bgcolor='$EvenBackgroundColor'>
	       <input tabindex='3' type='text' name='firstname' size='30' value='$row[firstname]'></td>
	       </tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='$OddBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_name]</font></td>
	       <td width='50%' bgcolor='$OddBackgroundColor'>
	       <input tabindex='4' type='text' name='lastname' size='30' value='$row[surname]'></td>
	       </tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='$EvenBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_email]</font></td>
	       <td width='50%' bgcolor='$EvenBackgroundColor'>
	       <input tabindex='5' type='text' name='emailaddress' size='30' value='$row[email]'></td>
	       </tr>
	       <tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='" . $OddBackgroundColor . "'>
	       <font face='Arial' size='2'>$sas_lang[forum_email_visible]</font></td>";

	if ($row["showemail"] == 1)
	{
		$tmptext = " checked";
	}
	else
	{
		$tmptext = "";
	}

	print "<td width='50%' bgcolor='$OddBackgroundColor'>
	       <input tabindex='6' type='checkbox' name='showemail' $tmptext></td>
	       </tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='$EvenBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_website]</font></td>
	       <td width='50%' bgcolor='$EvenBackgroundColor'>
	       <input tabindex='7' type='text' name='weburl' size='30' value='$row[weburl]'></td>
	       </tr>
	       <tr>
	       <td width='50%' align='right' bgcolor='$OddBackgroundColor'>
	       <font face='Arial' size='2'>$sas_lang[forum_header]</font></td>
	       <td width='50%' align='left' bgcolor='$OddBackgroundColor'>
	       <font face='Arial' size='2'><b>$forum_title</b></font></td>
	       </tr>
	       <tr>
	       <td width='100%' colspan='2' align='center' bgcolor='$EvenBackgroundColor'>
	       <input tabindex='8' type='submit' value='$sas_lang[forum_send]' name='B1'></td>
	       </tr>
	       </table>
	       </td></tr>
	       </table>
	       </center>
	       </form>";
}
else
{
	print "<table border='0' cellpadding='2' cellspacing='0' width='100%'>
	       <tr>
	       <td width='100%' bgcolor='$TitleBackgroundColor'><font face='Arial' size='4'>$sas_lang[forum_error]</font></td>
	       </tr>
	       </table>
	       <p><font face='Arial' size='2'>A database error occured while trying to read your forum account.</font>
	       <font face='Arial' size='2'><br><A HREF=JavaScript:history.back()>$sas_lang[forum_back]</a></font></p>";
}
?>
