<?php

@( (bool)FALSE === strpos( $_SERVER['REQUEST_URI'], basename( __FILE__ ) ) ) OR exit( '!! ACCESS DENIED !!' );
error_reporting( _E_VALUE );

/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: phpbbconfig.php,v 1.4.2.8 2004/08/15 12:58:04 kirilt Exp $




/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)            */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* =========================                                            */
/* Part of phpBB integration                                            */
/* Copyright (c) 2001 by                                                */
/*    Richard Tirtadji AKA King Richard (rtirtadji@hotmail.com)         */
/*    Hutdik Hermawan AKA hotFix (hutdik76@hotmail.com)                 */
/* http://www.phpnuke.web.id                                            */
/*                                                                      */
/* 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.       */
/************************************************************************/


if ( !_MPN_ADMIN ) { adminLoginForm(); }
if ( ! _ADMIN_TRUSTED || $GLOBALS['ainf']['forum'] ) { goBack( translate( 'Insufficient Rights' ) ); }

@( include_once _DP_ADMIN_SUBMENUS_ . 'forum.submenu.php' )
  OR goBack( translate( 'Include Error' ) );

function ForumConfigAdmin() {
    global $hlpfile, $admin, $mpnTables,$phpEx;
    include ("header.$phpEx");
    GraphicAdmin($hlpfile);
    OpenTable();
    $result = mysql_query("select * from ".$mpnTables['forumconfig']);
    list($allow_html,$allow_bbcode,$allow_sig,$posts_per_page,$hot_threshold,$topics_per_page) = mysql_fetch_row($result);
    echo "
    <center><font size=\"4\"><b>".translate("Forum Configuration")."</b></center><br><br>\n
    <font size=\"2\">\n
    <form action=\"admin.$phpEx\" method=\"post\">\n
    <table border=\"0\" width=\"100%\">\n<tr><td>
    ".translate("Allow HTML:")." </td><td>";
    if ($allow_html==1) {
    ?>
    <INPUT TYPE="RADIO" NAME="xallow_html" VALUE="1" CHECKED> <?PHP echo translate("Yes") ?>
	<INPUT TYPE="RADIO" NAME="xallow_html" VALUE="0" > <?PHP echo translate("No") ?>
    <?php
    } else {
    ?>
    <INPUT TYPE="RADIO" NAME="xallow_html" VALUE="1"> <?PHP echo translate("Yes") ?>
	<INPUT TYPE="RADIO" NAME="xallow_html" VALUE="0" CHECKED> <?PHP echo translate("No") ?>
    <?php
    }
    echo"</td></tr>\n
    <tr><td>
    ".translate("Allow BBCODE:")." </td><td>";
    if ($allow_bbcode==1) {
    ?>
    <INPUT TYPE="RADIO" NAME="xallow_bbcode" VALUE="1" CHECKED> <?PHP echo translate("Yes") ?>
	<INPUT TYPE="RADIO" NAME="xallow_bbcode" VALUE="0" > <?PHP echo translate("No") ?>
    <?php
    } else {
    ?>
    <INPUT TYPE="RADIO" NAME="xallow_bbcode" VALUE="1"> <?PHP echo translate("Yes") ?>
	<INPUT TYPE="RADIO" NAME="xallow_bbcode" VALUE="0" CHECKED> <?PHP echo translate("No") ?>
    <?php
    }
    echo"</td></tr>\n
    <tr><td>
    ".translate("Allow Signature:")." </td><td>";
    if ($allow_sig==1) {
    ?>
    <INPUT TYPE="RADIO" NAME="xallow_sig" VALUE="1" CHECKED> <?PHP echo translate("Yes") ?>
	<INPUT TYPE="RADIO" NAME="xallow_sig" VALUE="0" > <?PHP echo translate("No") ?>
    <?php
    } else {
    ?>
    <INPUT TYPE="RADIO" NAME="xallow_sig" VALUE="1"> <?PHP echo translate("Yes") ?>
	<INPUT TYPE="RADIO" NAME="xallow_sig" VALUE="0" CHECKED> <?PHP echo translate("No") ?>
    <?php
    }
    echo "</td></tr>\n<tr><td>
    ".translate("Hot Topic Threshold:")." </td><td><input type=text name=\"xhot_threshold\" size=\"4\" value=\"$hot_threshold\"></td></tr>\n<tr><td>
    ".translate("Items per Page:")."<br /><small><i>".translate("(This is the number of topics and posts")."<br />".translate("that will be displayed per page)")."</i></small></td><td><input type=\"text\" name=\"xposts_per_page\" size=\"4\" value=\"$posts_per_page\">
    </td></tr>\n</table>\n<br /><br />\n
    <input type=\"hidden\" name=\"op\" value=\"ForumConfigChange\">\n
    <input class='button' type=\"submit\" value=".translate("Change").">\n
    </form>\n
    </td></tr>\n</table>\n</td></tr>\n</table>\n";

/*    <tr><td colspan=2></td></tr><tr><td><tr><td>
    ".translate("Topics per Forum:")." </td><td><input type=text name=topics_per_page size=4 value=$topics_per_page></td></tr>
    <tr><td colspan=2><small><i>".translate("(This is the number of topics per forum that will be displayed per page of a forum)")."</i></small>
    </td></tr>*/

    include("footer.$phpEx");
}

function ForumConfigChange($xallow_html,$xallow_bbcode,$xallow_sig,$xposts_per_page,$xhot_threshold) {
    global $mpnTables,$phpEx;
    $sql="update " . $mpnTables['forumconfig'] .
         " set allow_html=" . $_POST['xallow_html'] . ", " .
         "allow_bbcode=" . $_POST['xallow_bbcode'] .  ", " .
         "allow_sig=" . $_POST['xallow_sig'] .  ", " .
         "posts_per_page=" . $_POST['xposts_per_page'] .  ", " .
         "hot_threshold=" . $_POST['xhot_threshold'];
    $result=mysql_query($sql) or die(mysql_error);
    $_SERVER['F_LIB'] -> redirectRequest( 'admin.php?op=ForumConfigAdmin' );

}

?>
