<?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: myphpnuke.php,v 1.9.2.12 2004/09/19 20:39:03 ajvwaay Exp $

$hlpfile = getHelpFile("myphpnuke.htm");

function myPHPNukeConfigAdmin() {

        global $hlpfile, $admin, $phpEx,$mpn_version;
        global $system;
        global $mpn_activate_email;
        global $mpn_split_userpage;
        global $mpn_use_newuser_fix;
        //global $mpn_use_pager;
        //global $mpn_anonymous_id;
        global $mpn_poll_seperate_rows;
        global $mpn_use_timezone_formattimestamp;
        global $mpn_set_timezone;
        global $mpn_timezone;
        global $mpn_host_use_safemode;
        global $mpn_mysql_pconnect;
        global $mpn_pagesize_updatelog;
        global $mpn_sections_only_for_users;
        global $mpn_display_quote;
        global $mpn_display_fetching_request;
        global $mpn_webmaster_name;
        global $mpn_conf_subject;
        global $mpn_use_headline_applet;
        global $mpn_use_opendir;
        global $mpn_display_recenttopics;
        global $mpn_recenttopics_num;
        global $mpn_display_lastseen;
        global $mpn_lastseen_daysintable;
        global $mpn_display_whatsnews;
        global $mpn_display_chatboxII;
        global $mpn_whatsnew_entries;
        global $mpn_mail_newuser_password;
        global $mpn_new_user_notify;
        global $mpn_new_comment_notify;
        global $mpn_new_pollcomment_notify;
        global $mpn_new_forumtopic_notify;
        global $mpn_new_guestbook_notify;
        global $mpn_uname_test_level;
        global $mpn_use_oldnews_applet;
//        global $mpn_use_gzcompress;

        OpenTable();

        echo "<center><font size=4><b>" . translate("myPHPNuke Configuration") . " -- $mpn_version</b></center><br><br>\n";
        echo "<font size=2>\n";
        echo "<form action=\"admin.$phpEx?fct=myphpnuke\" method=\"post\">\n";
        echo "<table border=0 width='100%'>\n";

        echo "<tr><td>" . translate("Split Login / New User page:") . " </td><td>";

        if ($mpn_split_userpage==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_split_userpage\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_split_userpage\" VALUE=\"0\" >&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_split_userpage\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_split_userpage\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";
        echo "<tr><td>" . translate("New User Registration duplicate key fix:") . " </td><td>";

        if ($mpn_use_newuser_fix==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_newuser_fix\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_newuser_fix\" VALUE=\"0\" >&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_newuser_fix\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_newuser_fix\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

/*        echo "<tr><td>" . translate("Activate Output Compression:") . " </td><td>";

        if ($mpn_use_gzcompress==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_gzcompress\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_gzcompress\" VALUE=\"0\" >&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_gzcompress\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_gzcompress\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }
            echo "</td></tr>\n";
*/




/*
        echo "<tr><td>" . translate("Activate Instant Messenger:") . " </td><td>";

        if ($mpn_use_pager==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_pager\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_pager\" VALUE=\"0\" >&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_pager\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_pager\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";
*/

        echo "<tr><td>" . translate("Put Poll buttons on seperate lines:") . " </td><td>";

        if ($mpn_poll_seperate_rows==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_poll_seperate_rows\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_poll_seperate_rows\" VALUE=\"0\" >&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_poll_seperate_rows\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_poll_seperate_rows\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Use Timezone in formatTimestamp:") . "</td><td>";

        if ($mpn_use_timezone_formattimestamp==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_timezone_formattimestamp\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_timezone_formattimestamp\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_timezone_formattimestamp\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_timezone_formattimestamp\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Set the Server Timzone via putenv:") . "</td><td>";

        if ($mpn_set_timezone==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_set_timezone\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_set_timezone\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_set_timezone\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_set_timezone\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Which timezone:") . "<br />";
        echo translate("For a complete list of timezones visit this <a href='http://www.theprojects.org/dev/zone.txt' target='blank'>site</a>");
		echo  " </td><td>";
        echo "<input type=\"text\" name=\"xmpn_timezone\" value=\"$mpn_timezone\"></td></tr>\n";
/*
        echo "</td></tr>\n";

        echo "<tr><td>";
        echo "</td></tr>\n";

        echo "<tr><td>";
        echo "<br>";
        echo "</td></tr>\n";
*/
        echo "<tr><td>" . translate("Host uses PHP safe_mode:") . "</td><td>";

        if ($mpn_host_use_safemode==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_host_use_safemode\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_host_use_safemode\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_host_use_safemode\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_host_use_safemode\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Use mysql_pconnect:") . "</td><td>";

        if ($mpn_mysql_pconnect==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_mysql_pconnect\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_mysql_pconnect\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_mysql_pconnect\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_mysql_pconnect\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Sections can only view by registered user:") . "</td><td>";

        if ($mpn_sections_only_for_users==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_sections_only_for_users\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_sections_only_for_users\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_sections_only_for_users\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_sections_only_for_users\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "<tr><td>" . translate("Activate the random quotes:") . "</td><td>";

        if ($mpn_display_quote==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_quote\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_quote\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_quote\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_quote\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display the fetching request box:") . "</td><td>";

        if ($mpn_display_fetching_request==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_fetching_request\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_fetching_request\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_fetching_request\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_fetching_request\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display headlines in a scrolling box:") . "</td><td>";

        if ($mpn_use_headline_applet==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_headline_applet\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_headline_applet\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_headline_applet\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_headline_applet\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display the old news in a scrolling box:") . "</td><td>";

        if ($mpn_use_oldnews_applet==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_oldnews_applet\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_oldnews_applet\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_oldnews_applet\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_oldnews_applet\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display the Netscape Opendir in the links:") . "</td><td>";

        if ($mpn_use_opendir==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_opendir\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_opendir\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_opendir\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_use_opendir\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display recent topics from the forum at the first page:") . "</td><td>";

        if ($mpn_display_recenttopics==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_recenttopics\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_recenttopics\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_recenttopics\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_recenttopics\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Number of Forum Topics To Display In The Above Block") . " </td><td>";
    echo "<input type=\"text\" name=\"xmpn_recenttopics_num\" size=\"4\" value=\"$mpn_recenttopics_num\">";

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display the last seen box:") . "</td><td>";

        if ($mpn_display_lastseen==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_lastseen\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_lastseen\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_lastseen\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_lastseen\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }
        echo "</td></tr>\n";


        echo "<tr><td>" . translate("How many days should the last seen entries stay in the database:") . " </td><td>";

        echo "<input type=\"text\" name=\"xmpn_lastseen_daysintable\" value=\"$mpn_lastseen_daysintable\"></td></tr>\n";

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display the What's new box at the first page:") . "</td><td>";

        if ($mpn_display_whatsnews==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_whatsnews\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_whatsnews\" VALUE=\"0\">&nbsp;" .translate("No")."&nbsp;</INPUT>";
        } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_whatsnews\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_display_whatsnews\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
        }

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Display ChatboxII:") . "<br />\n";
        echo translate("If you choose SideBlock, remember to enable ChatBoxII in the Blocks Administration.");
		echo "</td><td>";
        echo "<select name=\"xmpn_display_chatboxII\">\n";
        if ($mpn_display_chatboxII == 0) {
            echo "<option value=0 selected>".translate("None")."</option>\n";
            echo "<option value=1>".translate("CenterBlock")."</option>\n";
            echo "<option value=2>".translate("SideBlock")."</option>\n";
        } elseif ($mpn_display_chatboxII == 1) {
            echo "<option value=0>".translate("None")."</option>\n";
            echo "<option value=1 selected>".translate("CenterBlock")."</option>\n";
            echo "<option value=2>".translate("SideBlock")."</option>\n";
        } elseif ($mpn_display_chatboxII == 2) {
            echo "<option value=0>".translate("None")."</option>\n";
            echo "<option value=1>".translate("CenterBlock")."</option>\n";
            echo "<option value=2 selected>".translate("SideBlock")."</option>\n";
        }
        echo "</select>";

        echo "</td></tr>\n";
//        echo "<tr><td>";
//        echo "</td></tr>\n";

        echo "<tr><td>" . translate("How many entries are displayed at the What's new page:") . " </td><td>";

        echo "<input type=\"text\" name=\"xmpn_whatsnew_entries\" value=\"$mpn_whatsnew_entries\"></td></tr>\n";

        echo "</td></tr>\n";

        echo "<tr><td>" . translate("How many entries per page in the updatelog:") . " </td><td>";

        echo "<input type=\"text\" name=\"xmpn_pagesize_updatelog\" value=\"$mpn_pagesize_updatelog\"></td></tr>\n";

        echo "</td></tr>\n";

        echo "<tr><td>".translate("How strict are the test for new user nicknames:")."</td><td>";
        echo "<select name=\"xmpn_uname_test_level\">\n";
        if ($mpn_uname_test_level == 0) {
            echo "<option value=0 selected>".translate("Strict")."</option>\n";
            echo "<option value=1>".translate("Medium")."</option>\n";
            echo "<option value=2>".translate("Loose")."</option>\n";
        } elseif ($mpn_uname_test_level == 1) {
            echo "<option value=0>".translate("Strict")."</option>\n";
            echo "<option value=1 selected>".translate("Medium")."</option>\n";
            echo "<option value=2>".translate("Loose")."</option>\n";
        } elseif ($mpn_uname_test_level == 2) {
            echo "<option value=0>".translate("Strict")."</option>\n";
            echo "<option value=1>".translate("Medium")."</option>\n";
            echo "<option value=2 selected>".translate("Loose")."</option>\n";
        }
        echo "</select>\n";
        echo "</td></tr>\n";
        echo "<tr><td colspan=2>";
        echo translate("Allowed chars for:") . "<br />\n";
//        echo "</td></tr>\n";
//        echo "<tr><td>";
        echo translate("Strict").": a-z, A-Z, 0-9, _" . "<br />\n";
//        echo "</td></tr>\n";
//        echo "<tr><td>";
        echo translate("Medium").": a-z, A-Z, 0-9, _, <, >, ,, ., $, %, #, @, !, ', \"" . "<br />\n";
//        echo "</td></tr>\n";
//        echo "<tr><td>";
        echo translate("Loose").": a-z, A-Z, 0-9, _, <, >, ,, ., $, %, #, @, !, ', \", ?, {, }, [, ], (, ), ^, &, *, `, ~, ;, :, \\, +, =" . "<br />\n";
        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Name of the webmaster:") . " </td><td>";

        echo "<input type=\"text\" name=\"xmpn_webmaster_name\" value=\"$mpn_webmaster_name\"></td></tr>\n";

//        echo "</td></tr>\n";

        echo "<tr><td>" . translate("Subject for the confirmation message from contact us:") . " </td><td>";

        echo "<input type=\"text\" name=\"xmpn_conf_subject\" value=\"$mpn_conf_subject\"></td></tr>\n";

//        echo "</td></tr>\n";

        /*echo "<tr><td>" . translate("Anonymous ID:") . " </td><td>";

        echo "<input type=\"text\" name=\"xmpn_anonymous_id\" size=\"5\" value=\"$mpn_anonymous_id\"></td></tr>\n";

        echo "</td></tr>\n";*/


        if ($system == 1) {
            echo "<tr><td>".translate("Activate Email:") . " </td><td>";
            if ($mpn_activate_email==1) {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_activate_email\" VALUE=\"1\" CHECKED>&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_activate_email\" VALUE=\"0\" >&nbsp;" .translate("No")."&nbsp;</INPUT>";
            } else {
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_activate_email\" VALUE=\"1\">&nbsp;" .translate("Yes")."&nbsp;</INPUT>";
                echo "<INPUT TYPE=\"RADIO\" NAME=\"xmpn_activate_email\" VALUE=\"0\" CHECKED>&nbsp;" .translate("No")."&nbsp;</INPUT>";
            }
            echo "</td></tr>\n";
        } else {
            if ($mpn_activate_email == 0) { $mpn_activate_email = 1; }
            echo "<input type=hidden name=\"xmpn_activate_email\" value=1>";
        }
        if ($mpn_activate_email == 1) {
            echo "<tr><td>
            ".translate("Mail password to New User?")."</td><td>";
            if ($mpn_mail_newuser_password==1) {
                echo "<input type=radio name=\"xmpn_mail_newuser_password\" value=1 checked>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_mail_newuser_password\" value=0>".translate("No")."";
            } else {
                echo "<input type=radio name=\"xmpn_mail_newuser_password\" value=1>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_mail_newuser_password\" value=0 checked>".translate("No")."";
            }

            echo "</td></tr>\n<tr><td>
            ".translate("Mail ADMIN on New User Registration?")."</td><td>";
            if ($mpn_new_user_notify==1) {
                echo "<input type=radio name=\"xmpn_new_user_notify\" value=1 checked>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_user_notify\" value=0>".translate("No")."";
            } else {
                echo "<input type=radio name=\"xmpn_new_user_notify\" value=1>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_user_notify\" value=0 checked>".translate("No")."";
            }

            echo "</td></tr>\n<tr><td>
            ".translate("Mail ADMIN on New Comment or Reply?")."</td><td>";
            if ($mpn_new_comment_notify==1) {
                echo "<input type=radio name=\"xmpn_new_comment_notify\" value=1 checked>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_comment_notify\" value=0>".translate("No")."";
            } else {
                echo "<input type=radio name=\"xmpn_new_comment_notify\" value=1>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_comment_notify\" value=0 checked>".translate("No")."";
            }

            echo "</td></tr>\n<tr><td>
            ".translate("Mail ADMIN on New Poll Comment or Reply?")."</td><td>";
            if ($mpn_new_pollcomment_notify==1) {
                echo "<input type=radio name=\"xmpn_new_pollcomment_notify\" value=1 checked>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_pollcomment_notify\" value=0>".translate("No")."";
            } else {
                echo "<input type=radio name=\"xmpn_new_pollcomment_notify\" value=1>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_pollcomment_notify\" value=0 checked>".translate("No")."";
            }

            echo "</td></tr>\n<tr><td>
            ".translate("Mail ADMIN on New Forum Topic?")."</td><td>";
            if ($mpn_new_forumtopic_notify==1) {
                echo "<input type=radio name=\"xmpn_new_forumtopic_notify\" value=1 checked>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_forumtopic_notify\" value=0>".translate("No")."";
            } else {
                echo "<input type=radio name=\"xmpn_new_forumtopic_notify\" value=1>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_forumtopic_notify\" value=0 checked>".translate("No")."";
            }

            echo "</td></tr>\n<tr><td>
            ".translate("Mail ADMIN on New Guestbook entry?")."</td><td>";
            if ($mpn_new_guestbook_notify==1) {
                echo "<input type=radio name=\"xmpn_new_guestbook_notify\" value=1 checked>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_guestbook_notify\" value=0>".translate("No")."";
            } else {
                echo "<input type=radio name=\"xmpn_new_guestbook_notify\" value=1>".translate("Yes")." &nbsp;
                <input type=radio name=\"xmpn_new_guestbook_notify\" value=0 checked>".translate("No")."";
            }
            echo "</td></tr>\n";
        } else {
            echo "<input type=hidden name=\"xmpn_mail_newuser_password\" value=0>\n";
            echo "<input type=hidden name=\"xmpn_mail_userpass_to_admin\" value=0>\n";
            echo "<input type=hidden name=\"xmpn_new_user_notify\" value=0>\n";
            echo "<input type=hidden name=\"xmpn_new_comment_notify\" value=0>\n";
            echo "<input type=hidden name=\"xmpn_new_pollcomment_notify\" value=0>\n";
            echo "<input type=hidden name=\"xmpn_new_forumtopic_notify\" value=0>\n";
            echo "<input type=hidden name=\"xmpn_new_guestbook_notify\" value=0>\n";
        }


//        echo "<tr><td>&nbsp;</td></tr>\n";
            echo "</table>\n";
			echo "<br />\n";
            echo "<input type=hidden name=op value=myPHPNukeConfigChange>\n";
            echo "<input class='button' type='submit' value=".translate("Change").">\n";
            echo "</form>\n";
            echo "</td></tr>\n</table>\n</td></tr>\n</table>\n";

//    include("footer.$phpEx");
}

function myPHPNukeConfigChange() {
    global $fct, $phpEx, $mpn_install_date;

        global $xmpn_activate_email;
        global $xmpn_split_userpage;
        global $xmpn_use_newuser_fix;
//        global $xmpn_use_pager;
        //global $xmpn_anonymous_id;
        global $xmpn_poll_seperate_rows;
        global $xmpn_use_timezone_formattimestamp;
        global $xmpn_set_timezone;
        global $xmpn_timezone;
        global $xmpn_host_use_safemode;
        global $xmpn_mysql_pconnect;
        global $xmpn_pagesize_updatelog;
        global $xmpn_sections_only_for_users;
        global $xmpn_display_quote;
        global $xmpn_display_fetching_request;
        global $xmpn_webmaster_name;
        global $xmpn_conf_subject;
        global $xmpn_use_headline_applet;
        global $xmpn_use_opendir;
        global $xmpn_display_recenttopics;
        global $xmpn_recenttopics_num;
        global $xmpn_display_lastseen;
        global $xmpn_lastseen_daysintable;
        global $xmpn_display_whatsnews;
        global $xmpn_display_chatboxII;
        global $xmpn_whatsnew_entries;
        global $xmpn_mail_newuser_password;
        global $xmpn_mail_userpass_to_admin;
        global $xmpn_new_user_notify;
        global $xmpn_new_comment_notify;
        global $xmpn_new_pollcomment_notify;
        global $xmpn_new_forumtopic_notify;
        global $xmpn_new_guestbook_notify;
        global $xmpn_uname_test_level;
        global $xmpn_use_oldnews_applet;
//        global $xmpn_use_gzcompress;

        /*if ($xmpn_anonymous_id == '') {
            $xmpn_anonymous_id = 1;
        }*/
        if ($xmpn_lastseen_daysintable == '') {
            $xmpn_lastseen_daysintable = 10;
        }
        if ($xmpn_whatsnew_entries == '') {
            $xmpn_whatsnew_entries = 5;
        }
        if ($xmpn_pagesize_updatelog == '') {
            $xmpn_pagesize_updatelog = 10;
        }

        if ( ! isset( $mpn_install_date ) )
        {
            $mpn_install_date = time();
        }

   /* $urlarray = parse_url( _MPN_ROOT_URI );

    if (isset($urlarray["path"])) {
        $filename = getcwd()."/admin/$fct/config.$phpEx";
    } else {

    }*/


        $content = "";
        $content .= "<?php\n";
        $content .= require './admin/configs_header.php';
        $content .= "\n";
        $content .= "###################################################################################################\n";
        $content .= "# myPHPNuke\n";
        $content .= "#\n";
        $content .= "# \$mpn_activate_email:               Activate Email Subsystem.                         Default = 0\n";
        $content .= "# \$mpn_split_userpage:               Split Login and New User Registration screen.     Default = 1\n";
        $content .= "# \$mpn_use_newuser_fix:              Fix 214... error.                                 Default = 0\n";
        $content .= "# \$mpn_use_gzcompress:               Enable Output Compression                         Default = 0\n";
        $content .= "# \$mpn_use_pager:                    Enable Instant Messenger.                         Default = 0\n";
        $content .= "# \$mpn_anonymous_id                  User Id for anonymus user.                        Default = 1\n";
        $content .= "# \$mpn_poll_seperate_rows:           Put Poll buttons on seperate lines.               Default = 1\n";
        $content .= "# \$mpn_use_timezone_formattimestamp: Use Timezone in formatTimestamp.                  Default = 1\n";
        $content .= "# \$mpn_set_timezone:                 Set the timezone via putenv.                      Default = 0\n";
        $content .= "# \$mpn_timezone:                     The timezone with is set via putenv.              Default = \n";
        $content .= "# For a complete list of timezones visit: http://www.theprojects.org/dev/zone.txt\n";
        $content .= "# \$mpn_host_use_safemode             Host uses PHP safe_mode.                          Default = 0\n";
        $content .= "# \$mpn_mysql_pconnect                Use mysql_pconnect                                Default = 1\n";
        $content .= "# \$mpn_pagesize_updatelog            Entries per page in the updatelog                 Default = 10\n";
        $content .= "# \$mpn_sections_only_for_users       Only registered users can view the sections       Default = 0\n";
        $content .= "# \$mpn_display_quote                 Activate the random quotes                        Default = 1\n";
        $content .= "# \$mpn_display_fetching_request      Display the fetching request box                  Default = 0\n";
        $content .= "# \$mpn_webmaster_name                Name of the webmaster for the Contact us Form     Default = \n";
        $content .= "# \$mpn_conf_subject                  Subject for the confirmation mail                 Default = \n";
        $content .= "# \$mpn_use_headline_applet           Scroll the headlines in applet                    Default = 0\n";
        $content .= "# \$mpn_use_oldnews_applet            Scroll the old news in applet                     Default = 0\n";
        $content .= "# \$mpn_use_opendir                   Use the opendir in weblinks                       Default = 1\n";
        $content .= "# \$mpn_display_recenttopics          Display recent topics on first page    Default = 0\n";
        $content .= "# \$mpn_display_lastseen              Display the last seen box                         Default = 1\n";
        $content .= "# \$mpn_lastseen_daysintable          How many days should the entrie stay in db        Default = 10\n";
        $content .= "# \$mpn_display_whatsnews             Display the x the what's new box                  Default = 1\n";
        $content .= "# \$mpn_display_chatboxII             Display chatboxII                                 Default = 0\n";
        $content .= "# \$mpn_whatsnew_entries              How many entries at the What's new Page           Default = 5\n";
        $content .= "# \$mpn_uname_test_level              How strict are the test for the user nickname     Default = 0\n";
        $content .= "# \$mpn_mail_newuser_password         Mail the password to the new user                 Default = 1\n";
        $content .= "# \$mpn_new_user_notify               Send e-mail to ADMIN on New User Registration     Default = 0\n";
        $content .= "# \$mpn_new_comment_notify            Send e-mail to ADMIN on New Comment or Reply      Default = 0\n";
        $content .= "# \$mpn_new_pollcomment_notify        Send e-mail to ADMIN on New Poll Comment or Reply Default = 0\n";
        $content .= "# \$mpn_new_forumtopic_notify         Send e-mail to ADMIN on New Forum Topic           Default = 0\n";
        $content .= "# \$mpn_new_guestbook_notify          Send e-mail to ADMIN on New Guestbook entry       Default = 0\n";
        $content .= "###################################################################################################\n";
        $content .= "\n";
        $content .= "\$mpn_activate_email = $xmpn_activate_email;\n";
        $content .= "\$mpn_split_userpage = $xmpn_split_userpage;\n";
        $content .= "\$mpn_use_newuser_fix = $xmpn_use_newuser_fix;\n";
/*        $content .= "\$mpn_use_gzcompress = $xmpn_use_gzcompress;\n"; */
        $content .= "\$mpn_use_gzcompress = 0;\n";
        $content .= "\$mpn_use_pager = 0;\n";
/*        $content .= "\$mpn_use_pager = $xmpn_use_pager;\n";*/
        $content .= "\$mpn_anonymous_id = 1;\n";
        $content .= "\$mpn_poll_seperate_rows = $xmpn_poll_seperate_rows;\n";
        $content .= "\$mpn_use_timezone_formattimestamp = $xmpn_use_timezone_formattimestamp;\n";
        $content .= "\$mpn_set_timezone = $xmpn_set_timezone;\n";
        $content .= "\$mpn_timezone = \"$xmpn_timezone\";\n";
        $content .= "\$mpn_host_use_safemode = $xmpn_host_use_safemode;\n";
        $content .= "\$mpn_mysql_pconnect = $xmpn_mysql_pconnect;\n";
        $content .= "\$mpn_pagesize_updatelog = $xmpn_pagesize_updatelog;\n";
        $content .= "\$mpn_sections_only_for_users = $xmpn_sections_only_for_users;\n";
        $content .= "\$mpn_display_quote = $xmpn_display_quote;\n";
        $content .= "\$mpn_display_fetching_request = $xmpn_display_fetching_request;\n";
       $content .= "\$mpn_webmaster_name = \"$xmpn_webmaster_name\";\n";
        $content .= "\$mpn_conf_subject = \"$xmpn_conf_subject\";\n";
        $content .= "\$mpn_use_headline_applet = $xmpn_use_headline_applet;\n";
        $content .= "\$mpn_use_oldnews_applet = $xmpn_use_oldnews_applet;\n";
        $content .= "\$mpn_use_opendir = $xmpn_use_opendir;\n";
        $content .= "\$mpn_display_recenttopics = $xmpn_display_recenttopics;\n";
        $content .= "\$mpn_recenttopics_num = $xmpn_recenttopics_num;\n";
        $content .= "\$mpn_display_lastseen = $xmpn_display_lastseen;\n";
        $content .= "\$mpn_lastseen_daysintable = $xmpn_lastseen_daysintable;\n";
        $content .= "\$mpn_display_whatsnews = $xmpn_display_whatsnews;\n";
        $content .= "\$mpn_display_chatboxII = $xmpn_display_chatboxII;\n";
        $content .= "\$mpn_whatsnew_entries = $xmpn_whatsnew_entries;\n";
        $content .= "\$mpn_uname_test_level = $xmpn_uname_test_level;\n";
        $content .= "\$mpn_mail_newuser_password = $xmpn_mail_newuser_password;\n";
        $content .= "\$mpn_new_user_notify = $xmpn_new_user_notify;\n";
        $content .= "\$mpn_new_comment_notify = $xmpn_new_comment_notify;\n";
        $content .= "\$mpn_new_pollcomment_notify = $xmpn_new_pollcomment_notify;\n";
        $content .= "\$mpn_new_forumtopic_notify = $xmpn_new_forumtopic_notify;\n";
        $content .= "\$mpn_new_guestbook_notify = $xmpn_new_guestbook_notify;\n";
        $content .= "\n";
        $content .= "\$mpn_version = \"" . _MPN_VERSION_ . "\";\n";
        $content .= "\$mpn_install_date = $mpn_install_date;\n";
        $content .= "?>";

        $filename = 'admin/' . $fct . '/config.php';

        if ( ! $_SERVER['F_LIB'] -> writeFile( $filename, 'w+b', $content ) )
        {
            goBack( translate( 'File Write Error.  Check Permissions On ' ) . $filename );
            exit;
        }

      /*  $file = fopen($filename, "wb");

        fwrite($file, $content);
            fclose($file);*/


        $_SERVER['F_LIB'] -> redirectRequest( 'admin.php?fct=myphpnuke' );

}

?>
