<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| Modified by PHP-Fusion SF Group
| Copyright © 2007 by SF
| http://www.rus-phpfusion.com/
+----------------------------------------------------*/
require_once "../maincore.php";
require_once BASEDIR."subheader.php";
require_once ADMIN."navigation.php";
#include LOCALE.LOCALESET."admin/forum_settings.php";

if (!checkrights("F") || !defined("iAUTH") || $aid != iAUTH) fallback("../index.php");
if (isset($_POST['savesettings'])) {
	$forumintro = descript(stripslash($_POST['intro']));
	$result = dbquery("UPDATE ".$db_prefix."forum_settings SET
		forumname='".stripinput($_POST['forumname'])."',
		forumintro='".addslashes(addslashes($forumintro))."',
		forum_enabled='".(isNum($_POST['forum_enabled']) ? $_POST['forum_enabled'] : "0")."',
		stat_1='".(isNum($_POST['stat_1']) ? $_POST['stat_1'] : "1")."',
		stat_2='".(isNum($_POST['stat_2']) ? $_POST['stat_2'] : "5")."',
		stat_3='".(isNum($_POST['stat_3']) ? $_POST['stat_3'] : "10")."',
		stat_4='".(isNum($_POST['stat_4']) ? $_POST['stat_4'] : "15")."',
		stat_5='".(isNum($_POST['stat_5']) ? $_POST['stat_5'] : "50")."',
		stat_6='".(isNum($_POST['stat_6']) ? $_POST['stat_6'] : "100")."',
		stat_sig_1='".stripinput($_POST['stat_sig_1'])."',
		stat_sig_2='".stripinput($_POST['stat_sig_2'])."',
		stat_sig_3='".stripinput($_POST['stat_sig_3'])."',
		stat_sig_4='".stripinput($_POST['stat_sig_4'])."',
		stat_sig_5='".stripinput($_POST['stat_sig_5'])."',
		stat_sig_6='".stripinput($_POST['stat_sig_6'])."',		
		forum_offline_message='".addslash(descript($_POST['forum_offline_message']))."',
		forumn='".(isNum($_POST['forumn']) ? $_POST['forumn'] : "20")."',
		threadn='".(isNum($_POST['threadn']) ? $_POST['threadn'] : "20")."',
		show_panel='".(isNum($_POST['show_panel']) ? $_POST['show_panel'] : "0")."'
	");
	redirect(FUSION_SELF.$aidlink);
}

$settings_forum2 = dbarray(dbquery("SELECT * FROM ".$db_prefix."forum_settings"));

opentable(@$locale['400']);

echo "<form name='settingsform' method='post' action='".FUSION_SELF.$aidlink."'>
<table align='center' cellpadding='0' cellspacing='0' width='500'>
<tr>
<td width='50%' class='tbl'>Название сайта</td>
<td width='50%' class='tbl'><input type='text' name='forumname' value='".phpentities($settings_forum2['forumname'])."' maxlength='200' class='textbox' style='width:230px;'></td>
</tr>
<tr>
<td valign='top' width='50%' class='tbl'>объявление<br></td>
<td width='50%' class='tbl'><textarea name='intro' rows='6' class='textbox' style='width:230px;'>".phpentities(stripslashes($settings_forum2['forumintro']))."</textarea></td>
</tr>
<tr>
<td width='50%' class='tbl'>Вкл форума</td>
<td width='50%' class='tbl'><select name='forum_enabled' class='textbox'>
<option value='1'".($settings_forum2['forum_enabled'] == "1" ? " selected" : "").">Выкл</option>
<option value='0'".($settings_forum2['forum_enabled'] == "0" ? " selected" : "").">Вкл</option>
</select></td>
</tr>
<tr>
<td width='50%' class='tbl'>значение<br>
</td>
<td width='50%' class='tbl'>".$settings_forum2['stat_1']." Звание
<input type='text' name='stat_sig_1' value='".$settings_forum2['stat_sig_1']."' maxlength='50' class='textbox' style='width:120px;'></td>
</tr>
<tr>
<td width='50%' class='tbl'>значение<br>
</td>
<td width='50%' class='tbl'><input type='text' name='stat_2' value='".$settings_forum2['stat_2']."' maxlength='3' class='textbox' style='width:40px;'> Звание
<input type='text' name='stat_sig_2' value='".$settings_forum2['stat_sig_2']."' maxlength='50' class='textbox' style='width:120px;'>
</td>
</tr>
<tr>
<td width='50%' class='tbl'>значение<br>
</td>
<td width='50%' class='tbl'><input type='text' name='stat_3' value='".$settings_forum2['stat_3']."' maxlength='3' class='textbox' style='width:40px;'> Звание
<input type='text' name='stat_sig_3' value='".$settings_forum2['stat_sig_3']."' maxlength='50' class='textbox' style='width:120px;'></td>
</tr>
<tr>
<td width='50%' class='tbl'>значение<br>
</td>
<td width='50%' class='tbl'><input type='text' name='stat_4' value='".$settings_forum2['stat_4']."' maxlength='3' class='textbox' style='width:40px;'> Звание
<input type='text' name='stat_sig_4' value='".$settings_forum2['stat_sig_4']."' maxlength='50' class='textbox' style='width:120px;'></td>
</tr>
<tr>
<td width='50%' class='tbl'>значение<br>
</td>
<td width='50%' class='tbl'><input type='text' name='stat_5' value='".$settings_forum2['stat_5']."' maxlength='3' class='textbox' style='width:40px;'> Звание
<input type='text' name='stat_sig_5' value='".$settings_forum2['stat_sig_5']."' maxlength='50' class='textbox' style='width:120px;'></td>
</tr>
<tr>
<td width='50%' class='tbl'>значение<br>
</td>
<td width='50%' class='tbl'><input type='text' name='stat_6' value='".$settings_forum2['stat_6']."' maxlength='4' class='textbox' style='width:40px;'> Звание
<input type='text' name='stat_sig_6' value='".$settings_forum2['stat_sig_6']."' maxlength='50' class='textbox' style='width:120px;'></td>
</tr>
</tr>
<tr><td valign='top' width='50%' class='tbl'>закрытый форум</td>
<td width='50%' class='tbl'><textarea name='forum_offline_message' rows='5' class='textbox' style='width:250px;'>".stripslashes($settings_forum2['forum_offline_message'])."</textarea></td>
</tr>
<tr>
<td width='50%' class='tbl'>Количество тем на странице</td>
<td width='50%' class='tbl'>
<select name='forumn' class='textbox' style='width:50px;'>
<option".($settings_forum2['forumn'] == 10 ? " selected" : "").">10</option>
<option".($settings_forum2['forumn'] == 20 ? " selected" : "").">20</option>
<option".($settings_forum2['forumn'] == 50 ? " selected" : "").">50</option>
</select>
</td>
</tr>
<tr>
<td width='50%' class='tbl'>Количество постов на странице</td>
<td width='50%' class='tbl'>
<select name='threadn' class='textbox' style='width:50px;'>
<option".($settings_forum2['threadn'] == 10 ? " selected" : "").">10</option>
<option".($settings_forum2['threadn'] == 20 ? " selected" : "").">20</option>
<option".($settings_forum2['threadn'] == 30 ? " selected" : "").">30</option>
</select>
</td>
</tr>
<tr>
<td width='50%' class='tbl'>Панели на форуме</td>
<td width='50%' class='tbl'><select name='show_panel' class='textbox'>
<option value='1'".($settings_forum2['show_panel'] == "1" ? " selected" : "").">Вкл</option>
<option value='0'".($settings_forum2['show_panel'] == "0" ? " selected" : "").">Выкл</option>
</select></td>
</tr>
<tr>
<td align='center' colspan='2' class='tbl'><br>
<input type='submit' name='savesettings' value='Сохранить' class='button'></td>
</tr>
</table>
</form>\n";
closetable();

echo "</td>\n";

require_once BASEDIR."footer.php";
?>